libcruft-util/m4/nc_boost_system.m4

37 lines
1.1 KiB
Plaintext
Raw Normal View History

2016-04-05 11:11:19 +10:00
AC_DEFUN([NC_BOOST_SYSTEM], [
AC_REQUIRE([NC_BOOST_BASE])
AC_LANG_PUSH([C++])
for lib in boost_system; do
AC_MSG_CHECKING([if boost system library is $lib])
nc_save_cflags=$CFLAGS
nc_save_libs=$LIBS
CFLAGS="$CFLAGS $BOOST_BASE_CPPFLAGS"
LIBS="$LIBS $BOOST_BASE_LDFLAGS -l$lib"
dnl Try to call boost::system::throws as it appears to be extern
AC_TRY_LINK(
[@%:@include <boost/system/error_code.hpp>],
[boost::system::throws ();],
[nc_cv_boost_system=yes],
[nc_cv_boost_system=no]
)
BOOST_SYSTEM_CPPFLAGS=$CFLAGS
2016-04-19 17:25:41 +10:00
BOOST_SYSTEM_LDFLAGS=-l$lib
2016-04-05 11:11:19 +10:00
CFLAGS=$nc_save_cflags
LIBS=$nc_save_libs
AC_MSG_RESULT([$nc_cv_boost_system])
AS_IF([test "x$nc_cv_boost_system" = "xyes"], [break;])
done
AC_LANG_POP([C++])
AS_IF([test "x$nc_cv_boost_system" != "xyes"], [
AC_MSG_ERROR([unable to locate boost_system])
])
])