|
@@ -1,4 +1,6 @@
|
|
|
-##### http://autoconf-archive.cryp.to/ax_boost_base.html
|
|
|
|
|
|
|
+# ===========================================================================
|
|
|
|
|
+# http://autoconf-archive.cryp.to/ax_boost_base.html
|
|
|
|
|
+# ===========================================================================
|
|
|
#
|
|
#
|
|
|
# SYNOPSIS
|
|
# SYNOPSIS
|
|
|
#
|
|
#
|
|
@@ -8,10 +10,10 @@
|
|
|
#
|
|
#
|
|
|
# Test for the Boost C++ libraries of a particular version (or newer)
|
|
# Test for the Boost C++ libraries of a particular version (or newer)
|
|
|
#
|
|
#
|
|
|
-# If no path to the installed boost library is given the macro
|
|
|
|
|
-# searchs under /usr, /usr/local, and /opt, and evaluates the
|
|
|
|
|
-# $BOOST_ROOT environment variable. Further documentation is
|
|
|
|
|
-# available at <http://randspringer.de/boost/index.html>.
|
|
|
|
|
|
|
+# If no path to the installed boost library is given the macro searchs
|
|
|
|
|
+# under /usr, /usr/local, /opt and /opt/local and evaluates the
|
|
|
|
|
+# $BOOST_ROOT environment variable. Further documentation is available at
|
|
|
|
|
+# <http://randspringer.de/boost/index.html>.
|
|
|
#
|
|
#
|
|
|
# This macro calls:
|
|
# This macro calls:
|
|
|
#
|
|
#
|
|
@@ -23,15 +25,15 @@
|
|
|
#
|
|
#
|
|
|
# LAST MODIFICATION
|
|
# LAST MODIFICATION
|
|
|
#
|
|
#
|
|
|
-# 2007-03-15
|
|
|
|
|
|
|
+# 2008-04-12
|
|
|
#
|
|
#
|
|
|
# COPYLEFT
|
|
# COPYLEFT
|
|
|
#
|
|
#
|
|
|
-# Copyright (c) 2007 Thomas Porschberg <[email protected]>
|
|
|
|
|
|
|
+# Copyright (c) 2008 Thomas Porschberg <[email protected]>
|
|
|
#
|
|
#
|
|
|
-# Copying and distribution of this file, with or without
|
|
|
|
|
-# modification, are permitted in any medium without royalty provided
|
|
|
|
|
-# the copyright notice and this notice are preserved.
|
|
|
|
|
|
|
+# Copying and distribution of this file, with or without modification, are
|
|
|
|
|
+# permitted in any medium without royalty provided the copyright notice
|
|
|
|
|
+# and this notice are preserved.
|
|
|
|
|
|
|
|
AC_DEFUN([AX_BOOST_BASE],
|
|
AC_DEFUN([AX_BOOST_BASE],
|
|
|
[
|
|
[
|
|
@@ -50,6 +52,21 @@ AC_ARG_WITH([boost],
|
|
|
],
|
|
],
|
|
|
[want_boost="yes"])
|
|
[want_boost="yes"])
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+AC_ARG_WITH([boost-libdir],
|
|
|
|
|
+ AS_HELP_STRING([--with-boost-libdir=LIB_DIR],
|
|
|
|
|
+ [Force given directory for boost libraries. Note that this will overwrite library path detection, so use this parameter only if default library detection fails and you know exactly where your boost libraries are located.]),
|
|
|
|
|
+ [
|
|
|
|
|
+ if test -d $withval
|
|
|
|
|
+ then
|
|
|
|
|
+ ac_boost_lib_path="$withval"
|
|
|
|
|
+ else
|
|
|
|
|
+ AC_MSG_ERROR(--with-boost-libdir expected directory name)
|
|
|
|
|
+ fi
|
|
|
|
|
+ ],
|
|
|
|
|
+ [ac_boost_lib_path=""]
|
|
|
|
|
+)
|
|
|
|
|
+
|
|
|
if test "x$want_boost" = "xyes"; then
|
|
if test "x$want_boost" = "xyes"; then
|
|
|
boost_lib_version_req=ifelse([$1], ,1.20.0,$1)
|
|
boost_lib_version_req=ifelse([$1], ,1.20.0,$1)
|
|
|
boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'`
|
|
boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'`
|
|
@@ -70,7 +87,7 @@ if test "x$want_boost" = "xyes"; then
|
|
|
BOOST_LDFLAGS="-L$ac_boost_path/lib"
|
|
BOOST_LDFLAGS="-L$ac_boost_path/lib"
|
|
|
BOOST_CPPFLAGS="-I$ac_boost_path/include"
|
|
BOOST_CPPFLAGS="-I$ac_boost_path/include"
|
|
|
else
|
|
else
|
|
|
- for ac_boost_path_tmp in /usr /usr/local /opt ; do
|
|
|
|
|
|
|
+ for ac_boost_path_tmp in /usr /usr/local /opt /opt/local ; do
|
|
|
if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then
|
|
if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then
|
|
|
BOOST_LDFLAGS="-L$ac_boost_path_tmp/lib"
|
|
BOOST_LDFLAGS="-L$ac_boost_path_tmp/lib"
|
|
|
BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include"
|
|
BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include"
|
|
@@ -79,6 +96,12 @@ if test "x$want_boost" = "xyes"; then
|
|
|
done
|
|
done
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
|
|
+ dnl overwrite ld flags if we have required special directory with
|
|
|
|
|
+ dnl --with-boost-libdir parameter
|
|
|
|
|
+ if test "$ac_boost_lib_path" != ""; then
|
|
|
|
|
+ BOOST_LDFLAGS="-L$ac_boost_lib_path"
|
|
|
|
|
+ fi
|
|
|
|
|
+
|
|
|
CPPFLAGS_SAVED="$CPPFLAGS"
|
|
CPPFLAGS_SAVED="$CPPFLAGS"
|
|
|
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
|
|
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
|
|
|
export CPPFLAGS
|
|
export CPPFLAGS
|
|
@@ -111,7 +134,6 @@ if test "x$want_boost" = "xyes"; then
|
|
|
if test "x$succeeded" != "xyes"; then
|
|
if test "x$succeeded" != "xyes"; then
|
|
|
_version=0
|
|
_version=0
|
|
|
if test "$ac_boost_path" != ""; then
|
|
if test "$ac_boost_path" != ""; then
|
|
|
- BOOST_LDFLAGS="-L$ac_boost_path/lib"
|
|
|
|
|
if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
|
|
if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
|
|
|
for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
|
|
for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
|
|
|
_version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
|
|
_version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
|
|
@@ -124,7 +146,7 @@ if test "x$want_boost" = "xyes"; then
|
|
|
done
|
|
done
|
|
|
fi
|
|
fi
|
|
|
else
|
|
else
|
|
|
- for ac_boost_path in /usr /usr/local /opt ; do
|
|
|
|
|
|
|
+ for ac_boost_path in /usr /usr/local /opt /opt/local ; do
|
|
|
if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
|
|
if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
|
|
|
for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
|
|
for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
|
|
|
_version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
|
|
_version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
|
|
@@ -139,7 +161,10 @@ if test "x$want_boost" = "xyes"; then
|
|
|
|
|
|
|
|
VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
|
|
VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
|
|
|
BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
|
|
BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
|
|
|
- BOOST_LDFLAGS="-L$best_path/lib"
|
|
|
|
|
|
|
+ if test "$ac_boost_lib_path" = ""
|
|
|
|
|
+ then
|
|
|
|
|
+ BOOST_LDFLAGS="-L$best_path/lib"
|
|
|
|
|
+ fi
|
|
|
|
|
|
|
|
if test "x$BOOST_ROOT" != "x"; then
|
|
if test "x$BOOST_ROOT" != "x"; then
|
|
|
if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/lib" && test -r "$BOOST_ROOT/stage/lib"; then
|
|
if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/lib" && test -r "$BOOST_ROOT/stage/lib"; then
|
|
@@ -147,7 +172,7 @@ if test "x$want_boost" = "xyes"; then
|
|
|
stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'`
|
|
stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'`
|
|
|
stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'`
|
|
stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'`
|
|
|
V_CHECK=`expr $stage_version_shorten \>\= $_version`
|
|
V_CHECK=`expr $stage_version_shorten \>\= $_version`
|
|
|
- if test "$V_CHECK" = "1" ; then
|
|
|
|
|
|
|
+ if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then
|
|
|
AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT)
|
|
AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT)
|
|
|
BOOST_CPPFLAGS="-I$BOOST_ROOT"
|
|
BOOST_CPPFLAGS="-I$BOOST_ROOT"
|
|
|
BOOST_LDFLAGS="-L$BOOST_ROOT/stage/lib"
|
|
BOOST_LDFLAGS="-L$BOOST_ROOT/stage/lib"
|