# Jarkko Hietaniemi <jhi@iki.fi>.
# AIX 4.3.x LP64 build by Steven Hirsch <hirschs@btv.ibm.com>
# Merged on Mon Feb 6 10:22:35 EST 1995 by
-# Andy Dougherty <doughera@lafcol.lafayette.edu>
+# Andy Dougherty <doughera@lafayette.edu>
#
# Contact dfavor@corridor.com for any of the following:
# Intuiting the existence of system calls under AIX is difficult,
# at best; the safest technique is to find them empirically.
-# AIX 4.3.* and above default to using nm for symbol extraction
+# AIX 4.3.* and above default to letting Configure test if nm
+# extraction will work.
case "$osvers" in
3.*|4.1.*|4.2.*)
case "$usenm" in
esac
;;
*)
- case "$usenm" in
- '') usenm='true'
- esac
case "$usenativedlopen" in
'') usenativedlopen='true'
esac
case "$cc" in
*gcc*)
cc_type=gcc
- ccdlflags='-Xlinker' ;;
-*) ccversion=`lslpp -L | grep 'C for AIX Compiler$' | awk '{print $2}'`
+ ccdlflags='-Xlinker'
+ if [ "X$gccversion" = "X" ]; then
+ # Done too late in Configure if hinted
+ gccversion=`$cc --version | sed 's/.*(GCC) *//`
+ fi
+ ;;
+*) ccversion=`lslpp -L | grep 'C for AIX Compiler$' | grep -v '\.msg\.[A-Za-z_]*\.' | awk '{print $2}'`
case "$ccversion" in
'') ccversion=`lslpp -L | grep 'IBM C and C++ Compilers LUM$' | awk '{print $2}'`
;;
# the required -bE:$installarchlib/CORE/perl.exp is added by
# libperl.U (Configure) later.
+case "$cc" in
+*gcc*) ;;
+cc*|xlc*) # cc should've been set by line 116 or so if empty.
+ if test ! -x /usr/bin/$cc -a -x /usr/vac/bin/$cc; then
+ case ":$PATH:" in
+ *:/usr/vac/bin:*) ;;
+ *) if test ! -x /QOpenSys/usr/bin/$cc; then
+ # The /QOpenSys/usr/bin/$cc saves us if we are
+ # building natively in OS/400 PASE.
+ cat >&4 <<EOF
+
+***
+*** You either implicitly or explicitly specified an IBM C compiler,
+*** but you do not seem to have one in /usr/bin, but you seem to have
+*** the VAC installed in /usr/vac, but you do not have the /usr/vac/bin
+*** in your PATH. I suggest adding that and retrying Configure.
+***
+EOF
+ exit 1
+ fi
+ ;;
+ esac
+ fi
+ ;;
+esac
+
case "$ldlibpthname" in
'') ldlibpthname=LIBPATH ;;
esac
$define|true|[yY]*)
ccflags="$ccflags -DNEED_PTHREAD_INIT"
case "$cc" in
- gcc) ;;
+ *gcc*)
+echo "GCC $gccversion disabling some _r functions" >&4
+ case "$gccversion" in
+ 3*) d_drand48_r='undef'
+ d_endgrent_r='undef'
+ d_endpwent_r='undef'
+ d_getgrent_r='undef'
+ d_getpwent_r='undef'
+ d_random_r='undef'
+ d_srand48_r='undef'
+ d_strerror_r='undef'
+ ;;
+ esac
+ ;;
cc_r) ;;
cc|xl[cC]_r)
echo >&4 "Switching cc to cc_r because of POSIX threads."
# --jhi@iki.fi
cc=cc_r
- case "`oslevel`" in
- 4.2.1.*) i_crypt='undef' ;;
- esac
+ case "`oslevel`" in
+ 4.2.1.*) i_crypt='undef' ;;
+ esac
;;
'')
cc=cc_r
esac
case "$gccversion" in
'') ;;
- *)
- cat >&4 <<EOM
-
-*** Warning: gcc in AIX might not work with the largefile support of Perl
-*** (default since 5.6.0), this combination hasn't been tested.
-*** I will try, though.
-
-EOM
- # Remove xlc-spefific -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'`"
- # Move xld-spefific -bflags.
- ccflags="`echo $ccflags | sed -e 's@ -b@ -Wl,-b@g'`"
- ldflags="`echo ' '$ldflags | sed -e 's@ -b@ -Wl,-b@g'`"
- lddlflags="`echo ' '$lddlflags | sed -e 's@ -b@ -Wl,-b@g'`"
- ld='gcc'
- echo >&4 "(using ccflags $ccflags)"
- echo >&4 "(using ldflags $ldflags)"
- echo >&4 "(using lddlflags $lddlflags)"
- ;;
+ *) # Remove xlc-spefific -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'`"
+ # Move xld-spefific -bflags.
+ ccflags="`echo $ccflags | sed -e 's@ -b@ -Wl,-b@g'`"
+ ldflags="`echo ' '$ldflags | sed -e 's@ -b@ -Wl,-b@g'`"
+ lddlflags="`echo ' '$lddlflags | sed -e 's@ -b@ -Wl,-b@g'`"
+ ld='gcc'
+ echo >&4 "(using ccflags $ccflags)"
+ echo >&4 "(using ldflags $ldflags)"
+ echo >&4 "(using lddlflags $lddlflags)"
+ ;;
esac
;;
esac
esac
fi
+case "$PASE" in
+define)
+ case "$prefix" in
+ '') prefix=/QOpenSys/perl ;;
+ esac
+ cat >&4 <<EOF
+
+***
+*** You seem to be compiling in AIX for the OS/400 PASE environment.
+*** I'm not going to use the AIX bind, nsl, and possible util libraries, then.
+*** I'm also not going to install perl as /usr/bin/perl.
+*** Perl will be installed under $prefix.
+*** For instructions how to install this build from AIX to PASE,
+*** see the file README.os400. Accept the "aix" for the question
+*** about "Operating system name".
+***
+EOF
+ set `echo " $libswanted " | sed -e 's@ bind @ @' -e 's@ nsl @ @' -e 's@ util @ @'`
+ shift
+ libswanted="$*"
+ installusrbinperl="$undef"
+
+ # V5R1 doesn't have this (V5R2 does), without knowing
+ # which one we have it's safer to be pessimistic.
+ # Cwd will work fine even without fchdir(), but if
+ # V5R1 tries to use code compiled assuming fchdir(),
+ # lots of grief will issue forth from Cwd.
+ case "$d_fchdir" in
+ '') d_fchdir="$undef" ;;
+ esac
+ ;;
+esac
+
# EOF