summaryrefslogtreecommitdiff
path: root/m4/ax_python_devel.m4
diff options
context:
space:
mode:
authorDaniel Mullner <muellner@math.stanford.edu>2013-04-04 12:05:35 +0200
committerPeter Simons <simons@cryp.to>2013-04-04 12:05:35 +0200
commitca8373b5907cc64384169dc645163da82683895a (patch)
treea33bb491f6c1e8cf871bd2e50e8d98baa8747a76 /m4/ax_python_devel.m4
parente4d76fea621336c2d909220f0bd417ae88439786 (diff)
downloadautoconf-archive-ca8373b5907cc64384169dc645163da82683895a.tar.gz
AX_PYTHON_DEVEL: improve support for MacOS X
Diffstat (limited to 'm4/ax_python_devel.m4')
-rw-r--r--m4/ax_python_devel.m435
1 files changed, 11 insertions, 24 deletions
diff --git a/m4/ax_python_devel.m4 b/m4/ax_python_devel.m4
index ef67366..c82ba9a 100644
--- a/m4/ax_python_devel.m4
+++ b/m4/ax_python_devel.m4
@@ -39,6 +39,7 @@
# Copyright (c) 2009 Andrew Collier
# Copyright (c) 2009 Matteo Settenvini <matteo@member.fsf.org>
# Copyright (c) 2009 Horst Knorr <hk_classes@knoda.org>
+# Copyright (c) 2013 Daniel Mullner <muellner@math.stanford.edu>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
@@ -66,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 14
+#serial 15
AU_ALIAS([AC_PYTHON_DEVEL], [AX_PYTHON_DEVEL])
AC_DEFUN([AX_PYTHON_DEVEL],[
@@ -207,36 +208,22 @@ if e is not None:
print (e)
EOD`
- # Before checking for libpythonX.Y, we need to know
- # the extension the OS we're on uses for libraries.
- # The code snippet below is borrowed from
- # numpy.distutils.misc_util.get_shared_lib_extension
- # (NumPy version 1.7.0).
- ac_python_soext=`cat<<EOD | $PYTHON -
-
-import distutils.sysconfig as ds
-so_ext = ds.get_config_var('SO') or ''
-# fix long extension for Python >=3.2, see PEP 3149.
-if 'SOABI' in ds.get_config_vars():
- # Does nothing unless SOABI config var exists
- so_ext = so_ext.replace('.' + ds.get_config_var('SOABI'), '', 1)
-print(so_ext)
-EOD`
-
# Now, for the library:
- ac_python_soname=`$PYTHON -c \
- "import distutils.sysconfig; \
- print (distutils.sysconfig.get_config_var('LDLIBRARY'))"`
+ ac_python_library=`cat<<EOD | $PYTHON -
- # Strip away extension from the end to canonicalize its name:
- ac_python_library=`echo "$ac_python_soname" | sed "s/${ac_python_soext}$//"`
+import distutils.sysconfig
+c = distutils.sysconfig.get_config_vars()
+if 'LDVERSION' in c:
+ print ('python'+c[['LDVERSION']])
+else:
+ print ('python'+c[['VERSION']])
+EOD`
# This small piece shamelessly adapted from PostgreSQL python macro;
# credits goes to momjian, I think. I'd like to put the right name
# in the credits, if someone can point me in the right direction... ?
#
- if test -n "$ac_python_libdir" -a -n "$ac_python_library" \
- -a x"$ac_python_library" != x"$ac_python_soname"
+ if test -n "$ac_python_libdir" -a -n "$ac_python_library"
then
# use the official shared library
ac_python_library=`echo "$ac_python_library" | sed "s/^lib//"`