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

John David Anglin dave@hiauly1.hia.nrc.ca
Tue Dec 3 08:31:00 GMT 2002


> I applied the patch to config.guess in gcc-3.3.  I had to apply it
> manually because of minor formatting differences.  It didn't work
> correctly.  The following appeared in the gcc build log.  I was
> using a 64-bit gcc as the build compiler.
> 
> ../gcc/config.guess[631]: tmpdir=${TMPDIR-/tmp}/config-guess-$$:  not found.
> ../gcc/config.guess[632]: -E:  not found.
> Configuring for a hppa64-hp-hpux11.11 host.
> ...

We need to eval $set_cc_for_build.  I am doing a gcc bootstrap with
the patch below.  I have verified that it correctly selects hppa64
when using gcc (64-bit version selected using $PATH) and the HP
bundled compiler selected with CC="cc +DA2.0W".

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

Index: config.guess
===================================================================
RCS file: /cvsroot/gcc/gcc/config.guess,v
retrieving revision 1.53
diff -u -3 -p -r1.53 config.guess
--- config.guess	20 Aug 2002 21:53:23 -0000	1.53
+++ config.guess	3 Dec 2002 16:19:35 -0000
@@ -621,10 +621,21 @@ EOF
               }
 EOF
 		    (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 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" || eval $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