This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR41180 pt2: fix config.guess on darwin10
- From: Jack Howarth <howarth at bromo dot med dot uc dot edu>
- To: FX <fxcoudert at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, mrs at apple dot com, ralf dot wildenhues at gmx dot de
- Date: Tue, 1 Sep 2009 10:13:09 -0400
- Subject: Re: [PATCH] PR41180 pt2: fix config.guess on darwin10
- References: <2C0EA4DC-21CA-4F61-B413-07978C6C6DFB@gmail.com>
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