summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Simons <simons@cryp.to>2022-08-29 21:08:13 +0200
committerGitHub <noreply@github.com>2022-08-29 21:08:13 +0200
commit14d21bf44e83bd87ce550a37b28593b99cae64bd (patch)
tree1dd90236e71751b93495a9206903e505c5351954
parent5773790e8b71c12450aa8d1d234a54c44b86b18f (diff)
parent2f9fe41516189695ddc1e469ba3530432255919d (diff)
downloadautoconf-archive-14d21bf44e83bd87ce550a37b28593b99cae64bd.tar.gz
Merge pull request #259 from bastien-roucaries/fromdebianpython
Fromdebianpython
-rw-r--r--m4/ax_python.m44
-rw-r--r--m4/ax_python_devel.m436
2 files changed, 32 insertions, 8 deletions
diff --git a/m4/ax_python.m4 b/m4/ax_python.m4
index 7c9f511..68dd655 100644
--- a/m4/ax_python.m4
+++ b/m4/ax_python.m4
@@ -50,12 +50,12 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
-#serial 19
+#serial 20
AC_DEFUN([AX_PYTHON],
[AC_MSG_CHECKING(for python build information)
AC_MSG_RESULT([])
-for python in python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python; do
+for python in python3.12 python3.11 python3.10 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python; do
AC_CHECK_PROGS(PYTHON_BIN, [$python])
ax_python_bin=$PYTHON_BIN
if test x$ax_python_bin != x; then
diff --git a/m4/ax_python_devel.m4 b/m4/ax_python_devel.m4
index 0a71592..6a74f29 100644
--- a/m4/ax_python_devel.m4
+++ b/m4/ax_python_devel.m4
@@ -67,7 +67,7 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
-#serial 25
+#serial 26
AU_ALIAS([AC_PYTHON_DEVEL], [AX_PYTHON_DEVEL])
AC_DEFUN([AX_PYTHON_DEVEL],[
@@ -295,8 +295,20 @@ EOD`
AC_MSG_CHECKING([for Python site-packages path])
if test -z "$PYTHON_SITE_PKG"; then
if test "$IMPORT_SYSCONFIG" = "import sysconfig"; then
- PYTHON_SITE_PKG=`$PYTHON -c "$IMPORT_SYSCONFIG; \
- print (sysconfig.get_path('purelib'));"`
+ PYTHON_SITE_PKG=`$PYTHON -c "
+$IMPORT_SYSCONFIG;
+if hasattr(sysconfig, 'get_default_scheme'):
+ scheme = sysconfig.get_default_scheme()
+else:
+ scheme = sysconfig._get_default_scheme()
+if scheme == 'posix_local':
+ # Debian's default scheme installs to /usr/local/ but we want to find headers in /usr/
+ scheme = 'posix_prefix'
+prefix = '$prefix'
+if prefix == 'NONE':
+ prefix = '$ac_default_prefix'
+sitedir = sysconfig.get_path('purelib', scheme, vars={'base': prefix})
+print(sitedir)"`
else
# distutils.sysconfig way
PYTHON_SITE_PKG=`$PYTHON -c "$IMPORT_SYSCONFIG; \
@@ -310,10 +322,22 @@ EOD`
# Check for platform-specific site packages
#
AC_MSG_CHECKING([for Python platform specific site-packages path])
- if test -z "$PYTHON_SITE_PKG"; then
+ if test -z "$PYTHON_PLATFORM_SITE_PKG"; then
if test "$IMPORT_SYSCONFIG" = "import sysconfig"; then
- PYTHON_PLATFORM_SITE_PKG=`$PYTHON -c "$IMPORT_SYSCONFIG; \
- print (sysconfig.get_path('platlib'));"`
+ PYTHON_PLATFORM_SITE_PKG=`$PYTHON -c "
+$IMPORT_SYSCONFIG;
+if hasattr(sysconfig, 'get_default_scheme'):
+ scheme = sysconfig.get_default_scheme()
+else:
+ scheme = sysconfig._get_default_scheme()
+if scheme == 'posix_local':
+ # Debian's default scheme installs to /usr/local/ but we want to find headers in /usr/
+ scheme = 'posix_prefix'
+prefix = '$prefix'
+if prefix == 'NONE':
+ prefix = '$ac_default_prefix'
+sitedir = sysconfig.get_path('platlib', scheme, vars={'platbase': prefix})
+print(sitedir)"`
else
# distutils.sysconfig way
PYTHON_PLATFORM_SITE_PKG=`$PYTHON -c "$IMPORT_SYSCONFIG; \