1 dnl @synopsis AX_BOOST_REGEX
3 dnl This macro checks to see if the Boost.Regex library is installed.
4 dnl It also attempts to guess the currect library name using several
5 dnl attempts. It tries to build the library name using a user supplied
6 dnl name or suffix and then just the raw library.
8 dnl If the library is found, HAVE_BOOST_REGEX is defined and
9 dnl BOOST_REGEX_LIB is set to the name of the library.
11 dnl This macro calls AC_SUBST(BOOST_REGEX_LIB).
14 dnl @author Michael Tindal <mtindal@paradoxpoint.com>
16 AC_DEFUN([AX_BOOST_REGEX],
17 [AC_REQUIRE([AC_CXX_NAMESPACES])dnl
18 AC_CACHE_CHECK(whether the Boost::Regex library is available,
22 AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[#include <boost/regex.hpp>]],
23 [[boost::regex r(); return 0;]]),
24 ax_cv_boost_regex=yes, ax_cv_boost_regex=no)
27 if test "$ax_cv_boost_regex" = yes; then
28 AC_DEFINE(HAVE_BOOST_REGEX,,[define if the Boost::Regex library is available])
29 dnl Now determine the appropriate file names
30 AC_ARG_WITH([boost-regex],AS_HELP_STRING([--with-boost-regex],
31 [specify the boost regex library or suffix to use]),
32 [if test "x$with_boost_regex" != "xno"; then
33 ax_regex_lib=$with_boost_regex
34 ax_boost_regex_lib=boost_regex-$with_boost_regex
36 for ax_lib in $ax_regex_lib $ax_boost_regex_lib boost_regex; do
37 AC_CHECK_LIB($ax_lib, main, [BOOST_REGEX_LIB=$ax_lib
40 AC_SUBST(BOOST_REGEX_LIB)