projects
/
m4-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix test for Boost version / presence
[m4-moved-to-github.git]
/
boost.m4
diff --git
a/boost.m4
b/boost.m4
index
0bbcdbd
..
0540465
100644
(file)
--- a/
boost.m4
+++ b/
boost.m4
@@
-23,19
+23,29
@@
AC_DEFUN([ID_BOOST],
BOOST_REQ_VERSION=`echo "$2" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 100 + [$]3;}'`
CPPFLAGS="$CPPFLAGS -DBOOST_REQ_VERSION=${BOOST_REQ_VERSION}"
BOOST_REQ_VERSION=`echo "$2" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 100 + [$]3;}'`
CPPFLAGS="$CPPFLAGS -DBOOST_REQ_VERSION=${BOOST_REQ_VERSION}"
- AC_ARG_WITH([boost],[[ --with-boost=DIR use Boost in prefix DIR]])
+ AC_ARG_WITH([boost],[ --with-boost=DIR use Boost in prefix DIR])
if test "$with_boost" = "yes" -o -z "$with_boost"; then
BOOST_CPPFLAGS=""
BOOST_LIB=""
else
if test "$with_boost" = "yes" -o -z "$with_boost"; then
BOOST_CPPFLAGS=""
BOOST_LIB=""
else
- BOOST_LIB="-L${with_boost}/lib"
+ for b in ${with_boost}/lib ${with_boost}/lib64; do
+ if test -d "$b"; then
+ BOOST_LIB="-L$b"
+ fi
+ done
BOOST_CPPFLAGS="-I${with_boost}/include"
BOOST_CPPFLAGS="-I${with_boost}/include"
- if test ! -f "${with_boost}/include/version.hpp"; then
+ if test ! -f "${with_boost}/include/boost/version.hpp"; then
for b in ${with_boost}/include/boost-*; do
BOOST_CPPFLAGS="-I$b"
done
fi
fi
for b in ${with_boost}/include/boost-*; do
BOOST_CPPFLAGS="-I$b"
done
fi
fi
+ AC_ARG_WITH([boost-toolset],[ --with-boost-toolset=x use Boost toolset (eg gcc43)])
+ if test "$with_boost_toolset" = "yes" -o -z "$with_boost_toolset"; then
+ BOOST_TOOLSET=""
+ else
+ BOOST_TOOLSET="-${with_boost_toolset}"
+ fi
if test "${with_boost}" = "no"; then
AC_MSG_RESULT([disabled])
else
if test "${with_boost}" = "no"; then
AC_MSG_RESULT([disabled])
else
@@
-47,7
+57,8
@@
AC_DEFUN([ID_BOOST],
version_is:BOOST_VERSION
]])])
BOOST_GOT_VERSION=`(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | $EGREP version_is 2>/dev/null | cut -d ":" -f2`
version_is:BOOST_VERSION
]])])
BOOST_GOT_VERSION=`(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | $EGREP version_is 2>/dev/null | cut -d ":" -f2`
- if test "$BOOST_GOT_VERSION" = "BOOST_VERSION"; then
+ if test -z "$BOOST_GOT_VERSION" -o \
+ "$BOOST_GOT_VERSION" = "BOOST_VERSION"; then
AC_MSG_RESULT([no])
AC_MSG_ERROR([Boost development libraries required])
fi
AC_MSG_RESULT([no])
AC_MSG_ERROR([Boost development libraries required])
fi
@@
-62,7
+73,7
@@
version_is:BOOST_VERSION
AC_SUBST([BOOST_THREAD_LIB])
saveLIBS="${LIBS}"
BOOST_THREAD_LIB=""
AC_SUBST([BOOST_THREAD_LIB])
saveLIBS="${LIBS}"
BOOST_THREAD_LIB=""
- for l in boost_thread-mt boost_thread; do
+ for l in boost_thread${BOOST_TOOLSET}-mt boost_thread${BOOST_TOOLSET}; do
LIBS="${saveLIBS} -l${l}"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <boost/version.hpp>
LIBS="${saveLIBS} -l${l}"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <boost/version.hpp>
@@
-84,7
+95,7
@@
int x = BOOST_VERSION;
saveLIBS="${LIBS}"
AC_SUBST([BOOST_TEST_LIB])
BOOST_TEST_LIB=""
saveLIBS="${LIBS}"
AC_SUBST([BOOST_TEST_LIB])
BOOST_TEST_LIB=""
- for l in boost_unit_test_framework-mt boost_unit_test_framework; do
+ for l in boost_unit_test_framework${BOOST_TOOLSET}-mt boost_unit_test_framework${BOOST_TOOLSET}; do
LIBS="${saveLIBS} -l${l}"
AC_LINK_IFELSE([AC_LANG_SOURCE([[
#define BOOST_TEST_DYN_LINK
LIBS="${saveLIBS} -l${l}"
AC_LINK_IFELSE([AC_LANG_SOURCE([[
#define BOOST_TEST_DYN_LINK