[gnote] Update boost.m4 to latest version from http://repo.or.cz/w/boost.m4.git



commit a0deb4db0a777564f3ff551b0e02e7f227340472
Author: Priit Laes <plaes plaes org>
Date:   Wed May 6 09:53:45 2009 +0300

    Update boost.m4 to latest version from http://repo.or.cz/w/boost.m4.git
    (Closes #581559)
    
    Signed-off-by: Hubert Figuiere <hub figuiere net>
---
 NEWS        |    1 +
 m4/boost.m4 |  361 ++++++++++++++++++++++++++++++++++++++++++-----------------
 2 files changed, 258 insertions(+), 104 deletions(-)

diff --git a/NEWS b/NEWS
index 812ecc4..103544d 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,7 @@ Fixes:
   * Add --{en,dis}able-applet to configure. (Closes #584158) 
     (Gilles Dartiguelongue)
   * Don't open the start note if it is an applet. (Closes #584583)
+  * Update boost.m4 to latest version. (Closes #581559) (Priit Laes)
 
 Translations:
 
diff --git a/m4/boost.m4 b/m4/boost.m4
index 551f263..c4ba5ec 100644
--- a/m4/boost.m4
+++ b/m4/boost.m4
@@ -1,11 +1,18 @@
 # boost.m4: Locate Boost headers and libraries for autoconf-based projects.
-# Copyright (C) 2007  Benoit Sigoure <tsuna lrde epita fr>
+# Copyright (C) 2007, 2008, 2009  Benoit Sigoure <tsuna lrde epita fr>
 #
 # 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 3 of the License, or
 # (at your option) any later version.
 #
+# Additional permission under section 7 of the GNU General Public
+# License, version 3 ("GPLv3"):
+#
+# If you convey this file as part of a work that contains a
+# configuration script generated by Autoconf, you may do so under
+# terms of your choice.
+#
 # 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
@@ -14,7 +21,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# serial 4
+# serial 10
 # Original sources can be found at http://repo.or.cz/w/boost.m4.git
 # You can fetch the latest version of the script by doing:
 #   wget 'http://repo.or.cz/w/boost.m4.git?a=blob_plain;f=build-aux/boost.m4;hb=HEAD' -O boost.m4
@@ -28,12 +35,36 @@
 # find the Boost headers of a given (optional) minimum version and it will
 # define BOOST_CPPFLAGS accordingly.  It will add an option --with-boost to
 # your configure so that users can specify non standard locations.
+# If the user's environment contains BOOST_ROOT and --with-boost was not
+# specified, --with-boost=$BOOST_ROOT is implicitly used.
 # For more README and documentation, go to http://repo.or.cz/w/boost.m4.git
-# Note: THESE MACRO ASSUME THAT YOU USE LIBTOOL.  If you don't, don't worry,
+# Note: THESE MACROS ASSUME THAT YOU USE LIBTOOL.  If you don't, don't worry,
 # simply read the README, it will show you what to do step by step.
 
 m4_pattern_forbid([^_?BOOST_])
 
+
+# _BOOST_SED_CPP(SED-PROGRAM, PROGRAM,
+#                [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# --------------------------------------------------------
+# Same as AC_EGREP_CPP, but leave the result in conftest.i.
+# PATTERN is *not* overquoted, as in AC_EGREP_CPP.  It could be useful
+# to turn this into a macro which extracts the value of any macro.
+m4_define([_BOOST_SED_CPP],
+[AC_LANG_PREPROC_REQUIRE()dnl
+AC_REQUIRE([AC_PROG_SED])dnl
+AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])])
+AS_IF([dnl eval is necessary to expand ac_cpp.
+dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
+(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
+  $SED -n -e "$1" >conftest.i 2>&1],
+  [$3],
+  [$4])dnl
+rm -f conftest*
+])# AC_EGREP_CPP
+
+
+
 # BOOST_REQUIRE([VERSION])
 # ------------------------
 # Look for Boost.  If version is given, it must either be a literal of the form
