10000 Use targeted env vars for overriding compiler/linker args on macOS by erlend-aasland · Pull Request #1058 · python/devguide · GitHub
[go: up one dir, main page]

Skip to content

Use targeted env vars for overriding compiler/linker args on macOS #1058

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 25 additions & 18 deletions getting-started/setup-building.rst
Original file line number Diff line number Diff line change
Expand Up @@ -419,46 +419,53 @@ For example, with **Homebrew**, install the dependencies::

$ brew install pkg-config openssl@1.1 xz gdbm tcl-tk

8000 Then, for Python 3.10 and newer, run ``configure``::
Then, for Python 3.11 and newer, run ``configure``::

$ CFLAGS="-I$(brew --prefix gdbm)/include -I$(brew --prefix xz)/include" \
LDFLAGS="-L$(brew --prefix gdbm)/lib -I$(brew --prefix xz)/lib" \
PKG_CONFIG_PATH="$(brew --prefix tcl-tk)/lib/pkgconfig" \
$ GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
GDBM_LIBS="-L$(brew --prefix gdbm)/lib -lgdbm" \
./configure --with-pydebug \
--with-openssl="$(brew --prefix openssl@1.1)"

Or, for Python 3.7 through 3.10::

Or, for Python 3.7 through 3.9::

$ export PKG_CONFIG_PATH="$(brew --prefix tcl-tk)/lib/pkgconfig"; \
CFLAGS="-I$(brew --prefix gdbm)/include -I$(brew --prefix xz)/include" \
$ CPPFLAGS="-I$(brew --prefix gdbm)/include -I$(brew --prefix xz)/include" \
LDFLAGS="-L$(brew --prefix gdbm)/lib -L$(brew --prefix xz)/lib" \
./configure --with-pydebug \
--with-openssl="$(brew --prefix openssl@1.1)" \
--with-tcltk-libs="$(pkg-config --libs tcl tk)" \
--with-tcltk-includes="$(pkg-config --cflags tcl tk)"
--with-openssl="$(brew --prefix openssl@1.1)" \
--with-tcltk-libs="$(pkg-config --libs tcl tk)" \
--with-tcltk-includes="$(pkg-config --cflags tcl tk)"

And finally, run ``make``::

$ make -s -j2

Alternatively, with **MacPorts**::

$ sudo port install pkgconfig openssl xz gdbm
$ sudo port install pkgconfig openssl11 xz gdbm tcl tk +quartz

Then, for Python 3.11 and newer, run ``configure``::

$ GDBM_CFLAGS="-I$(dirname $(dirname $(which port)))/include" \
GDBM_LIBS="-L$(dirname $(dirname $(which port)))/lib -lgdbm" \
./configure --with-pydebug \
--with-openssl="$(dirname $(dirname $(which port)))/libexec/openssl11"

and ``configure``::
Or, for Python 3.7 through 3.10::

$ CPPFLAGS="-I/opt/local/include" \
LDFLAGS="-L/opt/local/lib" \
./configure --with-pydebug
$ CPPFLAGS="-I$(dirname $(dirname $(which port)))/include" \
LDFLAGS="-L$(dirname $(dirname $(which port)))/lib" \
./configure --with-pydebug \
--with-openssl="$(dirname $(dirname $(which port)))/libexec/openssl11" \
--with-tcltk-libs="$(pkg-config --libs tcl tk)" \
--with-tcltk-includes="$(pkg-config --cflags tcl tk)"

and ``make``::
And finally, run ``make``::

$ make -s -j2

There will sometimes be optional modules added for a new release which
won't yet be identified in the OS-level build dependencies. In those cases,
just ask for assistance on the core-mentorship list.
just ask for assistance in the *Core Development* category on :ref:`help-discourse`.

Explaining how to build optional dependencies on a Unix-based system without
root access is beyond the scope of this guide.
Expand Down
0