formatting fixes in client test, and made the test build when resolve countries is...
[libtorrent-kjk.git] / m4 / ax_boost_regex.m4
blob8ff226655fcb3342cf8e3b1b64a648d5d79dc3f2
1 dnl @synopsis AX_BOOST_REGEX
2 dnl
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.
7 dnl
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.
10 dnl
11 dnl This macro calls AC_SUBST(BOOST_REGEX_LIB).
12 dnl
13 dnl @version $Id$
14 dnl @author Michael Tindal <mtindal@paradoxpoint.com>
15 dnl
16 AC_DEFUN([AX_BOOST_REGEX],
17 [AC_REQUIRE([AC_CXX_NAMESPACES])dnl
18 AC_CACHE_CHECK(whether the Boost::Regex library is available,
19 ax_cv_boost_regex,
20 [AC_LANG_SAVE
21  AC_LANG_CPLUSPLUS
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)
25  AC_LANG_RESTORE
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
35   fi])
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
38 break])
39   done
40   AC_SUBST(BOOST_REGEX_LIB)
42 ])dnl