summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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