aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2007-05-05 00:08:17 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2007-05-05 00:08:17 +0000
commit17c80c08d1ef25e08889509da5277ab65a9f570b (patch)
treeb21452f5dac1c244fad99b92b04ccbcdca34cbab
parent02e73e7f00154bdfebac199dd6a6ea1620f83132 (diff)
downloadpaludis-17c80c08d1ef25e08889509da5277ab65a9f570b.tar.gz
paludis-17c80c08d1ef25e08889509da5277ab65a9f570b.tar.xz
Accept either threaded or non-threaded boost.python, and fix as-needed.
-rw-r--r--configure.ac27
-rw-r--r--python/Makefile.am5
2 files changed, 30 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 25b6f7f..59281f4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -763,6 +763,33 @@ if test "x$enable_python" = "xyes" ; then
CXXFLAGS="$save_CXXFLAGS"
dnl }}}
+ dnl {{{ check whether we need -lboost_python or -lboost_python-mt
+ AC_MSG_CHECKING([for boost.python library name])
+ save_CXXFLAGS="$CXXFLAGS"
+ save_LIBS="$LIBS"
+ CXXFLAGS="$CXXFLAGS -I$PYTHON_INCLUDE_DIR"
+ LIBS="$LIBS -lboost_python -lpython$PYTHON_VERSION"
+ AC_LINK_IFELSE([
+#include <boost/python.hpp>
+int main() { boost::python::throw_error_already_set(); return 0; }
+],
+ [BOOST_PYTHON_LIB="-lboost_python"
+ AC_MSG_RESULT([$BOOST_PYTHON_LIB])],
+ [LIBS="$save_LIBS -lboost_python-mt -lpython$PYTHON_VERSION"
+ AC_LINK_IFELSE([
+#include <boost/python.hpp>
+int main() { boost::python::throw_error_already_set(); return 0; }
+],
+ [BOOST_PYTHON_LIB="-lboost_python-mt"
+ AC_MSG_RESULT([$BOOST_PYTHON_LIB])],
+ [AC_MSG_RESULT([not found])
+ AC_MSG_ERROR([boost.python (http://www.boost.org/libs/python/doc/) is required])])])
+ AC_SUBST(BOOST_PYTHON_LIB)
+ dnl Restore the C++ flags
+ LIBS="$save_LIBS"
+ CXXFLAGS="$save_CXXFLAGS"
+ dnl }}}
+
fi
AM_CONDITIONAL([ENABLE_PYTHON], test "x$enable_python" = "xyes")
dnl }}}
diff --git a/python/Makefile.am b/python/Makefile.am
index 9654034..1a8e9c0 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -85,6 +85,7 @@ if ENABLE_PYTHON
lib_LTLIBRARIES = libpaludispython.la
libpaludispython_la_CXXFLAGS = $(AM_CXXFLAGS) -I. -I@PYTHON_INCLUDE_DIR@
+libpaludispython_la_LDFLAGS = @BOOST_PYTHON_LIB@
paludis_python_so.o : paludis_python_so.cc
if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) \
@@ -135,7 +136,7 @@ pythonlib_DATA = paludis.so
$(CXX) -fPIC -shared $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) \
- -I@PYTHON_INCLUDE_DIR@ -lboost_python \
+ -I@PYTHON_INCLUDE_DIR@ @BOOST_PYTHON_LIB@ \
-o $@ \
.libs/paludis_python_so.o \
-L$(top_builddir)/python/.libs -lpaludispython
@@ -144,7 +145,7 @@ paludis.so : libpaludispython.la paludis_python_so.o
$(CXX) -fPIC -shared $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) \
- -I@PYTHON_INCLUDE_DIR@ -lboost_python \
+ -I@PYTHON_INCLUDE_DIR@ @BOOST_PYTHON_LIB@ \
-o $@ \
.libs/paludis_python_so.o \
-L$(top_builddir)/python/.libs -lpaludispython