perl/hints/vos.sh
[p5sagit/p5-mst-13.2.git] / hints / hpux.sh
index b2ffcd5..9e4a01f 100644 (file)
@@ -31,6 +31,12 @@ else
        sed -e 's/HP-//' -e 1q`;
     selecttype='int *'
     fi
+    # For some strange reason, the u32align test from Configure hangs in
+    # HP-UX 10.20 since the December 2001 patches.  So hint it to avoid
+    # the test.
+    if [ "$xxOsRevMajor" -le 10 ]; then
+       d_u32align=$define
+    fi
 
 echo "Archname is $archname"
 
@@ -63,18 +69,25 @@ case "$prefix" in
 case `$cc -v 2>&1`"" in
     *gcc*)  ccisgcc="$define"
            ccflags="$cc_cppflags"
+           if [ "X$gccversion" = "X" ]; then
+               # Done too late in Configure if hinted
+               gccversion=`$cc --version`
+               fi
            case "`getconf KERNEL_BITS 2>/dev/null`" in
                *64*)
                    echo "main(){}">try.c
-                   # gcc with gas will not accept +DA2.0
-                   case "`$cc -c -Wa,+DA2.0 try.c 2>&1`" in
-                       *"+DA2.0"*)             # gas
-                           gnu_as=yes
+                   case "$gccversion" in
+                       3*) ccflags="$ccflags -mpa-risc-2-0"
                            ;;
-                       *)                      # HPas
-                           case "$gccversion" in
-                               [12]*) ccflags="$ccflags -Wa,+DA2.0" ;;
-                               esac
+                       *)  # gcc with gas will not accept +DA2.0
+                           case "`$cc -c -Wa,+DA2.0 try.c 2>&1`" in
+                               *"+DA2.0"*)             # gas
+                                   gnu_as=yes
+                                   ;;
+                               *)                      # HPas
+                                   ccflags="$ccflags -Wa,+DA2.0"
+                                   ;;
+                               esac
                            ;;
                        esac
                    # gcc with gld will not accept +vnocompatwarnings
@@ -83,16 +96,24 @@ case `$cc -v 2>&1`"" in
                            gnu_ld=yes
                            ;;
                        *)                      # HPld
-                           ldflags="$ldflags -Wl,+vnocompatwarnings"
-                           ccflags="$ccflags -Wl,+vnocompatwarnings"
+                           case "$gccversion" in
+                               [12]*)
+                                   ldflags="$ldflags -Wl,+vnocompatwarnings"
+                                   ccflags="$ccflags -Wl,+vnocompatwarnings"
+                                   ;;
+                               esac
                            ;;
                        esac
+                   rm -f try.c
                    ;;
                esac
            ;;
     *)      ccisgcc=''
            ccversion=`which cc | xargs what | awk '/Compiler/{print $2}'`
-           ccflags="-Ae $cc_cppflags -Wl,+vnocompatwarnings"
+           case "$ccflags" in
+           "-Ae "*) ;;
+           *) ccflags="-Ae $cc_cppflags -Wl,+vnocompatwarnings" ;;
+           esac
            # Needed because cpp does only support -Aa (not -Ae)
            cpplast='-'
            cppminus='-'
@@ -114,7 +135,7 @@ toke_cflags='ccflags="$ccflags -DARG_ZERO_IS_SCRIPT"'
     gcc_64native=no
 case "$ccisgcc" in
     $define|true|[Yy])
-       echo 'int main(){long l;printf("%d\\n",sizeof(l));}'>try.c
+       echo 'int main(){long l;printf("%d\\n",sizeof(l));}'>try.c
        $cc -o try $ccflags $ldflags try.c
        if [ "`try`" = "8" ]; then
            cat <<EOM >&4
@@ -185,8 +206,11 @@ EOM
                # anyway. Expect auto-detection of 64-bit enabled gcc on
                # HP-UX soon, including a user-friendly exit
                case $gcc_64native in
-                   no) ccflags="$ccflags -mlp64"
-                       ldflags="$ldflags -Wl,+DD64"
+                   no) case "$gccversion" in
+                           [12]*)  ccflags="$ccflags -mlp64"
+                                   ldflags="$ldflags -Wl,+DD64"
+                                   ;;
+                           esac
                        ;;
                    esac
                ;;
@@ -252,6 +276,7 @@ int main ()
 EOF
 $cc -o try $ccflags $ldflags try.c
        maxdsiz=`try`
+rm -f try try.c core
 if [ $maxdsiz -le 64 ]; then
     # 64 Mb is probably not enough to optimize toke.c
     # and regexp.c with -O2
@@ -344,7 +369,10 @@ case "$uselargefiles" in
        # but we cheat for now.  (Keep that in the left margin.)
 ccflags_uselargefiles="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
 
-       ccflags="$ccflags $ccflags_uselargefiles"
+       case "$ccflags" in
+       *" $ccflags_uselargefiles") ;;
+       *) ccflags="$ccflags $ccflags_uselargefiles" ;;
+       esac
 
         if test -z "$ccisgcc" -a -z "$gccversion"; then
            # The strict ANSI mode (-Aa) doesn't like large files.
@@ -438,3 +466,6 @@ EOM
        ;;
     esac
 EOCBU
+
+# fpclassify() is a macro, the library call is Fpclassify
+d_fpclassify='define'