### HP-UX OS specific behaviour
-# Initial setting of some flags
-ccflags="$ccflags -D_HPUX_SOURCE"
-ldflags="$ldflags -D_HPUX_SOURCE"
+# -ldbm is obsolete and should not be used
+# -lBSD contains BSD-style duplicates of SVR4 routines that cause confusion
+# -lPW is obsolete and should not be used
+# The libraries crypt, malloc, ndir, and net are empty.
+set `echo "X $libswanted " | sed -e 's/ ld / /' -e 's/ dbm / /' -e 's/ BSD / /' -e 's/ PW / /'`
+shift
+libswanted="$*"
-# When HP-UX runs a script with "#!", it sets argv[0] to the script name.
-toke_cflags='ccflags="$ccflags -DARG_ZERO_IS_SCRIPT"'
+# By setting the deferred flag below, this means that if you run perl
+# on a system that does not have the required shared library that you
+# linked it with, it will die when you try to access a symbol in the
+# (missing) shared library. If you would rather know at perl startup
+# time that you are missing an important shared library, switch the
+# comments so that immediate, rather than deferred loading is
+# performed. Even with immediate loading, you can postpone errors for
+# undefined (or multiply defined) routines until actual access by
+# adding the "nonfatal" option.
+# ccdlflags="-Wl,-E -Wl,-B,immediate $ccdlflags"
+# ccdlflags="-Wl,-E -Wl,-B,immediate,-B,nonfatal $ccdlflags"
+ccdlflags="-Wl,-E -Wl,-B,deferred $ccdlflags"
cc=${cc:-cc}
+ar=/usr/bin/ar # Yes, truly override. We do not want the GNU ar.
+full_ar=$ar # I repeat, no GNU ar. arrr.
+
+set `echo "X $ccflags " | sed -e 's/ -A[ea] / /' -e 's/ -D_HPUX_SOURCE / /'`
+shift
+ cc_cppflags="$* -D_HPUX_SOURCE"
+cppflags="-Aa -D__STDC_EXT__ $cc_cppflags"
+
+case "$prefix" in
+ "") prefix='/opt/perl5' ;;
+ esac
+
case `$cc -v 2>&1`"" in
- *gcc*) ccisgcc="$define" ;;
- *) ccisgcc=''
- ccversion=`which cc | xargs what | awk '/Compiler/{print $2}'`
- case "$d_casti32" in
- "") d_casti32='undef' ;;
- esac
- ;;
+ *gcc*) ccisgcc="$define"
+ ccflags="$cc_cppflags"
+ case "`getconf KERNEL_BITS 2>/dev/null`" in
+ *64*) ldflags="$ldflags -Wl,+vnocompatwarnings"
+ ccflags="$ccflags -Wl,+vnocompatwarnings -Wa,+DA2.0"
+ ;;
+ esac
+ ;;
+ *) ccisgcc=''
+ ccversion=`which cc | xargs what | awk '/Compiler/{print $2}'`
+ ccflags="-Ae $cc_cppflags"
+ # Needed because cpp does only support -Aa (not -Ae)
+ cpplast='-'
+ cppminus='-'
+ cppstdin='cc -E -Aa -D__STDC_EXT__'
+ cpprun=$cppstdin
+ case "$d_casti32" in
+ "") d_casti32='undef' ;;
+ esac
+ ;;
esac
-set `echo X "$libswanted "| sed -e 's/ BSD//' -e 's/ PW//'`
-shift
-libswanted="$*"
+# When HP-UX runs a script with "#!", it sets argv[0] to the script name.
+toke_cflags='ccflags="$ccflags -DARG_ZERO_IS_SCRIPT"'
### 64 BITNESS
$define|true|[Yy])
case "$optimize" in
- "") optimize="-g -O" ;;
+ "") optimize="-g -O" ;;
+ *O[3456789]*) optimize=`echo "$optimize" | sed -e 's/O[3-9]/O2/'` ;;
esac
- ld="$cc"
+ #ld="$cc"
+ ld="/usr/bin/ld"
cccdlflags='-fPIC'
- lddlflags='-shared'
+ #lddlflags='-shared'
+ lddlflags='-b +vnocompatwarnings'
+ case "$optimize" in
+ *-g*-O*|*-O*-g*)
+ # gcc without gas will not accept -g
+ echo "main(){}">try.c
+ case "`$cc $optimize -c try.c 2>&1`" in
+ *"-g option disabled"*)
+ set `echo "X $optimize " | sed -e 's/ -g / /'`
+ shift
+ optimize="$*"
+ ;;
+ esac
+ ;;
+ esac
;;
*) # HP's compiler cannot combine -g and -O
case "$optimize" in
- "") optimize="-O" ;;
+ "") optimize="+O2 +Onolimit" ;;
+ *O[3456789]*) optimize=`echo "$optimize" | sed -e 's/O[3-9]/O2/'` ;;
esac
ld=/usr/bin/ld
cccdlflags='+Z'
- lddlflags='-b'
+ lddlflags='-b +vnocompatwarnings'
;;
esac
-cat > UU/cc.cbu <<'EOCBU'
-# XXX This script UU/cc.cbu will get 'called-back' by Configure after it
-# XXX has prompted the user for the C compiler to use.
-# Get gcc to share its secrets.
-echo 'main() { return 0; }' > try.c
- # Indent to avoid propagation to config.sh
- verbose=`${cc:-cc} -v -o try try.c 2>&1`
- if echo "$verbose" | grep '^Reading specs from' >/dev/null 2>&1; then
- # Using gcc.
- : nothing to see here, move on.
- else
- # Using cc.
- ar=${ar:-ar}
- case "`$ar -V 2>&1`" in
- *GNU*)
- if test -x /usr/bin/ar; then
- cat <<END >&2
-
-*** You are using HP cc(1) but GNU ar(1). This might lead into trouble
-*** later on, I'm switching to HP ar to play safe.
-
-END
- ar=/usr/bin/ar
- fi
- ;;
- esac
- fi
-EOCBU
## LARGEFILES
-case "$uselargefiles-$ccisgcc" in
- "$define-$define"|'-define')
- cat <<EOM >&4
-
-*** I'm ignoring large files for this build because
-*** I don't know how to do use large files in HP-UX using gcc.
-
-EOM
- uselargefiles="$undef"
- ;;
- esac
+#case "$uselargefiles-$ccisgcc" in
+# "$define-$define"|'-define')
+# cat <<EOM >&4
+#
+#*** I'm ignoring large files for this build because
+#*** I don't know how to do use large files in HP-UX using gcc.
+#
+#EOM
+# uselargefiles="$undef"
+# ;;
+# esac
cat >UU/uselargefiles.cbu <<'EOCBU'
# This script UU/uselargefiles.cbu will get 'called-back' by Configure