summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2019-11-10 10:40:43 -0500
committerSébastien Helleu <flashcode@flashtux.org>2019-11-12 21:19:47 +0100
commit76c6f52e8c93e3a9f53f30e2c86908dfb3079bc8 (patch)
tree4b88cd1df53065cf3397f336b1d227049bef67a0
parentpython: use more idiomatic cmake pkg-config linking (diff)
downloadweechat-76c6f52e8c93e3a9f53f30e2c86908dfb3079bc8.tar.xz
weechat-76c6f52e8c93e3a9f53f30e2c86908dfb3079bc8.zip
build: support python 3.8
In python 3.8, in order to link to -lpython3.8, you need to use the exported pkg-config interface 'python3-embed' (or 'python3-config --libs --embed'), see https://bugs.python.org/issue36721 for details.
-rw-r--r--cmake/FindPython.cmake5
-rw-r--r--configure.ac5
2 files changed, 8 insertions, 2 deletions
diff --git a/cmake/FindPython.cmake b/cmake/FindPython.cmake
index e6023dbc9..7690833c9 100644
--- a/cmake/FindPython.cmake
+++ b/cmake/FindPython.cmake
@@ -33,5 +33,8 @@ include(FindPkgConfig)
if(ENABLE_PYTHON2)
pkg_check_modules(PYTHON python2 IMPORTED_TARGET GLOBAL)
else()
- pkg_check_modules(PYTHON python3 IMPORTED_TARGET GLOBAL)
+ pkg_check_modules(PYTHON python3-embed IMPORTED_TARGET GLOBAL)
+ if(NOT PYTHON_FOUND)
+ pkg_check_modules(PYTHON python3 IMPORTED_TARGET GLOBAL)
+ endif()
endif()
diff --git a/configure.ac b/configure.ac
index 672ff0e5e..a12b74cb9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -477,7 +477,10 @@ if test "x$enable_python" = "xyes" ; then
if test "x$enable_python2" = "xyes" ; then
PKG_CHECK_MODULES(PYTHON, [python2], [PYTHON_FOUND=yes; PYTHON_VERSION=`$PKGCONFIG --modversion python2`], [PYTHON_FOUND=no])
else
- PKG_CHECK_MODULES(PYTHON, [python3], [PYTHON_FOUND=yes; PYTHON_VERSION=`$PKGCONFIG --modversion python3`], [PYTHON_FOUND=no])
+ PKG_CHECK_MODULES(PYTHON, [python3-embed], [PYTHON_FOUND=yes; PYTHON_VERSION=`$PKGCONFIG --modversion python3-embed`], [PYTHON_FOUND=no])
+ if test "x$PYTHON_FOUND" != "xyes"; then
+ PKG_CHECK_MODULES(PYTHON, [python3], [PYTHON_FOUND=yes; PYTHON_VERSION=`$PKGCONFIG --modversion python3`], [PYTHON_FOUND=no])
+ fi
fi
if test "x$PYTHON_FOUND" != "xyes" ; then
AC_MSG_WARN([