@@ -44,109 +75,101 @@ m4_pattern_forbid([^_?BOOST_])
 # FIXME: Add a 2nd optional argument so that it's not fatal if Boost isn't found
 # and add an AC_DEFINE to tell whether HAVE_BOOST.
 AC_DEFUN([BOOST_REQUIRE],
-[dnl First find out what kind of argument we have.
-dnl If we have an empty argument, there is no constraint on the version of
-dnl Boost to use.  If it's a literal version number, we can split it in M4 (so
-dnl the resulting configure script will be smaller/faster).  Otherwise we do
-dnl the splitting at runtime.
-m4_bmatch([$1],
-  [^ *$], [m4_pushdef([BOOST_VERSION_REQ], [])dnl
-           boost_version_major=0
-           boost_version_minor=0
-           boost_version_subminor=0
-],
-  [^[0-9]+\([-._][0-9]+\)*$],
-    [m4_pushdef([BOOST_VERSION_REQ], [ version >= $1])dnl
-     boost_version_major=m4_bregexp([$1], [^\([0-9]+\)], [\1])
-     boost_version_minor=m4_bregexp([$1], [^[0-9]+[-._]\([0-9]+\)], [\1])
-     boost_version_subminor=m4_bregexp([$1], [^[0-9]+[-._][0-9]+[-._]\([0-9]+\)], [\1])
-],
-  [^\$[a-zA-Z_]+$],
-    [m4_pushdef([BOOST_VERSION_REQ], [])dnl
-     boost_version_major=`expr "X$1" : 'X\([[^-._]]*\)'`
-     boost_version_minor=`expr "X$1" : 'X[[0-9]]*[[-._]]\([[^-._]]*\)'`
-     boost_version_subminor=`expr "X$1" : 'X[[0-9]]*[[-._]][[0-9]]*[[-._]]\([[0-9]]*\)'`
-     case $boost_version_major:$boost_version_minor in #(
-       *: | :* | *[[^0-9]]*:* | *:*[[^0-9]]*)
-         AC_MSG_ERROR([[Invalid argument for REQUIRE_BOOST: `$1']])
-         ;;
-     esac
-],
-  [m4_fatal(Invalid argument: `$1')]
-)dnl
+[boost_save_IFS=$IFS
+boost_version_req="$1"
+IFS=.
+set x $boost_version_req 0 0 0
+IFS=$boost_save_IFS
+shift
+boost_version_req=`expr "$[1]" '*' 100000 + "$[2]" '*' 100 + "$[3]"`
 AC_ARG_WITH([boost],
    [AS_HELP_STRING([--with-boost=DIR],
-                   [prefix of Boost]BOOST_VERSION_REQ[ @<:@guess@:>@])])dnl
+                   [prefix of Boost $1 @<:@guess@:>@])])dnl
+AC_ARG_VAR([BOOST_ROOT],[Location of Boost installation])dnl
+# If BOOST_ROOT is set and the user has not provided a value to
+# --with-boost, then treat BOOST_ROOT as if it the user supplied it.
+if test x"$BOOST_ROOT" != x; then
+  if test x"$with_boost" = x; then
+    AC_MSG_NOTICE([Detected BOOST_ROOT; continuing with --with-boost=$BOOST_ROOT])
+    with_boost=$BOOST_ROOT
+  else
+    AC_MSG_NOTICE([Detected BOOST_ROOT=$BOOST_ROOT, but overridden by --with-boost=$with_boost])
+  fi
+fi
 AC_SUBST([DISTCHECK_CONFIGURE_FLAGS],
          ["$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'"])
-  AC_CACHE_CHECK([for Boost headers[]BOOST_VERSION_REQ],
+boost_save_CPPFLAGS=$CPPFLAGS
+  AC_CACHE_CHECK([for Boost headers version >= $boost_version_req],
     [boost_cv_inc_path],
     [boost_cv_inc_path=no
 AC_LANG_PUSH([C++])dnl
-    boost_subminor_chk=
-    test x"$boost_version_subminor" != x \
-      && boost_subminor_chk="|| (B_V_MAJ == $boost_version_major \
-&& B_V_MIN == $boost_version_minor \
-&& B_V_SUB < $boost_version_subminor)"
-    for boost_inc in "$with_boost/include" '' \
-             /opt/local/include /usr/local/include /opt/include /usr/include \
-             "$with_boost" C:/Boost/include
-    do
-      test -e "$boost_inc" || continue
-      # Ensure that version.hpp exists: we're going to read it.  Moreover,
-      # Boost could be reachable thanks to the default include path so we can
-      # mistakenly accept a wrong include path without this check.
-      test -e "$boost_inc/boost/version.hpp" || continue
-      boost_save_CPPFLAGS=$CPPFLAGS
-      test x"$boost_inc" != x && CPPFLAGS="$CPPFLAGS -I$boost_inc"
 m4_pattern_allow([^BOOST_VERSION$])dnl
-      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <boost/version.hpp>
-#ifndef BOOST_VERSION
+    AC_LANG_CONFTEST([AC_LANG_PROGRAM([[#include <boost/version.hpp>
+#if !defined BOOST_VERSION
 # error BOOST_VERSION is not defined
+#elif BOOST_VERSION < $boost_version_req
+# error Boost headers version < $boost_version_req
 #endif
-#define B_V_MAJ (BOOST_VERSION / 100000)
-#define B_V_MIN (BOOST_VERSION / 100 % 1000)
-#define B_V_SUB (BOOST_VERSION % 100)
-#if (B_V_MAJ < $boost_version_major) \
-   || (B_V_MAJ == $boost_version_major \
-       && B_V_MIN < $boost_version_minor) $boost_subminor_chk
-# error Boost headers version < $1
-#endif
-]])], [boost_cv_inc_path=yes], [boost_cv_version=no])
-      CPPFLAGS=$boost_save_CPPFLAGS
+]])])
+    # If the user provided a value to --with-boost, use it and only it.
+    case $with_boost in #(
+      ''|yes) set x '' /opt/local/include /usr/local/include /opt/include \
+                 /usr/include C:/Boost/include;; #(
+      *)      set x "$with_boost/include" "$with_boost";;
+    esac
+    shift
+    for boost_dir
+    do
+    # Without --layout=system, Boost (or at least some versions) installs
+    # itself in <prefix>/include/boost-<version>.  This inner loop helps to
+    # find headers in such directories.
+    # I didn't indent this loop on purpose (to avoid over-indented code)
+    for boost_inc in "$boost_dir" "$boost_dir"/boost-*
+    do
+      test x"$boost_inc" != x && CPPFLAGS="$CPPFLAGS -I$boost_inc"
+      AC_COMPILE_IFELSE([], [boost_cv_inc_path=yes], [boost_cv_version=no])
       if test x"$boost_cv_inc_path" = xyes; then
         if test x"$boost_inc" != x; then
           boost_cv_inc_path=$boost_inc
         fi
