Commit 6749cda4 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

allow --without-boostlib (or --with-boostlib=no) to force disabling

boost library (and boost::asio)


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1253 e5f2f494-b856-4b98-b285-d166d9295462
parent 07b1694c
...@@ -95,42 +95,45 @@ AC_SUBST(USE_LCOV) ...@@ -95,42 +95,45 @@ AC_SUBST(USE_LCOV)
AC_MSG_CHECKING([for boost::system library]) AC_MSG_CHECKING([for boost::system library])
AC_ARG_WITH([boostlib], AC_ARG_WITH([boostlib],
AC_HELP_STRING([--with-boostlib=PATH], AC_HELP_STRING([--with-boostlib=PATH],
[specify a path to boost libraries if it is not automatically found]), [specify a path to boost libraries if it is not automatically found, or "no" to disable it]),
[boostlib_path="$withval"], [boostlib_path="no"]) [boostlib_path="$withval"], [boostlib_path="auto"])
if test "$boostlib_path" != "no"; then if test "$boostlib_path" != "no" -a "$boostlib_path" != "auto"; then
BOOST_LDFLAGS="-L$boostlib_path" BOOST_LDFLAGS="-L$boostlib_path"
fi fi
LDFLAGS_SAVED="$LDFLAGS" if test "$boostlib_path" != "no"; then
LIBS_SAVED="$LIBS" LDFLAGS_SAVED="$LDFLAGS"
CPPFLAGS_SAVED="$CPPFLAGS" LIBS_SAVED="$LIBS"
CPPFLAGS="$CPPFLAGS -Iext" CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -Iext"
for BOOST_TRY_LIB in boost_system boost_system-mt; do
LDFLAGS="$LDFLAGS_SAVED ${BOOST_LDFLAGS}" for BOOST_TRY_LIB in boost_system boost_system-mt; do
LIBS="$LIBS_SAVED -l${BOOST_TRY_LIB}" LDFLAGS="$LDFLAGS_SAVED ${BOOST_LDFLAGS}"
AC_TRY_LINK([#include <boost/system/error_code.hpp>], LIBS="$LIBS_SAVED -l${BOOST_TRY_LIB}"
[ boost::system::error_code error_code; AC_TRY_LINK([#include <boost/system/error_code.hpp>],
std::string message(error_code.message()); [ boost::system::error_code error_code;
return 0; ], std::string message(error_code.message());
[ AC_MSG_RESULT(yes) return 0; ],
BOOST_SYSTEM_LIB="-l${BOOST_TRY_LIB}" [ AC_MSG_RESULT(yes)
],[]) BOOST_SYSTEM_LIB="-l${BOOST_TRY_LIB}"
if test "X${BOOST_SYSTEM_LIB}" != X; then ],[])
break if test "X${BOOST_SYSTEM_LIB}" != X; then
fi break
done fi
done
LDFLAGS="$LDFLAGS_SAVED"
CPPFLAGS="$CPPFLAGS_SAVED"
LIBS="$LIBS_SAVED"
fi
if test "X${BOOST_SYSTEM_LIB}" = X; then if test "X${BOOST_SYSTEM_LIB}" = X; then
AC_MSG_RESULT(not found) AC_MSG_RESULT(no)
else else
AC_DEFINE(HAVE_BOOSTLIB, 1, Define to 1 if boost libraries are available) AC_DEFINE(HAVE_BOOSTLIB, 1, Define to 1 if boost libraries are available)
fi fi
AM_CONDITIONAL(HAVE_BOOSTLIB, test "X${BOOST_SYSTEM_LIB}" != X) AM_CONDITIONAL(HAVE_BOOSTLIB, test "X${BOOST_SYSTEM_LIB}" != X)
LDFLAGS="$LDFLAGS_SAVED"
CPPFLAGS="$CPPFLAGS_SAVED"
LIBS="$LIBS_SAVED"
AC_SUBST(BOOST_LDFLAGS) AC_SUBST(BOOST_LDFLAGS)
AC_SUBST(BOOST_SYSTEM_LIB) AC_SUBST(BOOST_SYSTEM_LIB)
......
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