Commit Graph

13 Commits

Author SHA1 Message Date
Michał Górny 7d2447137e
gh-120291: Fix a bashism in python-config.sh.in (#120292)
gh-120291: Fix bashisms in python-config.sh.in

Replace the use of bash-specific `[[ ... ]]` with POSIX-compliant
`[ ... ]` to make the `python-config` shell script work with non-bash
shells again.  While at it, use `local` in a safer way, since it is
not in POSIX either (though universally supported).

Fixes #120291
2024-06-11 10:11:13 +03:00
Thomas A Caswell c4bf58a14f
gh-116745: Remove all internal usage of @LIBPYTHON@ (#116746)
Replace with MODULE_LDFLAGS.
2024-03-22 00:54:50 +01:00
Kien Dang de2a73dc46
bpo-45101: Add consistency in usage message IO between 2 versions of python-config (GH-28162)
On --help output to stdout.
On error output to stderr.
2024-02-26 22:04:44 +02:00
Batuhan Taşkaya d3cc189b17 bpo-37925: Mention --embed in python-config usage (GH-15458) 2019-08-26 23:45:36 +02:00
Victor Stinner 0a8e57248b
bpo-36721: Add --embed option to python-config (GH-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".
2019-05-23 03:30:23 +02:00
xdegaye 254b309c80 bpo-21536: On Android, C extensions are linked to libpython (GH-12989) 2019-04-29 09:27:40 +02:00
Victor Stinner 8c3ecc6bac
bpo-21536: C extensions are no longer linked to libpython (GH-12946)
On Unix, C extensions are no longer linked to libpython.

It is now possible to load a C extension built using a shared library
Python with a statically linked Python.

When Python is embedded, libpython must not be loaded with
RTLD_LOCAL, but RTLD_GLOBAL instead. Previously, using RTLD_LOCAL, it
was already not possible to load C extensions which were not linked
to libpython, like C extensions of the standard library built by the
"*shared*" section of Modules/Setup.

distutils, python-config and python-config.py have been modified.
2019-04-25 20:13:10 +02:00
Victor Stinner e65f01f78d
bpo-36508: python-config don't export LINKFORSHARED (GH-12661)
python-config --ldflags no longer includes flags of the LINKFORSHARED
variable. The LINKFORSHARED variable must only be used to build
executables.
2019-04-09 18:12:44 +02:00
Michał Górny 14086cfc5e closes bpo-22140: Prevent double substitution of prefix in python-config.sh (#3769)
Fix the logic in python-config.sh to avoid attempting to substitute
prefix in a variable that might have already been subject to
substitution. This e.g. happened if @exec_prefix@ was defined as
"${prefix}" (which is the default of the configure script) -- in which
case the exec_prefix_build variable was initialized with
already-subtituted prefix, and then another round of substitution was
performed which might have resulted in duplicate prefix.

To avoid that, rename the variables so that the variables matching
likely configure names (prefix, exec_prefix) retain their original
values and a '_real' suffix is used for the real values of prefix.

Furthermore, replace the unnecessary prefix and exec_prefix
substitutions with direct prefix_real references since the sed
always replaced the whole string anyway by design.
2017-09-26 22:45:06 -07:00
doko@ubuntu.com 2bf91bf46c - Issue #25440: Fix output of python-config --extension-suffix. 2015-10-19 14:07:57 +02:00
doko@ubuntu.com d486c43d8d - Issue #18096: Fix library order returned by python-config. 2014-10-02 02:00:14 +02:00
doko@ubuntu.com 0df35b0a57 - Issue #18257: Fix readlink usage in python-config. Install the python
version again on Darwin.
2013-08-01 15:32:49 +02:00
doko@python.org 874211978c - Issue #16235: Implement python-config as a shell script. 2013-01-26 11:39:31 +01:00