~ubuntu-branches/ubuntu/trusty/mapnik/trusty-proposed

« back to all changes in this revision

Viewing changes to config/ax_boost_regex.m4

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Sauthier
  • Date: 2009-08-27 00:28:37 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090827002837-ztqzfg2rmclfh4i9
Tags: 0.6.1-0ubuntu1
* New upstream release.
* Change usr/lib to usr/lib* to enable build on 64 bits systems due to new
  configuration in SConstruct in :
  - debian/libmapnik-dev.install
  - debian/libmapnik0.6.install
  - debian/mapnik-plugin-base

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl @synopsis AX_BOOST_REGEX
2
 
dnl
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>.
6
 
dnl
7
 
dnl This macro calls:
8
 
dnl
9
 
dnl   AC_SUBST(BOOST_REGEX_LIB)
10
 
dnl
11
 
dnl And sets:
12
 
dnl
13
 
dnl   HAVE_BOOST_REGEX
14
 
dnl
15
 
dnl @category InstalledPackages
16
 
dnl @category Cxx
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
21
 
 
22
 
AC_DEFUN([AX_BOOST_REGEX],
23
 
[
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 ]),
28
 
        [
29
 
        if test "$withval" = "no"; then
30
 
                        want_boost="no"
31
 
        elif test "$withval" = "yes"; then
32
 
            want_boost="yes"
33
 
            ax_boost_user_regex_lib=""
34
 
        else
35
 
                    want_boost="yes"
36
 
                ax_boost_user_regex_lib="$withval"
37
 
                fi
38
 
        ],
39
 
        [want_boost="yes"]
40
 
        )
41
 
 
42
 
        if test "x$want_boost" = "xyes"; then
43
 
        AC_REQUIRE([AC_PROG_CC])
44
 
                CPPFLAGS_SAVED="$CPPFLAGS"
45
 
                CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
46
 
                export CPPFLAGS
47
 
 
48
 
                LDFLAGS_SAVED="$LDFLAGS"
49
 
                LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
50
 
                export LDFLAGS
51
 
 
52
 
        AC_CACHE_CHECK(whether the Boost::Regex library is available,
53
 
                                           ax_cv_boost_regex,
54
 
        [AC_LANG_PUSH([C++])
55
 
                         AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/regex.hpp>
56
 
                                                                                                ]],
57
 
                                   [[boost::regex r(); return 0;]]),
58
 
                   ax_cv_boost_regex=yes, ax_cv_boost_regex=no)
59
 
         AC_LANG_POP([C++])
60
 
                ])
61
 
                if test "x$ax_cv_boost_regex" = "xyes"; then
62
 
                        AC_DEFINE(HAVE_BOOST_REGEX,,[define if the Boost::Regex library is available])
63
 
                        BN=boost_regex
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],
69
 
                                 [link_regex="no"])
70
 
                                done
71
 
            else
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],
75
 
                                   [link_regex="no"])
76
 
               done
77
 
            fi
78
 
                        if test "x$link_regex" = "xno"; then
79
 
                                AC_MSG_ERROR(Could not link against $ax_lib !)
80
 
                        fi
81
 
                fi
82
 
 
83
 
                CPPFLAGS="$CPPFLAGS_SAVED"
84
 
        LDFLAGS="$LDFLAGS_SAVED"
85
 
        fi
86
 
])