# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
# Copyright (c) 2009 Peter Adolphs
#
#
# Copying and distribution of this file, with or without modification, are
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved.
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 22
AC_DEFUN([AX_BOOST_BASE],
AC_DEFUN([AX_BOOST_BASE],
[
[
AC_ARG_WITH([boost],
AC_ARG_WITH([boost],
AS_HELP_STRING([--with-boost@<:@=DIR@:>@], [use boost (default is yes) - it is possible to specify the root directory for boost (optional)]),
[AS_HELP_STRING([--with-boost@<:@=ARG@:>@],
[use Boost library from a standard location (ARG=yes),
from the specified location (ARG=<path>),
or disable it (ARG=no)
@<:@ARG=yes@:>@ ])],
[
[
if test "x$withval" = "xno"; then
if test "$withval" = "no"; then
want_boost="no"
want_boost="no"
elif test "x$withval" = "xyes"; then
elif test "$withval" = "yes"; then
want_boost="yes"
want_boost="yes"
ac_boost_path=""
ac_boost_path=""
else
else
@ -54,9 +59,9 @@ AC_ARG_WITH([boost],
AC_ARG_WITH([boost-libdir],
AC_ARG_WITH([boost-libdir],
AS_HELP_STRING([--with-boost-libdir=LIB_DIR],
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.]),
[Force given directory for boost libraries. Note that this will override 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
if test -d "$withval"
then
then
ac_boost_lib_path="$withval"
ac_boost_lib_path="$withval"
else
else
@ -79,18 +84,44 @@ if test "x$want_boost" = "xyes"; then
if test "$V_CHECK" = "1" -a "x$ac_boost_lib_path" = "x" ; 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/$libsubdir"
fi
fi
fi
fi
fi
fi
@ -204,17 +243,20 @@ if test "x$want_boost" = "xyes"; then
AC_LANG_POP([C++])
AC_LANG_POP([C++])
fi
fi
if test "x$succeeded" != "xyes" ; then
if test "$succeeded" != "yes" ; then
if test "$_version" = "0" ; then
if test "$_version" = "0" ; then
AC_MSG_ERROR([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]])
AC_MSG_NOTICE([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]])
else
else
AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).])
AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).])
fi
fi
# execute ACTION-IF-NOT-FOUND (if present):
ifelse([$3], , :, [$3])
else
else
AC_SUBST(BOOST_CPPFLAGS)
AC_SUBST(BOOST_CPPFLAGS)
AC_SUBST(BOOST_LDFLAGS)
AC_SUBST(BOOST_LDFLAGS)
AC_SUBST(BOOST_VERSION)
AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available])
AC_DEFINE(HAVE_BOOST,[1],[define if the Boost library is available])