X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=hints%2Faix.sh;h=5c07c12c8a0b0857c95e0f93aecaddeee8123989;hb=79c530cb74824bda9eaf13218c0c013baf5ac51f;hp=da61d31564b97138aa23f12aa0a71e413c5c56dc;hpb=2463cec9eed76df1882d67924716c953eafc3a83;p=p5sagit%2Fp5-mst-13.2.git diff --git a/hints/aix.sh b/hints/aix.sh index da61d31..5c07c12 100644 --- a/hints/aix.sh +++ b/hints/aix.sh @@ -39,6 +39,11 @@ case "$usemymalloc" in '') usemymalloc='n' ;; esac +# malloc wrap works, but not in vac-5, see later +case "$usemallocwrap" in + '') usemallocwrap='define' ;; + esac + # Intuiting the existence of system calls under AIX is difficult, # at best; the safest technique is to find them empirically. @@ -75,6 +80,12 @@ EOF ;; esac + s=`lslpp -lc bos.adt.libm >/dev/null` +if [ $? != 0 ]; then + echo "You cannot build perl without the bos.adt.libm package installed" >&4 + exit + fi + # uname -m output is too specific and not appropriate here case "$archname" in '') archname="$osname" ;; @@ -104,11 +115,11 @@ case "$cc" in ccdlflags='-Xlinker' if [ "X$gccversion" = "X" ]; then # Done too late in Configure if hinted - gccversion=`$cc --version | sed 's/.*(GCC) *//'` + gccversion=`$cc -dumpversion` fi ;; - *) ccversion=`lslpp -L | grep 'C for AIX Compiler$' | grep -v '\.msg\.[A-Za-z_]*\.' | head -1 | awk '{print $1,$2}'` + *) ccversion=`lslpp -ql -Ou vac.C | grep -v '^Path' | head -1 | awk '{print $1,$2}'` case "$ccversion" in '') ccversion=`lslpp -L | grep 'IBM C and C++ Compilers LUM$'` ;; @@ -138,6 +149,9 @@ case "$cc" in ccversion=`echo "$ccversion" | awk '{print $2}'` # Redbooks state AIX-5 only supports vac-5.0.2.0 and up + case "$ccversion" in + 5*) usemallocwrap='n' ;; # panic in miniperl + esac ;; esac @@ -149,7 +163,11 @@ case "$cc" in # -bI:$(PERL_INC)/perl.exp Read the exported symbols from the perl binary # -bE:$(BASEEXT).exp Export these symbols. This file contains only one # symbol: boot_$(EXP) can it be auto-generated? -lddlflags="$lddlflags -bhalt:4 -bM:SRE -bI:\$(PERL_INC)/perl.exp -bE:\$(BASEEXT).exp -bnoentry -lc" +if test $usenativedlopen = 'true' ; then + lddlflags="$lddlflags -bhalt:4 -G -bI:\$(PERL_INC)/perl.exp -bE:\$(BASEEXT).exp -bnoentry -lc -lm" +else + lddlflags="$lddlflags -bhalt:4 -bM:SRE -bI:\$(PERL_INC)/perl.exp -bE:\$(BASEEXT).exp -bnoentry -lc" + fi case "$use64bitall" in $define|true|[yY]*) use64bitint="$define" ;; @@ -223,17 +241,26 @@ case "$usethreads" in *gcc*) ccflags="-D_THREAD_SAFE $ccflags" ;; cc_r) ;; - cc|xl[cC]|xl[cC]_r) + '') cc=cc_r ;; + + *) + + + # No | alternation in aix sed. :-( + newcc=`echo $cc | sed -e 's/cc$/cc_r/' -e 's/xl[cC]$/cc_r/' -e 's/xl[cC]_r$/cc_r/'` + case "$newcc" in + $cc) # No change + ;; + + *cc_r) echo >&4 "Switching cc to cc_r because of POSIX threads." # xlc_r has been known to produce buggy code in AIX 4.3.2. # (e.g. pragma/overload core dumps) Let's suspect xlC_r, too. # --jhi@iki.fi - cc=cc_r + cc="$newcc" ;; - '') cc=cc_r ;; - - *) + *) cat >&4 <&4 "(using ccflags $ccflags)" echo >&4 "(using ldflags $ldflags)" echo >&4 "(using lddlflags $lddlflags)" @@ -357,11 +425,18 @@ EOM # string is simply not detectable by any means. Since it doesn't # do any harm, I didn't pursue it. -- sh qaldflags="`echo $qaldflags`" - qalibs="`getconf XBS5_LP64_OFF64_LIBS 2>/dev/null|sed -e 's@^-l@@' -e 's@ -l@ @g`" + qalibs="`getconf XBS5_LP64_OFF64_LIBS 2>/dev/null|sed -e 's@^-l@@' -e 's@ -l@ @g'`" # -q32 and -b32 may have been set by uselargefiles or user. # Remove them. ccflags="`echo $ccflags | sed -e 's@-q32@@'`" ldflags="`echo $ldflags | sed -e 's@-b32@@'`" + case "$cc" in + *gcc*) + ccflags="`echo $ccflags | sed -e 's@-q64@-maix64@'`" + ccflags_uselargefiles="`echo $ccflags_uselargefiles | sed -e 's@-q64@-maix64@'`" + qacflags="`echo $qacflags | sed -e 's@-q64@-maix64@'`" + ;; + esac # Tell archiver to use large format. Unless we remove 'ar' # from 'trylist', the Configure script will just reset it to 'ar' # immediately prior to writing config.sh. This took me hours @@ -369,13 +444,10 @@ EOM trylist="`echo $trylist | sed -e 's@^ar @@' -e 's@ ar @ @g' -e 's@ ar$@@'`" ar="ar -X64" nm_opt="-X64 $nm_opt" - # Note: Placing the 'qacflags' variable into the 'ldflags' string - # is NOT a typo. ldflags is passed to the C compiler for final - # linking, and it wants -q64 (-b64 is for ld only!). case "$qacflags$qaldflags$qalibs" in '') ;; *) ccflags="$ccflags $qacflags" - ldflags="$ldflags $qacflags" + ldflags="$ldflags" lddlflags="$qaldflags $lddlflags" libswanted="$libswanted $qalibs" ;; @@ -398,9 +470,14 @@ EOCBU if test $usenativedlopen = 'true' ; then ccflags="$ccflags -DUSE_NATIVE_DLOPEN" + # -brtl Enables a binary to use run time linking + # -bdynamic When used with -brtl, tells linker to search for + # ".so"-suffix libraries as well as ".a" suffix + # libraries. AIX allows both .so and .a libraries to + # contain dynamic shared objects. case "$cc" in - *gcc*) ldflags="$ldflags -Wl,-brtl" ;; - *) ldflags="$ldflags -brtl" ;; + *gcc*) ldflags="$ldflags -Wl,-brtl -Wl,-bdynamic" ;; + *) ldflags="$ldflags -brtl -bdynamic" ;; esac elif test -f /lib/libC.a -a X"`$cc -v 2>&1 | grep gcc`" = X; then # If the C++ libraries, libC and libC_r, are available we will