This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR41180 pt2: fix config.guess on darwin10


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]