diff --git a/README b/README index d06276c..fc3b1d9 100644 --- a/README +++ b/README @@ -28,7 +28,7 @@ HOWTO boost.m4 (set it to `.' if you put boost.m4 in the same, top-level directory). 3. If you don't use GNU Libtool already, then time has come to do the switch. - Add AC_PROG_LIBTOOL to your configure.ac then, in all the Makefile.am of + Add LT_INIT to your configure.ac then, in all the Makefile.am of your project, change *_LIBRARIES to *_LTLIBRARIES (notice the extra `LT') for each of your library that depends on Boost. This way, Automake will delegate the build of your libraries to Libtool which will do the necessary diff --git a/build-aux/boost.m4 b/build-aux/boost.m4 index d3d7531..37aefd2 100644 --- a/build-aux/boost.m4 +++ b/build-aux/boost.m4 @@ -1216,15 +1216,15 @@ BOOST_DEFUN([Program_Options], -# _BOOST_PYTHON_CONFIG(VARIABLE, FLAG) +# _BOOST_PYTHON_CONFIG(PYTHON_CONFIG, VARIABLE, FLAG, EXTRA) # ------------------------------------ # Save VARIABLE, and define it via `python-config --FLAG`. # Substitute BOOST_PYTHON_VARIABLE. m4_define([_BOOST_PYTHON_CONFIG], -[AC_SUBST([BOOST_PYTHON_$1], - [`python-config --$2 2>/dev/null`])dnl -boost_python_save_$1=$$1 -$1="$$1 $BOOST_PYTHON_$1"]) +[AC_SUBST([BOOST_PYTHON_$2], + [`$1 --$3 2>/dev/null`])dnl +boost_python_save_$2=$$2 +$2="$$2 $BOOST_PYTHON_$2 $4"]) # BOOST_PYTHON([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE]) @@ -1232,15 +1232,27 @@ $1="$$1 $BOOST_PYTHON_$1"]) # Look for Boost.Python. For the documentation of PREFERRED-RT-OPT, # see the documentation of BOOST_FIND_LIB above. BOOST_DEFUN([Python], -[_BOOST_PYTHON_CONFIG([CPPFLAGS], [includes]) -_BOOST_PYTHON_CONFIG([LDFLAGS], [ldflags]) -_BOOST_PYTHON_CONFIG([LIBS], [libs]) +[ +boost_python_version='' +boost_python_config_prog='' + +for python_version in 3.9 3.8 3.7 3.6 3.5 3 ''; do + AC_CHECK_PROGS(PYTHON_CONFIG_BIN, [python$python_version-config]) + boost_python_config_prog=$PYTHON_CONFIG_BIN + boost_python_version=$python_version + AS_IF([test -n "$boost_python_config_prog"], [break]) +done +AS_IF([test -z "$boost_python_config_prog"], AC_MSG_ERROR([Could not find a python-config executable])) + +_BOOST_PYTHON_CONFIG([$boost_python_config_prog], [CPPFLAGS], [includes]) +_BOOST_PYTHON_CONFIG([$boost_python_config_prog], [LDFLAGS], [ldflags], [-lpython$boost_python_version]) +_BOOST_PYTHON_CONFIG([$boost_python_config_prog], [LIBS], [libs]) m4_pattern_allow([^BOOST_PYTHON_MODULE$])dnl BOOST_FIND_LIBS([python], [python python3], [$1], [boost/python.hpp], [], [BOOST_PYTHON_MODULE(empty) {}], [], [$2]) CPPFLAGS=$boost_python_save_CPPFLAGS -LDFLAGS=$boost_python_save_LDFLAGS +LDFLAGS=$boost_python_save_LDFLAGS -lpython$boost_python_version LIBS=$boost_python_save_LIBS ])# BOOST_PYTHON diff --git a/configure.ac b/configure.ac index 18af1a3..57657aa 100644 --- a/configure.ac +++ b/configure.ac @@ -20,7 +20,7 @@ AM_INIT_AUTOMAKE AC_CANONICAL_HOST -AC_PROG_LIBTOOL +LT_INIT AC_PROG_GREP AC_PROG_EGREP diff --git a/tests/testsuite.at b/tests/testsuite.at index d5c3b16..15fd706 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -109,7 +109,7 @@ done AT_DATA([configure.ac], [[AC_INIT AC_CONFIG_AUX_DIR([$top_srcdir/build-aux])] -AC_PROG_LIBTOOL +LT_INIT AC_PROG_CXX $1 [AC_OUTPUT