config-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

config.guess avoiding cc invocation on new macs


From: Karl Berry
Subject: config.guess avoiding cc invocation on new macs
Date: Sun, 10 Nov 2013 00:30:25 GMT

Ben and all - courtesy of Adam and Dick (cc'd, to whom all questions
should be directed :), here is our prospective patch to eliminate
invoking the compiler on new-enough Macs.  (diff -c output seemed the
most readable.)

The idea was not to perturb the results, but just avoid the compiler
invocation when it's known not to be needed.  So the existing darwin
compilation block is used as-is for the uname -r <= 10.  When uname -r
is >= 11 (on Intel), it's known for sure that 64-bit processors are
being used.  For the record, more data on the confusing correspondences
between MacOSX namaes, release versions, and uname output is at
https://en.wikipedia.org/wiki/Uname.

Hope it flies.  Thanks,
Karl

P.S. Independent aside: I suggest using test ... in the few cases where
[ ... ] is used now.  One of which is in the original darwin block here.


*** ORIG/config.guess   Tue Jun 11 00:57:51 2013
--- ./config.guess      Sat Nov  9 16:18:41 2013
***************
*** 1260,1276 ****
        if test "$UNAME_PROCESSOR" = unknown ; then
            UNAME_PROCESSOR=powerpc
        fi
!       if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
!           if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
!               (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
!               grep IS_64BIT_ARCH >/dev/null
!           then
!               case $UNAME_PROCESSOR in
!                   i386) UNAME_PROCESSOR=x86_64 ;;
!                   powerpc) UNAME_PROCESSOR=powerpc64 ;;
!               esac
!           fi
!       fi
        echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
        exit ;;
      *:procnto*:*:* | *:QNX:[0123456789]*:*)
--- 1260,1286 ----
        if test "$UNAME_PROCESSOR" = unknown ; then
            UNAME_PROCESSOR=powerpc
        fi
!     if test `echo "$UNAME_RELEASE" |sed -e 's/\..*//g'` -le 10 ; then
!         # note that results will vary, depending on which compiler is set
!       if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
!           if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
!               (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
!               grep IS_64BIT_ARCH >/dev/null
!           then
!               case $UNAME_PROCESSOR in
!                   i386) UNAME_PROCESSOR=x86_64 ;;
!                   powerpc) UNAME_PROCESSOR=powerpc64 ;;
!               esac
!           fi
!       fi
!     elif test "$UNAME_PROCESSOR" = i386 ; then
!         # Avoid executing cc on OS X 10.9, as it ships with a stub that
!         # puts up a graphical alert prompting to install developer tools.
!         # Any system running Mac OS X 10.7 or later (darwin 11 and later)
!         # is required to have a 64-bit processor. This is not true of the
!         # ARM version of darwin that Apple uses in portable devices.
!         UNAME_PROCESSOR=x86_64
!     fi
        echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
        exit ;;
      *:procnto*:*:* | *:QNX:[0123456789]*:*)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]