From: Ronald Oussoren Date: Sun, 18 Apr 2010 18:21:03 +0000 (+0000) Subject: Merged revisions 80187 via svnmerge from X-Git-Tag: v2.6.6rc1~445 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e3eaf3153f126f9086a29d9bb93ccafdc3210f54;p=python Merged revisions 80187 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r80187 | ronald.oussoren | 2010-04-18 19:59:37 +0200 (Sun, 18 Apr 2010) | 6 lines Add the OSX universal binary related options to CFLAGS instead of BASECFLAGS. This fixes issue 8366 and is needed due to changes introduced in the fix for issue 1628484. ........ Also: force usage of gcc-4.0 when building using the 10.4 SDK, this is needed to avoid compile errors when building on OSX 10.6 (and is already in the trunk) --- diff --git a/configure b/configure index 76cdd1795a..ed927943c3 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 78820 . +# From configure.in Revision: 79353 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 2.6. # @@ -3900,7 +3900,7 @@ else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi -rm -f conftest* +rm -f -r conftest* @@ -4710,6 +4710,24 @@ echo "${ECHO_T}$ac_cv_no_strict_aliasing_ok" >&6; } # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd # used to be here, but non-Apple gcc doesn't accept them. + if test "${CC}" = gcc + then + { echo "$as_me:$LINENO: checking which compiler should be used" >&5 +echo $ECHO_N "checking which compiler should be used... $ECHO_C" >&6; } + case "${UNIVERSALSDK}" in + */MacOSX10.4u.sdk) + # Build using 10.4 SDK, force usage of gcc when the + # compiler is gcc, otherwise the user will get very + # confusing error messages when building on OSX 10.6 + CC=gcc-4.0 + CPP=cpp-4.0 + ;; + esac + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } + fi + + if test "${enable_universalsdk}"; then UNIVERSAL_ARCH_FLAGS="" if test "$UNIVERSAL_ARCHS" = "32-bit" ; then @@ -4752,10 +4770,11 @@ echo "$as_me: error: proper usage is --with-universal-arch=32-bit|64-bit|all|int fi - BASECFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${BASECFLAGS}" - tgt=`sw_vers -productVersion | sed 's/\(10\.[0-9]*\).*/\1/'` - if test "${UNIVERSALSDK}" != "/" -a "${tgt}" '>' '10.4' ; then - CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}" + CFLAGS="${UNIVERSAL_ARCH_FLAGS} ${CFLAGS}" + if test "${UNIVERSALSDK}" != "/" + then + CFLAGS="-isysroot ${UNIVERSALSDK} ${CFLAGS}" + CPPFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}" fi fi @@ -5450,7 +5469,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | else ac_cv_header_stdc=no fi -rm -f conftest* +rm -f -r conftest* fi @@ -5471,7 +5490,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | else ac_cv_header_stdc=no fi -rm -f conftest* +rm -f -r conftest* fi @@ -6569,7 +6588,7 @@ _ACEOF fi -rm -f conftest* +rm -f -r conftest* { echo "$as_me:$LINENO: result: $was_it_defined" >&5 echo "${ECHO_T}$was_it_defined" >&6; } @@ -7099,7 +7118,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | else ac_cv_type_uid_t=no fi -rm -f conftest* +rm -f -r conftest* fi { echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 @@ -14224,7 +14243,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | else unistd_defines_pthreads=no fi -rm -f conftest* +rm -f -r conftest* { echo "$as_me:$LINENO: result: $unistd_defines_pthreads" >&5 echo "${ECHO_T}$unistd_defines_pthreads" >&6; } @@ -15838,7 +15857,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then ipv6type=$i fi -rm -f conftest* +rm -f -r conftest* ;; kame) @@ -15861,7 +15880,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ipv6libdir=/usr/local/v6/lib ipv6trylibc=yes fi -rm -f conftest* +rm -f -r conftest* ;; linux-glibc) @@ -15882,7 +15901,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ipv6type=$i; ipv6trylibc=yes fi -rm -f conftest* +rm -f -r conftest* ;; linux-inet6) @@ -15920,7 +15939,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ipv6lib=inet6; ipv6libdir=/usr/local/v6/lib fi -rm -f conftest* +rm -f -r conftest* ;; v6d) @@ -15943,7 +15962,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ipv6libdir=/usr/local/v6/lib; BASECFLAGS="-I/usr/local/v6/include $BASECFLAGS" fi -rm -f conftest* +rm -f -r conftest* ;; zeta) @@ -15965,7 +15984,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ipv6lib=inet6; ipv6libdir=/usr/local/v6/lib fi -rm -f conftest* +rm -f -r conftest* ;; esac @@ -23743,7 +23762,7 @@ cat >>confdefs.h <<\_ACEOF _ACEOF fi -rm -f conftest* +rm -f -r conftest* cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23762,7 +23781,7 @@ cat >>confdefs.h <<\_ACEOF _ACEOF fi -rm -f conftest* +rm -f -r conftest* fi @@ -24032,7 +24051,7 @@ cat >>confdefs.h <<\_ACEOF _ACEOF fi -rm -f conftest* +rm -f -r conftest* fi diff --git a/configure.in b/configure.in index fcea443e95..0413533a4b 100644 --- a/configure.in +++ b/configure.in @@ -953,6 +953,22 @@ yes) # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd # used to be here, but non-Apple gcc doesn't accept them. + if test "${CC}" = gcc + then + AC_MSG_CHECKING(which compiler should be used) + case "${UNIVERSALSDK}" in + */MacOSX10.4u.sdk) + # Build using 10.4 SDK, force usage of gcc when the + # compiler is gcc, otherwise the user will get very + # confusing error messages when building on OSX 10.6 + CC=gcc-4.0 + CPP=cpp-4.0 + ;; + esac + AC_MSG_RESULT($CC) + fi + + if test "${enable_universalsdk}"; then UNIVERSAL_ARCH_FLAGS="" if test "$UNIVERSAL_ARCHS" = "32-bit" ; then @@ -993,10 +1009,11 @@ yes) fi - BASECFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${BASECFLAGS}" - tgt=`sw_vers -productVersion | sed 's/\(10\.[[0-9]]*\).*/\1/'` - if test "${UNIVERSALSDK}" != "/" -a "${tgt}" '>' '10.4' ; then - CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}" + CFLAGS="${UNIVERSAL_ARCH_FLAGS} ${CFLAGS}" + if test "${UNIVERSALSDK}" != "/" + then + CFLAGS="-isysroot ${UNIVERSALSDK} ${CFLAGS}" + CPPFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}" fi fi