[PATCH] PR41180 pt2: fix config.guess on darwin10
Jack Howarth
howarth@bromo.med.uc.edu
Tue Sep 1 14:13:00 GMT 2009
On Tue, Sep 01, 2009 at 03:45:44PM +0200, FX wrote:
> > Can't you grep some preprocessor symbol instead of introducing another
> > tool into config.guess with 'file'? There are a few similar examples
> > in the script already.
>
> You can simply check whether the __LP64__ macro is defined. This is done
> already in config.guess for hppa-hp-hpux, you can certainly use similar
> logic.
>
> FX
FX,
Thanks. This is untested but I believe the following will work...
Index: config.guess
===================================================================
--- config.guess (revision 151230)
+++ config.guess (working copy)
@@ -1246,6 +1246,19 @@
exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #ifdef __LP64__
+ main()
+ {
+ }
+ #endif
+EOF
+ if test "$(UNAME_PROCESSOR)"= i386 ; then
+ if test "`$CC_FOR_BUILD -E $dummy.c | grep -c main`" = 1 ; then
+ UNAME_PROCESSOR=x86_64
+ fi
+ fi
case $UNAME_PROCESSOR in
unknown) UNAME_PROCESSOR=powerpc ;;
esac
I'll test this tonight.
Jack
More information about the Gcc-patches
mailing list