-        break
+        break 2
       fi
     done
+    done
 AC_LANG_POP([C++])dnl
     ])
     case $boost_cv_inc_path in #(
-      no)
-        AC_MSG_ERROR([Could not find Boost headers[]BOOST_VERSION_REQ])
-        ;;#(
-      yes)
-        BOOST_CPPFLAGS=
-        ;;#(
-      *)
-        BOOST_CPPFLAGS="-I$boost_cv_inc_path"
-        ;;
+      no)   AC_MSG_ERROR([cannot find Boost headers version >= $boost_version_req]);;#(
+      yes)  BOOST_CPPFLAGS=;;#(
+      *)    AC_SUBST([BOOST_CPPFLAGS], ["-I$boost_cv_inc_path"]);;
     esac
-AC_SUBST([BOOST_CPPFLAGS])dnl
   AC_CACHE_CHECK([for Boost's header version],
     [boost_cv_lib_version],
     [m4_pattern_allow([^BOOST_LIB_VERSION$])dnl
-    boost_cv_lib_version=unknown
-    boost_sed_version='/^.*BOOST_LIB_VERSION.*"\([[^"]]*\)".*$/!d;s//\1/'
-    boost_version_hpp="$boost_inc/boost/version.hpp"
-    test -e "$boost_version_hpp" \
-      && boost_cv_lib_version=`sed "$boost_sed_version" "$boost_version_hpp"`
-    ])
-m4_popdef([BOOST_VERSION_REQ])dnl
+     _BOOST_SED_CPP([/^boost-lib-version = /{s///;s/\"//g;p;g;}],
+                    [#include <boost/version.hpp>
+boost-lib-version = BOOST_LIB_VERSION],
+    [boost_cv_lib_version=`cat conftest.i`])])
+    # e.g. "134" for 1_34_1 or "135" for 1_35
+    boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'`
+    case $boost_major_version in #(
+      '' | *[[!0-9]]*)
+        AC_MSG_ERROR([Invalid value: boost_major_version=$boost_major_version])
+        ;;
+    esac
+CPPFLAGS=$boost_save_CPPFLAGS
 ])# BOOST_REQUIRE
 
+# BOOST_STATIC()
+# --------------
+# Add the "--enable-static-boost" configure argument. If this argument is given
+# on the command line, static versions of the libraries will be looked up.
+AC_DEFUN([BOOST_STATIC],
+  [AC_ARG_ENABLE([static-boost],
+     [AC_HELP_STRING([--enable-static-boost],
+               [Prefer the static boost libraries over the shared ones [no]])],
+     [enable_static_boost=yes],
+     [enable_static_boost=no])])# BOOST_STATIC
 
 # BOOST_FIND_HEADER([HEADER-NAME], [ACTION-IF-NOT-FOUND], [ACTION-IF-FOUND])
 # --------------------------------------------------------------------------
@@ -173,11 +196,14 @@ AC_LANG_POP([C++])dnl
 ])# BOOST_FIND_HEADER
 
 
-# BOOST_FIND_LIB([LIB-NAME], [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST], [CXX-PROLOGUE])
+# BOOST_FIND_LIB([LIB-NAME], [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+#                [CXX-PROLOGUE])
 # -------------------------------------------------------------------------
 # Look for the Boost library LIB-NAME (e.g., LIB-NAME = `thread', for
 # libboost_thread).  Check that HEADER-NAME works and check that
-# libboost_LIB-NAME can link with the code CXX-TEST.
+# libboost_LIB-NAME can link with the code CXX-TEST.  The optional argument
+# CXX-PROLOGUE can be used to include some C++ code before the `main'
+# function.
 #
 # Invokes BOOST_FIND_HEADER([HEADER-NAME]) (see above).
 #
@@ -194,6 +220,7 @@ AC_LANG_POP([C++])dnl
 AC_DEFUN([BOOST_FIND_LIB],
 [AC_REQUIRE([_BOOST_FIND_COMPILER_TAG])dnl
 AC_REQUIRE([BOOST_REQUIRE])dnl
+AC_REQUIRE([BOOST_STATIC])dnl
 AC_REQUIRE([_BOOST_GUESS_WHETHER_TO_USE_MT])dnl
 AC_LANG_PUSH([C++])dnl
 AS_VAR_PUSHDEF([Boost_lib], [boost_cv_lib_$1])dnl
@@ -216,10 +243,18 @@ AC_CACHE_CHECK([for the Boost $1 library], [Boost_lib],
     mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X$2" : 'Xmt-*\(.*\)'`;; #(
     *) boost_mt=; boost_rtopt=$2;;
   esac
-  # If the PREFERRED-RT-OPT are not empty, prepend a `-'.
+  if test $enable_static_boost = yes; then
+    boost_rtopt="s$boost_rtopt"
+  fi
+  # Find the proper debug variant depending on what we've been asked to find.
   case $boost_rtopt in #(
-    *[[a-z0-9A-Z]]*) boost_rtopt="-$boost_rtopt";;
+    *d*) boost_rt_d=$boost_rtopt;; #(
+    *[[sgpn]]*) # Insert the `d' at the right place (in between `sg' and `pn')
+      boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #(
+    *) boost_rt_d='-d';;
   esac
+  # If the PREFERRED-RT-OPT are not empty, prepend a `-'.
+  test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt"
   $boost_guess_use_mt && boost_mt=-mt
   # Look for the abs path the static archive.
   # $libext is computed by Libtool but let's make sure it's non empty.
@@ -227,8 +262,8 @@ AC_CACHE_CHECK([for the Boost $1 library], [Boost_lib],
     AC_MSG_ERROR([the libext variable is empty, did you invoke Libtool?])
   boost_save_ac_objext=$ac_objext
   # Generate the test file.
-  AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <$3> 
-  $5], [$4])])
+  AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <$3>
+$5], [$4])])
 dnl Optimization hacks: compiling C++ is slow, especially with Boost.  What
 dnl we're trying to do here is guess the right combination of link flags
 dnl (LIBS / LDFLAGS) to use a given library.  This can take several
@@ -258,9 +293,8 @@ for boost_mt_ in $boost_mt -mt ''; do
 for boost_rtopt_ in $boost_rtopt '' -d; do
   for boost_lib in \
     boost_$1$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \
-    boost_$1$boost_tag_$boost_mt_$boost_ver_ \
     boost_$1$boost_tag_$boost_rtopt_$boost_ver_ \
-    boost_$1$boost_tag_$boost_mt_ \
+    boost_$1$boost_tag_$boost_mt_$boost_ver_ \
     boost_$1$boost_tag_$boost_ver_
   do
     # Avoid testing twice the same lib
@@ -332,6 +366,14 @@ AC_LANG_POP([C++])dnl
 # version of each library (among other things).
 
 
+# BOOST_ASIO()
+# ------------
+# Look for Boost.Asio (new in Boost 1.35).
+AC_DEFUN([BOOST_ASIO],
+[AC_REQUIRE([BOOST_SYSTEM])dnl
+BOOST_FIND_HEADER([boost/asio.hpp])])
+
+
 # BOOST_BIND()
 # ------------
 # Look for Boost.Bind
@@ -361,12 +403,26 @@ AC_DEFUN([BOOST_DATE_TIME],
 
 # BOOST_FILESYSTEM([PREFERRED-RT-OPT])
 # ------------------------------------
-# Look for Boost.Filesystem.  For the documentation of PREFERRED-RT-OPT, see the
-# documentation of BOOST_FIND_LIB above.
-# Do not check for boost/filesystem.hpp because this file was introduced in 1.34.
+# Look for Boost.Filesystem.  For the documentation of PREFERRED-RT-OPT, see
+# the documentation of BOOST_FIND_LIB above.
+# Do not check for boost/filesystem.hpp because this file was introduced in
+# 1.34.
 AC_DEFUN([BOOST_FILESYSTEM],
-[BOOST_FIND_LIB([filesystem], [$1],
+[# Do we have to check for Boost.System?  This link-time dependency was
+# added as of 1.35.0.  If we have a version <1.35, we must not attempt to
+# find Boost.System as it didn't exist by then.
+if test $boost_major_version -ge 135; then
+BOOST_SYSTEM([$1])
+fi # end of the Boost.System check.
+boost_filesystem_save_LIBS=$LIBS
+boost_filesystem_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([filesystem], [$1],
                 [boost/filesystem/path.hpp], [boost::filesystem::path p;])
+LIBS=$boost_filesystem_save_LIBS
+LDFLAGS=$boost_filesystem_save_LDFLAGS
 ])# BOOST_FILESYSTEM
 
 
@@ -423,6 +479,27 @@ AC_DEFUN([BOOST_HASH],
 [BOOST_FIND_HEADER([boost/functional/hash.hpp])])
 
 
+# BOOST_LAMBDA()
+# --------------
+# Look for Boost.Lambda
+AC_DEFUN([BOOST_LAMBDA],
+[BOOST_FIND_HEADER([boost/lambda/lambda.hpp])])
+
+
+# BOOST_OPTIONAL()
+# ----------------
+# Look for Boost.Optional
+AC_DEFUN([BOOST_OPTIONAL],
+[BOOST_FIND_HEADER([boost/optional.hpp])])
+
+
+# BOOST_PREPROCESSOR()
+# --------------------
+# Look for Boost.Preprocessor
+AC_DEFUN([BOOST_PREPROCESSOR],
+[BOOST_FIND_HEADER([boost/preprocessor/repeat.hpp])])
+
+
 # BOOST_PROGRAM_OPTIONS([PREFERRED-RT-OPT])
 # -----------------------------------------
 # Look for Boost.Program_options.  For the documentation of PREFERRED-RT-OPT, see
@@ -452,6 +529,18 @@ AC_DEFUN([BOOST_REGEX],
 ])# BOOST_REGEX
 
 
+# BOOST_SERIALIZATION([PREFERRED-RT-OPT])
+# ---------------------------------------
+# Look for Boost.Serialization.  For the documentation of PREFERRED-RT-OPT, see
+# the documentation of BOOST_FIND_LIB above.
+AC_DEFUN([BOOST_SERIALIZATION],
+[BOOST_FIND_LIB([serialization], [$1],
+                [boost/archive/text_oarchive.hpp],
+                [std::ostream* o = 0; // Cheap way to get an ostream...
+                boost::archive::text_oarchive t(*o);])
+])# BOOST_SIGNALS
+
+
 # BOOST_SIGNALS([PREFERRED-RT-OPT])
 # ---------------------------------
 # Look for Boost.Signals.  For the documentation of PREFERRED-RT-OPT, see the
@@ -472,6 +561,13 @@ BOOST_FIND_HEADER([boost/shared_ptr.hpp])
 ])
 
 
+# BOOST_STATICASSERT()
+# --------------------
+# Look for Boost.StaticAssert
+AC_DEFUN([BOOST_STATICASSERT],
+[BOOST_FIND_HEADER([boost/static_assert.hpp])])
+
+
 # BOOST_STRING_ALGO()
 # -------------------
 # Look for Boost.StringAlgo
@@ -480,6 +576,18 @@ AC_DEFUN([BOOST_STRING_ALGO],
 ])
 
 
+# BOOST_SYSTEM([PREFERRED-RT-OPT])
+# --------------------------------
+# Look for Boost.System.  For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.  This library was introduced in Boost
+# 1.35.0.
+AC_DEFUN([BOOST_SYSTEM],
+[BOOST_FIND_LIB([system], [$1],
+                [boost/system/error_code.hpp],
+                [boost::system::error_code e; e.clear();])
+])# BOOST_SYSTEM
+
+
 # BOOST_TEST([PREFERRED-RT-OPT])
 # ------------------------------
 # Look for Boost.Test.  For the documentation of PREFERRED-RT-OPT, see the
@@ -487,8 +595,10 @@ AC_DEFUN([BOOST_STRING_ALGO],
 AC_DEFUN([BOOST_TEST],
 [m4_pattern_allow([^BOOST_CHECK$])dnl
 BOOST_FIND_LIB([unit_test_framework], [$1],
-               [boost/test/unit_test.hpp], [BOOST_CHECK(2==2);],
-               [using boost::unit_test::test_suite; test_suite* init_unit_test_suite( int argc, char ** argv ) { return NULL;}])
+               [boost/test/unit_test.hpp], [BOOST_CHECK(2 == 2);],
+               [using boost::unit_test::test_suite;
+               test_suite* init_unit_test_suite(int argc, char ** argv)
+               { return NULL; }])
 ])# BOOST_TEST
 
 
@@ -543,6 +653,13 @@ AC_DEFUN([BOOST_TUPLE],
 [BOOST_FIND_HEADER([boost/tuple/tuple.hpp])])
 
 
+# BOOST_TYPETRAITS()
+# --------------------
+# Look for Boost.TypeTraits
+AC_DEFUN([BOOST_TYPETRAITS],
+[BOOST_FIND_HEADER([boost/type_traits.hpp])])
+
+
 # BOOST_UTILITY()
 # ---------------
 # Look for Boost.Utility (noncopyable, result_of, base-from-member idiom,
@@ -561,12 +678,33 @@ BOOST_FIND_HEADER([boost/variant.hpp])])
 
 # BOOST_WAVE([PREFERRED-RT-OPT])
 # ------------------------------
+# NOTE: If you intend to use Wave/Spirit with thread support, make sure you
+# call BOOST_THREADS first.
 # Look for Boost.Wave.  For the documentation of PREFERRED-RT-OPT, see the
 # documentation of BOOST_FIND_LIB above.
 AC_DEFUN([BOOST_WAVE],
-[BOOST_FIND_LIB([wave], [$1],
+[AC_REQUIRE([BOOST_FILESYSTEM])dnl
+AC_REQUIRE([BOOST_DATE_TIME])dnl
+boost_wave_save_LIBS=$LIBS
+boost_wave_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_((FILE)?SYSTEM|DATE_TIME|THREAD)_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_DATE_TIME_LIBS\
+$BOOST_THREAD_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS\
+$BOOST_DATE_TIME_LDFLAGS $BOOST_THREAD_LDFLAGS"
+BOOST_FIND_LIB([wave], [$1],
                 [boost/wave.hpp],
-                [boost::wave::token_id id; get_token_name(id);])])
+                [boost::wave::token_id id; get_token_name(id);])
+LIBS=$boost_wave_save_LIBS
+LDFLAGS=$boost_wave_save_LDFLAGS
+])# BOOST_WAVE
+
+
+# BOOST_XPRESSIVE()
+# -----------------
+# Look for Boost.Xpressive (new since 1.36.0).
+AC_DEFUN([BOOST_XPRESSIVE],
+[BOOST_FIND_HEADER([boost/xpressive/xpressive.hpp])])
 
 
 # ----------------- #
@@ -669,8 +807,9 @@ AC_CACHE_CHECK([for the toolset name used by Boost for $CXX], [boost_cv_lib_tag]
   #   como, edg, kcc, bck, mp, sw, tru, xlc
   # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines
   # the same defines as GCC's).
-  # TODO: Move the test on GCC 4.3 up once it's released.
+  # TODO: Move the test on GCC 4.4 up once it's released.
   for i in \
+    _BOOST_gcc_test(4, 3) \
     _BOOST_gcc_test(4, 2) \
     _BOOST_gcc_test(4, 1) \
     _BOOST_gcc_test(4, 0) \
@@ -688,7 +827,7 @@ AC_CACHE_CHECK([for the toolset name used by Boost for $CXX], [boost_cv_lib_tag]
     "defined __ICC && (defined __unix || defined __unix__) @ il" \
     "defined __ICL @ iw" \
     "defined _MSC_VER && _MSC_VER == 1300 @ vc7" \
-    _BOOST_gcc_test(4, 3) \
+    _BOOST_gcc_test(4, 4) \
     _BOOST_gcc_test(2, 95) \
     "defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \
     "defined _MSC_VER && _MSC_VER < 1300 && !defined UNDER_CE @ vc6" \
@@ -706,11 +845,21 @@ AC_CACHE_CHECK([for the toolset name used by Boost for $CXX], [boost_cv_lib_tag]
 ]])], [boost_cv_lib_tag=$boost_tag; break], [])
   done
 AC_LANG_POP([C++])dnl
-])
-  if test x"$boost_cv_lib_tag" = xunknown; then
-    AC_MSG_WARN([[could not figure out which toolset name to use for $CXX]])
-    boost_cv_lib_tag=
-  fi
+  case $boost_cv_lib_tag in #(
+    # Some newer (>= 1.35?) versions of Boost seem to only use "gcc" as opposed
+    # to "gcc41" for instance.
+    *-gcc | *'-gcc ') :;; #(  Don't re-add -gcc: it's already in there.
+    gcc*)
+      # We can specify multiple tags in this variable because it's used by
+      # BOOST_FIND_LIB that does a `for tag in -$boost_cv_lib_tag' ...
+      boost_cv_lib_tag="$boost_cv_lib_tag -gcc"
+      ;; #(
+    unknown)
+      AC_MSG_WARN([[could not figure out which toolset name to use for $CXX]])
+      boost_cv_lib_tag=
+      ;;
+  esac
+])dnl end of AC_CACHE_CHECK
 ])# _BOOST_FIND_COMPILER_TAG
 
 
@@ -765,3 +914,7 @@ dnl as it would interfere with the next link command.
 rm -f core conftest.err conftest_ipa8_conftest.oo \
       conftest$ac_exeext m4_ifval([$1], [conftest.$ac_ext])[]dnl
 ])# _BOOST_AC_LINK_IFELSE
+
+# Local Variables:
+# mode: autoconf
+# End:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]