--- configure.ac 2015/06/08 02:27:18 1.1 +++ configure.ac 2015/06/08 20:59:12 @@ -1153,43 +1153,47 @@ AC_MSG_RESULT($CC) fi - # Calculate the right deployment target for this build. - # - cur_target_major=`sw_vers -productVersion | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` - cur_target_minor=`sw_vers -productVersion | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'` - cur_target="${cur_target_major}.${cur_target_minor}" - if test ${cur_target_major} -eq 10 && \ - test ${cur_target_minor} -ge 3 - then - cur_target=10.3 - if test ${enable_universalsdk}; then - if test "${UNIVERSAL_ARCHS}" = "all"; then - # Ensure that the default platform for a - # 4-way universal build is OSX 10.5, - # that's the first OS release where - # 4-way builds make sense. - cur_target='10.5' - - elif test "${UNIVERSAL_ARCHS}" = "3-way"; then - cur_target='10.5' - - elif test "${UNIVERSAL_ARCHS}" = "intel"; then - cur_target='10.5' - - elif test "${UNIVERSAL_ARCHS}" = "64-bit"; then - cur_target='10.5' - fi - else - if test `/usr/bin/arch` = "i386"; then - # On Intel macs default to a deployment - # target of 10.4, that's the first OSX - # release with Intel support. - cur_target="10.4" - fi - fi - fi + # Calculate an appropriate deployment target for this build: + # The deployment target value is used explicitly to enable certain + # features are enabled (such as builtin libedit support for readline) + # through the use of Apple's Availabiliy Macros and is used as a + # component of the string returned by distutils.get_platform(). + # + # Use the value from: + # 1. the MACOSX_DEPLOYMENT_TARGET environment variable if specified + # 2. the operating system version of the build machine if >= 10.6 + # 3. If running on OS X 10.3 through 10.5, use the legacy tests + # below to pick either 10.3, 10.4, or 10.5 as the target. + # 4. If we are running on OS X 10.2 or earlier, good luck! + + AC_MSG_CHECKING(which MACOSX_DEPLOYMENT_TARGET to use) + cur_target_major=`sw_vers -productVersion | \ + sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` + cur_target_minor=`sw_vers -productVersion | \ + sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'` + cur_target="${cur_target_major}.${cur_target_minor}" + if test ${cur_target_major} -eq 10 && \ + test ${cur_target_minor} -ge 3 && \ + test ${cur_target_minor} -le 5 + then + # OS X 10.3 through 10.5 + cur_target=10.3 + if test ${enable_universalsdk} + then + case "$UNIVERSAL_ARCHS" in + all|3-way|intel|64-bit) + # These configurations were first supported in 10.5 + cur_target='10.5' + ;; + esac + else + if test `/usr/bin/arch` = "i386" + then + # 10.4 was the first release to support Intel archs + cur_target="10.4" + fi + fi + fi CONFIGURE_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET-${cur_target}} # Make sure that MACOSX_DEPLOYMENT_TARGET is set in the @@ -1199,6 +1203,7 @@ MACOSX_DEPLOYMENT_TARGET="$CONFIGURE_MACOSX_DEPLOYMENT_TARGET" export MACOSX_DEPLOYMENT_TARGET EXPORT_MACOSX_DEPLOYMENT_TARGET='' + AC_MSG_RESULT($MACOSX_DEPLOYMENT_TARGET) if test "${enable_universalsdk}"; then UNIVERSAL_ARCH_FLAGS=""