This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix groups.t test on AIX
[perl5.git] / hints / aix.sh
index 3cf6436..63f245f 100644 (file)
@@ -80,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" ;;
@@ -158,7 +164,7 @@ case "$cc" in
 # -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
@@ -228,41 +234,30 @@ case "$usethreads" in
        d_setgrent_r='undef'
        d_setpwent_r='undef'
        d_srand48_r='undef'
+       d_srandom_r='undef'
        d_strerror_r='undef'
 
        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.
@@ -274,6 +269,21 @@ EOM
        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
 
@@ -524,4 +534,19 @@ EOF
        ;;
     esac
 
+# remove libbsd.a from wanted libraries
+libswanted=`echo " $libswanted " | sed -e 's/ bsd / /'`
+libswanted=`echo " $libswanted " | sed -e 's/ BSD / /'`
+d_flock='undef'
+
+# remove libgdbm from wanted libraries
+# The libgdbm < 1.8.3-5 from the AIX Toolbox is not working
+# because two wrong .h are present
+if [ -f "/opt/freeware/include/gdbm/dbm.h" ] ||
+   [ -f "/opt/freeware/include/gdbm/ndbm.h" ]; then
+    echo "GDBM support disabled because your GDBM package contains extraneous headers - see README.aix."
+    libswanted=`echo " $libswanted " | sed -e 's/ gdbm / /'`
+    i_gdbm='undef'
+    i_gdbmndbm='undef'
+fi
 # EOF