;;
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" ;;
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$'` ;;
# -bE:$(BASEEXT).exp Export these symbols. This file contains only one
# symbol: boot_$(EXP) can it be auto-generated?
if test $usenativedlopen = 'true' ; then
- lddlflags="$lddlflags -bhalt:4 -bexpall -G -bnoentry -lc"
+ 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
ccflags="$ccflags -DNEED_PTHREAD_INIT"
case "$cc" in
- *gcc*) ccflags="-D_THREAD_SAFE $ccflags" ;;
-
- cc_r) ;;
- '') cc=cc_r ;;
-
+ *gcc*)
+ ccflags="-D_THREAD_SAFE $ccflags"
+ ;;
+ cc_r)
+ ;;
+ xlc_r)
+ # for -qlonglong
+ ccflags="$ccflags -qlanglvl=extended"
+ ;;
+ # we do not need the C++ compiler
+ xlC_r)
+ # for -qlonglong
+ ccflags="$ccflags -qlanglvl=extended"
+ cc=xlc_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="$newcc"
- ;;
-
- *)
- cat >&4 <<EOM
-*** For pthreads you should use the AIX C compiler cc_r.
-*** (now your compiler was set to '$cc')
-*** Cannot continue, aborting.
-EOM
- exit 1
- ;;
- esac
esac
# Insert pthreads to libswanted, before any libc or libC.
shift
lddlflags="$*"
;;
+ *)
+ case "$cc" in
+ xlc)
+ # for -qlonglong
+ ccflags="$ccflags -qlanglvl=extended"
+ ;;
+ # we do not need the C++ compiler
+ xlC)
+ # for -qlonglong
+ ccflags="$ccflags -qlanglvl=extended"
+ cc=xlc
+ ;;
+ *)
+ esac
+ ;;
esac
EOCBU
fi
if test X"$use64bitint:$quadtype" = X"$define:long" -o X"$use64bitall" = Xdefine; then
# Keep this at the left margin.
-libswanted_uselargefiles="`getconf XBS5_LP64_OFF64_LIBS 2>/dev/null|sed -e 's@^-l@@' -e 's@ -l@ @g`"
+libswanted_uselargefiles="`getconf XBS5_LP64_OFF64_LIBS 2>/dev/null|sed -e 's@^-l@@' -e 's@ -l@ @g'`"
else
# Keep this at the left margin.
-libswanted_uselargefiles="`getconf XBS5_ILP32_OFFBIG_LIBS 2>/dev/null|sed -e 's@^-l@@' -e 's@ -l@ @g`"
+libswanted_uselargefiles="`getconf XBS5_ILP32_OFFBIG_LIBS 2>/dev/null|sed -e 's@^-l@@' -e 's@ -l@ @g'`"
fi
case "$ccflags_uselargefiles$ldflags_uselargefiles$libs_uselargefiles" in
;;
esac
+ # -bmaxdata:0x80000000
+ # - This increases the size of heap memory available to perl.
+ # Default is 256 MB, which sounds large but caused a software
+ # vendor problems. So this sets heap to 2 GB maximum. Anything
+ # higher and you'd want to consider 64 bit perl.
+ # - NOTE however, that setting this in 64bit mode will limit your
+ # amount of available memory to 2GB, so we set this only in
+ # 32bit mode to avoid future problems a la "should be enough
+ # for everyone" ...
+ #
+ case "$use64bitall" in
+ $define|true|[yY]*)
+ :
+ ;;
+ *)
+ ldflags="$ldflags -bmaxdata:0x80000000"
+ ;;
+ esac
+
case "$gccversion" in
- '') ;;
+ '') # Not using gcc.
+ # Due to calling $cc without $cflags when linking some
+ # binaries we need to hardwire $cc to the right mode.
+ # The correct fix would be to have Makefile.SH not set
+ # CLDFLAGS from $ldflags ...
+ case "$use64bitall" in
+ $define|true|[yY]*) cc="$cc -q64" ;;
+ *) cc="$cc -q32" ;;
+ esac
+ ;;
*) # Remove xlc-specific -qflags.
ccflags="`echo $ccflags | sed -e 's@ -q[^ ]*@ @g' -e 's@^-q[^ ]* @@g'`"
ldflags="`echo $ldflags | sed -e 's@ -q[^ ]*@ @g' -e 's@^-q[^ ]* @@g'`"
ldflags="`echo ' '$ldflags | sed -e 's@ -b@ -Wl,-b@g'`"
lddlflags="`echo ' '$lddlflags | sed -e 's@ -b@ -Wl,-b@g'`"
lddlflags="`echo ' '$lddlflags | sed -e 's@ -G @ -Wl,-G @g'`"
- ld='gcc'
+
+ # Due to calling $cc without $cflags when linking some
+ # binaries we need to hardwire $cc to the right mode.
+ case "$use64bitall" in
+ $define|true|[yY]*)
+ cc="$cc -maix64"
+ ld="$cc"
+ ;;
+ *)
+ cc="$cc -maix32"
+ ld="$cc"
+ ;;
+ esac
echo >&4 "(using ccflags $ccflags)"
echo >&4 "(using ldflags $ldflags)"
echo >&4 "(using lddlflags $lddlflags)"
# 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
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"
;;
# ".so"-suffix libraries as well as ".a" suffix
# libraries. AIX allows both .so and .a libraries to
# contain dynamic shared objects.
- # -bmaxdata:0x80000000 This increases the size of heap memory available
- # to perl. Default is 256 MB, which sounds large but
- # caused a software vendor problems. So this sets
- # heap to 2 GB maximum. Anything higher and you'd
- # want to consider 64 bit perl.
case "$cc" in
- *gcc*) ldflags="$ldflags -Wl,-brtl -Wl,-bdynamic -Wl,-bmaxdata:0x80000000" ;;
- *) ldflags="$ldflags -brtl -bdynamic -bmaxdata:0x80000000" ;;
+ *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
;;
esac
+# remove libbsd.a from wanted libraries
+libswanted=`echo " $libswanted " | sed -e 's/ bsd / /'`
+libswanted=`echo " $libswanted " | sed -e 's/ BSD / /'`
+d_flock='undef'
+
# EOF