Issue #14499: Fix several problems with OS X universal build support:
1. ppc arch detection for extension module builds broke with Xcode 5 2. ppc arch detection in configure did not work on OS X 10.4 3. -sysroot and -arch flags were unnecessarily duplicated 4. there was no obvious way to configure an intel-32 only build.
This commit is contained in:
parent
ea41d5f27c
commit
87adb6ef38
|
@ -235,13 +235,19 @@ def _remove_unsupported_archs(_config_vars):
|
||||||
if re.search('-arch\s+ppc', _config_vars['CFLAGS']) is not None:
|
if re.search('-arch\s+ppc', _config_vars['CFLAGS']) is not None:
|
||||||
# NOTE: Cannot use subprocess here because of bootstrap
|
# NOTE: Cannot use subprocess here because of bootstrap
|
||||||
# issues when building Python itself
|
# issues when building Python itself
|
||||||
status = os.system("'%s' -arch ppc -x c /dev/null 2>/dev/null"%(
|
status = os.system(
|
||||||
_config_vars['CC'].replace("'", "'\"'\"'"),))
|
"""echo 'int main{};' | """
|
||||||
# The Apple compiler drivers return status 255 if no PPC
|
"""'%s' -c -arch ppc -x c -o /dev/null /dev/null 2>/dev/null"""
|
||||||
if (status >> 8) == 255:
|
%(_config_vars['CC'].replace("'", "'\"'\"'"),))
|
||||||
# Compiler doesn't support PPC, remove the related
|
if status:
|
||||||
# '-arch' flags if not explicitly overridden by an
|
# The compile failed for some reason. Because of differences
|
||||||
# environment variable
|
# across Xcode and compiler versions, there is no reliable way
|
||||||
|
# to be sure why it failed. Assume here it was due to lack of
|
||||||
|
# PPC support and remove the related '-arch' flags from each
|
||||||
|
# config variables not explicitly overriden by an environment
|
||||||
|
# variable. If the error was for some other reason, we hope the
|
||||||
|
# failure will show up again when trying to compile an extension
|
||||||
|
# module.
|
||||||
for cv in _UNIVERSAL_CONFIG_VARS:
|
for cv in _UNIVERSAL_CONFIG_VARS:
|
||||||
if cv in _config_vars and cv not in os.environ:
|
if cv in _config_vars and cv not in os.environ:
|
||||||
flags = _config_vars[cv]
|
flags = _config_vars[cv]
|
||||||
|
|
10
Mac/README
10
Mac/README
|
@ -7,7 +7,7 @@ Python on Mac OS X README
|
||||||
Ronald Oussoren (2010-04),
|
Ronald Oussoren (2010-04),
|
||||||
Ned Deily (2012-06)
|
Ned Deily (2012-06)
|
||||||
|
|
||||||
:Version: 3.3.0
|
:Version: 3.4.0
|
||||||
|
|
||||||
This document provides a quick overview of some Mac OS X specific features in
|
This document provides a quick overview of some Mac OS X specific features in
|
||||||
the Python distribution.
|
the Python distribution.
|
||||||
|
@ -99,6 +99,8 @@ values are available:
|
||||||
|
|
||||||
* ``intel``: ``i386``, ``x86_64``
|
* ``intel``: ``i386``, ``x86_64``
|
||||||
|
|
||||||
|
* ``intel-32``: ``i386``
|
||||||
|
|
||||||
* ``32-bit``: ``ppc``, ``i386``
|
* ``32-bit``: ``ppc``, ``i386``
|
||||||
|
|
||||||
* ``3-way``: ``i386``, ``x86_64``, ``ppc``
|
* ``3-way``: ``i386``, ``x86_64``, ``ppc``
|
||||||
|
@ -125,7 +127,7 @@ following combinations of SDKs and universal-archs flavors are available:
|
||||||
|
|
||||||
* 10.7 and 10.8 SDKs with Xcode 4 support ``intel`` only
|
* 10.7 and 10.8 SDKs with Xcode 4 support ``intel`` only
|
||||||
|
|
||||||
The makefile for a framework build will also install ``python3.3-32``
|
The makefile for a framework build will also install ``python3.4-32``
|
||||||
binaries when the universal architecture includes at least one 32-bit
|
binaries when the universal architecture includes at least one 32-bit
|
||||||
architecture (that is, for all flavors but ``64-bit``).
|
architecture (that is, for all flavors but ``64-bit``).
|
||||||
|
|
||||||
|
@ -149,7 +151,7 @@ Using ``arch`` is not a perfect solution as the selected architecture will
|
||||||
not automatically carry through to subprocesses launched by programs and tests
|
not automatically carry through to subprocesses launched by programs and tests
|
||||||
under that Python. If you want to ensure that Python interpreters launched in
|
under that Python. If you want to ensure that Python interpreters launched in
|
||||||
subprocesses also run in 32-bit-mode if the main interpreter does, use
|
subprocesses also run in 32-bit-mode if the main interpreter does, use
|
||||||
a ``python3.3-32`` binary and use the value of ``sys.executable`` as the
|
a ``python3.4-32`` binary and use the value of ``sys.executable`` as the
|
||||||
``subprocess`` ``Popen`` executable value.
|
``subprocess`` ``Popen`` executable value.
|
||||||
|
|
||||||
|
|
||||||
|
@ -169,7 +171,7 @@ will have to do the work yourself if you really want this.
|
||||||
|
|
||||||
A second reason for using frameworks is that they put Python-related items in
|
A second reason for using frameworks is that they put Python-related items in
|
||||||
only two places: "/Library/Framework/Python.framework" and
|
only two places: "/Library/Framework/Python.framework" and
|
||||||
"/Applications/Python <VERSION>" where ``<VERSION>`` can be e.g. "3.3",
|
"/Applications/Python <VERSION>" where ``<VERSION>`` can be e.g. "3.4",
|
||||||
"2.7", etc. This simplifies matters for users installing
|
"2.7", etc. This simplifies matters for users installing
|
||||||
Python from a binary distribution if they want to get rid of it again. Moreover,
|
Python from a binary distribution if they want to get rid of it again. Moreover,
|
||||||
due to the way frameworks work, a user without admin privileges can install a
|
due to the way frameworks work, a user without admin privileges can install a
|
||||||
|
|
|
@ -190,6 +190,12 @@ Build
|
||||||
|
|
||||||
- Issue #15663: Update OS X 10.6+ installer to use Tcl/Tk 8.5.15.
|
- Issue #15663: Update OS X 10.6+ installer to use Tcl/Tk 8.5.15.
|
||||||
|
|
||||||
|
- Issue #14499: Fix several problems with OS X universal build support:
|
||||||
|
1. ppc arch detection for extension module builds broke with Xcode 5
|
||||||
|
2. ppc arch detection in configure did not work on OS X 10.4
|
||||||
|
3. -sysroot and -arch flags were unnecessarily duplicated
|
||||||
|
4. there was no obvious way to configure an intel-32 only build.
|
||||||
|
|
||||||
What's New in Python 3.4.0 Alpha 3?
|
What's New in Python 3.4.0 Alpha 3?
|
||||||
===================================
|
===================================
|
||||||
|
|
||||||
|
|
|
@ -1455,7 +1455,7 @@ Optional Packages:
|
||||||
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
|
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
|
||||||
--with-universal-archs=ARCH
|
--with-universal-archs=ARCH
|
||||||
select architectures for universal build ("32-bit",
|
select architectures for universal build ("32-bit",
|
||||||
"64-bit", "3-way", "intel" or "all")
|
"64-bit", "3-way", "intel", "intel-32", or "all")
|
||||||
--with-framework-name=FRAMEWORK
|
--with-framework-name=FRAMEWORK
|
||||||
specify an alternate name of the framework built
|
specify an alternate name of the framework built
|
||||||
with --enable-framework
|
with --enable-framework
|
||||||
|
@ -3037,7 +3037,7 @@ if test "${enable_universalsdk+set}" = set; then :
|
||||||
# Locate the best usable SDK, see Mac/README.txt for more
|
# Locate the best usable SDK, see Mac/README.txt for more
|
||||||
# information
|
# information
|
||||||
enableval="`/usr/bin/xcodebuild -version -sdk macosx Path 2>/dev/null`"
|
enableval="`/usr/bin/xcodebuild -version -sdk macosx Path 2>/dev/null`"
|
||||||
if test -z "${enableval}"
|
if ! ( echo $enableval | grep -E '\.sdk' 1>/dev/null )
|
||||||
then
|
then
|
||||||
enableval=/Developer/SDKs/MacOSX10.4u.sdk
|
enableval=/Developer/SDKs/MacOSX10.4u.sdk
|
||||||
if test ! -d "${enableval}"
|
if test ! -d "${enableval}"
|
||||||
|
@ -3080,6 +3080,7 @@ fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ARCH_RUN_32BIT=""
|
||||||
|
|
||||||
# For backward compatibility reasons we prefer to select '32-bit' if available,
|
# For backward compatibility reasons we prefer to select '32-bit' if available,
|
||||||
# otherwise use 'intel'
|
# otherwise use 'intel'
|
||||||
|
@ -3088,7 +3089,7 @@ if test "`uname -s`" = "Darwin"
|
||||||
then
|
then
|
||||||
if test -n "${UNIVERSALSDK}"
|
if test -n "${UNIVERSALSDK}"
|
||||||
then
|
then
|
||||||
if test -z "`/usr/bin/file "${UNIVERSALSDK}/usr/lib/libSystem.dylib" | grep ppc`"
|
if test -z "`/usr/bin/file -L "${UNIVERSALSDK}/usr/lib/libSystem.dylib" | grep ppc`"
|
||||||
then
|
then
|
||||||
UNIVERSAL_ARCHS="intel"
|
UNIVERSAL_ARCHS="intel"
|
||||||
fi
|
fi
|
||||||
|
@ -3102,19 +3103,18 @@ $as_echo_n "checking for --with-universal-archs... " >&6; }
|
||||||
# Check whether --with-universal-archs was given.
|
# Check whether --with-universal-archs was given.
|
||||||
if test "${with_universal_archs+set}" = set; then :
|
if test "${with_universal_archs+set}" = set; then :
|
||||||
withval=$with_universal_archs;
|
withval=$with_universal_archs;
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5
|
|
||||||
$as_echo "$withval" >&6; }
|
|
||||||
UNIVERSAL_ARCHS="$withval"
|
UNIVERSAL_ARCHS="$withval"
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${UNIVERSAL_ARCHS}" >&5
|
|
||||||
$as_echo "${UNIVERSAL_ARCHS}" >&6; }
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test -n "${UNIVERSALSDK}"
|
||||||
|
then
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${UNIVERSAL_ARCHS}" >&5
|
||||||
|
$as_echo "${UNIVERSAL_ARCHS}" >&6; }
|
||||||
|
else
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||||
|
$as_echo "no" >&6; }
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Check whether --with-framework-name was given.
|
# Check whether --with-framework-name was given.
|
||||||
|
@ -6441,113 +6441,124 @@ $as_echo "$ac_cv_declaration_after_statement_warning" >&6; }
|
||||||
SCO_SV*)
|
SCO_SV*)
|
||||||
BASECFLAGS="$BASECFLAGS -m486 -DSCO5"
|
BASECFLAGS="$BASECFLAGS -m486 -DSCO5"
|
||||||
;;
|
;;
|
||||||
# is there any other compiler on Darwin besides gcc?
|
|
||||||
Darwin*)
|
# is there any other compiler on Darwin besides gcc?
|
||||||
# -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd
|
Darwin*)
|
||||||
# used to be here, but non-Apple gcc doesn't accept them.
|
# -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd
|
||||||
if test "${CC}" = gcc
|
# used to be here, but non-Apple gcc doesn't accept them.
|
||||||
then
|
if test "${CC}" = gcc
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which compiler should be used" >&5
|
then
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which compiler should be used" >&5
|
||||||
$as_echo_n "checking which compiler should be used... " >&6; }
|
$as_echo_n "checking which compiler should be used... " >&6; }
|
||||||
case "${UNIVERSALSDK}" in
|
case "${UNIVERSALSDK}" in
|
||||||
*/MacOSX10.4u.sdk)
|
*/MacOSX10.4u.sdk)
|
||||||
# Build using 10.4 SDK, force usage of gcc when the
|
# Build using 10.4 SDK, force usage of gcc when the
|
||||||
# compiler is gcc, otherwise the user will get very
|
# compiler is gcc, otherwise the user will get very
|
||||||
# confusing error messages when building on OSX 10.6
|
# confusing error messages when building on OSX 10.6
|
||||||
CC=gcc-4.0
|
CC=gcc-4.0
|
||||||
CPP=cpp-4.0
|
CPP=cpp-4.0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
|
||||||
$as_echo "$CC" >&6; }
|
$as_echo "$CC" >&6; }
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test "${enable_universalsdk}"
|
||||||
|
then
|
||||||
|
case "$UNIVERSAL_ARCHS" in
|
||||||
|
32-bit)
|
||||||
|
UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
|
||||||
|
LIPO_32BIT_FLAGS=""
|
||||||
|
ARCH_RUN_32BIT=""
|
||||||
|
;;
|
||||||
|
64-bit)
|
||||||
|
UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
|
||||||
|
LIPO_32BIT_FLAGS=""
|
||||||
|
ARCH_RUN_32BIT="true"
|
||||||
|
;;
|
||||||
|
all)
|
||||||
|
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
|
||||||
|
LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
|
||||||
|
ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
|
||||||
|
;;
|
||||||
|
intel)
|
||||||
|
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64"
|
||||||
|
LIPO_32BIT_FLAGS="-extract i386"
|
||||||
|
ARCH_RUN_32BIT="/usr/bin/arch -i386"
|
||||||
|
;;
|
||||||
|
intel-32)
|
||||||
|
UNIVERSAL_ARCH_FLAGS="-arch i386"
|
||||||
|
LIPO_32BIT_FLAGS=""
|
||||||
|
ARCH_RUN_32BIT=""
|
||||||
|
;;
|
||||||
|
3-way)
|
||||||
|
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64"
|
||||||
|
LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
|
||||||
|
ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
as_fn_error $? "proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way" "$LINENO" 5
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
if test "${enable_universalsdk}"; then
|
CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}"
|
||||||
UNIVERSAL_ARCH_FLAGS=""
|
LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
|
||||||
if test "$UNIVERSAL_ARCHS" = "32-bit" ; then
|
if test "${UNIVERSALSDK}" != "/"
|
||||||
UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
|
then
|
||||||
ARCH_RUN_32BIT=""
|
CPPFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}"
|
||||||
LIPO_32BIT_FLAGS=""
|
fi
|
||||||
elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then
|
fi
|
||||||
UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
|
|
||||||
LIPO_32BIT_FLAGS=""
|
|
||||||
ARCH_RUN_32BIT="true"
|
|
||||||
|
|
||||||
elif test "$UNIVERSAL_ARCHS" = "all" ; then
|
# Calculate an appropriate deployment target for this build:
|
||||||
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
|
# The deployment target value is used explicitly to enable certain
|
||||||
LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
|
# features are enabled (such as builtin libedit support for readline)
|
||||||
ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
|
# 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!
|
||||||
|
|
||||||
elif test "$UNIVERSAL_ARCHS" = "intel" ; then
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which MACOSX_DEPLOYMENT_TARGET to use" >&5
|
||||||
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64"
|
$as_echo_n "checking which MACOSX_DEPLOYMENT_TARGET to use... " >&6; }
|
||||||
LIPO_32BIT_FLAGS="-extract i386"
|
cur_target=`sw_vers -productVersion | sed 's/\(10\.[0-9]*\).*/\1/'`
|
||||||
ARCH_RUN_32BIT="/usr/bin/arch -i386"
|
if test ${cur_target} '>' 10.2 && \
|
||||||
|
test ${cur_target} '<' 10.6
|
||||||
|
then
|
||||||
|
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}}
|
||||||
|
|
||||||
elif test "$UNIVERSAL_ARCHS" = "3-way" ; then
|
# Make sure that MACOSX_DEPLOYMENT_TARGET is set in the
|
||||||
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64"
|
# environment with a value that is the same as what we'll use
|
||||||
LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
|
# in the Makefile to ensure that we'll get the same compiler
|
||||||
ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
|
# environment during configure and build time.
|
||||||
|
MACOSX_DEPLOYMENT_TARGET="$CONFIGURE_MACOSX_DEPLOYMENT_TARGET"
|
||||||
|
export MACOSX_DEPLOYMENT_TARGET
|
||||||
|
EXPORT_MACOSX_DEPLOYMENT_TARGET=''
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MACOSX_DEPLOYMENT_TARGET" >&5
|
||||||
|
$as_echo "$MACOSX_DEPLOYMENT_TARGET" >&6; }
|
||||||
|
|
||||||
else
|
# end of Darwin* tests
|
||||||
as_fn_error $? "proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way" "$LINENO" 5
|
;;
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}"
|
|
||||||
if test "${UNIVERSALSDK}" != "/"
|
|
||||||
then
|
|
||||||
CFLAGS="-isysroot ${UNIVERSALSDK} ${CFLAGS}"
|
|
||||||
LDFLAGS="-isysroot ${UNIVERSALSDK} ${LDFLAGS}"
|
|
||||||
CPPFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Calculate the right deployment target for this build.
|
|
||||||
#
|
|
||||||
cur_target=`sw_vers -productVersion | sed 's/\(10\.[0-9]*\).*/\1/'`
|
|
||||||
if test ${cur_target} '>' 10.2 && \
|
|
||||||
test ${cur_target} '<' 10.6
|
|
||||||
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
|
|
||||||
CONFIGURE_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET-${cur_target}}
|
|
||||||
|
|
||||||
# Make sure that MACOSX_DEPLOYMENT_TARGET is set in the
|
|
||||||
# environment with a value that is the same as what we'll use
|
|
||||||
# in the Makefile to ensure that we'll get the same compiler
|
|
||||||
# environment during configure and build time.
|
|
||||||
MACOSX_DEPLOYMENT_TARGET="$CONFIGURE_MACOSX_DEPLOYMENT_TARGET"
|
|
||||||
export MACOSX_DEPLOYMENT_TARGET
|
|
||||||
EXPORT_MACOSX_DEPLOYMENT_TARGET=''
|
|
||||||
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
@ -8285,7 +8296,6 @@ case $ac_sys_system/$ac_sys_release in
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
ARCH_RUN_32BIT=""
|
|
||||||
|
|
||||||
case $ac_sys_system/$ac_sys_release in
|
case $ac_sys_system/$ac_sys_release in
|
||||||
Darwin/[01567]\..*)
|
Darwin/[01567]\..*)
|
||||||
|
@ -8357,14 +8367,12 @@ fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
#ARCH_RUN_32BIT="true"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only ${MACOSX_DEFAULT_ARCH}"
|
LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only ${MACOSX_DEFAULT_ARCH}"
|
||||||
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
||||||
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
|
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-framework" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-framework" >&5
|
||||||
$as_echo_n "checking for --enable-framework... " >&6; }
|
$as_echo_n "checking for --enable-framework... " >&6; }
|
||||||
if test "$enable_framework"
|
if test "$enable_framework"
|
||||||
|
@ -8492,9 +8500,6 @@ then
|
||||||
|
|
||||||
if test ${MACOSX_DEPLOYMENT_TARGET} '>' 10.2
|
if test ${MACOSX_DEPLOYMENT_TARGET} '>' 10.2
|
||||||
then
|
then
|
||||||
if test "${enable_universalsdk}"; then
|
|
||||||
LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
|
|
||||||
fi
|
|
||||||
LDSHARED='$(CC) -bundle -undefined dynamic_lookup'
|
LDSHARED='$(CC) -bundle -undefined dynamic_lookup'
|
||||||
LDCXXSHARED='$(CXX) -bundle -undefined dynamic_lookup'
|
LDCXXSHARED='$(CXX) -bundle -undefined dynamic_lookup'
|
||||||
BLDSHARED="$LDSHARED"
|
BLDSHARED="$LDSHARED"
|
||||||
|
|
231
configure.ac
231
configure.ac
|
@ -152,7 +152,7 @@ AC_ARG_ENABLE(universalsdk,
|
||||||
# Locate the best usable SDK, see Mac/README.txt for more
|
# Locate the best usable SDK, see Mac/README.txt for more
|
||||||
# information
|
# information
|
||||||
enableval="`/usr/bin/xcodebuild -version -sdk macosx Path 2>/dev/null`"
|
enableval="`/usr/bin/xcodebuild -version -sdk macosx Path 2>/dev/null`"
|
||||||
if test -z "${enableval}"
|
if ! ( echo $enableval | grep -E '\.sdk' 1>/dev/null )
|
||||||
then
|
then
|
||||||
enableval=/Developer/SDKs/MacOSX10.4u.sdk
|
enableval=/Developer/SDKs/MacOSX10.4u.sdk
|
||||||
if test ! -d "${enableval}"
|
if test ! -d "${enableval}"
|
||||||
|
@ -189,6 +189,7 @@ fi
|
||||||
AC_SUBST(UNIVERSALSDK)
|
AC_SUBST(UNIVERSALSDK)
|
||||||
|
|
||||||
AC_SUBST(ARCH_RUN_32BIT)
|
AC_SUBST(ARCH_RUN_32BIT)
|
||||||
|
ARCH_RUN_32BIT=""
|
||||||
|
|
||||||
# For backward compatibility reasons we prefer to select '32-bit' if available,
|
# For backward compatibility reasons we prefer to select '32-bit' if available,
|
||||||
# otherwise use 'intel'
|
# otherwise use 'intel'
|
||||||
|
@ -197,7 +198,7 @@ if test "`uname -s`" = "Darwin"
|
||||||
then
|
then
|
||||||
if test -n "${UNIVERSALSDK}"
|
if test -n "${UNIVERSALSDK}"
|
||||||
then
|
then
|
||||||
if test -z "`/usr/bin/file "${UNIVERSALSDK}/usr/lib/libSystem.dylib" | grep ppc`"
|
if test -z "`/usr/bin/file -L "${UNIVERSALSDK}/usr/lib/libSystem.dylib" | grep ppc`"
|
||||||
then
|
then
|
||||||
UNIVERSAL_ARCHS="intel"
|
UNIVERSAL_ARCHS="intel"
|
||||||
fi
|
fi
|
||||||
|
@ -207,16 +208,17 @@ fi
|
||||||
AC_SUBST(LIPO_32BIT_FLAGS)
|
AC_SUBST(LIPO_32BIT_FLAGS)
|
||||||
AC_MSG_CHECKING(for --with-universal-archs)
|
AC_MSG_CHECKING(for --with-universal-archs)
|
||||||
AC_ARG_WITH(universal-archs,
|
AC_ARG_WITH(universal-archs,
|
||||||
AS_HELP_STRING([--with-universal-archs=ARCH], [select architectures for universal build ("32-bit", "64-bit", "3-way", "intel" or "all")]),
|
AS_HELP_STRING([--with-universal-archs=ARCH], [select architectures for universal build ("32-bit", "64-bit", "3-way", "intel", "intel-32", or "all")]),
|
||||||
[
|
[
|
||||||
AC_MSG_RESULT($withval)
|
|
||||||
UNIVERSAL_ARCHS="$withval"
|
UNIVERSAL_ARCHS="$withval"
|
||||||
],
|
],
|
||||||
[
|
[])
|
||||||
AC_MSG_RESULT(${UNIVERSAL_ARCHS})
|
if test -n "${UNIVERSALSDK}"
|
||||||
])
|
then
|
||||||
|
AC_MSG_RESULT(${UNIVERSAL_ARCHS})
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
fi
|
||||||
|
|
||||||
AC_ARG_WITH(framework-name,
|
AC_ARG_WITH(framework-name,
|
||||||
AS_HELP_STRING([--with-framework-name=FRAMEWORK],
|
AS_HELP_STRING([--with-framework-name=FRAMEWORK],
|
||||||
|
@ -1219,111 +1221,120 @@ yes)
|
||||||
SCO_SV*)
|
SCO_SV*)
|
||||||
BASECFLAGS="$BASECFLAGS -m486 -DSCO5"
|
BASECFLAGS="$BASECFLAGS -m486 -DSCO5"
|
||||||
;;
|
;;
|
||||||
# is there any other compiler on Darwin besides gcc?
|
|
||||||
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 "${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
|
|
||||||
|
|
||||||
|
# is there any other compiler on Darwin besides gcc?
|
||||||
|
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 "${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
|
if test "${enable_universalsdk}"
|
||||||
UNIVERSAL_ARCH_FLAGS=""
|
then
|
||||||
if test "$UNIVERSAL_ARCHS" = "32-bit" ; then
|
case "$UNIVERSAL_ARCHS" in
|
||||||
UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
|
32-bit)
|
||||||
ARCH_RUN_32BIT=""
|
UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
|
||||||
LIPO_32BIT_FLAGS=""
|
LIPO_32BIT_FLAGS=""
|
||||||
elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then
|
ARCH_RUN_32BIT=""
|
||||||
UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
|
;;
|
||||||
LIPO_32BIT_FLAGS=""
|
64-bit)
|
||||||
ARCH_RUN_32BIT="true"
|
UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
|
||||||
|
LIPO_32BIT_FLAGS=""
|
||||||
|
ARCH_RUN_32BIT="true"
|
||||||
|
;;
|
||||||
|
all)
|
||||||
|
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
|
||||||
|
LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
|
||||||
|
ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
|
||||||
|
;;
|
||||||
|
intel)
|
||||||
|
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64"
|
||||||
|
LIPO_32BIT_FLAGS="-extract i386"
|
||||||
|
ARCH_RUN_32BIT="/usr/bin/arch -i386"
|
||||||
|
;;
|
||||||
|
intel-32)
|
||||||
|
UNIVERSAL_ARCH_FLAGS="-arch i386"
|
||||||
|
LIPO_32BIT_FLAGS=""
|
||||||
|
ARCH_RUN_32BIT=""
|
||||||
|
;;
|
||||||
|
3-way)
|
||||||
|
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64"
|
||||||
|
LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
|
||||||
|
ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
AC_MSG_ERROR([proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way])
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
elif test "$UNIVERSAL_ARCHS" = "all" ; then
|
CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}"
|
||||||
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
|
LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
|
||||||
LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
|
if test "${UNIVERSALSDK}" != "/"
|
||||||
ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
|
then
|
||||||
|
CPPFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
elif test "$UNIVERSAL_ARCHS" = "intel" ; then
|
# Calculate an appropriate deployment target for this build:
|
||||||
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64"
|
# The deployment target value is used explicitly to enable certain
|
||||||
LIPO_32BIT_FLAGS="-extract i386"
|
# features are enabled (such as builtin libedit support for readline)
|
||||||
ARCH_RUN_32BIT="/usr/bin/arch -i386"
|
# 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!
|
||||||
|
|
||||||
elif test "$UNIVERSAL_ARCHS" = "3-way" ; then
|
AC_MSG_CHECKING(which MACOSX_DEPLOYMENT_TARGET to use)
|
||||||
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64"
|
cur_target=`sw_vers -productVersion | sed 's/\(10\.[[0-9]]*\).*/\1/'`
|
||||||
LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
|
if test ${cur_target} '>' 10.2 && \
|
||||||
ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
|
test ${cur_target} '<' 10.6
|
||||||
|
then
|
||||||
|
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}}
|
||||||
|
|
||||||
else
|
# Make sure that MACOSX_DEPLOYMENT_TARGET is set in the
|
||||||
AC_MSG_ERROR([proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way])
|
# environment with a value that is the same as what we'll use
|
||||||
|
# in the Makefile to ensure that we'll get the same compiler
|
||||||
|
# environment during configure and build time.
|
||||||
|
MACOSX_DEPLOYMENT_TARGET="$CONFIGURE_MACOSX_DEPLOYMENT_TARGET"
|
||||||
|
export MACOSX_DEPLOYMENT_TARGET
|
||||||
|
EXPORT_MACOSX_DEPLOYMENT_TARGET=''
|
||||||
|
AC_MSG_RESULT($MACOSX_DEPLOYMENT_TARGET)
|
||||||
|
|
||||||
fi
|
# end of Darwin* tests
|
||||||
|
;;
|
||||||
|
|
||||||
CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}"
|
|
||||||
if test "${UNIVERSALSDK}" != "/"
|
|
||||||
then
|
|
||||||
CFLAGS="-isysroot ${UNIVERSALSDK} ${CFLAGS}"
|
|
||||||
LDFLAGS="-isysroot ${UNIVERSALSDK} ${LDFLAGS}"
|
|
||||||
CPPFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Calculate the right deployment target for this build.
|
|
||||||
#
|
|
||||||
cur_target=`sw_vers -productVersion | sed 's/\(10\.[[0-9]]*\).*/\1/'`
|
|
||||||
if test ${cur_target} '>' 10.2 && \
|
|
||||||
test ${cur_target} '<' 10.6
|
|
||||||
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
|
|
||||||
CONFIGURE_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET-${cur_target}}
|
|
||||||
|
|
||||||
# Make sure that MACOSX_DEPLOYMENT_TARGET is set in the
|
|
||||||
# environment with a value that is the same as what we'll use
|
|
||||||
# in the Makefile to ensure that we'll get the same compiler
|
|
||||||
# environment during configure and build time.
|
|
||||||
MACOSX_DEPLOYMENT_TARGET="$CONFIGURE_MACOSX_DEPLOYMENT_TARGET"
|
|
||||||
export MACOSX_DEPLOYMENT_TARGET
|
|
||||||
EXPORT_MACOSX_DEPLOYMENT_TARGET=''
|
|
||||||
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
@ -1804,7 +1815,6 @@ case $ac_sys_system/$ac_sys_release in
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
ARCH_RUN_32BIT=""
|
|
||||||
AC_SUBST(LIBTOOL_CRUFT)
|
AC_SUBST(LIBTOOL_CRUFT)
|
||||||
case $ac_sys_system/$ac_sys_release in
|
case $ac_sys_system/$ac_sys_release in
|
||||||
Darwin/@<:@01567@:>@\..*)
|
Darwin/@<:@01567@:>@\..*)
|
||||||
|
@ -1861,14 +1871,12 @@ case $ac_sys_system/$ac_sys_release in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
#ARCH_RUN_32BIT="true"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only ${MACOSX_DEFAULT_ARCH}"
|
LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only ${MACOSX_DEFAULT_ARCH}"
|
||||||
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
||||||
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
|
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
AC_MSG_CHECKING(for --enable-framework)
|
AC_MSG_CHECKING(for --enable-framework)
|
||||||
if test "$enable_framework"
|
if test "$enable_framework"
|
||||||
then
|
then
|
||||||
|
@ -1988,9 +1996,6 @@ then
|
||||||
|
|
||||||
if test ${MACOSX_DEPLOYMENT_TARGET} '>' 10.2
|
if test ${MACOSX_DEPLOYMENT_TARGET} '>' 10.2
|
||||||
then
|
then
|
||||||
if test "${enable_universalsdk}"; then
|
|
||||||
LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
|
|
||||||
fi
|
|
||||||
LDSHARED='$(CC) -bundle -undefined dynamic_lookup'
|
LDSHARED='$(CC) -bundle -undefined dynamic_lookup'
|
||||||
LDCXXSHARED='$(CXX) -bundle -undefined dynamic_lookup'
|
LDCXXSHARED='$(CXX) -bundle -undefined dynamic_lookup'
|
||||||
BLDSHARED="$LDSHARED"
|
BLDSHARED="$LDSHARED"
|
||||||
|
|
Loading…
Reference in New Issue