Commit 34b34b06 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Improve autoconf detection of boost::python and sparsehash

parent b0e68cc3
......@@ -162,19 +162,6 @@ AC_ARG_ENABLE([cairo], [AS_HELP_STRING([--disable-cairo],[disable cairo drawing
[AC_MSG_RESULT(yes)]
)
[USING_SPARSEHASH=yes]
AC_MSG_CHECKING(whether to enable sparsehash...)
AC_ARG_ENABLE([sparsehash], [AS_HELP_STRING([--disable-sparsehash],[disable use of google's sparsehash [default=enabled] ])],
if test $enableval = no; then
[USING_SPARSEHASH=no]
[AC_MSG_RESULT(no)]
else
[AC_MSG_RESULT(yes)]
fi
,
[AC_MSG_RESULT(yes)]
)
dnl Override prefix with default value if not set
if test "x${prefix}" = "xNONE"; then
prefix=${ac_default_prefix}
......@@ -324,9 +311,24 @@ AC_ARG_WITH([sparsehash-prefix], [AS_HELP_STRING([--with-sparsehash-prefix=prefi
[default=sparsehash] ])],
[SPARSEHASH_PREFIX=$withval])
[USING_SPARSEHASH=yes]
AC_MSG_CHECKING(whether to enable sparsehash...)
AC_ARG_ENABLE([sparsehash], [AS_HELP_STRING([--disable-sparsehash],[disable use of google's sparsehash [default=enabled] ])],
if test $enableval = no; then
[USING_SPARSEHASH=no]
[AC_MSG_RESULT(no)]
else
[AC_MSG_RESULT(yes)]
fi
,
[AC_MSG_RESULT(yes)]
)
if test "$USING_SPARSEHASH" = "yes"; then
PKG_CHECK_MODULES(SPARSEHASH, [libsparsehash], AC_DEFINE([HAVE_SPARSEHASH], [1],
[Using google's sparsehash]), [])
PKG_CHECK_MODULES(SPARSEHASH, [libsparsehash],
AC_DEFINE([HAVE_SPARSEHASH], [1], [Using google's sparsehash]),
[AC_MSG_RESULT([not found by pkgconfig, trying default...])])
[SPARSEHASH_CFLAGS="${SPARSEHASH_CFLAGS} -DSPARSEHASH_PREFIX=${SPARSEHASH_PREFIX}"]
AC_SUBST(SPARSEHASH_CFLAGS)
AC_DEFINE_UNQUOTED([SPARSEHASH_INCLUDE(f)], [<${SPARSEHASH_PREFIX}/f>],
......
......@@ -82,12 +82,17 @@ if test "$ac_cv_boost_python" = "yes"; then
ax_python_lib=$with_boost_python
ax_boost_python_lib=boost_python-$with_boost_python
fi])
pyver=`$PYTHON -c "import sys; ver = sys.version.split()[[0]].split('.'); print(''.join(ver[[:2]]))"`
for ax_lib in $ax_python_lib $ax_boost_python_lib boost_python boost_python-mt; do
AC_CHECK_LIB($ax_lib, exit, [BOOST_PYTHON_LIB=$ax_lib break])
ax_lib_alt=${ax_lib}-py$PYTHON_VERSION
AC_CHECK_LIB($ax_lib_alt, exit, [BOOST_PYTHON_LIB=$ax_lib_alt break])
ax_lib_alt=${ax_lib}-$PYTHON_VERSION
AC_CHECK_LIB($ax_lib_alt, exit, [BOOST_PYTHON_LIB=$ax_lib_alt break])
ax_lib_alt=${ax_lib}-py$pyver
AC_CHECK_LIB($ax_lib_alt, exit, [BOOST_PYTHON_LIB=$ax_lib_alt break])
ax_lib_alt=${ax_lib}-$pyver
AC_CHECK_LIB($ax_lib_alt, exit, [BOOST_PYTHON_LIB=$ax_lib_alt break])
done
AC_SUBST(BOOST_PYTHON_LIB)
fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment