summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2020-10-20 21:24:11 +0100
committerTim-Philipp Müller <tim@centricular.com>2020-10-20 21:28:35 +0100
commit095e08afa1b9076148d22b98fbeef94364c0e7ec (patch)
treefb8ba6f8d9329f264681cfa636a11739b1537acd
parentc9bdccc529e8137dc06de37dfc1fa31044929727 (diff)
autotools: fix configure with python >= 3.8
Would fail like this with python >= 3.8: configure: checking for libraries required to embed python configure: error: Python libs not found. Windows requires Python modules to be explicitly linked to libpython. Reason being that we must pass --embed now to python3-config to get the -lpython3.8 linker argument. https://docs.python.org/dev/whatsnew/3.8.html#debug-build-uses-the-same-abi-as-release-build Also see commit 22f28155d86e27c4134de4ed2861264003fcfd23 for Meson. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-python/-/merge_requests/44>
-rw-r--r--acinclude.m49
1 files changed, 8 insertions, 1 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index c0d1a5e..2636f91 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -79,7 +79,14 @@ AC_MSG_CHECKING(for libraries required to embed python)
dnl deduce PYTHON_LIBS
if $PYTHON-config --help 1>/dev/null 2>/dev/null; then
- PYTHON_LIBS=`$PYTHON-config --ldflags 2>/dev/null`
+ dnl Need to pass --embed in python 3.8 or newer:
+ dnl https://docs.python.org/dev/whatsnew/3.8.html#debug-build-uses-the-same-abi-as-release-build
+ if $PYTHON-config --embed 1>/dev/null 2>/dev/null; then
+ python_config_embed_flag="--embed"
+ else
+ python_config_embed_flag=""
+ fi
+ PYTHON_LIBS=`$PYTHON-config --ldflags $python_config_embed_flag 2>/dev/null`
PYTHON_LIB=`$PYTHON -c "import distutils.sysconfig as s; print(s.get_python_lib(standard_lib=1))"`
if echo "$host_os" | grep darwin >/dev/null 2>&1; then
dnl OSX is a pain. Python as shipped by apple installs libpython in /usr/lib