summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2015-10-20 10:22:06 +0200
committerPeter Simons <simons@cryp.to>2015-11-23 12:00:01 +0100
commit433b0e37b2c3cd7aa6b4551a7824a49e06875fba (patch)
tree0626c4c8711cc3842318969b90ee8640ee1943f3
parente3d948b0303aabb8c016c7f3d7f1d538aa5472be (diff)
downloadautoconf-archive-433b0e37b2c3cd7aa6b4551a7824a49e06875fba.tar.gz
AX_BOOST_PYTHON: Update for the AX_PYTHON_DEVEL change.
Because AX_PYTHON_DEVEL now provides PYTHON_LIBS instead of PYTHON_FLAGS, this script needs to be updated accordingly. This lets AX_BOOST_PYTHON actually find the boost python library on newer systems that ignore the -l flags if they appear before the source file on the command line. I'm not sure why I needed to add PYTHON_LIBS to LIBS in the AC_CACHE_CHECK() line, though it apparently wasn't necessary to use PYTHON_LDFLAGS there before. I suspect that much of this file doesn't really make sense.
-rw-r--r--m4/ax_boost_python.m414
1 files changed, 12 insertions, 2 deletions
diff --git a/m4/ax_boost_python.m4 b/m4/ax_boost_python.m4
index 5a40f61..385af3e 100644
--- a/m4/ax_boost_python.m4
+++ b/m4/ax_boost_python.m4
@@ -53,7 +53,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
AC_DEFUN([AX_BOOST_PYTHON],
[AC_REQUIRE([AX_PYTHON_DEVEL])dnl
@@ -65,9 +65,19 @@ ax_boost_python_save_LIBS="$LIBS"
if test "x$PYTHON_CPPFLAGS" != "x"; then
CPPFLAGS="$PYTHON_CPPFLAGS $CPPFLAGS"
fi
+
+# Versions of AX_PYTHON_DEVEL() before serial 18 provided PYTHON_LDFLAGS
+# instead of PYTHON_LIBS, so this is just here for compatibility.
if test "x$PYTHON_LDFLAGS" != "x"; then
LDFLAGS="$PYTHON_LDFLAGS $LDFLAGS"
fi
+
+# Note: Only versions of AX_PYTHON_DEVEL() since serial 18 provide PYTHON_LIBS
+# instead of PYTHON_LDFLAGS.
+if test "x$PYTHON_LIBS" != "x"; then
+ LIBS="$PYTHON_LIBS $LIBS"
+fi
+
if test "x$BOOST_CPPFLAGS" != "x"; then
CPPFLAGS="$BOOST_CPPFLAGS $CPPFLAGS"
fi
@@ -93,7 +103,7 @@ if test "$ac_cv_boost_python" = "yes"; then
for ax_lib in $ax_python_lib $ax_boost_python_lib `ls $BOOSTLIBDIR/libboost_python*.so* $BOOSTLIBDIR/libboost_python*.dylib* $BOOSTLIBDIR/libboost_python*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_python.*\)\.so.*$;\1;' -e 's;^lib\(boost_python.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_python.*\)\.a.*$;\1;' ` boost_python boost_python3; do
AS_VAR_PUSHDEF([ax_Lib], [ax_cv_lib_$ax_lib''_BOOST_PYTHON_MODULE])dnl
AC_CACHE_CHECK([whether $ax_lib is the correct library], [ax_Lib],
- [LIBS="-l$ax_lib $ax_boost_python_save_LIBS"
+ [LIBS="-l$ax_lib $ax_boost_python_save_LIBS $PYTHON_LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <boost/python/module.hpp>
BOOST_PYTHON_MODULE(test) { throw "Boost::Python test."; }]], [])],