summaryrefslogtreecommitdiff
path: root/m4/ax_python_devel.m4
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2017-06-27 11:43:29 +0100
committerSimon McVittie <smcv@debian.org>2017-06-27 11:43:29 +0100
commiteadfb64c4d93c68b7cb61ca960bf59b131aebaa7 (patch)
treebde20893d85a2b9ac90f853820f0dad267824c98 /m4/ax_python_devel.m4
parent9b4f7d37a4694be9915457cd239300a8aea48416 (diff)
downloadautoconf-archive-eadfb64c4d93c68b7cb61ca960bf59b131aebaa7.tar.gz
AX_PYTHON_DEVEL: Swap values of PYTHON_EXTRA_LIBS, PYTHON_EXTRA_LDFLAGS
The LIBS and SYSLIBS Python configuration variables are lists of libraries, with typical values (on Debian GNU/Linux) being LIBS = -lpthread -ldl -lutil SYSLIBS = -lm so they should clearly be in a LIBS variable, not LDFLAGS. Conversely, the LINKFORSHARED Python configuration variable contains miscellaneous linker options, with its value on Debian being -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions so it should be in the LDFLAGS. This matters when linking statically or using a particularly pedantic linker: LDFLAGS appear on the linker command-line before the object files to be linked and (with some linkers) cannot satisfy undefined symbols, whereas LIBS appear after the object files in dependency order. Signed-off-by: Simon McVittie <smcv@debian.org>
Diffstat (limited to 'm4/ax_python_devel.m4')
-rw-r--r--m4/ax_python_devel.m418
1 files changed, 9 insertions, 9 deletions
diff --git a/m4/ax_python_devel.m4 b/m4/ax_python_devel.m4
index 9487fad..44dbd83 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 20
+#serial 21
AU_ALIAS([AC_PYTHON_DEVEL], [AX_PYTHON_DEVEL])
AC_DEFUN([AX_PYTHON_DEVEL],[
@@ -262,25 +262,25 @@ EOD`
# libraries which must be linked in when embedding
#
AC_MSG_CHECKING(python extra libraries)
- if test -z "$PYTHON_EXTRA_LDFLAGS"; then
- PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \
+ if test -z "$PYTHON_EXTRA_LIBS"; then
+ PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \
conf = distutils.sysconfig.get_config_var; \
print (conf('LIBS') + ' ' + conf('SYSLIBS'))"`
fi
- AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS])
- AC_SUBST(PYTHON_EXTRA_LDFLAGS)
+ AC_MSG_RESULT([$PYTHON_EXTRA_LIBS])
+ AC_SUBST(PYTHON_EXTRA_LIBS)
#
# linking flags needed when embedding
#
AC_MSG_CHECKING(python extra linking flags)
- if test -z "$PYTHON_EXTRA_LIBS"; then
- PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \
+ if test -z "$PYTHON_EXTRA_LDFLAGS"; then
+ PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \
conf = distutils.sysconfig.get_config_var; \
print (conf('LINKFORSHARED'))"`
fi
- AC_MSG_RESULT([$PYTHON_EXTRA_LIBS])
- AC_SUBST(PYTHON_EXTRA_LIBS)
+ AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS])
+ AC_SUBST(PYTHON_EXTRA_LDFLAGS)
#
# final check to see if everything compiles alright