bpo-32726: macOS installer and framework enhancements and changes for 3.7.0 (GH-5448)

This issue covers various changes for the macOS installers provided via python.org for 3.7.0.

- Provide a provisional new installer variant for macOS 10.9 and later systems with 64-bit (x86_64) architecture only.  Apple has made it known that future versions of macOS will only fully support 64-bit executables and some other third-party software suppliers have chosen 10.9 as their oldest supported system.
 
- Support **Tcl/Tk 8.6** with the 10.9 installer variant.
 
- Upgrade **OpenSSL** to 1.1.0g and **SQLite** to 3.22.0.
 
- The compiler name used for the interpreter build and for modules built with **Distutils / pip** is now _gcc_ rather than _gcc-4.2_. And extension module builds will no longer try to force use of an old SDK if present.
This commit is contained in:
Ned Deily 2018-01-30 07:42:14 -05:00 committed by GitHub
parent b8d90328ad
commit 8c9bb72e8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 129 additions and 174 deletions

View File

@ -1,30 +1,39 @@
#!/usr/bin/env python #!/usr/bin/env python
""" """
This script is used to build "official" universal installers on Mac OS X. This script is used to build "official" universal installers on macOS.
It requires at least Mac OS X 10.5, Xcode 3, and the 10.4u SDK for
32-bit builds. 64-bit or four-way universal builds require at least NEW for 3.7.0:
OS X 10.5 and the 10.5 SDK. - support Intel 64-bit-only () and 32-bit-only installer builds
- use external Tcl/Tk 8.6 for 10.9+ builds
- deprecate use of explicit SDK (--sdk-path=) since all but the oldest
versions of Xcode support implicit setting of an SDK via environment
variables (SDKROOT and friends, see the xcrun man page for more info).
The SDK stuff was primarily needed for building universal installers
for 10.4; so as of 3.7.0, building installers for 10.4 is no longer
supported with build-installer.
- use generic "gcc" as compiler (CC env var) rather than "gcc-4.2"
TODO:
- support SDKROOT and DEVELOPER_DIR xcrun env variables
- test with 10.5 and 10.4 and determine support status
Please ensure that this script keeps working with Python 2.5, to avoid Please ensure that this script keeps working with Python 2.5, to avoid
bootstrap issues (/usr/bin/python is Python 2.5 on OSX 10.5). Sphinx, bootstrap issues (/usr/bin/python is Python 2.5 on OSX 10.5). Doc builds
which is used to build the documentation, currently requires at least use current versions of Sphinx and require a reasonably current python3.
Python 2.4. However, as of Python 3.4.1, Doc builds require an external Sphinx and dependencies are installed into a venv using the python3's pip
sphinx-build and the current versions of Sphinx now require at least so will fetch them from PyPI if necessary. Since python3 is now used for
Python 2.6. Sphinx, build-installer.py should also be converted to use python3!
In addition to what is supplied with OS X 10.5+ and Xcode 3+, the script build-installer currently requires an installed third-party version of
requires an installed third-party version of Tcl/Tk 8.4 (for OS X 10.4 and 10.5 deployment targets), Tcl/TK 8.5
Tcl/Tk 8.4 (for OS X 10.4 and 10.5 deployment targets) or Tcl/TK 8.5 (for 10.6 or later), or Tcl/TK 8.6 (for 10.9 or later)
(for 10.6 or later) installed in /Library/Frameworks. When installed, installed in /Library/Frameworks. When installed,
the Python built by this script will attempt to dynamically link first to the Python built by this script will attempt to dynamically link first to
Tcl and Tk frameworks in /Library/Frameworks if available otherwise fall Tcl and Tk frameworks in /Library/Frameworks if available otherwise fall
back to the ones in /System/Library/Framework. For the build, we recommend back to the ones in /System/Library/Framework. For the build, we recommend
installing the most recent ActiveTcl 8.4 or 8.5 version. installing the most recent ActiveTcl 8.6. 8.5, or 8.4 version, depending
on the deployment target. The actual version linked to depends on the
32-bit-only installer builds are still possible on OS X 10.4 with Xcode 2.5 path of /Library/Frameworks/{Tcl,Tk}.framework/Versions/Current.
and the installation of additional components, such as a newer Python
(2.5 is needed for Python parser updates) and for the documentation
build either svn (pre-3.4.1) or sphinx-build (3.4.1 and later).
Usage: see USAGE variable in the script. Usage: see USAGE variable in the script.
""" """
@ -111,32 +120,19 @@ WORKDIR = "/tmp/_py"
DEPSRC = os.path.join(WORKDIR, 'third-party') DEPSRC = os.path.join(WORKDIR, 'third-party')
DEPSRC = os.path.expanduser('~/Universal/other-sources') DEPSRC = os.path.expanduser('~/Universal/other-sources')
# Location of the preferred SDK
### There are some issues with the SDK selection below here,
### The resulting binary doesn't work on all platforms that
### it should. Always default to the 10.4u SDK until that
### issue is resolved.
###
##if int(os.uname()[2].split('.')[0]) == 8:
## # Explicitly use the 10.4u (universal) SDK when
## # building on 10.4, the system headers are not
## # useable for a universal build
## SDKPATH = "/Developer/SDKs/MacOSX10.4u.sdk"
##else:
## SDKPATH = "/"
SDKPATH = "/Developer/SDKs/MacOSX10.4u.sdk"
universal_opts_map = { '32-bit': ('i386', 'ppc',), universal_opts_map = { '32-bit': ('i386', 'ppc',),
'64-bit': ('x86_64', 'ppc64',), '64-bit': ('x86_64', 'ppc64',),
'intel': ('i386', 'x86_64'), 'intel': ('i386', 'x86_64'),
'intel-32': ('i386',),
'intel-64': ('x86_64',),
'3-way': ('ppc', 'i386', 'x86_64'), '3-way': ('ppc', 'i386', 'x86_64'),
'all': ('i386', 'ppc', 'x86_64', 'ppc64',) } 'all': ('i386', 'ppc', 'x86_64', 'ppc64',) }
default_target_map = { default_target_map = {
'64-bit': '10.5', '64-bit': '10.5',
'3-way': '10.5', '3-way': '10.5',
'intel': '10.5', 'intel': '10.5',
'intel-32': '10.4',
'intel-64': '10.5',
'all': '10.5', 'all': '10.5',
} }
@ -154,19 +150,18 @@ SRCDIR = os.path.dirname(
)))) ))))
# $MACOSX_DEPLOYMENT_TARGET -> minimum OS X level # $MACOSX_DEPLOYMENT_TARGET -> minimum OS X level
DEPTARGET = '10.3' DEPTARGET = '10.5'
def getDeptargetTuple(): def getDeptargetTuple():
return tuple([int(n) for n in DEPTARGET.split('.')[0:2]]) return tuple([int(n) for n in DEPTARGET.split('.')[0:2]])
def getTargetCompilers(): def getTargetCompilers():
target_cc_map = { target_cc_map = {
'10.3': ('gcc-4.0', 'g++-4.0'),
'10.4': ('gcc-4.0', 'g++-4.0'), '10.4': ('gcc-4.0', 'g++-4.0'),
'10.5': ('gcc-4.2', 'g++-4.2'), '10.5': ('gcc', 'g++'),
'10.6': ('gcc-4.2', 'g++-4.2'), '10.6': ('gcc', 'g++'),
} }
return target_cc_map.get(DEPTARGET, ('clang', 'clang++') ) return target_cc_map.get(DEPTARGET, ('gcc', 'gcc++') )
CC, CXX = getTargetCompilers() CC, CXX = getTargetCompilers()
@ -180,9 +175,9 @@ USAGE = textwrap.dedent("""\
-b DIR -b DIR
--build-dir=DIR: Create build here (default: %(WORKDIR)r) --build-dir=DIR: Create build here (default: %(WORKDIR)r)
--third-party=DIR: Store third-party sources here (default: %(DEPSRC)r) --third-party=DIR: Store third-party sources here (default: %(DEPSRC)r)
--sdk-path=DIR: Location of the SDK (default: %(SDKPATH)r) --sdk-path=DIR: Location of the SDK (deprecated, use SDKROOT env variable)
--src-dir=DIR: Location of the Python sources (default: %(SRCDIR)r) --src-dir=DIR: Location of the Python sources (default: %(SRCDIR)r)
--dep-target=10.n OS X deployment target (default: %(DEPTARGET)r) --dep-target=10.n macOS deployment target (default: %(DEPTARGET)r)
--universal-archs=x universal architectures (options: %(UNIVERSALOPTS)r, default: %(UNIVERSALARCHS)r) --universal-archs=x universal architectures (options: %(UNIVERSALOPTS)r, default: %(UNIVERSALARCHS)r)
""")% globals() """)% globals()
@ -213,12 +208,9 @@ def library_recipes():
result.extend([ result.extend([
dict( dict(
name="OpenSSL 1.0.2m", name="OpenSSL 1.1.0g",
url="https://www.openssl.org/source/openssl-1.0.2m.tar.gz", url="https://www.openssl.org/source/openssl-1.1.0g.tar.gz",
checksum='10e9e37f492094b9ef296f68f24a7666', checksum='ba5f1b8b835b88cadbce9b35ed9531a6',
patches=[
"openssl_sdk_makedepend.patch",
],
buildrecipe=build_universal_openssl, buildrecipe=build_universal_openssl,
configure=None, configure=None,
install=None, install=None,
@ -315,9 +307,9 @@ def library_recipes():
), ),
), ),
dict( dict(
name="SQLite 3.21.0", name="SQLite 3.22.0",
url="https://www.sqlite.org/2017/sqlite-autoconf-3210000.tar.gz", url="https://www.sqlite.org/2018/sqlite-autoconf-3220000.tar.gz",
checksum='7913de4c3126ba3c24689cb7a199ea31', checksum='96b5648d542e8afa6ab7ffb8db8ddc3d',
extra_cflags=('-Os ' extra_cflags=('-Os '
'-DSQLITE_ENABLE_FTS5 ' '-DSQLITE_ENABLE_FTS5 '
'-DSQLITE_ENABLE_FTS4 ' '-DSQLITE_ENABLE_FTS4 '
@ -343,11 +335,10 @@ def library_recipes():
url="http://bzip.org/1.0.6/bzip2-1.0.6.tar.gz", url="http://bzip.org/1.0.6/bzip2-1.0.6.tar.gz",
checksum='00b516f4704d4a7cb50a1d97e6e8e15b', checksum='00b516f4704d4a7cb50a1d97e6e8e15b',
configure=None, configure=None,
install='make install CC=%s CXX=%s, PREFIX=%s/usr/local/ CFLAGS="-arch %s -isysroot %s"'%( install='make install CC=%s CXX=%s, PREFIX=%s/usr/local/ CFLAGS="-arch %s"'%(
CC, CXX, CC, CXX,
shellQuote(os.path.join(WORKDIR, 'libraries')), shellQuote(os.path.join(WORKDIR, 'libraries')),
' -arch '.join(ARCHLIST), ' -arch '.join(ARCHLIST),
SDKPATH,
), ),
), ),
dict( dict(
@ -355,11 +346,10 @@ def library_recipes():
url="http://www.gzip.org/zlib/zlib-1.2.3.tar.gz", url="http://www.gzip.org/zlib/zlib-1.2.3.tar.gz",
checksum='debc62758716a169df9f62e6ab2bc634', checksum='debc62758716a169df9f62e6ab2bc634',
configure=None, configure=None,
install='make install CC=%s CXX=%s, prefix=%s/usr/local/ CFLAGS="-arch %s -isysroot %s"'%( install='make install CC=%s CXX=%s, prefix=%s/usr/local/ CFLAGS="-arch %s"'%(
CC, CXX, CC, CXX,
shellQuote(os.path.join(WORKDIR, 'libraries')), shellQuote(os.path.join(WORKDIR, 'libraries')),
' -arch '.join(ARCHLIST), ' -arch '.join(ARCHLIST),
SDKPATH,
), ),
), ),
dict( dict(
@ -406,8 +396,7 @@ def pkg_recipes():
source="/Library/Frameworks/Python.framework", source="/Library/Frameworks/Python.framework",
readme="""\ readme="""\
This package installs Python.framework, that is the python This package installs Python.framework, that is the python
interpreter and the standard library. This also includes Python interpreter and the standard library.
wrappers for lots of Mac OS X API's.
""", """,
postflight="scripts/postflight.framework", postflight="scripts/postflight.framework",
selected='selected', selected='selected',
@ -484,24 +473,6 @@ def pkg_recipes():
), ),
] ]
if getDeptargetTuple() < (10, 4) and not PYTHON_3:
result.append(
dict(
name="PythonSystemFixes",
long_name="Fix system Python",
readme="""\
This package updates the system python installation on
Mac OS X 10.3 to ensure that you can build new python extensions
using that copy of python after installing this version.
""",
postflight="../Tools/fixapplepython23.py",
topdir="/Library/Frameworks/Python.framework",
source="/empty-dir",
required=False,
selected=unselected_for_python3,
)
)
return result return result
def fatal(msg): def fatal(msg):
@ -566,41 +537,33 @@ def checkEnvironment():
Check that we're running on a supported system. Check that we're running on a supported system.
""" """
if sys.version_info[0:2] < (2, 4): if sys.version_info[0:2] < (2, 5):
fatal("This script must be run with Python 2.4 or later") fatal("This script must be run with Python 2.5 (or later)")
if platform.system() != 'Darwin': if platform.system() != 'Darwin':
fatal("This script should be run on a Mac OS X 10.4 (or later) system") fatal("This script should be run on a macOS 10.5 (or later) system")
if int(platform.release().split('.')[0]) < 8: if int(platform.release().split('.')[0]) < 8:
fatal("This script should be run on a Mac OS X 10.4 (or later) system") fatal("This script should be run on a macOS 10.5 (or later) system")
if not os.path.exists(SDKPATH):
fatal("Please install the latest version of Xcode and the %s SDK"%(
os.path.basename(SDKPATH[:-4])))
# Because we only support dynamic load of only one major/minor version of # Because we only support dynamic load of only one major/minor version of
# Tcl/Tk, ensure: # Tcl/Tk, ensure:
# 1. there are no user-installed frameworks of Tcl/Tk with version # 1. there is a user-installed framework (usually ActiveTcl) in (or linked
# higher than the Apple-supplied system version in # in) SDKROOT/Library/Frameworks. As of Python 3.7.0, we no longer
# SDKROOT/System/Library/Frameworks # enforce that the version of the user-installed framework also
# 2. there is a user-installed framework (usually ActiveTcl) in (or linked # exists in the system-supplied Tcl/Tk frameworks. Time to support
# in) SDKROOT/Library/Frameworks with the same version as the system # Tcl/Tk 8.6 even if Apple does not.
# version. This allows users to choose to install a newer patch level.
frameworks = {} frameworks = {}
for framework in ['Tcl', 'Tk']: for framework in ['Tcl', 'Tk']:
fwpth = 'Library/Frameworks/%s.framework/Versions/Current' % framework fwpth = 'Library/Frameworks/%s.framework/Versions/Current' % framework
sysfw = os.path.join(SDKPATH, 'System', fwpth) libfw = os.path.join('/', fwpth)
libfw = os.path.join(SDKPATH, fwpth)
usrfw = os.path.join(os.getenv('HOME'), fwpth) usrfw = os.path.join(os.getenv('HOME'), fwpth)
frameworks[framework] = os.readlink(sysfw) frameworks[framework] = os.readlink(libfw)
if not os.path.exists(libfw): if not os.path.exists(libfw):
fatal("Please install a link to a current %s %s as %s so " fatal("Please install a link to a current %s %s as %s so "
"the user can override the system framework." "the user can override the system framework."
% (framework, frameworks[framework], libfw)) % (framework, frameworks[framework], libfw))
if os.readlink(libfw) != os.readlink(sysfw):
fatal("Version of %s must match %s" % (libfw, sysfw) )
if os.path.exists(usrfw): if os.path.exists(usrfw):
fatal("Please rename %s to avoid possible dynamic load issues." fatal("Please rename %s to avoid possible dynamic load issues."
% usrfw) % usrfw)
@ -608,6 +571,10 @@ def checkEnvironment():
if frameworks['Tcl'] != frameworks['Tk']: if frameworks['Tcl'] != frameworks['Tk']:
fatal("The Tcl and Tk frameworks are not the same version.") fatal("The Tcl and Tk frameworks are not the same version.")
print(" -- Building with Tcl/Tk %s frameworks"
% frameworks['Tk'])
print("")
# add files to check after build # add files to check after build
EXPECTED_SHARED_LIBS['_tkinter.so'] = [ EXPECTED_SHARED_LIBS['_tkinter.so'] = [
"/Library/Frameworks/Tcl.framework/Versions/%s/Tcl" "/Library/Frameworks/Tcl.framework/Versions/%s/Tcl"
@ -644,7 +611,7 @@ def parseOptions(args=None):
""" """
Parse arguments and update global settings. Parse arguments and update global settings.
""" """
global WORKDIR, DEPSRC, SDKPATH, SRCDIR, DEPTARGET global WORKDIR, DEPSRC, SRCDIR, DEPTARGET
global UNIVERSALOPTS, UNIVERSALARCHS, ARCHLIST, CC, CXX global UNIVERSALOPTS, UNIVERSALARCHS, ARCHLIST, CC, CXX
global FW_VERSION_PREFIX global FW_VERSION_PREFIX
global FW_SSL_DIRECTORY global FW_SSL_DIRECTORY
@ -677,7 +644,7 @@ def parseOptions(args=None):
DEPSRC=v DEPSRC=v
elif k in ('--sdk-path',): elif k in ('--sdk-path',):
SDKPATH=v print(" WARNING: --sdk-path is no longer supported")
elif k in ('--src-dir',): elif k in ('--src-dir',):
SRCDIR=v SRCDIR=v
@ -693,7 +660,7 @@ def parseOptions(args=None):
if deptarget is None: if deptarget is None:
# Select alternate default deployment # Select alternate default deployment
# target # target
DEPTARGET = default_target_map.get(v, '10.3') DEPTARGET = default_target_map.get(v, '10.5')
else: else:
raise NotImplementedError(v) raise NotImplementedError(v)
@ -702,7 +669,6 @@ def parseOptions(args=None):
SRCDIR=os.path.abspath(SRCDIR) SRCDIR=os.path.abspath(SRCDIR)
WORKDIR=os.path.abspath(WORKDIR) WORKDIR=os.path.abspath(WORKDIR)
SDKPATH=os.path.abspath(SDKPATH)
DEPSRC=os.path.abspath(DEPSRC) DEPSRC=os.path.abspath(DEPSRC)
CC, CXX = getTargetCompilers() CC, CXX = getTargetCompilers()
@ -713,7 +679,6 @@ def parseOptions(args=None):
print("-- Settings:") print("-- Settings:")
print(" * Source directory: %s" % SRCDIR) print(" * Source directory: %s" % SRCDIR)
print(" * Build directory: %s" % WORKDIR) print(" * Build directory: %s" % WORKDIR)
print(" * SDK location: %s" % SDKPATH)
print(" * Third-party source: %s" % DEPSRC) print(" * Third-party source: %s" % DEPSRC)
print(" * Deployment target: %s" % DEPTARGET) print(" * Deployment target: %s" % DEPTARGET)
print(" * Universal archs: %s" % str(ARCHLIST)) print(" * Universal archs: %s" % str(ARCHLIST))
@ -837,17 +802,13 @@ def build_universal_openssl(basedir, archList):
"ppc64": ["darwin64-ppc-cc"], "ppc64": ["darwin64-ppc-cc"],
} }
configure_opts = [ configure_opts = [
"no-krb5",
"no-idea", "no-idea",
"no-mdc2", "no-mdc2",
"no-rc5", "no-rc5",
"no-zlib", "no-zlib",
"enable-tlsext",
"no-ssl2",
"no-ssl3", "no-ssl3",
# "enable-unit-test", # "enable-unit-test",
"shared", "shared",
"--install_prefix=%s"%shellQuote(archbase),
"--prefix=%s"%os.path.join("/", *FW_VERSION_PREFIX), "--prefix=%s"%os.path.join("/", *FW_VERSION_PREFIX),
"--openssldir=%s"%os.path.join("/", *FW_SSL_DIRECTORY), "--openssldir=%s"%os.path.join("/", *FW_SSL_DIRECTORY),
] ]
@ -855,9 +816,9 @@ def build_universal_openssl(basedir, archList):
configure_opts.append("no-asm") configure_opts.append("no-asm")
runCommand(" ".join(["perl", "Configure"] runCommand(" ".join(["perl", "Configure"]
+ arch_opts[arch] + configure_opts)) + arch_opts[arch] + configure_opts))
runCommand("make depend OSX_SDK=%s" % SDKPATH) runCommand("make depend")
runCommand("make all OSX_SDK=%s" % SDKPATH) runCommand("make all")
runCommand("make install_sw OSX_SDK=%s" % SDKPATH) runCommand("make install_sw DESTDIR=%s"%shellQuote(archbase))
# runCommand("make test") # runCommand("make test")
return return
@ -1016,27 +977,24 @@ def buildRecipe(recipe, basedir, archList):
if recipe.get('useLDFlags', 1): if recipe.get('useLDFlags', 1):
configure_args.extend([ configure_args.extend([
"CFLAGS=%s-mmacosx-version-min=%s -arch %s -isysroot %s " "CFLAGS=%s-mmacosx-version-min=%s -arch %s "
"-I%s/usr/local/include"%( "-I%s/usr/local/include"%(
recipe.get('extra_cflags', ''), recipe.get('extra_cflags', ''),
DEPTARGET, DEPTARGET,
' -arch '.join(archList), ' -arch '.join(archList),
shellQuote(SDKPATH)[1:-1],
shellQuote(basedir)[1:-1],), shellQuote(basedir)[1:-1],),
"LDFLAGS=-mmacosx-version-min=%s -isysroot %s -L%s/usr/local/lib -arch %s"%( "LDFLAGS=-mmacosx-version-min=%s -L%s/usr/local/lib -arch %s"%(
DEPTARGET, DEPTARGET,
shellQuote(SDKPATH)[1:-1],
shellQuote(basedir)[1:-1], shellQuote(basedir)[1:-1],
' -arch '.join(archList)), ' -arch '.join(archList)),
]) ])
else: else:
configure_args.extend([ configure_args.extend([
"CFLAGS=%s-mmacosx-version-min=%s -arch %s -isysroot %s " "CFLAGS=%s-mmacosx-version-min=%s -arch %s "
"-I%s/usr/local/include"%( "-I%s/usr/local/include"%(
recipe.get('extra_cflags', ''), recipe.get('extra_cflags', ''),
DEPTARGET, DEPTARGET,
' -arch '.join(archList), ' -arch '.join(archList),
shellQuote(SDKPATH)[1:-1],
shellQuote(basedir)[1:-1],), shellQuote(basedir)[1:-1],),
]) ])
@ -1114,10 +1072,6 @@ def buildPython():
curdir = os.getcwd() curdir = os.getcwd()
os.chdir(buildDir) os.chdir(buildDir)
# Not sure if this is still needed, the original build script
# claims that parts of the install assume python.exe exists.
os.symlink('python', os.path.join(buildDir, 'python.exe'))
# Extract the version from the configure file, needed to calculate # Extract the version from the configure file, needed to calculate
# several paths. # several paths.
version = getVersion() version = getVersion()
@ -1128,13 +1082,13 @@ def buildPython():
os.environ['DYLD_LIBRARY_PATH'] = os.path.join(WORKDIR, os.environ['DYLD_LIBRARY_PATH'] = os.path.join(WORKDIR,
'libraries', 'usr', 'local', 'lib') 'libraries', 'usr', 'local', 'lib')
print("Running configure...") print("Running configure...")
runCommand("%s -C --enable-framework --enable-universalsdk=%s " runCommand("%s -C --enable-framework --enable-universalsdk=/ "
"--with-universal-archs=%s " "--with-universal-archs=%s "
"%s " "%s "
"%s " "%s "
"LDFLAGS='-g -L%s/libraries/usr/local/lib' " "LDFLAGS='-g -L%s/libraries/usr/local/lib' "
"CFLAGS='-g -I%s/libraries/usr/local/include' 2>&1"%( "CFLAGS='-g -I%s/libraries/usr/local/include' 2>&1"%(
shellQuote(os.path.join(SRCDIR, 'configure')), shellQuote(SDKPATH), shellQuote(os.path.join(SRCDIR, 'configure')),
UNIVERSALARCHS, UNIVERSALARCHS,
(' ', '--with-computed-gotos ')[PYTHON_3], (' ', '--with-computed-gotos ')[PYTHON_3],
(' ', '--without-ensurepip ')[PYTHON_3], (' ', '--without-ensurepip ')[PYTHON_3],

View File

@ -1,40 +0,0 @@
# HG changeset patch
#
# using openssl 1.0.2k
#
# - support building with an OS X SDK
diff Configure
diff --git a/Configure b/Configure
--- a/Configure
+++ b/Configure
@@ -642,12 +642,12 @@
##### MacOS X (a.k.a. Rhapsody or Darwin) setup
"rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown):MACOSX_RHAPSODY::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}::",
-"darwin-ppc-cc","cc:-arch ppc -O3 -DB_ENDIAN -Wa,-force_cpusubtype_ALL::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
-"darwin64-ppc-cc","cc:-arch ppc64 -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc64_asm}:osx64:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
-"darwin-i386-cc","cc:-arch i386 -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:".eval{my $asm=$x86_asm;$asm=~s/cast\-586\.o//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
-"debug-darwin-i386-cc","cc:-arch i386 -g3 -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
-"darwin64-x86_64-cc","cc:-arch x86_64 -O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
-"debug-darwin64-x86_64-cc","cc:-arch x86_64 -ggdb -g2 -O0 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+"darwin-ppc-cc","cc:-arch ppc -isysroot \$(OSX_SDK) -O3 -DB_ENDIAN -Wa,-force_cpusubtype_ALL::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+"darwin64-ppc-cc","cc:-arch ppc64 -isysroot \$(OSX_SDK) -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc64_asm}:osx64:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+"darwin-i386-cc","cc:-arch i386 -isysroot \$(OSX_SDK) -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:".eval{my $asm=$x86_asm;$asm=~s/cast\-586\.o//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+"debug-darwin-i386-cc","cc:-arch i386 -isysroot \$(OSX_SDK) -g3 -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+"darwin64-x86_64-cc","cc:-arch x86_64 -isysroot \$(OSX_SDK) -O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+"debug-darwin64-x86_64-cc","cc:-arch x86_64 -isysroot \$(OSX_SDK) -ggdb -g2 -O0 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
"debug-darwin-ppc-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DB_ENDIAN -g -Wall -O::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
# iPhoneOS/iOS
"iphoneos-cross","llvm-gcc:-O3 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fomit-frame-pointer -fno-common::-D_REENTRANT:iOS:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
@@ -1728,8 +1728,7 @@
s/^AR=\s*ar/AR= $ar/;
s/^RANLIB=.*/RANLIB= $ranlib/;
s/^RC=.*/RC= $windres/;
- s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $cc eq "gcc";
- s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $ecc eq "gcc" || $ecc eq "clang";
+ s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/;
}
s/^CFLAG=.*$/CFLAG= $cflags/;
s/^DEPFLAG=.*$/DEPFLAG=$depflags/;

View File

@ -1,4 +1,4 @@
{\rtf1\ansi\ansicpg1252\cocoartf1504\cocoasubrtf830 {\rtf1\ansi\ansicpg1252\cocoartf1561\cocoasubrtf200
{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fmodern\fcharset0 CourierNewPSMT;} {\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fmodern\fcharset0 CourierNewPSMT;}
{\colortbl;\red255\green255\blue255;} {\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;} {\*\expandedcolortbl;;}
@ -10,21 +10,37 @@
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\partightenfactor0 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\partightenfactor0
\b \cf0 NOTE: \b \cf0 NOTE:
\b0 This is an early developer preview of the next feature release of Python 3. Many features are yet to be added and existing features may change substantially or be deleted prior to the feature code freeze.\ \b0 This is a beta preview of the next feature release of Python 3. Existing features may change or be deleted prior to the release code freeze.\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\cf0 \ \cf0 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\b \cf0 \ul \ulc0 Certificate verification and OpenSSL\ \b \cf0 \ul \ulc0 Which installer variant should I use? [CHANGED in 3.7.0b1]
\b0 \ulnone \
\
For Python.3.7, python.org currently provides two installer variants for download: one that installs a
\i 64-bit/32-bit Intel
\i0 Python capable of running on
\i macOS 10.6 (Snow Leopard)
\i0 or later; and one that installs a
\i 64-bit-only
\i0 Python capable of running on
\i macOS 10.9 (Mavericks)
\i0 or later. This ReadMe was installed with the
\i $MACOSX_DEPLOYMENT_TARGET
\i0 variant. Use the 10.6 variant if you are running on macOS 10.6 through 10.8 or if you want to produce standalone applications that can run on systems from 10.6. If you are running on macOS 10.9 or later and if you have no need for compatibility with older systems, use the 10.9 variant. The Pythons installed by these installers are built with private copies of some third-party libraries not included with or newer than those in macOS itself. The list of these libraries varies by installer variant and is included at the end of the License.rtf file.
\b \ul \
\
Certificate verification and OpenSSL \{UPDATED in 3.7.0b1]\
\b0 \ulnone \ \b0 \ulnone \
This variant of Python 3.7 includes its own private copy of OpenSSL 1.0.2. The deprecated Apple-supplied OpenSSL libraries are no longer used. This means that the trust certificates in system and user keychains managed by the This variant of Python 3.7 includes its own private copy of OpenSSL 1.1.0. The deprecated Apple-supplied OpenSSL libraries are no longer used. This means that the trust certificates in system and user keychains managed by the
\i Keychain Access \i Keychain Access
\i0 application and the \i0 application and the
\i security \i security
\i0 command line utility are no longer used as defaults by the Python \i0 command line utility are no longer used as defaults by the Python
\f1 ssl \f1 ssl
\f0 module. For this preview release, a sample command script is included in \f0 module. For this beta release, a sample command script is included in
\f1 /Applications/Python 3.7 \f1 /Applications/Python 3.7
\f0 to install a curated bundle of default root certificates from the third-party \f0 to install a curated bundle of default root certificates from the third-party
\f1 certifi \f1 certifi
@ -37,14 +53,14 @@ The bundled
\f0 included with this installer has its own default certificate store for verifying download connections.\ \f0 included with this installer has its own default certificate store for verifying download connections.\
\ \
\b \ul Update your version of Tcl/Tk to use IDLE or other Tk applications \b \ul Update your version of Tcl/Tk to use IDLE or other Tk applications [CHANGED in 3.7.0b1]
\b0 \ulnone \ \b0 \ulnone \
\ \
To use IDLE or other programs that use the Tkinter graphical user interface toolkit, you need to install a newer third-party version of the To use IDLE or other programs that use the Tkinter graphical user interface toolkit, you need to install a newer third-party version of the
\i Tcl/Tk \i Tcl/Tk
\i0 frameworks. Visit {\field{\*\fldinst{HYPERLINK "https://www.python.org/download/mac/tcltk/"}}{\fldrslt https://www.python.org/download/mac/tcltk/}} for current information about supported and recommended versions of \i0 frameworks. Visit {\field{\*\fldinst{HYPERLINK "https://www.python.org/download/mac/tcltk/"}}{\fldrslt https://www.python.org/download/mac/tcltk/}} for current information about supported and recommended versions of
\i Tcl/Tk \i Tcl/Tk
\i0 for this version of Python and of Mac OS X. For this developer preview, the installer is still linked with Tcl/Tk 8.5.\ \i0 for this version of Python and of Mac OS X. For 3.7.0b1, the 10.9 installer variant is linked with Tcl/Tk 8.6 which you must install separately. The 10.6 installer links /with Tcl/Tk 8.5 which you should also download and install.\
\b \ul \ \b \ul \
Other changes\ Other changes\

View File

@ -1,4 +1,4 @@
{\rtf1\ansi\ansicpg1252\cocoartf1504\cocoasubrtf830 {\rtf1\ansi\ansicpg1252\cocoartf1561\cocoasubrtf200
\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} \cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;} {\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;} {\*\expandedcolortbl;;}
@ -19,7 +19,11 @@
\ \
\b NOTE: \b NOTE:
\b0 This is an early developer preview of the next feature release of Python 3. Many features are yet to be added and existing features may change substantially or be deleted prior to the feature code freeze.\ \b0 This is an beta preview of the next feature release of Python 3. New features may change substantially or be deleted prior to the final code freeze.\
\
\b NEW in 3.7.0b1:
\b0 two installer variants (10.9+ 64-bit-only, 10.6+ 64-/32-bit), Tcl/Tk 8.6 support in the 10.9+ variant, OpenSSL 1.1.0g, and more!\
\ \
\b IMPORTANT: \b IMPORTANT:

View File

@ -0,0 +1,4 @@
Provide an additional, more modern macOS installer variant that supports
macOS 10.9+ systems in 64-bit mode only. Upgrade the supplied third-party
libraries to OpenSSL 1.1.0g and to SQLite 3.22.0. The 10.9+ installer now
links with Tcl/Tk 8.6.

15
configure vendored
View File

@ -1489,7 +1489,8 @@ 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", "intel-32", or "all") "64-bit", "3-way", "intel", "intel-32", "intel-64",
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
@ -7224,6 +7225,11 @@ $as_echo "$CC" >&6; }
LIPO_32BIT_FLAGS="" LIPO_32BIT_FLAGS=""
ARCH_RUN_32BIT="" ARCH_RUN_32BIT=""
;; ;;
intel-64)
UNIVERSAL_ARCH_FLAGS="-arch x86_64"
LIPO_32BIT_FLAGS=""
ARCH_RUN_32BIT="true"
;;
3-way) 3-way)
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64" UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64"
LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386" LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
@ -7234,11 +7240,14 @@ $as_echo "$CC" >&6; }
;; ;;
esac esac
CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}"
LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
if test "${UNIVERSALSDK}" != "/" if test "${UNIVERSALSDK}" != "/"
then then
CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}"
LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
CPPFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}" CPPFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}"
else
CFLAGS="${UNIVERSAL_ARCH_FLAGS} ${CFLAGS}"
LDFLAGS="${UNIVERSAL_ARCH_FLAGS} ${LDFLAGS}"
fi fi
fi fi

View File

@ -212,7 +212,7 @@ 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", "intel-32", or "all")]), AS_HELP_STRING([--with-universal-archs=ARCH], [select architectures for universal build ("32-bit", "64-bit", "3-way", "intel", "intel-32", "intel-64", or "all")]),
[ [
UNIVERSAL_ARCHS="$withval" UNIVERSAL_ARCHS="$withval"
], ],
@ -1768,6 +1768,11 @@ yes)
LIPO_32BIT_FLAGS="" LIPO_32BIT_FLAGS=""
ARCH_RUN_32BIT="" ARCH_RUN_32BIT=""
;; ;;
intel-64)
UNIVERSAL_ARCH_FLAGS="-arch x86_64"
LIPO_32BIT_FLAGS=""
ARCH_RUN_32BIT="true"
;;
3-way) 3-way)
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64" UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64"
LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386" LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
@ -1778,11 +1783,14 @@ yes)
;; ;;
esac esac
CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}"
LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
if test "${UNIVERSALSDK}" != "/" if test "${UNIVERSALSDK}" != "/"
then then
CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}"
LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
CPPFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}" CPPFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}"
else
CFLAGS="${UNIVERSAL_ARCH_FLAGS} ${CFLAGS}"
LDFLAGS="${UNIVERSAL_ARCH_FLAGS} ${LDFLAGS}"
fi fi
fi fi