Commit ee8e4b61 authored by Ned Deily's avatar Ned Deily Committed by GitHub

[2.7] Backport macOS universal build and installer fixes from 3.6. (GH-6469)

These include:

- bpo-32726: 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.0.2n and SQLite 3.22.0. The 10.9+
  installer now supplies its own private copy of Tcl/Tk 8.6.8.

- bpo-24414: Default macOS deployment target is now set by ``configure`` to
  the build system's OS version (as is done by Python 3), not ``10.4``;
  override with, for example, ``./configure MACOSX_DEPLOYMENT_TARGET=10.4``.

- bpo-19019: All 2.7 macOS installer variants now supply their own version
  of ``OpenSSL 1.0.2``; the Apple-supplied SSL libraries and root
  certificates are not longer used.  The ``Installer Certificate`` command
  in ``/Applications/Python 2.7`` may be used to download and install a
  default set of root certificates from the third-party ``certifi`` package.

- bpo-11485: python.org macOS Pythons no longer supply a default SDK value
  (e.g. ``-isysroot /``) or specific compiler version default (e.g.
  ``gcc-4.2``) when building extension modules.  Use ``CC``, ``SDKROOT``,
  and ``DEVELOPER_DIR`` environment variables to override compilers or to
  use an SDK.  See Apple's ``xcrun`` man page for more info.

