Commit 0116929e authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Update boost m4 macros

parent 236cc632
......@@ -430,8 +430,8 @@ AC_SUBST(CXXFLAGS)
AC_SUBST(MOD_CPPFLAGS)
# default LIBADD flags for submodules
[MOD_LIBADD="${PYTHON_LDFLAGS} -l${BOOST_IOSTREAMS_LIB} -l${BOOST_PYTHON_LIB} \
-l${BOOST_REGEX_LIB} ${BOOST_COROUTINE_LIB} ${OPENMP_LDFLAGS} -lexpat"]
[MOD_LIBADD="${PYTHON_LDFLAGS} ${BOOST_IOSTREAMS_LIB} ${BOOST_PYTHON_LIB} \
${BOOST_REGEX_LIB} ${BOOST_COROUTINE_LIB} ${OPENMP_LDFLAGS} -lexpat"]
AC_SUBST(MOD_LIBADD)
# needed for typeinfo objects to work across DSO boundaries.
......
# ===========================================================================
# http://autoconf-archive.cryp.to/ax_boost_graph.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_BOOST_GRAPH
#
# DESCRIPTION
#
# This macro checks to see if the Boost.Graph library is installed. It
# also attempts to guess the currect library name using several attempts.
# It tries to build the library name using a user supplied name or suffix
# and then just the raw library.
#
# If the library is found, HAVE_BOOST_GRAPH is defined and
# BOOST_GRAPH_LIB is set to the name of the library.
#
# This macro calls AC_SUBST(BOOST_GRAPH_LIB).
#
# In order to ensure that the Graph headers are specified on the include
# path, this macro requires AX_GRAPH to be called.
# Test for Graph library from the Boost C++ libraries. The macro
# requires a preceding call to AX_BOOST_BASE. Further documentation is
# available at <http://randspringer.de/boost/index.html>.
#
# LAST MODIFICATION
# This macro calls:
#
# 2008-04-12
# AC_SUBST(BOOST_GRAPH_LIB)
#
# COPYLEFT
# And sets:
#
# Copyright (c) 2008 Michael Tindal
# HAVE_BOOST_GRAPH
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
# LICENSE
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Macro Archive. When you make and
# distribute a modified version of the Autoconf Macro, you may extend this
# special exception to the GPL to apply to your modified version as well.
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 20
AC_DEFUN([AX_BOOST_GRAPH],
[AC_CACHE_CHECK(whether the Boost::Graph library is available,
ac_cv_boost_graph,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
CPPFLAGS_SAVE=$CPPFLAGS
if test "x$GRAPH_INCLUDE_DIR" != "x"; then
CPPFLAGS="-I$GRAPH_INCLUDE_DIR $CPPFLAGS"
fi
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
#include <boost/graph/adjacency_list.hpp>
using namespace boost;
adjacency_list<> g;
]],
[[return 0;]]),
ac_cv_boost_graph=yes, ac_cv_boost_graph=no)
AC_LANG_RESTORE
CPPFLAGS="$CPPFLAGS_SAVE"
[
AC_ARG_WITH([boost-graph],
AS_HELP_STRING([--with-boost-graph@<:@=special-lib@:>@],
[use the Graph library from boost - it is possible to specify a certain library for the linker
e.g. --with-boost-graph=boost_graph-gcc-mt-d-1_33_1 ]),
[
if test "$withval" = "no"; then
want_boost="no"
elif test "$withval" = "yes"; then
want_boost="yes"
ax_boost_user_graph_lib=""
else
want_boost="yes"
ax_boost_user_graph_lib="$withval"
fi
],
[want_boost="yes"]
)
if test "x$want_boost" = "xyes"; then
AC_REQUIRE([AC_PROG_CC])
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
AC_CACHE_CHECK(whether the Boost::Graph library is available,
ax_cv_boost_graph,
[AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/graph/adjacency_list.hpp>]],
[[using namespace boost; adjacency_list<> g; return 0;]])],
ax_cv_boost_graph=yes, ax_cv_boost_graph=no)
AC_LANG_POP([C++])
])
if test "x$ax_cv_boost_graph" = "xyes"; then
AC_DEFINE(HAVE_BOOST_GRAPH,,[define if the Boost::Graph library is available])
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
if test "x$ax_boost_user_graph_lib" = "x"; then
for libextension in `ls $BOOSTLIBDIR/libboost_graph*.so* $BOOSTLIBDIR/libboost_iostream*.dylib* $BOOSTLIBDIR/libboost_graph*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_graph.*\)\.so.*$;\1;' -e 's;^lib\(boost_iostream.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_graph.*\)\.a.*$;\1;'` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_GRAPH_LIB="-l$ax_lib"; AC_SUBST(BOOST_GRAPH_LIB) link_graph="yes"; break],
[link_graph="no"])
done
if test "x$link_graph" != "xyes"; then
for libextension in `ls $BOOSTLIBDIR/boost_graph*.dll* $BOOSTLIBDIR/boost_graph*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_graph.*\)\.dll.*$;\1;' -e 's;^\(boost_graph.*\)\.a.*$;\1;'` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_GRAPH_LIB="-l$ax_lib"; AC_SUBST(BOOST_GRAPH_LIB) link_graph="yes"; break],
[link_graph="no"])
done
fi
else
for ax_lib in $ax_boost_user_graph_lib boost_graph-$ax_boost_user_graph_lib; do
AC_CHECK_LIB($ax_lib, main,
[BOOST_GRAPH_LIB="-l$ax_lib"; AC_SUBST(BOOST_GRAPH_LIB) link_graph="yes"; break],
[link_graph="no"])
done
fi
if test "x$ax_lib" = "x"; then
AC_MSG_ERROR(Could not find a version of the library!)
fi
if test "x$link_graph" != "xyes"; then
AC_MSG_ERROR(Could not link against $ax_lib !)
fi
fi
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
fi
])
if test "$ac_cv_boost_graph" = "yes"; then
AC_DEFINE(HAVE_BOOST_GRAPH,,[define if the Boost::Graph library is available])
ax_graph_lib=boost_graph
AC_ARG_WITH([boost-graph],AS_HELP_STRING([--with-boost-graph],[specify the boost graph library or suffix to use]),
[if test "x$with_boost_graph" != "xno"; then
ax_graph_lib=$with_boost_graph
ax_boost_graph_lib=boost_graph-$with_boost_graph
fi])
for ax_lib in $ax_graph_lib $ax_boost_graph_lib boost_graph boost_graph-mt boost_graph-mt-py2.5; do
AC_CHECK_LIB($ax_lib, exit, [BOOST_GRAPH_LIB=$ax_lib break])
done
AC_SUBST(BOOST_GRAPH_LIB)
fi
])dnl
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_boost_iostreams.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_BOOST_IOSTREAMS
#
# DESCRIPTION
#
# This macro checks to see if the Boost.Regex library is installed. It
# also attempts to guess the currect library name using several attempts.
# It tries to build the library name using a user supplied name or suffix
# and then just the raw library.
#
# If the library is found, HAVE_BOOST_IOSTREAMS is defined and
# BOOST_IOSTREAMS_LIB is set to the name of the library.
#
# This macro calls AC_SUBST(BOOST_IOSTREAMS_LIB).
#
# In order to ensure that the Regex headers are specified on the include
# path, this macro requires AX_IOSTREAMS to be called.
# Test for IOStreams library from the Boost C++ libraries. The macro
# requires a preceding call to AX_BOOST_BASE. Further documentation is
# available at <http://randspringer.de/boost/index.html>.
#
# LAST MODIFICATION
# This macro calls:
#
# 2008-04-12
# AC_SUBST(BOOST_IOSTREAMS_LIB)
#
# COPYLEFT
# And sets:
#
# Copyright (c) 2008 Michael Tindal
# HAVE_BOOST_IOSTREAMS
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
# LICENSE
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Macro Archive. When you make and
# distribute a modified version of the Autoconf Macro, you may extend this
# special exception to the GPL to apply to your modified version as well.
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 20
AC_DEFUN([AX_BOOST_IOSTREAMS],
[AC_CACHE_CHECK(whether the Boost::Iostreams library is available,
ac_cv_boost_iostreams,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
CPPFLAGS_SAVE=$CPPFLAGS
if test "x$IOSTREAMS_INCLUDE_DIR" != "x"; then
CPPFLAGS="-I$IOSTREAMS_INCLUDE_DIR $CPPFLAGS"
fi
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
#include <boost/iostreams/filtering_stream.hpp>
#include <boost/range/iterator_range.hpp>
]],
[[std::string input = "Hello World!";
namespace io = boost::iostreams;
io::filtering_istream in(boost::make_iterator_range(input));
return 0;
]]),
ac_cv_boost_iostreams=yes, ac_cv_boost_iostreams=no)
AC_LANG_RESTORE
CPPFLAGS="$CPPFLAGS_SAVE"
[
AC_ARG_WITH([boost-iostreams],
AS_HELP_STRING([--with-boost-iostreams@<:@=special-lib@:>@],
[use the IOStreams library from boost - it is possible to specify a certain library for the linker
e.g. --with-boost-iostreams=boost_iostreams-gcc-mt-d-1_33_1 ]),
[
if test "$withval" = "no"; then
want_boost="no"
elif test "$withval" = "yes"; then
want_boost="yes"
ax_boost_user_iostreams_lib=""
else
want_boost="yes"
ax_boost_user_iostreams_lib="$withval"
fi
],
[want_boost="yes"]
)
if test "x$want_boost" = "xyes"; then
AC_REQUIRE([AC_PROG_CC])
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
AC_CACHE_CHECK(whether the Boost::IOStreams library is available,
ax_cv_boost_iostreams,
[AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/iostreams/filtering_stream.hpp>
@%:@include <boost/range/iterator_range.hpp>
]],
[[std::string input = "Hello World!";
namespace io = boost::iostreams;
io::filtering_istream in(boost::make_iterator_range(input));
return 0;
]])],
ax_cv_boost_iostreams=yes, ax_cv_boost_iostreams=no)
AC_LANG_POP([C++])
])
if test "x$ax_cv_boost_iostreams" = "xyes"; then
AC_DEFINE(HAVE_BOOST_IOSTREAMS,,[define if the Boost::IOStreams library is available])
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
if test "x$ax_boost_user_iostreams_lib" = "x"; then
for libextension in `ls $BOOSTLIBDIR/libboost_iostreams*.so* $BOOSTLIBDIR/libboost_iostream*.dylib* $BOOSTLIBDIR/libboost_iostreams*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_iostreams.*\)\.so.*$;\1;' -e 's;^lib\(boost_iostream.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_iostreams.*\)\.a.*$;\1;'` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_IOSTREAMS_LIB="-l$ax_lib"; AC_SUBST(BOOST_IOSTREAMS_LIB) link_iostreams="yes"; break],
[link_iostreams="no"])
done
if test "x$link_iostreams" != "xyes"; then
for libextension in `ls $BOOSTLIBDIR/boost_iostreams*.dll* $BOOSTLIBDIR/boost_iostreams*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_iostreams.*\)\.dll.*$;\1;' -e 's;^\(boost_iostreams.*\)\.a.*$;\1;'` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_IOSTREAMS_LIB="-l$ax_lib"; AC_SUBST(BOOST_IOSTREAMS_LIB) link_iostreams="yes"; break],
[link_iostreams="no"])
done
fi
else
for ax_lib in $ax_boost_user_iostreams_lib boost_iostreams-$ax_boost_user_iostreams_lib; do
AC_CHECK_LIB($ax_lib, main,
[BOOST_IOSTREAMS_LIB="-l$ax_lib"; AC_SUBST(BOOST_IOSTREAMS_LIB) link_iostreams="yes"; break],
[link_iostreams="no"])
done
fi
if test "x$ax_lib" = "x"; then
AC_MSG_ERROR(Could not find a version of the library!)
fi
if test "x$link_iostreams" != "xyes"; then
AC_MSG_ERROR(Could not link against $ax_lib !)
fi
fi
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
fi
])
if test "$ac_cv_boost_iostreams" = "yes"; then
AC_DEFINE(HAVE_BOOST_IOSTREAMS,,[define if the Boost::Iostreams library is available])
ax_iostreams_lib=boost_iostreams
AC_ARG_WITH([boost-iostreams],AS_HELP_STRING([--with-boost-iostreams],[specify the boost iostreams library or suffix to use]),
[if test "x$with_boost_iostreams" != "xno"; then
ax_iostreams_lib=$with_boost_iostreams
ax_boost_iostreams_lib=boost_iostreams-$with_boost_iostreams
fi])
for ax_lib in $ax_iostreams_lib $ax_boost_iostreams_lib boost_iostreams boost_iostreams-mt boost_iostreams-mt-py2.5; do
AC_CHECK_LIB($ax_lib, exit, [BOOST_IOSTREAMS_LIB=$ax_lib break])
done
AC_SUBST(BOOST_IOSTREAMS_LIB)
fi
])dnl
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_boost_regex.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_BOOST_REGEX
#
# DESCRIPTION
#
# This macro checks to see if the Boost.Regex library is installed. It
# also attempts to guess the currect library name using several attempts.
# It tries to build the library name using a user supplied name or suffix
# and then just the raw library.
#
# If the library is found, HAVE_BOOST_REGEX is defined and
# BOOST_REGEX_LIB is set to the name of the library.
# Test for Regex library from the Boost C++ libraries. The macro requires
# a preceding call to AX_BOOST_BASE. Further documentation is available at
# <http://randspringer.de/boost/index.html>.
#
# This macro calls AC_SUBST(BOOST_REGEX_LIB).
# This macro calls:
#
# In order to ensure that the Regex headers are specified on the include
# path, this macro requires AX_REGEX to be called.
# AC_SUBST(BOOST_REGEX_LIB)
#
# LAST MODIFICATION
# And sets:
#
# 2008-04-12
# HAVE_BOOST_REGEX
#
# COPYLEFT
# LICENSE
#
# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
# Copyright (c) 2008 Michael Tindal
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Macro Archive. When you make and
# distribute a modified version of the Autoconf Macro, you may extend this
# special exception to the GPL to apply to your modified version as well.
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 22
AC_DEFUN([AX_BOOST_REGEX],
[AC_CACHE_CHECK(whether the Boost::Regex library is available,
ac_cv_boost_regex,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
CPPFLAGS_SAVE=$CPPFLAGS
if test "x$REGEX_INCLUDE_DIR" != "x"; then
CPPFLAGS="-I$REGEX_INCLUDE_DIR $CPPFLAGS"
fi
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
#include <boost/regex.hpp>
]],
[[boost::regex r(); return 0;]]),
ac_cv_boost_regex=yes, ac_cv_boost_regex=no)
AC_LANG_RESTORE
CPPFLAGS="$CPPFLAGS_SAVE"
[
AC_ARG_WITH([boost-regex],
AS_HELP_STRING([--with-boost-regex@<:@=special-lib@:>@],
[use the Regex library from boost - it is possible to specify a certain library for the linker
e.g. --with-boost-regex=boost_regex-gcc-mt-d-1_33_1 ]),
[
if test "$withval" = "no"; then
want_boost="no"
elif test "$withval" = "yes"; then
want_boost="yes"
ax_boost_user_regex_lib=""
else
want_boost="yes"
ax_boost_user_regex_lib="$withval"
fi
],
[want_boost="yes"]
)
if test "x$want_boost" = "xyes"; then
AC_REQUIRE([AC_PROG_CC])
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
AC_CACHE_CHECK(whether the Boost::Regex library is available,
ax_cv_boost_regex,
[AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/regex.hpp>
]],
[[boost::regex r(); return 0;]])],
ax_cv_boost_regex=yes, ax_cv_boost_regex=no)
AC_LANG_POP([C++])
])
if test "x$ax_cv_boost_regex" = "xyes"; then
AC_DEFINE(HAVE_BOOST_REGEX,,[define if the Boost::Regex library is available])
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
if test "x$ax_boost_user_regex_lib" = "x"; then
for libextension in `ls $BOOSTLIBDIR/libboost_regex*.so* $BOOSTLIBDIR/libboost_regex*.dylib* $BOOSTLIBDIR/libboost_regex*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_regex.*\)\.so.*$;\1;' -e 's;^lib\(boost_regex.*\)\.dylib.*;\1;' -e 's;^lib\(boost_regex.*\)\.a.*$;\1;'` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break],
[link_regex="no"])
done
if test "x$link_regex" != "xyes"; then
for libextension in `ls $BOOSTLIBDIR/boost_regex*.dll* $BOOSTLIBDIR/boost_regex*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_regex.*\)\.dll.*$;\1;' -e 's;^\(boost_regex.*\)\.a.*$;\1;'` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break],
[link_regex="no"])
done
fi
else
for ax_lib in $ax_boost_user_regex_lib boost_regex-$ax_boost_user_regex_lib; do
AC_CHECK_LIB($ax_lib, main,
[BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break],
[link_regex="no"])
done
fi
if test "x$ax_lib" = "x"; then
AC_MSG_ERROR(Could not find a version of the Boost::Regex library!)
fi
if test "x$link_regex" != "xyes"; then
AC_MSG_ERROR(Could not link against $ax_lib !)
fi
fi
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
fi
])
if test "$ac_cv_boost_regex" = "yes"; then
AC_DEFINE(HAVE_BOOST_REGEX,,[define if the Boost::Regex library is available])
ax_regex_lib=boost_regex
AC_ARG_WITH([boost-regex],AS_HELP_STRING([--with-boost-regex],[specify the boost regex library or suffix to use]),
[if test "x$with_boost_regex" != "xno"; then
ax_regex_lib=$with_boost_regex
ax_boost_regex_lib=boost_regex-$with_boost_regex
fi])
for ax_lib in $ax_regex_lib $ax_boost_regex_lib boost_regex boost_regex-mt boost_regex-mt-py2.5; do
AC_CHECK_LIB($ax_lib, exit, [BOOST_REGEX_LIB=$ax_lib break])
done
AC_SUBST(BOOST_REGEX_LIB)
fi
])dnl
......@@ -9,9 +9,9 @@
# DESCRIPTION
#
# Check for baseline language coverage in the compiler for the specified
# version of the C++ standard. If necessary, add switches to CXXFLAGS to
# enable support. VERSION may be '11' (for the C++11 standard) or '14'
# (for the C++14 standard).
# version of the C++ standard. If necessary, add switches to CXX and
# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard)
# or '14' (for the C++14 standard).
#
# The second argument, if specified, indicates whether you insist on an
# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
......@@ -39,7 +39,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 1
#serial 4
dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
dnl (serial version number 13).
......@@ -74,14 +74,17 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
$cachevar,
[ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $switch"
[ac_save_CXX="$CXX"
CXX="$CXX $switch"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
[eval $cachevar=yes],
[eval $cachevar=no])
CXXFLAGS="$ac_save_CXXFLAGS"])
CXX="$ac_save_CXX"])
if eval test x\$$cachevar = xyes; then
CXXFLAGS="$CXXFLAGS $switch"
CXX="$CXX $switch"
if test -n "$CXXCPP" ; then
CXXCPP="$CXXCPP $switch"
fi
ac_success=yes
break
fi
......@@ -97,14 +100,17 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
$cachevar,
[ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $switch"
[ac_save_CXX="$CXX"
CXX="$CXX $switch"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
[eval $cachevar=yes],
[eval $cachevar=no])
CXXFLAGS="$ac_save_CXXFLAGS"])
CXX="$ac_save_CXX"])
if eval test x\$$cachevar = xyes; then
CXXFLAGS="$CXXFLAGS $switch"
CXX="$CXX $switch"
if test -n "$CXXCPP" ; then
CXXCPP="$CXXCPP $switch"
fi
ac_success=yes
break
fi
......@@ -115,18 +121,16 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
if test x$ac_success = xno; then
AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.])
fi
fi
if test x$ac_success = xno; then
HAVE_CXX$1=0
AC_MSG_NOTICE([No compiler with C++$1 support was found])
else
if test x$ac_success = xno; then
HAVE_CXX$1=0
AC_MSG_NOTICE([No compiler with C++$1 support was found])
else
HAVE_CXX$1=1
AC_DEFINE(HAVE_CXX$1,1,
[define if the compiler supports basic C++$1 syntax])
fi