1
dnl @synopsis AX_BOOST_REGEX
3
dnl Test for Regex library from the Boost C++ libraries. The macro
4
dnl requires a preceding call to AX_BOOST_BASE. Further documentation
5
dnl is available at <http://randspringer.de/boost/index.html>.
9
dnl AC_SUBST(BOOST_REGEX_LIB)
15
dnl @category InstalledPackages
17
dnl @author Thomas Porschberg <thomas@randspringer.de>
18
dnl @author Michael Tindal <mtindal@paradoxpoint.com>
19
dnl @version 2006-06-15
20
dnl @license AllPermissive
22
AC_DEFUN([AX_BOOST_REGEX],
24
AC_ARG_WITH([boost-regex],
25
AS_HELP_STRING([--with-boost-regex@<:@=special-lib@:>@],
26
[use the Regex library from boost - it is possible to specify a certain library for the linker
27
e.g. --with-boost-regex=boost_regex-gcc-mt-d-1_33_1 ]),
29
if test "$withval" = "no"; then
31
elif test "$withval" = "yes"; then
33
ax_boost_user_regex_lib=""
36
ax_boost_user_regex_lib="$withval"
42
if test "x$want_boost" = "xyes"; then
43
AC_REQUIRE([AC_PROG_CC])
44
CPPFLAGS_SAVED="$CPPFLAGS"
45
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
48
LDFLAGS_SAVED="$LDFLAGS"
49
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
52
AC_CACHE_CHECK(whether the Boost::Regex library is available,
55
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/regex.hpp>
57
[[boost::regex r(); return 0;]]),
58
ax_cv_boost_regex=yes, ax_cv_boost_regex=no)
61
if test "x$ax_cv_boost_regex" = "xyes"; then
62
AC_DEFINE(HAVE_BOOST_REGEX,,[define if the Boost::Regex library is available])
64
if test "x$ax_boost_user_regex_lib" = "x"; then
65
for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \
66
lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \
67
$BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do
68
AC_CHECK_LIB($ax_lib, main, [BOOST_REGEX_LIB="-l$ax_lib" AC_SUBST(BOOST_REGEX_LIB) link_regex="yes" break],
72
for ax_lib in $ax_boost_user_regex_lib $BN-$ax_boost_user_regex_lib; do
73
AC_CHECK_LIB($ax_lib, main,
74
[BOOST_REGEX_LIB="-l$ax_lib" AC_SUBST(BOOST_REGEX_LIB) link_regex="yes" break],
78
if test "x$link_regex" = "xno"; then
79
AC_MSG_ERROR(Could not link against $ax_lib !)
83
CPPFLAGS="$CPPFLAGS_SAVED"
84
LDFLAGS="$LDFLAGS_SAVED"