forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bpo-36721: Add --embed option to python-config (pythonGH-13500)
To embed Python into an application, a new --embed option must be passed to "python3-config --libs --embed" to get "-lpython3.8" (link the application to libpython). To support both 3.8 and older, try "python3-config --libs --embed" first and fallback to "python3-config --libs" (without --embed) if the previous command fails. Add a pkg-config "python-3.8-embed" module to embed Python into an application: "pkg-config python-3.8-embed --libs" includes "-lpython3.8". To support both 3.8 and older, try "pkg-config python-X.Y-embed --libs" first and fallback to "pkg-config python-X.Y --libs" (without --embed) if the previous command fails (replace "X.Y" with the Python version). On the other hand, "pkg-config python3.8 --libs" no longer contains "-lpython3.8". C extensions must not be linked to libpython (except on Android, case handled by the script); this change is backward incompatible on purpose. "make install" now also installs "python-3.8-embed.pc".
- Loading branch information
Showing
10 changed files
with
78 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
Misc/NEWS.d/next/Build/2019-05-22-16-19-18.bpo-36721.9aRwfZ.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
To embed Python into an application, a new ``--embed`` option must be passed to | ||
``python3-config --libs --embed`` to get ``-lpython3.8`` (link the application | ||
to libpython). To support both 3.8 and older, try ``python3-config --libs | ||
--embed`` first and fallback to ``python3-config --libs`` (without ``--embed``) | ||
if the previous command fails. | ||
|
||
Add a pkg-config ``python-3.8-embed`` module to embed Python into an | ||
application: ``pkg-config python-3.8-embed --libs`` includes ``-lpython3.8``. | ||
To support both 3.8 and older, try ``pkg-config python-X.Y-embed --libs`` first | ||
and fallback to ``pkg-config python-X.Y --libs`` (without ``--embed``) if the | ||
previous command fails (replace ``X.Y`` with the Python version). | ||
|
||
On the other hand, ``pkg-config python3.8 --libs`` no longer contains | ||
``-lpython3.8``. C extensions must not be linked to libpython (except on | ||
Android, case handled by the script); this change is backward incompatible on | ||
purpose. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# See: man pkg-config | ||
prefix=@prefix@ | ||
exec_prefix=@exec_prefix@ | ||
libdir=@libdir@ | ||
includedir=@includedir@ | ||
|
||
Name: Python | ||
Description: Embed Python into an application | ||
Requires: | ||
Version: @VERSION@ | ||
Libs.private: @LIBS@ | ||
Libs: -L${libdir} -lpython@VERSION@@ABIFLAGS@ | ||
Cflags: -I${includedir}/python@VERSION@@ABIFLAGS@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters