Lines Matching +full:build +full:- +full:macos
2 Python on macOS README
6 Jack Jansen (2004-07),
7 Ronald Oussoren (2010-04),
8 Ned Deily (2012-06)
10 This document provides a quick overview of some macOS specific features in
13 macOS specific arguments to configure
16 * ``--enable-framework[=DIR]``
18 If this argument is specified the build will create a Python.framework rather
20 _`Building and using a framework-based Python on macOS` for more
27 $ ./configure --enable-framework=/Users/ronald/Library/Frameworks
32 command-line tools in ``/Users/ronald/bin``.
34 * ``--with-framework-name=NAME``
37 is only valid when ``--enable-framework`` is specified.
39 * ``--enable-universalsdk[=PATH]``
41 Create a universal binary build of Python. This can be used with both
44 The optional argument specifies which macOS SDK should be used to perform the
45 build. In most cases on current systems, you do not need to specify PATH or
47 Line Tools developer directory will be used. See the macOS ``xcrun`` man page
48 for more information. Current versions of macOS and Xcode no longer install
51 The Apple-supplied build tools handle this transparently and current
53 and since macOS 10.14, no longer possible to force the installation of system
54 headers with ``xcode-select``.
56 * ``--with-universal-archs=VALUE``
59 only valid when ``--enable-universalsdk`` is specified. The default is
60 ``32-bit`` if building with a SDK that supports PPC, otherwise defaults
61 to ``intel``. Note that ``intel`` means a universal build of both 32-bit
62 and 64-bit binaries and that may not be what you want; for example,
63 as of macOS 10.15 Catalina, 32-bit execution is no longer supported by
65 values for ``--with-universal-archs``:
67 ``--enable-universalsdk --with-universal-archs=intel-64``
72 Building and using a universal binary of Python on macOS
76 -----------------------------
78 A universal binary build of Python contains object code for more than one
79 CPU architecture. A universal macOS executable file or library combines the
80 architecture-specific code into one file and can therefore run at native
82 macOS 10.4 to add support for Intel-based Macs to the existing PowerPC (PPC)
83 machines. In macOS 10.5 support was extended to 64-bit Intel and 64-bit PPC
84 architectures. It is possible to build Python with various combinations
85 of architectures depending on the build tools and macOS version in use.
86 Note that PPC support was removed in macOS 10.7 and 32-bit Intel support
87 was removed in macOS 10.15. So currently as of macOS 10.15, macOS only
88 supports one execution architecture, 64-bit Intel (``x86_64``).
90 2. How do I build a universal binary
91 ------------------------------------
93 You can enable universal binaries by specifying the "--enable-universalsdk"
96 $ ./configure --enable-universalsdk
100 This flag can be used with a framework build of python, but also with a classic
101 unix build. Universal builds were first supported with macOS 10.4 with Xcode 2.1
102 and the 10.4u SDK. Starting with Xcode 3 and macOS 10.5, more configurations are
106 Apple-supplied compilers and other build tools included in Apple's Xcode
108 component appropriate for the macOS release you are running on. See the
115 It is possible to build a number of flavors of the universal binary build,
116 the default is a 32-bit only binary (i386 and ppc) in build environments that
118 Intel-32/-64-bit binary (i386 and X86_64) in build environments that do not
120 using the configure option ``--with-universal-archs=VALUE``. The following
127 * ``intel-32``: ``i386``
129 * ``intel-64``: ``x86_64``
131 * ``32-bit``: ``ppc``, ``i386``
133 * ``3-way``: ``i386``, ``x86_64``, ``ppc``
135 * ``64-bit``: ``ppc64``, ``x86_64``
139 To build a universal binary that includes a 64-bit architecture, you must build
140 on a system running macOS 10.5 or later. The ``all`` and ``64-bit`` flavors can
142 macOS 10.5. Although legacy ``ppc`` support was included with Xcode 3 on macOS
143 10.6, it was removed in Xcode 4, versions of which were released on macOS 10.6
144 and which is the standard for macOS 10.7. To summarize, the
145 following combinations of SDKs and universal-archs flavors are available:
147 * 10.4u SDK with Xcode 2 supports ``32-bit`` only
151 * 10.6 SDK with Xcode 3.2.x supports ``intel``, ``intel-32``,
152 ``intel-64``, ``3-way``, and ``32-bit``
154 * 10.6 SDK with Xcode 4 supports ``intel``, ``intel-32``, and ``intel-64``
156 * 10.7 through 10.14 SDKs support ``intel``, ``intel-32``, and ``intel-64``
158 * 10.15 and later SDKs support ``intel-64`` only
162 The makefile for a framework build will also install ``python3.x-32``
163 binaries when the universal architecture includes at least one 32-bit
164 architecture (that is, for all flavors but ``64-bit`` and ``intel-64``).
165 It will also install ``python3.x-intel64`` binaries in the ``universal2``
174 $ arch -i386 python
176 Or to explicitly run in 32-bit mode, regardless of the machine hardware::
178 $ arch -i386 -ppc python
183 subprocesses also run in 32-bit-mode if the main interpreter does, use
184 a ``python3.x-32`` binary and use the value of ``sys.executable`` as the
187 Likewise, use ``python3.x-intel64`` to force execution in ``x86_64`` mode
190 Building and using a framework-based Python on macOS
195 --------------------------------------------------------------------------
198 exception of X11/XDarwin-based GUI toolkits all GUI programs need to be run
199 from a macOS application bundle (".app").
204 A second reason for using frameworks is that they put Python-related items in
213 ------------------------------------------------------------------
222 ----------------------------
224 Yes, probably. If you want Tkinter support you need to get the macOS AquaTk
225 distribution, this is installed by default on macOS 10.4 or later. Be
226 aware, though, that the Cocoa-based AquaTk's supplied starting with macOS
228 installing a newer version before building on macOS 10.6 or later, such as
236 4. How do I build a framework Python?
237 -------------------------------------
239 This directory contains a Makefile that will create a couple of python-related
240 applications (full-blown macOS .app applications, that is) in
249 1. ./configure --enable-framework
261 by configuring with ``--enable-framework=$HOME/Library/Frameworks``.
263 at ``$HOME/Applications/Python-<VERSION>`` and ``$HOME/bin``.
266 frameworkinstall is composed of a couple of sub-targets that install the
281 double-click a .py, .pyc or .pyw file. For the first two it creates a Terminal
282 window and runs the scripts with the normal command-line Python. For the
284 GUI-things. Keep the ``Option`` key depressed while dragging or double-clicking
290 ``pythonwx.x`` which in early releases of Python on macOS was required to run
298 ``build-installer.py`` that does all the work. This will download and build
299 a number of 3rd-party libraries, configures and builds a framework Python,
306 The script will build a universal binary so you'll therefore have to run this
307 script on macOS 10.4 or later and with Xcode 2.1 or later installed.
308 However, the Python build process itself has several build dependencies not
309 available out of the box with macOS 10.4 so you may have to install
312 versions of Xcode to build installers that are compatible with older systems
316 dependencies. It is safest to build the distribution on a system running the
317 minimum macOS version supported.
320 use your normal build directory nor does it install into /.
324 command-line arguments, run it with --help for more information.
337 configure: WARNING: ## --------------------------------------- ##
339 configure: WARNING: ## --------------------------------------- ##
341 This almost always means you are trying to build a universal binary for
343 architectures. Temporarily move ``/usr/local`` aside to finish the build.
351 macOS does not provide a central uninstaller.
356 version-specific subdirectory: ``/Library/Frameworks/Python.framework/Versions/X.Y``.
369 to macOS 10.9. This is done through weak linking of symbols introduced in macOS
372 This requires the use of Apple's compiler toolchain on macOS 10.13 or later.
402 * https://www.python.org/downloads/macos/
404 * https://www.python.org/community/sigs/current/pythonmac-sig/