diff options
author | Ronald Oussoren <ronaldoussoren@mac.com> | 2010-01-17 16:25:57 (GMT) |
---|---|---|
committer | Ronald Oussoren <ronaldoussoren@mac.com> | 2010-01-17 16:25:57 (GMT) |
commit | a55af9a9db334fb587f2c6b37ac28ac2463ebf04 (patch) | |
tree | 085b4cb7df8d1b3c2890dd13851970cac2c070a0 /configure.in | |
parent | 60ba2c8bf8d8457282232127fd13543af4956a3d (diff) | |
download | cpython-a55af9a9db334fb587f2c6b37ac28ac2463ebf04.zip cpython-a55af9a9db334fb587f2c6b37ac28ac2463ebf04.tar.gz cpython-a55af9a9db334fb587f2c6b37ac28ac2463ebf04.tar.bz2 |
- Issue #7658: Ensure that the new pythonw executable works on OSX 10.4
- Issue #7714: Use ``gcc -dumpversion`` to detect the version of GCC on
MacOSX.
- Make configure look for util.h as well as libutil.h. The former
is the header file that on OSX contains the defition of openpty.
(Needed to compile for OSX 10.4 on OSX 10.6)
- Use the correct definition of CC to compile the pythonw executable
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 131 |
1 files changed, 89 insertions, 42 deletions
diff --git a/configure.in b/configure.in index 7070a42..16a743e 100644 --- a/configure.in +++ b/configure.in @@ -307,6 +307,8 @@ case $ac_sys_system/$ac_sys_release in # has no effect, don't bother defining them Darwin/@<:@6789@:>@.*) define_xopen_source=no;; + Darwin/1@<:@0-9@:>@.*) + define_xopen_source=no;; # On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but # used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined # or has another value. By not (re)defining it, the defaults come in place. @@ -935,46 +937,19 @@ yes) Darwin*) # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd # used to be here, but non-Apple gcc doesn't accept them. - - - if test "${enable_universalsdk}"; then - UNIVERSAL_ARCH_FLAGS="" - if test "$UNIVERSAL_ARCHS" = "32-bit" ; then - UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386" - ARCH_RUN_32BIT="" - LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386" - - elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then - UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64" - LIPO_32BIT_FLAGS="" - ARCH_RUN_32BIT="true" - - elif test "$UNIVERSAL_ARCHS" = "all" ; then - UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64" - LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386" - ARCH_RUN_32BIT="arch -i386 -ppc" - - elif test "$UNIVERSAL_ARCHS" = "intel" ; then - UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64" - LIPO_32BIT_FLAGS="-extract i386" - ARCH_RUN_32BIT="arch -i386" - - elif test "$UNIVERSAL_ARCHS" = "3-way" ; then - UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64" - LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386" - ARCH_RUN_32BIT="arch -i386 -ppc7400" - - else - AC_MSG_ERROR([proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way]) - - 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}" - fi + 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 # Calculate the right deployment target for this build. @@ -1018,6 +993,78 @@ yes) export MACOSX_DEPLOYMENT_TARGET EXPORT_MACOSX_DEPLOYMENT_TARGET='' + if test "${enable_universalsdk}"; then + UNIVERSAL_ARCH_FLAGS="" + if test "$UNIVERSAL_ARCHS" = "32-bit" ; then + UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386" + ARCH_RUN_32BIT="" + LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386" + + + # You have to use different flags on various versions of + # OSX to extract PPC code from an universal binary, basically + # '-arch ppc' on OSX 10.4 and '-arch ppc7400' on anything + # newer. + # Because '-arch pp7400' works on OSX 10.5 or higher this + # test is only present in the '32-bit' branch, all other + # branches require OSX 10.5 to compile. + + AC_MSG_CHECKING(lipo flag for extracting ppc code) + FN="test.$$" + cat >${FN}.c <<-EOF + int main() { return 0; } +EOF + ${CC} ${CFLAGS} -arch ppc -arch i386 -o ${FN} ${FN}.c -isysroot ${UNIVERSALSDK} + if test $? != 0 ; then + rm ${FN} ${FN}.c + AC_MSG_RESULT([failed, assumee -extract ppc7400]) + else + lipo -extract -output "${FN}.out" -arch ppc7400 "${FN}" 2>/dev/null + if test $? != 0 ; then + LIPO_32BIT_FLAGS="-extract ppc -extract i386" + AC_MSG_RESULT("'-extract ppc'") + else + AC_MSG_RESULT("'-extract ppc7400'") + fi + rm -f ${FN} ${FN}.c ${FN}.out + fi + + elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then + UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64" + LIPO_32BIT_FLAGS="" + ARCH_RUN_32BIT="true" + + elif test "$UNIVERSAL_ARCHS" = "all" ; then + UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64" + LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386" + ARCH_RUN_32BIT="arch -i386 -ppc" + + elif test "$UNIVERSAL_ARCHS" = "intel" ; then + UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64" + LIPO_32BIT_FLAGS="-extract i386" + ARCH_RUN_32BIT="arch -i386" + + elif test "$UNIVERSAL_ARCHS" = "3-way" ; then + UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64" + LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386" + ARCH_RUN_32BIT="arch -i386 -ppc7400" + + else + AC_MSG_ERROR([proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way]) + + 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}" + CPPFLAGS="-isysroot ${UNIVERSALSDK}" + fi + + fi + + ;; OSF*) BASECFLAGS="$BASECFLAGS -mieee" @@ -1297,7 +1344,7 @@ sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \ sys/termio.h sys/time.h \ sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \ sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \ -bluetooth/bluetooth.h linux/tipc.h) +bluetooth/bluetooth.h linux/tipc.h spawn.h util.h) AC_HEADER_DIRENT AC_HEADER_MAJOR @@ -1557,7 +1604,7 @@ case $ac_sys_system/$ac_sys_release in LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';; Darwin/*) - gcc_version=`gcc -v 2>&1 | grep version | cut -d\ -f3` + gcc_version=`gcc -dumpversion` if test ${gcc_version} '<' 4.0 then LIBTOOL_CRUFT="-lcc_dynamic" |