- prepare for pending Apple removal of 32-bit support in future macOS release
parent a61f5da5
Building a Python Mac OS X distribution Building a Python Mac OS X distribution
======================================= =======================================
The ``build-install.py`` script creates Python distributions, including WARNING
-------
The instructions in this README are incomplete and not up-to-date.
In particular, they do not explain how to create a modern flat installer
package from the now obsolete bundle-format installer package produced
by ``build-installer.py``.
The ``build-installer.py`` script creates Python distributions, including
certain third-party libraries as necessary. It builds a complete certain third-party libraries as necessary. It builds a complete
framework-based Python out-of-tree, installs it in a funny place with framework-based Python out-of-tree, installs it in a funny place with
$DESTROOT, massages that installation to remove .pyc files and such, creates $DESTROOT, massages that installation to remove .pyc files and such, creates
......
This diff is collapsed.
Issue #19373: Patch to Tk 8.5.15 to correct refresh problem on OS x 10.9.
From upstream checkin https://core.tcl.tk/tk/info/5a5abf71f9
--- tk8.5.15/macosx/tkMacOSXDraw.c 2013-09-16 09:41:21.000000000 -0700
+++ Tk_Source_Code-5a5abf71f9fdb0da/macosx/tkMacOSXDraw.c 2013-10-27 13:27:00.000000000 -0700
@@ -1688,6 +1688,7 @@
{
if (dcPtr->context) {
CGContextSynchronize(dcPtr->context);
+ [[dcPtr->view window] setViewsNeedDisplay:YES];
[[dcPtr->view window] enableFlushWindow];
if (dcPtr->focusLocked) {
[dcPtr->view unlockFocus];
# 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/;
{\rtf1\ansi\ansicpg1252\cocoartf1561\cocoasubrtf200
{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 LucidaGrande-Bold;\f2\fnil\fcharset0 LucidaGrande;
\f3\fnil\fcharset0 Monaco;}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}
\margl1440\margr1440\vieww10540\viewh8400\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\f0\fs28 \cf0 Congratulations!
\fs24
\f1\b\fs28 Python $FULL_VERSION for macOS $MACOSX_DEPLOYMENT_TARGET
\f2\b0 was successfully installed.
\fs24 \
\
One more thing: to verify the identity of secure network connections, this Python needs a set of SSL root certificates. You can download and install a current curated set from {\field{\*\fldinst{HYPERLINK "https://pypi.org/project/certifi/"}}{\fldrslt the Certifi project}} by double-clicking on the
\f3 Install Certificates
\f2 icon in {\field{\*\fldinst{HYPERLINK "file://localhost/Applications/Python%20$VERSION/"}}{\fldrslt the Finder window}}. See {\field{\*\fldinst{HYPERLINK "file://localhost/Applications/Python%20$VERSION/ReadMe.rtf"}}{\fldrslt the
\f3 ReadMe
\f2 file}} for more information.\
}
\ No newline at end of file
This diff is collapsed.
{\rtf1\ansi\ansicpg1252\cocoartf1343\cocoasubrtf160 {\rtf1\ansi\ansicpg1252\cocoartf1561\cocoasubrtf400
\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fmodern\fcharset0 CourierNewPSMT;} \cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fmodern\fcharset0 CourierNewPSMT;}
{\colortbl;\red255\green255\blue255;} {\colortbl;\red255\green255\blue255;}
\paperw11905\paperh16837\margl1440\margr1440\vieww11180\viewh10860\viewkind0 {\*\expandedcolortbl;;}
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640 \paperw11905\paperh16837\margl1440\margr1440\vieww13360\viewh10920\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\f0\fs24 \cf0 This package will install \f0\fs24 \cf0 This package will install
\b Python $FULL_VERSION \b Python $FULL_VERSION
\b0 for \b0 for
\b Mac OS X $MACOSX_DEPLOYMENT_TARGET \b macOS $MACOSX_DEPLOYMENT_TARGET
\b0 .\ \b0 .\
\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\partightenfactor0
\cf0 \
\b Python for Mac OS X \b Python for macOS
\b0 consists of the Python programming language interpreter, plus a set of programs to allow easy access to it for Mac OS X users including an integrated development environment \b0 consists of the Python programming language interpreter, plus a set of programs to allow easy access to it for macOS users including an integrated development environment
\b IDLE \b IDLE
\b0 .\ \b0 .\
\ \
\b NEW for Python 2.7.9: \b NEW in 2.7.15:
\b0 This package installs a version of \b0 two installer variants (10.9+ 64-bit-only, 10.6+ 64-/32-bit), built-in Tcl/Tk 8.6 support in the 10.9+ variant (no additional third-party downloads!), updated
\f1 pip \f1 pip,
\f0 , the recommended tool for installing and managing Python packages. Type \f0 built-in OpenSSL 1.0.2 (click on
\f1 pip2.7 --help \f1 Install Certificates
\f0 for an overview. 2.7.9 also includes a number of network security enhancements that may require changes to your Python applications. See the \f0 for root certificates)\
\f1 ReadMe }
\f0 file and {\field{\*\fldinst{HYPERLINK "https://docs.python.org/2/whatsnew/2.7.html#new-features-added-to-python-2-7-maintenance-releases"}}{\fldrslt the Python documentation}} for more information.\ \ No newline at end of file
\
\b IMPORTANT:
\b0
\b IDLE
\b0 and other programs using the
\b tkinter
\b0 graphical user interface toolkit require specific versions of the
\b Tcl/Tk
\b0 platform independent windowing toolkit. Visit {\field{\*\fldinst{HYPERLINK "https://www.python.org/download/mac/tcltk/"}}{\fldrslt https://www.python.org/download/mac/tcltk/}} for current information on supported and recommended versions of Tcl/Tk for this version of Python and Mac OS X.}
\ No newline at end of file
#!/bin/sh
/Library/Frameworks/Python.framework/Versions/@PYVER@/bin/python@PYVER@ << "EOF"
# install_certifi.py
#
# sample script to install or update a set of default Root Certificates
# for the ssl module. Uses the certificates provided by the certifi package:
# https://pypi.python.org/pypi/certifi
import os
import os.path
import ssl
import stat
import subprocess
import sys
STAT_0o775 = ( stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR
| stat.S_IRGRP | stat.S_IWGRP | stat.S_IXGRP
| stat.S_IROTH | stat.S_IXOTH )
def main():
openssl_dir, openssl_cafile = os.path.split(
ssl.get_default_verify_paths().openssl_cafile)
print(" -- pip install --upgrade certifi")
subprocess.check_call([sys.executable,
"-E", "-s", "-m", "pip", "install", "--upgrade", "certifi"])
import certifi
# change working directory to the default SSL directory
os.chdir(openssl_dir)
relpath_to_certifi_cafile = os.path.relpath(certifi.where())
print(" -- removing any existing file or link")
try:
os.remove(openssl_cafile)
except OSError:
pass
print(" -- creating symlink to certifi certificate bundle")
os.symlink(relpath_to_certifi_cafile, openssl_cafile)
print(" -- setting permissions")
os.chmod(openssl_cafile, STAT_0o775)
print(" -- update complete")
if __name__ == '__main__':
main()
EOF
...@@ -12,6 +12,7 @@ SHARE_DOCDIR_TO_FWK="../../.." ...@@ -12,6 +12,7 @@ SHARE_DOCDIR_TO_FWK="../../.."
# make link in /Applications/Python m.n/ for Finder users # make link in /Applications/Python m.n/ for Finder users
if [ -d "${APPDIR}" ]; then if [ -d "${APPDIR}" ]; then
ln -fhs "${FWK_DOCDIR}/index.html" "${APPDIR}/Python Documentation.html" ln -fhs "${FWK_DOCDIR}/index.html" "${APPDIR}/Python Documentation.html"
open "${APPDIR}" || true # open the applications folder
fi fi
# make share/doc link in framework for command line users # make share/doc link in framework for command line users
......
Fix build failure with +quartz variant on OS X 10.8 and 10.9.
Even though Gestalt was deprecated in OS X 10.8, it should work fine
through OS X 10.9, and its replacement NSOperatingSystemVersion was
not introduced until OS X 10.10.
Patch from MacPorts project and reported upstream:
https://trac.macports.org/ticket/55649
--- tk8.6.8/macosx/tkMacOSXXStubs.c.orig 2017-12-06 09:25:08.000000000 -0600
+++ tk8.6.8-patched/macosx/tkMacOSXXStubs.c 2018-01-06 19:34:17.000000000 -0600
@@ -175,7 +175,7 @@
{
int major, minor, patch;
-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1080
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 101000
Gestalt(gestaltSystemVersionMajor, (SInt32*)&major);
Gestalt(gestaltSystemVersionMinor, (SInt32*)&minor);
Gestalt(gestaltSystemVersionBugFix, (SInt32*)&patch);
...@@ -11,7 +11,6 @@ LIBDEST=$(prefix)/lib/python$(VERSION) ...@@ -11,7 +11,6 @@ LIBDEST=$(prefix)/lib/python$(VERSION)
UNIVERSALSDK=@UNIVERSALSDK@ UNIVERSALSDK=@UNIVERSALSDK@
builddir= ../.. builddir= ../..
PYTHONFRAMEWORK=@PYTHONFRAMEWORK@ PYTHONFRAMEWORK=@PYTHONFRAMEWORK@
LIPO_32BIT_FLAGS=@LIPO_32BIT_FLAGS@
RUNSHARED= @RUNSHARED@ RUNSHARED= @RUNSHARED@
...@@ -71,10 +70,6 @@ IDLE.app: \ ...@@ -71,10 +70,6 @@ IDLE.app: \
--resource=$(srcdir)/../Icons/PythonCompiled.icns \ --resource=$(srcdir)/../Icons/PythonCompiled.icns \
--python=$(prefix)/Resources/Python.app/Contents/MacOS/Python \ --python=$(prefix)/Resources/Python.app/Contents/MacOS/Python \
build build
ifneq ($(LIPO_32BIT_FLAGS),)
rm "IDLE.app/Contents/MacOS/Python"
lipo $(LIPO_32BIT_FLAGS) -output "IDLE.app/Contents/MacOS/Python" "$(BUILDPYTHON)"
endif
Info.plist: $(srcdir)/Info.plist.in Info.plist: $(srcdir)/Info.plist.in
sed 's/%VERSION%/'"`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(srcdir)/Info.plist.in > Info.plist sed 's/%VERSION%/'"`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(srcdir)/Info.plist.in > Info.plist
......
...@@ -7,7 +7,7 @@ Python on Mac OS X README ...@@ -7,7 +7,7 @@ Python on Mac OS X README
Ronald Oussoren (2010-04), Ronald Oussoren (2010-04),
Ned Deily (2014-05) Ned Deily (2014-05)
:Version: 2.7.7 :Version: 2.7.15
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.
...@@ -19,7 +19,7 @@ OS X specific arguments to configure ...@@ -19,7 +19,7 @@ OS X specific arguments to configure
If this argument is specified the build will create a Python.framework rather If this argument is specified the build will create a Python.framework rather
than a traditional Unix install. See the section than a traditional Unix install. See the section
_`Building and using a framework-based Python on Mac OS X` for more _`Building and using a framework-based Python on Mac OS X` for more
information on frameworks. information on frameworks.
If the optional directory argument is specified the framework is installed If the optional directory argument is specified the framework is installed
...@@ -44,10 +44,12 @@ OS X specific arguments to configure ...@@ -44,10 +44,12 @@ OS X specific arguments to configure
regular and framework builds. regular and framework builds.
The optional argument specifies which OS X SDK should be used to perform the The optional argument specifies which OS X SDK should be used to perform the
build. This defaults to ``/Developer/SDKs/MacOSX.10.4u.sdk``. When building build. If xcodebuild is available and configured, this defaults to
on OS X 10.5 or later, you can specify ``/`` to use the installed system the Xcode default MacOS X SDK, otherwise ``/Developer/SDKs/MacOSX.10.4u.sdk``
headers rather than an SDK. As of OS X 10.9, you should install the optional if available or ``/`` if not. When building on OS X 10.5 or later, you can
system headers from the Command Line Tools component using ``xcode-select``:: specify ``/`` to use the installed system headers rather than an SDK. As of
OS X 10.9, you should install the optional system headers from the Command
Line Tools component using ``xcode-select``::
$ sudo xcode-select --install $ sudo xcode-select --install
...@@ -56,10 +58,11 @@ OS X specific arguments to configure ...@@ -56,10 +58,11 @@ OS X specific arguments to configure
* ``--with-universal-archs=VALUE`` * ``--with-universal-archs=VALUE``
Specify the kind of universal binary that should be created. This option is Specify the kind of universal binary that should be created. This option is
only valid when ``--enable-universalsdk`` is specified. only valid when ``--enable-universalsdk`` is specified. The default is
``32-bit`` if a building with a SDK that supports PPC, otherwise defaults
to ``intel``.
Building and using a universal binary of Python on Mac OS X Building and using a universal binary of Python on Mac OS X
=========================================================== ===========================================================
...@@ -91,30 +94,30 @@ unix build. Universal builds were first supported with OS X 10.4 with Xcode 2.1 ...@@ -91,30 +94,30 @@ unix build. Universal builds were first supported with OS X 10.4 with Xcode 2.1
and the 10.4u SDK. Starting with Xcode 3 and OS X 10.5, more configurations are and the 10.4u SDK. Starting with Xcode 3 and OS X 10.5, more configurations are
available. available.
The option ``--enable-universalsdk`` has an optional argument to specify an
SDK, which defaults to the 10.4u SDK. When you build on OS X 10.5 or later
you can use the system headers instead of an SDK::
$ ./configure --enable-universalsdk=/
In general, universal builds depend on specific features provided by the In general, universal builds depend on specific features provided by the
Apple-supplied compilers and other build tools included in Apple's Xcode Apple-supplied compilers and other build tools included in Apple's Xcode
development tools. You should install Xcode and the command line tools development tools. You should install Xcode and the command line tools
component appropriate for the OS X release you are running on. See the component appropriate for the OS X release you are running on. See the
Python Developer's Guide (http://docs.python.org/devguide/setup.html) Python Developer's Guide (https://devguide.python.org/setup/)
for more information. for more information.
2.1 Flavors of universal binaries 2.1 Flavors of universal binaries
................................. .................................
It is possible to build a number of flavors of the universal binary build, It is possible to build a number of flavors of the universal binary build,
the default is a 32-bit only binary (i386 and ppc). Note that starting with the default is a 32-bit only binary (i386 and ppc) in build environments that
Xcode 4, the build tools no longer support ppc. The flavor can be support ppc (10.4 with Xcode 2, 10.5 and 10.6 with Xcode 3) or an
specified using the option ``--with-universal-archs=VALUE``. The following Intel-32/-64-bit binary (i386 and X86_64) in build environments that do not
support ppc (Xcode 4 on 10.6 and later systems). The flavor can be specified
using the configure option ``--with-universal-archs=VALUE``. The following
values are available: values are available:
* ``intel``: ``i386``, ``x86_64`` * ``intel``: ``i386``, ``x86_64``
* ``intel-32``: ``i386``
* ``intel-64``: ``x86_64``
* ``32-bit``: ``ppc``, ``i386`` * ``32-bit``: ``ppc``, ``i386``
* ``3-way``: ``i386``, ``x86_64``, ``ppc`` * ``3-way``: ``i386``, ``x86_64``, ``ppc``
...@@ -178,14 +181,14 @@ Building and using a framework-based Python on Mac OS X. ...@@ -178,14 +181,14 @@ Building and using a framework-based Python on Mac OS X.
-------------------------------------------------------------------------- --------------------------------------------------------------------------
The main reason is because you want to create GUI programs in Python. With the The main reason is because you want to create GUI programs in Python. With the
exception of X11/XDarwin-based GUI toolkits all GUI programs need to be run exception of X11/XDarwin-based GUI toolkits all GUI programs need to be run
from a Mac OS X application bundle (".app"). from a Mac OS X application bundle (".app").
While it is technically possible to create a .app without using frameworks you While it is technically possible to create a .app without using frameworks you
will have to do the work yourself if you really want this. 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.4", "/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,
...@@ -222,7 +225,7 @@ If you want Cocoa you need to get PyObjC. ...@@ -222,7 +225,7 @@ If you want Cocoa you need to get PyObjC.
This directory contains a Makefile that will create a couple of python-related This directory contains a Makefile that will create a couple of python-related
applications (full-blown OS X .app applications, that is) in applications (full-blown OS X .app applications, that is) in
"/Applications/Python <VERSION>", and a hidden helper application Python.app "/Applications/Python <VERSION>", and a hidden helper application Python.app
inside the Python.framework, and unix tools "python" and "pythonw" into inside the Python.framework, and unix tools including "python" into
/usr/local/bin. In addition it has a target "installmacsubtree" that installs /usr/local/bin. In addition it has a target "installmacsubtree" that installs
the relevant portions of the Mac subtree into the Python.framework. the relevant portions of the Mac subtree into the Python.framework.
...@@ -232,11 +235,11 @@ in the sequence ...@@ -232,11 +235,11 @@ in the sequence
1. ./configure --enable-framework 1. ./configure --enable-framework
2. make 2. make
3. make install 3. make install
This sequence will put the framework in ``/Library/Framework/Python.framework``, This sequence will put the framework in ``/Library/Framework/Python.framework``,
the applications in ``/Applications/Python <VERSION>`` and the unix tools in the applications in ``/Applications/Python <VERSION>`` and the unix tools in
``/usr/local/bin``. ``/usr/local/bin``.
Installing in another place, for instance ``$HOME/Library/Frameworks`` if you Installing in another place, for instance ``$HOME/Library/Frameworks`` if you
...@@ -313,7 +316,7 @@ All of this is normally done completely isolated in /tmp/_py, so it does not ...@@ -313,7 +316,7 @@ All of this is normally done completely isolated in /tmp/_py, so it does not
use your normal build directory nor does it install into /. use your normal build directory nor does it install into /.
Because of the way the script locates the files it needs you have to run it Because of the way the script locates the files it needs you have to run it
from within the BuildScript directory. The script accepts a number of from within the BuildScript directory. The script accepts a number of
command-line arguments, run it with --help for more information. command-line arguments, run it with --help for more information.
Configure warnings Configure warnings
...@@ -363,4 +366,4 @@ Resources ...@@ -363,4 +366,4 @@ Resources
* http://www.python.org/community/sigs/current/pythonmac-sig/ * http://www.python.org/community/sigs/current/pythonmac-sig/
* http://docs.python.org/devguide/ * https://devguide.python.org/
python.org macOS Pythons no longer supply a default SDK value (e.g.
``-isysroot /``) or specific compiler version default (e.g. ``gcc-4.2``)
when building extension modules. Use ``CC``, ``SDKROOT``, and
``DEVELOPER_DIR`` environment variables to override compilers or to use an
SDK. See Apple's ``xcrun`` man page for more info.
All 2.7 macOS installer variants now supply their own version of ``OpenSSL
1.0.2``; the Apple-supplied SSL libraries and root certificates are not
longer used. The ``Installer Certificate`` command in
``/Applications/Python 2.7`` may be used to download and install a default
set of root certificates from the third-party ``certifi`` package.
Default macOS deployment target is now set by ``configure`` to the build
system's OS version (as is done by Python 3), not ``10.4``; override with,
for example, ``./configure MACOSX_DEPLOYMENT_TARGET=10.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.0.2n and SQLite 3.22.0. The 10.9+ installer now
supplies its own private copy of Tcl/Tk 8.6.8.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment