|
Line 0
Link Here
|
|
|
1 |
From 31e5a0c83a4f4707e8dd401f2d4065cc094e1735 Mon Sep 17 00:00:00 2001 |
| 2 |
From: Priit Laes <plaes@plaes.org> |
| 3 |
Date: Wed, 6 May 2009 09:53:45 +0300 |
| 4 |
Subject: [PATCH 1/2] Update boost.m4 to latest version from http://repo.or.cz/w/boost.m4.git |
| 5 |
|
| 6 |
--- |
| 7 |
m4/boost.m4 | 361 ++++++++++++++++++++++++++++++++++++++++++----------------- |
| 8 |
1 files changed, 257 insertions(+), 104 deletions(-) |
| 9 |
|
| 10 |
diff --git a/m4/boost.m4 b/m4/boost.m4 |
| 11 |
index 551f263..c4ba5ec 100644 |
| 12 |
--- a/m4/boost.m4 |
| 13 |
+++ b/m4/boost.m4 |
| 14 |
@@ -1,11 +1,18 @@ |
| 15 |
# boost.m4: Locate Boost headers and libraries for autoconf-based projects. |
| 16 |
-# Copyright (C) 2007 Benoit Sigoure <tsuna@lrde.epita.fr> |
| 17 |
+# Copyright (C) 2007, 2008, 2009 Benoit Sigoure <tsuna@lrde.epita.fr> |
| 18 |
# |
| 19 |
# This program is free software: you can redistribute it and/or modify |
| 20 |
# it under the terms of the GNU General Public License as published by |
| 21 |
# the Free Software Foundation, either version 3 of the License, or |
| 22 |
# (at your option) any later version. |
| 23 |
# |
| 24 |
+# Additional permission under section 7 of the GNU General Public |
| 25 |
+# License, version 3 ("GPLv3"): |
| 26 |
+# |
| 27 |
+# If you convey this file as part of a work that contains a |
| 28 |
+# configuration script generated by Autoconf, you may do so under |
| 29 |
+# terms of your choice. |
| 30 |
+# |
| 31 |
# This program is distributed in the hope that it will be useful, |
| 32 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 33 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 34 |
@@ -14,7 +21,7 @@ |
| 35 |
# You should have received a copy of the GNU General Public License |
| 36 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 37 |
|
| 38 |
-# serial 4 |
| 39 |
+# serial 10 |
| 40 |
# Original sources can be found at http://repo.or.cz/w/boost.m4.git |
| 41 |
# You can fetch the latest version of the script by doing: |
| 42 |
# wget 'http://repo.or.cz/w/boost.m4.git?a=blob_plain;f=build-aux/boost.m4;hb=HEAD' -O boost.m4 |
| 43 |
@@ -28,12 +35,36 @@ |
| 44 |
# find the Boost headers of a given (optional) minimum version and it will |
| 45 |
# define BOOST_CPPFLAGS accordingly. It will add an option --with-boost to |
| 46 |
# your configure so that users can specify non standard locations. |
| 47 |
+# If the user's environment contains BOOST_ROOT and --with-boost was not |
| 48 |
+# specified, --with-boost=$BOOST_ROOT is implicitly used. |
| 49 |
# For more README and documentation, go to http://repo.or.cz/w/boost.m4.git |
| 50 |
-# Note: THESE MACRO ASSUME THAT YOU USE LIBTOOL. If you don't, don't worry, |
| 51 |
+# Note: THESE MACROS ASSUME THAT YOU USE LIBTOOL. If you don't, don't worry, |
| 52 |
# simply read the README, it will show you what to do step by step. |
| 53 |
|
| 54 |
m4_pattern_forbid([^_?BOOST_]) |
| 55 |
|
| 56 |
+ |
| 57 |
+# _BOOST_SED_CPP(SED-PROGRAM, PROGRAM, |
| 58 |
+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) |
| 59 |
+# -------------------------------------------------------- |
| 60 |
+# Same as AC_EGREP_CPP, but leave the result in conftest.i. |
| 61 |
+# PATTERN is *not* overquoted, as in AC_EGREP_CPP. It could be useful |
| 62 |
+# to turn this into a macro which extracts the value of any macro. |
| 63 |
+m4_define([_BOOST_SED_CPP], |
| 64 |
+[AC_LANG_PREPROC_REQUIRE()dnl |
| 65 |
+AC_REQUIRE([AC_PROG_SED])dnl |
| 66 |
+AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])]) |
| 67 |
+AS_IF([dnl eval is necessary to expand ac_cpp. |
| 68 |
+dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell. |
| 69 |
+(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | |
| 70 |
+ $SED -n -e "$1" >conftest.i 2>&1], |
| 71 |
+ [$3], |
| 72 |
+ [$4])dnl |
| 73 |
+rm -f conftest* |
| 74 |
+])# AC_EGREP_CPP |
| 75 |
+ |
| 76 |
+ |
| 77 |
+ |
| 78 |
# BOOST_REQUIRE([VERSION]) |
| 79 |
# ------------------------ |
| 80 |
# Look for Boost. If version is given, it must either be a literal of the form |
| 81 |
@@ -44,109 +75,101 @@ m4_pattern_forbid([^_?BOOST_]) |
| 82 |
# FIXME: Add a 2nd optional argument so that it's not fatal if Boost isn't found |
| 83 |
# and add an AC_DEFINE to tell whether HAVE_BOOST. |
| 84 |
AC_DEFUN([BOOST_REQUIRE], |
| 85 |
-[dnl First find out what kind of argument we have. |
| 86 |
-dnl If we have an empty argument, there is no constraint on the version of |
| 87 |
-dnl Boost to use. If it's a literal version number, we can split it in M4 (so |
| 88 |
-dnl the resulting configure script will be smaller/faster). Otherwise we do |
| 89 |
-dnl the splitting at runtime. |
| 90 |
-m4_bmatch([$1], |
| 91 |
- [^ *$], [m4_pushdef([BOOST_VERSION_REQ], [])dnl |
| 92 |
- boost_version_major=0 |
| 93 |
- boost_version_minor=0 |
| 94 |
- boost_version_subminor=0 |
| 95 |
-], |
| 96 |
- [^[0-9]+\([-._][0-9]+\)*$], |
| 97 |
- [m4_pushdef([BOOST_VERSION_REQ], [ version >= $1])dnl |
| 98 |
- boost_version_major=m4_bregexp([$1], [^\([0-9]+\)], [\1]) |
| 99 |
- boost_version_minor=m4_bregexp([$1], [^[0-9]+[-._]\([0-9]+\)], [\1]) |
| 100 |
- boost_version_subminor=m4_bregexp([$1], [^[0-9]+[-._][0-9]+[-._]\([0-9]+\)], [\1]) |
| 101 |
-], |
| 102 |
- [^\$[a-zA-Z_]+$], |
| 103 |
- [m4_pushdef([BOOST_VERSION_REQ], [])dnl |
| 104 |
- boost_version_major=`expr "X$1" : 'X\([[^-._]]*\)'` |
| 105 |
- boost_version_minor=`expr "X$1" : 'X[[0-9]]*[[-._]]\([[^-._]]*\)'` |
| 106 |
- boost_version_subminor=`expr "X$1" : 'X[[0-9]]*[[-._]][[0-9]]*[[-._]]\([[0-9]]*\)'` |
| 107 |
- case $boost_version_major:$boost_version_minor in #( |
| 108 |
- *: | :* | *[[^0-9]]*:* | *:*[[^0-9]]*) |
| 109 |
- AC_MSG_ERROR([[Invalid argument for REQUIRE_BOOST: `$1']]) |
| 110 |
- ;; |
| 111 |
- esac |
| 112 |
-], |
| 113 |
- [m4_fatal(Invalid argument: `$1')] |
| 114 |
-)dnl |
| 115 |
+[boost_save_IFS=$IFS |
| 116 |
+boost_version_req="$1" |
| 117 |
+IFS=. |
| 118 |
+set x $boost_version_req 0 0 0 |
| 119 |
+IFS=$boost_save_IFS |
| 120 |
+shift |
| 121 |
+boost_version_req=`expr "$[1]" '*' 100000 + "$[2]" '*' 100 + "$[3]"` |
| 122 |
AC_ARG_WITH([boost], |
| 123 |
[AS_HELP_STRING([--with-boost=DIR], |
| 124 |
- [prefix of Boost]BOOST_VERSION_REQ[ @<:@guess@:>@])])dnl |
| 125 |
+ [prefix of Boost $1 @<:@guess@:>@])])dnl |
| 126 |
+AC_ARG_VAR([BOOST_ROOT],[Location of Boost installation])dnl |
| 127 |
+# If BOOST_ROOT is set and the user has not provided a value to |
| 128 |
+# --with-boost, then treat BOOST_ROOT as if it the user supplied it. |
| 129 |
+if test x"$BOOST_ROOT" != x; then |
| 130 |
+ if test x"$with_boost" = x; then |
| 131 |
+ AC_MSG_NOTICE([Detected BOOST_ROOT; continuing with --with-boost=$BOOST_ROOT]) |
| 132 |
+ with_boost=$BOOST_ROOT |
| 133 |
+ else |
| 134 |
+ AC_MSG_NOTICE([Detected BOOST_ROOT=$BOOST_ROOT, but overridden by --with-boost=$with_boost]) |
| 135 |
+ fi |
| 136 |
+fi |
| 137 |
AC_SUBST([DISTCHECK_CONFIGURE_FLAGS], |
| 138 |
["$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'"]) |
| 139 |
- AC_CACHE_CHECK([for Boost headers[]BOOST_VERSION_REQ], |
| 140 |
+boost_save_CPPFLAGS=$CPPFLAGS |
| 141 |
+ AC_CACHE_CHECK([for Boost headers version >= $boost_version_req], |
| 142 |
[boost_cv_inc_path], |
| 143 |
[boost_cv_inc_path=no |
| 144 |
AC_LANG_PUSH([C++])dnl |
| 145 |
- boost_subminor_chk= |
| 146 |
- test x"$boost_version_subminor" != x \ |
| 147 |
- && boost_subminor_chk="|| (B_V_MAJ == $boost_version_major \ |
| 148 |
-&& B_V_MIN == $boost_version_minor \ |
| 149 |
-&& B_V_SUB < $boost_version_subminor)" |
| 150 |
- for boost_inc in "$with_boost/include" '' \ |
| 151 |
- /opt/local/include /usr/local/include /opt/include /usr/include \ |
| 152 |
- "$with_boost" C:/Boost/include |
| 153 |
- do |
| 154 |
- test -e "$boost_inc" || continue |
| 155 |
- # Ensure that version.hpp exists: we're going to read it. Moreover, |
| 156 |
- # Boost could be reachable thanks to the default include path so we can |
| 157 |
- # mistakenly accept a wrong include path without this check. |
| 158 |
- test -e "$boost_inc/boost/version.hpp" || continue |
| 159 |
- boost_save_CPPFLAGS=$CPPFLAGS |
| 160 |
- test x"$boost_inc" != x && CPPFLAGS="$CPPFLAGS -I$boost_inc" |
| 161 |
m4_pattern_allow([^BOOST_VERSION$])dnl |
| 162 |
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <boost/version.hpp> |
| 163 |
-#ifndef BOOST_VERSION |
| 164 |
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([[#include <boost/version.hpp> |
| 165 |
+#if !defined BOOST_VERSION |
| 166 |
# error BOOST_VERSION is not defined |
| 167 |
+#elif BOOST_VERSION < $boost_version_req |
| 168 |
+# error Boost headers version < $boost_version_req |
| 169 |
#endif |
| 170 |
-#define B_V_MAJ (BOOST_VERSION / 100000) |
| 171 |
-#define B_V_MIN (BOOST_VERSION / 100 % 1000) |
| 172 |
-#define B_V_SUB (BOOST_VERSION % 100) |
| 173 |
-#if (B_V_MAJ < $boost_version_major) \ |
| 174 |
- || (B_V_MAJ == $boost_version_major \ |
| 175 |
- && B_V_MIN < $boost_version_minor) $boost_subminor_chk |
| 176 |
-# error Boost headers version < $1 |
| 177 |
-#endif |
| 178 |
-]])], [boost_cv_inc_path=yes], [boost_cv_version=no]) |
| 179 |
- CPPFLAGS=$boost_save_CPPFLAGS |
| 180 |
+]])]) |
| 181 |
+ # If the user provided a value to --with-boost, use it and only it. |
| 182 |
+ case $with_boost in #( |
| 183 |
+ ''|yes) set x '' /opt/local/include /usr/local/include /opt/include \ |
| 184 |
+ /usr/include C:/Boost/include;; #( |
| 185 |
+ *) set x "$with_boost/include" "$with_boost";; |
| 186 |
+ esac |
| 187 |
+ shift |
| 188 |
+ for boost_dir |
| 189 |
+ do |
| 190 |
+ # Without --layout=system, Boost (or at least some versions) installs |
| 191 |
+ # itself in <prefix>/include/boost-<version>. This inner loop helps to |
| 192 |
+ # find headers in such directories. |
| 193 |
+ # I didn't indent this loop on purpose (to avoid over-indented code) |
| 194 |
+ for boost_inc in "$boost_dir" "$boost_dir"/boost-* |
| 195 |
+ do |
| 196 |
+ test x"$boost_inc" != x && CPPFLAGS="$CPPFLAGS -I$boost_inc" |
| 197 |
+ AC_COMPILE_IFELSE([], [boost_cv_inc_path=yes], [boost_cv_version=no]) |
| 198 |
if test x"$boost_cv_inc_path" = xyes; then |
| 199 |
if test x"$boost_inc" != x; then |
| 200 |
boost_cv_inc_path=$boost_inc |
| 201 |
fi |
| 202 |
- break |
| 203 |
+ break 2 |
| 204 |
fi |
| 205 |
done |
| 206 |
+ done |
| 207 |
AC_LANG_POP([C++])dnl |
| 208 |
]) |
| 209 |
case $boost_cv_inc_path in #( |
| 210 |
- no) |
| 211 |
- AC_MSG_ERROR([Could not find Boost headers[]BOOST_VERSION_REQ]) |
| 212 |
- ;;#( |
| 213 |
- yes) |
| 214 |
- BOOST_CPPFLAGS= |
| 215 |
- ;;#( |
| 216 |
- *) |
| 217 |
- BOOST_CPPFLAGS="-I$boost_cv_inc_path" |
| 218 |
- ;; |
| 219 |
+ no) AC_MSG_ERROR([cannot find Boost headers version >= $boost_version_req]);;#( |
| 220 |
+ yes) BOOST_CPPFLAGS=;;#( |
| 221 |
+ *) AC_SUBST([BOOST_CPPFLAGS], ["-I$boost_cv_inc_path"]);; |
| 222 |
esac |
| 223 |
-AC_SUBST([BOOST_CPPFLAGS])dnl |
| 224 |
AC_CACHE_CHECK([for Boost's header version], |
| 225 |
[boost_cv_lib_version], |
| 226 |
[m4_pattern_allow([^BOOST_LIB_VERSION$])dnl |
| 227 |
- boost_cv_lib_version=unknown |
| 228 |
- boost_sed_version='/^.*BOOST_LIB_VERSION.*"\([[^"]]*\)".*$/!d;s//\1/' |
| 229 |
- boost_version_hpp="$boost_inc/boost/version.hpp" |
| 230 |
- test -e "$boost_version_hpp" \ |
| 231 |
- && boost_cv_lib_version=`sed "$boost_sed_version" "$boost_version_hpp"` |
| 232 |
- ]) |
| 233 |
-m4_popdef([BOOST_VERSION_REQ])dnl |
| 234 |
+ _BOOST_SED_CPP([/^boost-lib-version = /{s///;s/\"//g;p;g;}], |
| 235 |
+ [#include <boost/version.hpp> |
| 236 |
+boost-lib-version = BOOST_LIB_VERSION], |
| 237 |
+ [boost_cv_lib_version=`cat conftest.i`])]) |
| 238 |
+ # e.g. "134" for 1_34_1 or "135" for 1_35 |
| 239 |
+ boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'` |
| 240 |
+ case $boost_major_version in #( |
| 241 |
+ '' | *[[!0-9]]*) |
| 242 |
+ AC_MSG_ERROR([Invalid value: boost_major_version=$boost_major_version]) |
| 243 |
+ ;; |
| 244 |
+ esac |
| 245 |
+CPPFLAGS=$boost_save_CPPFLAGS |
| 246 |
])# BOOST_REQUIRE |
| 247 |
|
| 248 |
+# BOOST_STATIC() |
| 249 |
+# -------------- |
| 250 |
+# Add the "--enable-static-boost" configure argument. If this argument is given |
| 251 |
+# on the command line, static versions of the libraries will be looked up. |
| 252 |
+AC_DEFUN([BOOST_STATIC], |
| 253 |
+ [AC_ARG_ENABLE([static-boost], |
| 254 |
+ [AC_HELP_STRING([--enable-static-boost], |
| 255 |
+ [Prefer the static boost libraries over the shared ones [no]])], |
| 256 |
+ [enable_static_boost=yes], |
| 257 |
+ [enable_static_boost=no])])# BOOST_STATIC |
| 258 |
|
| 259 |
# BOOST_FIND_HEADER([HEADER-NAME], [ACTION-IF-NOT-FOUND], [ACTION-IF-FOUND]) |
| 260 |
# -------------------------------------------------------------------------- |
| 261 |
@@ -173,11 +196,14 @@ AC_LANG_POP([C++])dnl |
| 262 |
])# BOOST_FIND_HEADER |
| 263 |
|
| 264 |
|
| 265 |
-# BOOST_FIND_LIB([LIB-NAME], [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST], [CXX-PROLOGUE]) |
| 266 |
+# BOOST_FIND_LIB([LIB-NAME], [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST], |
| 267 |
+# [CXX-PROLOGUE]) |
| 268 |
# ------------------------------------------------------------------------- |
| 269 |
# Look for the Boost library LIB-NAME (e.g., LIB-NAME = `thread', for |
| 270 |
# libboost_thread). Check that HEADER-NAME works and check that |
| 271 |
-# libboost_LIB-NAME can link with the code CXX-TEST. |
| 272 |
+# libboost_LIB-NAME can link with the code CXX-TEST. The optional argument |
| 273 |
+# CXX-PROLOGUE can be used to include some C++ code before the `main' |
| 274 |
+# function. |
| 275 |
# |
| 276 |
# Invokes BOOST_FIND_HEADER([HEADER-NAME]) (see above). |
| 277 |
# |
| 278 |
@@ -194,6 +220,7 @@ AC_LANG_POP([C++])dnl |
| 279 |
AC_DEFUN([BOOST_FIND_LIB], |
| 280 |
[AC_REQUIRE([_BOOST_FIND_COMPILER_TAG])dnl |
| 281 |
AC_REQUIRE([BOOST_REQUIRE])dnl |
| 282 |
+AC_REQUIRE([BOOST_STATIC])dnl |
| 283 |
AC_REQUIRE([_BOOST_GUESS_WHETHER_TO_USE_MT])dnl |
| 284 |
AC_LANG_PUSH([C++])dnl |
| 285 |
AS_VAR_PUSHDEF([Boost_lib], [boost_cv_lib_$1])dnl |
| 286 |
@@ -216,10 +243,18 @@ AC_CACHE_CHECK([for the Boost $1 library], [Boost_lib], |
| 287 |
mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X$2" : 'Xmt-*\(.*\)'`;; #( |
| 288 |
*) boost_mt=; boost_rtopt=$2;; |
| 289 |
esac |
| 290 |
- # If the PREFERRED-RT-OPT are not empty, prepend a `-'. |
| 291 |
+ if test $enable_static_boost = yes; then |
| 292 |
+ boost_rtopt="s$boost_rtopt" |
| 293 |
+ fi |
| 294 |
+ # Find the proper debug variant depending on what we've been asked to find. |
| 295 |
case $boost_rtopt in #( |
| 296 |
- *[[a-z0-9A-Z]]*) boost_rtopt="-$boost_rtopt";; |
| 297 |
+ *d*) boost_rt_d=$boost_rtopt;; #( |
| 298 |
+ *[[sgpn]]*) # Insert the `d' at the right place (in between `sg' and `pn') |
| 299 |
+ boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #( |
| 300 |
+ *) boost_rt_d='-d';; |
| 301 |
esac |
| 302 |
+ # If the PREFERRED-RT-OPT are not empty, prepend a `-'. |
| 303 |
+ test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt" |
| 304 |
$boost_guess_use_mt && boost_mt=-mt |
| 305 |
# Look for the abs path the static archive. |
| 306 |
# $libext is computed by Libtool but let's make sure it's non empty. |
| 307 |
@@ -227,8 +262,8 @@ AC_CACHE_CHECK([for the Boost $1 library], [Boost_lib], |
| 308 |
AC_MSG_ERROR([the libext variable is empty, did you invoke Libtool?]) |
| 309 |
boost_save_ac_objext=$ac_objext |
| 310 |
# Generate the test file. |
| 311 |
- AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <$3> |
| 312 |
- $5], [$4])]) |
| 313 |
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <$3> |
| 314 |
+$5], [$4])]) |
| 315 |
dnl Optimization hacks: compiling C++ is slow, especially with Boost. What |
| 316 |
dnl we're trying to do here is guess the right combination of link flags |
| 317 |
dnl (LIBS / LDFLAGS) to use a given library. This can take several |
| 318 |
@@ -258,9 +293,8 @@ for boost_mt_ in $boost_mt -mt ''; do |
| 319 |
for boost_rtopt_ in $boost_rtopt '' -d; do |
| 320 |
for boost_lib in \ |
| 321 |
boost_$1$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ |
| 322 |
- boost_$1$boost_tag_$boost_mt_$boost_ver_ \ |
| 323 |
boost_$1$boost_tag_$boost_rtopt_$boost_ver_ \ |
| 324 |
- boost_$1$boost_tag_$boost_mt_ \ |
| 325 |
+ boost_$1$boost_tag_$boost_mt_$boost_ver_ \ |
| 326 |
boost_$1$boost_tag_$boost_ver_ |
| 327 |
do |
| 328 |
# Avoid testing twice the same lib |
| 329 |
@@ -332,6 +366,14 @@ AC_LANG_POP([C++])dnl |
| 330 |
# version of each library (among other things). |
| 331 |
|
| 332 |
|
| 333 |
+# BOOST_ASIO() |
| 334 |
+# ------------ |
| 335 |
+# Look for Boost.Asio (new in Boost 1.35). |
| 336 |
+AC_DEFUN([BOOST_ASIO], |
| 337 |
+[AC_REQUIRE([BOOST_SYSTEM])dnl |
| 338 |
+BOOST_FIND_HEADER([boost/asio.hpp])]) |
| 339 |
+ |
| 340 |
+ |
| 341 |
# BOOST_BIND() |
| 342 |
# ------------ |
| 343 |
# Look for Boost.Bind |
| 344 |
@@ -361,12 +403,26 @@ AC_DEFUN([BOOST_DATE_TIME], |
| 345 |
|
| 346 |
# BOOST_FILESYSTEM([PREFERRED-RT-OPT]) |
| 347 |
# ------------------------------------ |
| 348 |
-# Look for Boost.Filesystem. For the documentation of PREFERRED-RT-OPT, see the |
| 349 |
-# documentation of BOOST_FIND_LIB above. |
| 350 |
-# Do not check for boost/filesystem.hpp because this file was introduced in 1.34. |
| 351 |
+# Look for Boost.Filesystem. For the documentation of PREFERRED-RT-OPT, see |
| 352 |
+# the documentation of BOOST_FIND_LIB above. |
| 353 |
+# Do not check for boost/filesystem.hpp because this file was introduced in |
| 354 |
+# 1.34. |
| 355 |
AC_DEFUN([BOOST_FILESYSTEM], |
| 356 |
-[BOOST_FIND_LIB([filesystem], [$1], |
| 357 |
+[# Do we have to check for Boost.System? This link-time dependency was |
| 358 |
+# added as of 1.35.0. If we have a version <1.35, we must not attempt to |
| 359 |
+# find Boost.System as it didn't exist by then. |
| 360 |
+if test $boost_major_version -ge 135; then |
| 361 |
+BOOST_SYSTEM([$1]) |
| 362 |
+fi # end of the Boost.System check. |
| 363 |
+boost_filesystem_save_LIBS=$LIBS |
| 364 |
+boost_filesystem_save_LDFLAGS=$LDFLAGS |
| 365 |
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl |
| 366 |
+LIBS="$LIBS $BOOST_SYSTEM_LIBS" |
| 367 |
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS" |
| 368 |
+BOOST_FIND_LIB([filesystem], [$1], |
| 369 |
[boost/filesystem/path.hpp], [boost::filesystem::path p;]) |
| 370 |
+LIBS=$boost_filesystem_save_LIBS |
| 371 |
+LDFLAGS=$boost_filesystem_save_LDFLAGS |
| 372 |
])# BOOST_FILESYSTEM |
| 373 |
|
| 374 |
|
| 375 |
@@ -423,6 +479,27 @@ AC_DEFUN([BOOST_HASH], |
| 376 |
[BOOST_FIND_HEADER([boost/functional/hash.hpp])]) |
| 377 |
|
| 378 |
|
| 379 |
+# BOOST_LAMBDA() |
| 380 |
+# -------------- |
| 381 |
+# Look for Boost.Lambda |
| 382 |
+AC_DEFUN([BOOST_LAMBDA], |
| 383 |
+[BOOST_FIND_HEADER([boost/lambda/lambda.hpp])]) |
| 384 |
+ |
| 385 |
+ |
| 386 |
+# BOOST_OPTIONAL() |
| 387 |
+# ---------------- |
| 388 |
+# Look for Boost.Optional |
| 389 |
+AC_DEFUN([BOOST_OPTIONAL], |
| 390 |
+[BOOST_FIND_HEADER([boost/optional.hpp])]) |
| 391 |
+ |
| 392 |
+ |
| 393 |
+# BOOST_PREPROCESSOR() |
| 394 |
+# -------------------- |
| 395 |
+# Look for Boost.Preprocessor |
| 396 |
+AC_DEFUN([BOOST_PREPROCESSOR], |
| 397 |
+[BOOST_FIND_HEADER([boost/preprocessor/repeat.hpp])]) |
| 398 |
+ |
| 399 |
+ |
| 400 |
# BOOST_PROGRAM_OPTIONS([PREFERRED-RT-OPT]) |
| 401 |
# ----------------------------------------- |
| 402 |
# Look for Boost.Program_options. For the documentation of PREFERRED-RT-OPT, see |
| 403 |
@@ -452,6 +529,18 @@ AC_DEFUN([BOOST_REGEX], |
| 404 |
])# BOOST_REGEX |
| 405 |
|
| 406 |
|
| 407 |
+# BOOST_SERIALIZATION([PREFERRED-RT-OPT]) |
| 408 |
+# --------------------------------------- |
| 409 |
+# Look for Boost.Serialization. For the documentation of PREFERRED-RT-OPT, see |
| 410 |
+# the documentation of BOOST_FIND_LIB above. |
| 411 |
+AC_DEFUN([BOOST_SERIALIZATION], |
| 412 |
+[BOOST_FIND_LIB([serialization], [$1], |
| 413 |
+ [boost/archive/text_oarchive.hpp], |
| 414 |
+ [std::ostream* o = 0; // Cheap way to get an ostream... |
| 415 |
+ boost::archive::text_oarchive t(*o);]) |
| 416 |
+])# BOOST_SIGNALS |
| 417 |
+ |
| 418 |
+ |
| 419 |
# BOOST_SIGNALS([PREFERRED-RT-OPT]) |
| 420 |
# --------------------------------- |
| 421 |
# Look for Boost.Signals. For the documentation of PREFERRED-RT-OPT, see the |
| 422 |
@@ -472,6 +561,13 @@ BOOST_FIND_HEADER([boost/shared_ptr.hpp]) |
| 423 |
]) |
| 424 |
|
| 425 |
|
| 426 |
+# BOOST_STATICASSERT() |
| 427 |
+# -------------------- |
| 428 |
+# Look for Boost.StaticAssert |
| 429 |
+AC_DEFUN([BOOST_STATICASSERT], |
| 430 |
+[BOOST_FIND_HEADER([boost/static_assert.hpp])]) |
| 431 |
+ |
| 432 |
+ |
| 433 |
# BOOST_STRING_ALGO() |
| 434 |
# ------------------- |
| 435 |
# Look for Boost.StringAlgo |
| 436 |
@@ -480,6 +576,18 @@ AC_DEFUN([BOOST_STRING_ALGO], |
| 437 |
]) |
| 438 |
|
| 439 |
|
| 440 |
+# BOOST_SYSTEM([PREFERRED-RT-OPT]) |
| 441 |
+# -------------------------------- |
| 442 |
+# Look for Boost.System. For the documentation of PREFERRED-RT-OPT, see the |
| 443 |
+# documentation of BOOST_FIND_LIB above. This library was introduced in Boost |
| 444 |
+# 1.35.0. |
| 445 |
+AC_DEFUN([BOOST_SYSTEM], |
| 446 |
+[BOOST_FIND_LIB([system], [$1], |
| 447 |
+ [boost/system/error_code.hpp], |
| 448 |
+ [boost::system::error_code e; e.clear();]) |
| 449 |
+])# BOOST_SYSTEM |
| 450 |
+ |
| 451 |
+ |
| 452 |
# BOOST_TEST([PREFERRED-RT-OPT]) |
| 453 |
# ------------------------------ |
| 454 |
# Look for Boost.Test. For the documentation of PREFERRED-RT-OPT, see the |
| 455 |
@@ -487,8 +595,10 @@ AC_DEFUN([BOOST_STRING_ALGO], |
| 456 |
AC_DEFUN([BOOST_TEST], |
| 457 |
[m4_pattern_allow([^BOOST_CHECK$])dnl |
| 458 |
BOOST_FIND_LIB([unit_test_framework], [$1], |
| 459 |
- [boost/test/unit_test.hpp], [BOOST_CHECK(2==2);], |
| 460 |
- [using boost::unit_test::test_suite; test_suite* init_unit_test_suite( int argc, char ** argv ) { return NULL;}]) |
| 461 |
+ [boost/test/unit_test.hpp], [BOOST_CHECK(2 == 2);], |
| 462 |
+ [using boost::unit_test::test_suite; |
| 463 |
+ test_suite* init_unit_test_suite(int argc, char ** argv) |
| 464 |
+ { return NULL; }]) |
| 465 |
])# BOOST_TEST |
| 466 |
|
| 467 |
|
| 468 |
@@ -543,6 +653,13 @@ AC_DEFUN([BOOST_TUPLE], |
| 469 |
[BOOST_FIND_HEADER([boost/tuple/tuple.hpp])]) |
| 470 |
|
| 471 |
|
| 472 |
+# BOOST_TYPETRAITS() |
| 473 |
+# -------------------- |
| 474 |
+# Look for Boost.TypeTraits |
| 475 |
+AC_DEFUN([BOOST_TYPETRAITS], |
| 476 |
+[BOOST_FIND_HEADER([boost/type_traits.hpp])]) |
| 477 |
+ |
| 478 |
+ |
| 479 |
# BOOST_UTILITY() |
| 480 |
# --------------- |
| 481 |
# Look for Boost.Utility (noncopyable, result_of, base-from-member idiom, |
| 482 |
@@ -561,12 +678,33 @@ BOOST_FIND_HEADER([boost/variant.hpp])]) |
| 483 |
|
| 484 |
# BOOST_WAVE([PREFERRED-RT-OPT]) |
| 485 |
# ------------------------------ |
| 486 |
+# NOTE: If you intend to use Wave/Spirit with thread support, make sure you |
| 487 |
+# call BOOST_THREADS first. |
| 488 |
# Look for Boost.Wave. For the documentation of PREFERRED-RT-OPT, see the |
| 489 |
# documentation of BOOST_FIND_LIB above. |
| 490 |
AC_DEFUN([BOOST_WAVE], |
| 491 |
-[BOOST_FIND_LIB([wave], [$1], |
| 492 |
+[AC_REQUIRE([BOOST_FILESYSTEM])dnl |
| 493 |
+AC_REQUIRE([BOOST_DATE_TIME])dnl |
| 494 |
+boost_wave_save_LIBS=$LIBS |
| 495 |
+boost_wave_save_LDFLAGS=$LDFLAGS |
| 496 |
+m4_pattern_allow([^BOOST_((FILE)?SYSTEM|DATE_TIME|THREAD)_(LIBS|LDFLAGS)$])dnl |
| 497 |
+LIBS="$LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_DATE_TIME_LIBS\ |
| 498 |
+$BOOST_THREAD_LIBS" |
| 499 |
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS\ |
| 500 |
+$BOOST_DATE_TIME_LDFLAGS $BOOST_THREAD_LDFLAGS" |
| 501 |
+BOOST_FIND_LIB([wave], [$1], |
| 502 |
[boost/wave.hpp], |
| 503 |
- [boost::wave::token_id id; get_token_name(id);])]) |
| 504 |
+ [boost::wave::token_id id; get_token_name(id);]) |
| 505 |
+LIBS=$boost_wave_save_LIBS |
| 506 |
+LDFLAGS=$boost_wave_save_LDFLAGS |
| 507 |
+])# BOOST_WAVE |
| 508 |
+ |
| 509 |
+ |
| 510 |
+# BOOST_XPRESSIVE() |
| 511 |
+# ----------------- |
| 512 |
+# Look for Boost.Xpressive (new since 1.36.0). |
| 513 |
+AC_DEFUN([BOOST_XPRESSIVE], |
| 514 |
+[BOOST_FIND_HEADER([boost/xpressive/xpressive.hpp])]) |
| 515 |
|
| 516 |
|
| 517 |
# ----------------- # |
| 518 |
@@ -669,8 +807,9 @@ AC_CACHE_CHECK([for the toolset name used by Boost for $CXX], [boost_cv_lib_tag] |
| 519 |
# como, edg, kcc, bck, mp, sw, tru, xlc |
| 520 |
# I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines |
| 521 |
# the same defines as GCC's). |
| 522 |
- # TODO: Move the test on GCC 4.3 up once it's released. |
| 523 |
+ # TODO: Move the test on GCC 4.4 up once it's released. |
| 524 |
for i in \ |
| 525 |
+ _BOOST_gcc_test(4, 3) \ |
| 526 |
_BOOST_gcc_test(4, 2) \ |
| 527 |
_BOOST_gcc_test(4, 1) \ |
| 528 |
_BOOST_gcc_test(4, 0) \ |
| 529 |
@@ -688,7 +827,7 @@ AC_CACHE_CHECK([for the toolset name used by Boost for $CXX], [boost_cv_lib_tag] |
| 530 |
"defined __ICC && (defined __unix || defined __unix__) @ il" \ |
| 531 |
"defined __ICL @ iw" \ |
| 532 |
"defined _MSC_VER && _MSC_VER == 1300 @ vc7" \ |
| 533 |
- _BOOST_gcc_test(4, 3) \ |
| 534 |
+ _BOOST_gcc_test(4, 4) \ |
| 535 |
_BOOST_gcc_test(2, 95) \ |
| 536 |
"defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \ |
| 537 |
"defined _MSC_VER && _MSC_VER < 1300 && !defined UNDER_CE @ vc6" \ |
| 538 |
@@ -706,11 +845,21 @@ AC_CACHE_CHECK([for the toolset name used by Boost for $CXX], [boost_cv_lib_tag] |
| 539 |
]])], [boost_cv_lib_tag=$boost_tag; break], []) |
| 540 |
done |
| 541 |
AC_LANG_POP([C++])dnl |
| 542 |
-]) |
| 543 |
- if test x"$boost_cv_lib_tag" = xunknown; then |
| 544 |
- AC_MSG_WARN([[could not figure out which toolset name to use for $CXX]]) |
| 545 |
- boost_cv_lib_tag= |
| 546 |
- fi |
| 547 |
+ case $boost_cv_lib_tag in #( |
| 548 |
+ # Some newer (>= 1.35?) versions of Boost seem to only use "gcc" as opposed |
| 549 |
+ # to "gcc41" for instance. |
| 550 |
+ *-gcc | *'-gcc ') :;; #( Don't re-add -gcc: it's already in there. |
| 551 |
+ gcc*) |
| 552 |
+ # We can specify multiple tags in this variable because it's used by |
| 553 |
+ # BOOST_FIND_LIB that does a `for tag in -$boost_cv_lib_tag' ... |
| 554 |
+ boost_cv_lib_tag="$boost_cv_lib_tag -gcc" |
| 555 |
+ ;; #( |
| 556 |
+ unknown) |
| 557 |
+ AC_MSG_WARN([[could not figure out which toolset name to use for $CXX]]) |
| 558 |
+ boost_cv_lib_tag= |
| 559 |
+ ;; |
| 560 |
+ esac |
| 561 |
+])dnl end of AC_CACHE_CHECK |
| 562 |
])# _BOOST_FIND_COMPILER_TAG |
| 563 |
|
| 564 |
|
| 565 |
@@ -765,3 +914,7 @@ dnl as it would interfere with the next link command. |
| 566 |
rm -f core conftest.err conftest_ipa8_conftest.oo \ |
| 567 |
conftest$ac_exeext m4_ifval([$1], [conftest.$ac_ext])[]dnl |
| 568 |
])# _BOOST_AC_LINK_IFELSE |
| 569 |
+ |
| 570 |
+# Local Variables: |
| 571 |
+# mode: autoconf |
| 572 |
+# End: |
| 573 |
-- |
| 574 |
1.6.2.5 |
| 575 |
|