Patch to config.guess (2002-07-03) to detect 64bit HPUX compiler

Ben Elliston bje@redhat.com
Fri Nov 29 22:05:00 GMT 2002


On a planet far away, an unsigned long long time ago, Ross Alexander
submitted a patch to correctly detect the 64-bit HP-UX compiler.

After some debate and the obligatory four month cooling off period
:-), here is a patch that combines the input of Ross and Dave Anglin.
I tidied it up a bit and made it more portable -- by dropping, to
hopefully no effect, the -q option to grep.

Is everyone agreeable to this patch?  Can someone with the right HP
systems test the patch?  Thanks.

Ben


2002-11-30  Ben Elliston  <bje@redhat.com>

        From <ross.alexander@uk.neceur.com>:
        * config.guess (*:HP-UX:*:*): Detect 64-bit compiler.

Index: config.guess
===================================================================
RCS file: /cvsroot/config/config/config.guess,v
retrieving revision 1.258
diff -u -r1.258 config.guess
--- config.guess        30 Nov 2002 05:05:28 -0000      1.258
+++ config.guess        30 Nov 2002 05:59:38 -0000
@@ -635,10 +635,21 @@
               }
 EOF
                    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
-                   if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
+                   test -z "$HP_ARCH" && HP_ARCH=hppa
                    rm -f $dummy.c $dummy && rmdir $tmpdir
                fi ;;
        esac
+       if [ ${HP_ARCH} = "hppa2.0w" ]
+       then
+           # avoid double evaluation of $set_cc_for_build
+           test -n "$CC_FOR_BUILD" || $set_cc_for_build
+           if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__
+           then
+               HP_ARCH="hppa2.0w"
+           else
+               HP_ARCH="hppa64"
+           fi
+       fi
        echo ${HP_ARCH}-hp-hpux${HPUX_REV}
        exit 0 ;;
     ia64:HP-UX:*:*)



More information about the Binutils mailing list