This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
make POP_SAVEARRAY() safe
[perl5.git] / hints / hpux.sh
index 410a013..b2650a7 100644 (file)
@@ -213,6 +213,30 @@ case "$usemorebits" in
     $define|true|[yY]*) use64bitint="$define"; uselongdouble="$define" ;;
     esac
 
+# There is a weird pre-C99 long double (a struct of four uin32_t)
+# in HP-UX 10.20 but beyond strtold() there's no support for them
+# for example in <math.h>.
+case "$uselongdouble" in
+    $define|true|[yY]*)
+       if [ "$xxOsRevMajor" -lt 11 ]; then
+           cat <<EOM >&4
+
+*** uselongdouble (or usemorebits) is not supported on HP-UX $xxOsRevMajor.
+*** You need at least HP-UX 11.0.
+*** Cannot continue, aborting.
+EOM
+           exit 1
+       fi
+       ;;
+    esac
+
+# Configure long double scan will detect the HP-UX 10.20 "long double"
+# (a struct of four uin32_t) and think it is IEEE quad.  Make it not so.
+if [ "$xxOsRevMajor" -lt 11 ]; then
+    d_longdbl="$undef"
+    longdblsize=8 # Make it double.
+fi
+
 case "$archname" in
     IA64*)
        # While here, override so=sl auto-detection
@@ -574,6 +598,14 @@ EOCBU
 cat >UU/uselargefiles.cbu <<'EOCBU'
 # This script UU/uselargefiles.cbu will get 'called-back' by Configure
 # after it has prompted the user for whether to use large files.
+
+case "$archname:$use64bitall:$use64bitint" in
+    *-LP64*:undef:define)
+       archname=`echo "$archname" | sed 's/-LP64/-64int/'`
+       echo "Archname changed to $archname"
+       ;;
+    esac
+
 case "$uselargefiles" in
     ""|$define|true|[yY]*)
        # there are largefile flags available via getconf(1)
@@ -768,8 +800,15 @@ i_dbm=undef
 
 # In HP-UXes prior to 11.23 strtold() returned a HP-UX
 # specific union called long_double, not a C99 long double.
-case "`grep "double strtold.const" /usr/include/stdlib.h`" in
+case "`grep 'double strtold.const' /usr/include/stdlib.h`" in
 *"long double strtold"*) ;; # strtold should be safe.
 *) echo "Looks like your strtold() is non-standard..." >&4
    d_strtold=undef ;;
 esac
+
+# In pre-11 HP-UXes there really isn't isfinite(), despite what
+# Configure might think. (There is finite(), though.)
+case "`grep 'isfinite' /usr/include/math.h`" in
+*"isfinite"*) ;;
+*) d_isfinite=undef ;;
+esac