summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2023-01-13 11:28:59 +0100
committerSlávek Banko <slavek.banko@axis.cz>2023-01-13 11:28:59 +0100
commit9fdc22134b3f0ed3c0af126ca8b3a63ebbcaf4d7 (patch)
treea122a5925f6fafcb9329760220d483d5fb8f4e17
parent7e4fd6fc5116d84e5dbc48a61fd566556d258cf8 (diff)
downloadadmin-9fdc22134b3f0ed3c0af126ca8b3a63ebbcaf4d7.tar.gz
admin-9fdc22134b3f0ed3c0af126ca8b3a63ebbcaf4d7.zip
Detect and use abiflags during Python 3 detectionr14.1.0
because these are used as part of the library name. Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--acinclude.m4.in27
1 files changed, 18 insertions, 9 deletions
diff --git a/acinclude.m4.in b/acinclude.m4.in
index a311854..760f9ff 100644
--- a/acinclude.m4.in
+++ b/acinclude.m4.in
@@ -4468,7 +4468,13 @@ else
version="$1"
fi
-AC_MSG_CHECKING([for Python$version])
+AC_PATH_PROG([PYTHON],[python$version])
+
+if test -n "$PYTHON"; then
+ abiflags=$($PYTHON -c 'import sys; print(sys.abiflags)')
+else
+ abiflags=""
+fi
python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
@@ -4484,13 +4490,13 @@ PYTHONINC=-I$python_incdir
python_multiarch_libdirs="`find /usr/lib/ -maxdepth 1 -type d | xargs echo`"
python_libdirs="$ac_python_dir/lib$tdelibsuff /usr/lib$tdelibsuff /usr/local /usr/lib$tdelibsuff $python_multiarch_libdirs $kde_extra_libs"
-AC_FIND_FILE(libpython$version.so, $python_libdirs, python_libdir)
-if test ! -r $python_libdir/libpython$version.so; then
- AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
- if test ! -r $python_libdir/libpython$version.a; then
- AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
+AC_FIND_FILE(libpython$version$abiflags.so, $python_libdirs, python_libdir)
+if test ! -r $python_libdir/libpython$version$abiflags.so; then
+ AC_FIND_FILE(libpython$version$abiflags.a, $python_libdirs, python_libdir)
+ if test ! -r $python_libdir/libpython$version$abiflags.a; then
+ AC_FIND_FILE(python$version/config/libpython$version$abiflags.a, $python_libdirs, python_libdir)
python_libdir=$python_libdir/python$version/config
- if test ! -r $python_libdir/libpython$version.a; then
+ if test ! -r $python_libdir/libpython$version$abiflags.a; then
python_libdir=no
fi
fi
@@ -4499,7 +4505,7 @@ fi
PYTHONLIB=-L$python_libdir
kde_orig_LIBPYTHON=$LIBPYTHON
if test -z "$LIBPYTHON"; then
- LIBPYTHON=-lpython$version
+ LIBPYTHON=-lpython$version$abiflags
fi
AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
@@ -4510,7 +4516,10 @@ fi
PYTHONMODDIR=$python_moddir
-AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
+AC_MSG_RESULT([\
+ header $python_incdir,
+ library $python_libdir,
+ modules $python_moddir])
if test x$python_incdir = xno || test x$python_libdir = xno || test x$python_moddir = xno; then
LIBPYTHON=$kde_orig_LIBPYTHON