1 The version of boost.m4 initially included in cc-tool has an issue
2 with gcc5 (one of its tests fails due to the first change described in [1]
3 "Preprocessor issues").
5 This was fixed upstream (boost.m4 project) in Nov 2014 [2].
7 We add the latest commit [3] of upstream boost.m4 plus a patch from github PR
8 [4] to add detection for gcc 5.1.
11 https://gcc.gnu.org/gcc-5/porting_to.html
14 https://github.com/tsuna/boost.m4/commit/32553aaf4d5090da19aa0ec33b936982c685009f
17 https://github.com/tsuna/boost.m4/commit/d9ff75b6af66360d76f46f469a26ab18e24e1030
20 https://github.com/rubenk/boost.m4/commit/b879eb85f112cf054643d2e7f9544c230299c0b2
22 Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
24 diff -purN cc-tool.original/m4/boost.m4 cc-tool/m4/boost.m4
25 --- cc-tool.original/m4/boost.m4 2015-07-28 15:43:25.458840000 +0200
26 +++ cc-tool/m4/boost.m4 2015-07-28 16:12:02.532791424 +0200
28 # boost.m4: Locate Boost headers and libraries for autoconf-based projects.
29 -# Copyright (C) 2007, 2008, 2009, 2010, 2011 Benoit Sigoure <tsuna@lrde.epita.fr>
30 +# Copyright (C) 2007-2011, 2014 Benoit Sigoure <tsuna@lrde.epita.fr>
32 # This program is free software: you can redistribute it and/or modify
33 # it under the terms of the GNU General Public License as published by
35 # along with this program. If not, see <http://www.gnu.org/licenses/>.
37 m4_define([_BOOST_SERIAL], [m4_translit([
43 @@ -59,7 +59,8 @@ m4_pattern_forbid([^_?(BOOST|Boost)_])
44 # It could be useful to turn this into a macro which extracts the
46 m4_define([_BOOST_SED_CPP],
47 -[AC_LANG_PREPROC_REQUIRE()dnl
48 +[AC_LANG_PUSH([C++])dnl
49 +AC_LANG_PREPROC_REQUIRE()dnl
50 AC_REQUIRE([AC_PROG_SED])dnl
51 AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])])
52 AS_IF([dnl eval is necessary to expand ac_cpp.
53 @@ -71,13 +72,31 @@ dnl strip `\n' with backquotes, not the
54 dnl boost_cv_lib_version='1_37\r' for instance, which breaks
56 dnl Cannot use 'dnl' after [$4] because a trailing dnl may break AC_CACHE_CHECK
58 +dnl Beware that GCC 5, when expanding macros, may embed # line directives
59 +dnl a within single line:
61 +dnl # 1 "conftest.cc"
63 +dnl # 1 "<command-line>"
64 +dnl # 1 "conftest.cc"
65 +dnl # 1 "/opt/local/include/boost/version.hpp" 1 3
66 +dnl # 2 "conftest.cc" 2
67 +dnl boost-lib-version =
68 +dnl # 2 "conftest.cc" 3
71 +dnl So get rid of the # lines, and glue the remaining ones together.
72 (eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
76 $SED -n -e "$1" >conftest.i 2>&1],
81 +AC_LANG_POP([C++])dnl
86 @@ -206,7 +225,7 @@ AC_LANG_POP([C++])dnl
87 AC_CACHE_CHECK([for Boost's header version],
88 [boost_cv_lib_version],
89 [m4_pattern_allow([^BOOST_LIB_VERSION$])dnl
90 - _BOOST_SED_CPP([/^boost-lib-version = /{s///;s/\"//g;p;q;}],
91 + _BOOST_SED_CPP([[/^boost-lib-version = /{s///;s/[\" ]//g;p;q;}]],
92 [#include <boost/version.hpp>
93 boost-lib-version = BOOST_LIB_VERSION],
94 [boost_cv_lib_version=`cat conftest.i`])])
95 @@ -214,13 +233,14 @@ boost-lib-version = BOOST_LIB_VERSION],
96 boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'`
97 case $boost_major_version in #(
99 - AC_MSG_ERROR([invalid value: boost_major_version=$boost_major_version])
100 + AC_MSG_ERROR([invalid value: boost_major_version='$boost_major_version'])
104 CPPFLAGS=$boost_save_CPPFLAGS
110 # Add the "--enable-static-boost" configure argument. If this argument is given
111 @@ -232,6 +252,7 @@ AC_DEFUN([BOOST_STATIC],
112 [enable_static_boost=yes],
113 [enable_static_boost=no])])# BOOST_STATIC
116 # BOOST_FIND_HEADER([HEADER-NAME], [ACTION-IF-NOT-FOUND], [ACTION-IF-FOUND])
117 # --------------------------------------------------------------------------
118 # Wrapper around AC_CHECK_HEADER for Boost headers. Useful to check for
119 @@ -264,14 +285,16 @@ fi
120 ])# BOOST_FIND_HEADER
123 -# BOOST_FIND_LIB([LIB-NAME], [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
125 -# -------------------------------------------------------------------------
126 -# Look for the Boost library LIB-NAME (e.g., LIB-NAME = `thread', for
127 -# libboost_thread). Check that HEADER-NAME works and check that
128 -# libboost_LIB-NAME can link with the code CXX-TEST. The optional argument
129 -# CXX-PROLOGUE can be used to include some C++ code before the `main'
131 +# BOOST_FIND_LIBS([COMPONENT-NAME], [CANDIDATE-LIB-NAMES],
132 +# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
134 +# --------------------------------------------------------------
135 +# Look for the Boost library COMPONENT-NAME (e.g., `thread', for
136 +# libboost_thread) under the possible CANDIDATE-LIB-NAMES (e.g.,
137 +# "thread_win32 thread"). Check that HEADER-NAME works and check that
138 +# libboost_LIB-NAME can link with the code CXX-TEST. The optional
139 +# argument CXX-PROLOGUE can be used to include some C++ code before
140 +# the `main' function.
142 # Invokes BOOST_FIND_HEADER([HEADER-NAME]) (see above).
144 @@ -285,7 +308,7 @@ fi
145 # builds. Some sample values for PREFERRED-RT-OPT: (nothing), mt, d, mt-d, gdp
146 # ... If you want to make sure you have a specific version of Boost
147 # (eg, >= 1.33) you *must* invoke BOOST_REQUIRE before this macro.
148 -AC_DEFUN([BOOST_FIND_LIB],
149 +AC_DEFUN([BOOST_FIND_LIBS],
150 [AC_REQUIRE([BOOST_REQUIRE])dnl
151 AC_REQUIRE([_BOOST_FIND_COMPILER_TAG])dnl
152 AC_REQUIRE([BOOST_STATIC])dnl
153 @@ -299,32 +322,69 @@ AS_VAR_PUSHDEF([Boost_lib], [boost_cv_li
154 AS_VAR_PUSHDEF([Boost_lib_LDFLAGS], [boost_cv_lib_$1_LDFLAGS])dnl
155 AS_VAR_PUSHDEF([Boost_lib_LDPATH], [boost_cv_lib_$1_LDPATH])dnl
156 AS_VAR_PUSHDEF([Boost_lib_LIBS], [boost_cv_lib_$1_LIBS])dnl
157 -BOOST_FIND_HEADER([$3])
158 +BOOST_FIND_HEADER([$4])
159 boost_save_CPPFLAGS=$CPPFLAGS
160 CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
161 -# Now let's try to find the library. The algorithm is as follows: first look
162 -# for a given library name according to the user's PREFERRED-RT-OPT. For each
163 -# library name, we prefer to use the ones that carry the tag (toolset name).
164 -# Each library is searched through the various standard paths were Boost is
165 -# usually installed. If we can't find the standard variants, we try to
166 -# enforce -mt (for instance on MacOSX, libboost_threads.dylib doesn't exist
167 -# but there's -obviously- libboost_threads-mt.dylib).
168 AC_CACHE_CHECK([for the Boost $1 library], [Boost_lib],
171 - mt | mt-) boost_mt=-mt; boost_rtopt=;; #(
172 - mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X$2" : 'Xmt-*\(.*\)'`;; #(
173 - *) boost_mt=; boost_rtopt=$2;;
174 + [_BOOST_FIND_LIBS($@)])
175 +case $Boost_lib in #(
176 + (no) _AC_MSG_LOG_CONFTEST
177 + AC_MSG_ERROR([cannot find the flags to link with Boost $1])
180 +AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS])dnl
181 +AC_SUBST(AS_TR_CPP([BOOST_$1_LDPATH]), [$Boost_lib_LDPATH])dnl
182 +AC_SUBST([BOOST_LDPATH], [$Boost_lib_LDPATH])dnl
183 +AC_SUBST(AS_TR_CPP([BOOST_$1_LIBS]), [$Boost_lib_LIBS])dnl
184 +CPPFLAGS=$boost_save_CPPFLAGS
185 +AS_VAR_POPDEF([Boost_lib])dnl
186 +AS_VAR_POPDEF([Boost_lib_LDFLAGS])dnl
187 +AS_VAR_POPDEF([Boost_lib_LDPATH])dnl
188 +AS_VAR_POPDEF([Boost_lib_LIBS])dnl
189 +AC_LANG_POP([C++])dnl
194 +# BOOST_FIND_LIB([LIB-NAME],
195 +# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
197 +# --------------------------------------------------------------
198 +# Backward compatibility wrapper for BOOST_FIND_LIBS.
199 +AC_DEFUN([BOOST_FIND_LIB],
200 +[BOOST_FIND_LIBS([$1], $@)])
203 +# _BOOST_FIND_LIBS([LIB-NAME], [CANDIDATE-LIB-NAMES],
204 +# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
206 +# --------------------------------------------------------------
207 +# Real implementation of BOOST_FIND_LIBS: rely on these local macros:
208 +# Boost_lib, Boost_lib_LDFLAGS, Boost_lib_LDPATH, Boost_lib_LIBS
210 +# The algorithm is as follows: first look for a given library name
211 +# according to the user's PREFERRED-RT-OPT. For each library name, we
212 +# prefer to use the ones that carry the tag (toolset name). Each
213 +# library is searched through the various standard paths were Boost is
214 +# usually installed. If we can't find the standard variants, we try
215 +# to enforce -mt (for instance on MacOSX, libboost_thread.dylib
216 +# doesn't exist but there's -obviously- libboost_thread-mt.dylib).
217 +AC_DEFUN([_BOOST_FIND_LIBS],
220 + (mt | mt-) boost_mt=-mt; boost_rtopt=;; #(
221 + (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X$3" : 'Xmt-*\(.*\)'`;; #(
222 + (*) boost_mt=; boost_rtopt=$3;;
224 if test $enable_static_boost = yes; then
225 boost_rtopt="s$boost_rtopt"
227 # Find the proper debug variant depending on what we've been asked to find.
228 case $boost_rtopt in #(
229 - *d*) boost_rt_d=$boost_rtopt;; #(
230 - *[[sgpn]]*) # Insert the `d' at the right place (in between `sg' and `pn')
231 + (*d*) boost_rt_d=$boost_rtopt;; #(
232 + (*[[sgpn]]*) # Insert the `d' at the right place (in between `sg' and `pn')
233 boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #(
234 - *) boost_rt_d='-d';;
235 + (*) boost_rt_d='-d';;
237 # If the PREFERRED-RT-OPT are not empty, prepend a `-'.
238 test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt"
239 @@ -335,8 +395,8 @@ AC_CACHE_CHECK([for the Boost $1 library
240 AC_MSG_ERROR([the libext variable is empty, did you invoke Libtool?])
241 boost_save_ac_objext=$ac_objext
242 # Generate the test file.
243 - AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <$3>
245 + AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <$4>
247 dnl Optimization hacks: compiling C++ is slow, especially with Boost. What
248 dnl we're trying to do here is guess the right combination of link flags
249 dnl (LIBS / LDFLAGS) to use a given library. This can take several
250 @@ -358,21 +418,22 @@ dnl start the for loops).
251 [AC_MSG_ERROR([cannot compile a test that uses Boost $1])])
252 ac_objext=$boost_save_ac_objext
254 -# Don't bother to ident the 6 nested for loops, only the 2 innermost ones
256 +# Don't bother to ident the following nested for loops, only the 2
257 +# innermost ones matter.
258 +for boost_lib_ in $2; do
259 for boost_tag_ in -$boost_cv_lib_tag ''; do
260 for boost_ver_ in -$boost_cv_lib_version ''; do
261 for boost_mt_ in $boost_mt -mt ''; do
262 for boost_rtopt_ in $boost_rtopt '' -d; do
264 - boost_$1$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \
265 - boost_$1$boost_tag_$boost_rtopt_$boost_ver_ \
266 - boost_$1$boost_tag_$boost_mt_$boost_ver_ \
267 - boost_$1$boost_tag_$boost_ver_
268 + boost_$boost_lib_$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \
269 + boost_$boost_lib_$boost_tag_$boost_rtopt_$boost_ver_ \
270 + boost_$boost_lib_$boost_tag_$boost_mt_$boost_ver_ \
271 + boost_$boost_lib_$boost_tag_$boost_ver_
273 # Avoid testing twice the same lib
274 case $boost_failed_libs in #(
275 - *@$boost_lib@*) continue;;
276 + (*@$boost_lib@*) continue;;
278 # If with_boost is empty, we'll search in /lib first, which is not quite
279 # right so instead we'll try to a location based on where the headers are.
280 @@ -382,14 +443,17 @@ for boost_rtopt_ in $boost_rtopt '' -d;
281 /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \
282 "$with_boost" C:/Boost/lib /lib*
284 - test -e "$boost_ldpath" || continue
285 + # Don't waste time with directories that don't exist.
286 + if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then
289 boost_save_LDFLAGS=$LDFLAGS
290 # Are we looking for a static library?
291 case $boost_ldpath:$boost_rtopt_ in #(
292 - *?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt)
293 + (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt)
294 Boost_lib_LIBS="$boost_ldpath/lib$boost_lib.$libext"
295 test -e "$Boost_lib_LIBS" || continue;; #(
296 - *) # No: use -lboost_foo to find the shared library.
297 + (*) # No: use -lboost_foo to find the shared library.
298 Boost_lib_LIBS="-l$boost_lib";;
300 boost_save_LIBS=$LIBS
301 @@ -403,9 +467,35 @@ dnl generated only once above (before we
302 LDFLAGS=$boost_save_LDFLAGS
303 LIBS=$boost_save_LIBS
304 if test x"$Boost_lib" = xyes; then
305 - Boost_lib_LDFLAGS="-L$boost_ldpath -Wl,-rpath,$boost_ldpath"
306 + # Check or used cached result of whether or not using -R or
307 + # -rpath makes sense. Some implementations of ld, such as for
308 + # Mac OSX, require -rpath but -R is the flag known to work on
309 + # other systems. https://github.com/tsuna/boost.m4/issues/19
310 + AC_CACHE_VAL([boost_cv_rpath_link_ldflag],
311 + [case $boost_ldpath in
312 + '') # Nothing to do.
313 + boost_cv_rpath_link_ldflag=
314 + boost_rpath_link_ldflag_found=yes;;
316 + for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do
317 + LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
318 + LIBS="$boost_save_LIBS $Boost_lib_LIBS"
319 + _BOOST_AC_LINK_IFELSE([],
320 + [boost_rpath_link_ldflag_found=yes
322 + [boost_rpath_link_ldflag_found=no])
326 + AS_IF([test "x$boost_rpath_link_ldflag_found" != "xyes"],
327 + [AC_MSG_ERROR([Unable to determine whether to use -R or -rpath])])
328 + LDFLAGS=$boost_save_LDFLAGS
329 + LIBS=$boost_save_LIBS
331 + test x"$boost_ldpath" != x &&
332 + Boost_lib_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
333 Boost_lib_LDPATH="$boost_ldpath"
337 boost_failed_libs="$boost_failed_libs@$boost_lib@"
339 @@ -415,25 +505,10 @@ done
344 rm -f conftest.$ac_objext
346 -case $Boost_lib in #(
347 - no) _AC_MSG_LOG_CONFTEST
348 - AC_MSG_ERROR([cannot find the flags to link with Boost $1])
351 -AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS])dnl
352 -AC_SUBST(AS_TR_CPP([BOOST_$1_LDPATH]), [$Boost_lib_LDPATH])dnl
353 -AC_SUBST([BOOST_LDPATH], [$Boost_lib_LDPATH])dnl
354 -AC_SUBST(AS_TR_CPP([BOOST_$1_LIBS]), [$Boost_lib_LIBS])dnl
355 -CPPFLAGS=$boost_save_CPPFLAGS
356 -AS_VAR_POPDEF([Boost_lib])dnl
357 -AS_VAR_POPDEF([Boost_lib_LDFLAGS])dnl
358 -AS_VAR_POPDEF([Boost_lib_LDPATH])dnl
359 -AS_VAR_POPDEF([Boost_lib_LIBS])dnl
360 -AC_LANG_POP([C++])dnl
366 # --------------------------------------- #
367 @@ -475,20 +550,20 @@ BOOST_FIND_HEADER([boost/asio.hpp])])
371 -# Look for Boost.Bind
372 +# Look for Boost.Bind.
374 [BOOST_FIND_HEADER([boost/bind.hpp])])
378 -# ------------------
379 -# Look for Boost.Chrono
381 +# Look for Boost.Chrono.
382 BOOST_DEFUN([Chrono],
383 [# Do we have to check for Boost.System? This link-time dependency was
384 # added as of 1.35.0. If we have a version <1.35, we must not attempt to
385 # find Boost.System as it didn't exist by then.
386 if test $boost_major_version -ge 135; then
389 fi # end of the Boost.System check.
390 boost_filesystem_save_LIBS=$LIBS
391 boost_filesystem_save_LDFLAGS=$LDFLAGS
392 @@ -499,14 +574,40 @@ BOOST_FIND_LIB([chrono], [$1],
394 [boost::chrono::thread_clock d;])
395 if test $enable_static_boost = yes && test $boost_major_version -ge 135; then
396 - AC_SUBST([BOOST_FILESYSTEM_LIBS], ["$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"])
397 + BOOST_CHRONO_LIBS="$BOOST_CHRONO_LIBS $BOOST_SYSTEM_LIBS"
399 LIBS=$boost_filesystem_save_LIBS
400 LDFLAGS=$boost_filesystem_save_LDFLAGS
405 +# BOOST_CONTEXT([PREFERRED-RT-OPT])
406 +# -----------------------------------
407 +# Look for Boost.Context. For the documentation of PREFERRED-RT-OPT, see the
408 +# documentation of BOOST_FIND_LIB above. This library was introduced in Boost
410 +BOOST_DEFUN([Context],
411 +[BOOST_FIND_LIB([context], [$1],
412 + [boost/context/all.hpp],[[
414 +void * stack_pointer = new void*[4096];
415 +std::size_t const size = sizeof(void*[4096]);
417 +// context fc uses f() as context function
418 +// fcontext_t is placed on top of context stack
419 +// a pointer to fcontext_t is returned
420 +fc = ctx::make_fcontext(stack_pointer, size, f);
421 +return ctx::jump_fcontext(&fcm, fc, 3) == 6;]],[dnl
422 +namespace ctx = boost::context;
424 +static ctx::fcontext_t fcm, *fc;
426 +static void f(intptr_t i) {
427 + ctx::jump_fcontext(fc, &fcm, i * 2);
434 # Look for Boost.Conversion (cast / lexical_cast)
435 @@ -516,6 +617,52 @@ BOOST_FIND_HEADER([boost/lexical_cast.hp
439 +# BOOST_COROUTINE([PREFERRED-RT-OPT])
440 +# -----------------------------------
441 +# Look for Boost.Coroutine. For the documentation of PREFERRED-RT-OPT, see the
442 +# documentation of BOOST_FIND_LIB above. This library was introduced in Boost
444 +BOOST_DEFUN([Coroutine],
446 +boost_coroutine_save_LIBS=$LIBS
447 +boost_coroutine_save_LDFLAGS=$LDFLAGS
448 +# Link-time dependency from coroutine to context
450 +# Starting from Boost 1.55 a dependency on Boost.System is added
451 +if test $boost_major_version -ge 155; then
454 +m4_pattern_allow([^BOOST_(CONTEXT|SYSTEM)_(LIBS|LDFLAGS)])
455 +LIBS="$LIBS $BOOST_CONTEXT_LIBS $BOOST_SYSTEM_LIBS"
456 +LDFLAGS="$LDFLAGS $BOOST_CONTEXT_LDFLAGS"
458 +BOOST_FIND_LIB([coroutine], [$1],
459 + [boost/coroutine/coroutine.hpp],
460 + [boost::coroutines::coroutine< int(int) > coro; coro.empty();])
462 +# Link-time dependency from coroutine to context, existed only in 1.53, in 1.54
463 +# coroutine doesn't use context from its headers but from its library.
464 +if test $boost_major_version -eq 153 || test $enable_static_boost = yes && test $boost_major_version -ge 154; then
465 + BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_CONTEXT_LIBS"
466 + BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_CONTEXT_LDFLAGS"
468 +if test $enable_static_boost = yes && test $boost_major_version -ge 155; then
469 + BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_SYSTEM_LIBS"
470 + BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_SYSTEM_LDFLAGS"
472 +LIBS=$boost_coroutine_save_LIBS
473 +LDFLAGS=$boost_coroutine_save_LDFLAGS
479 +# Look for Boost.CRC
481 +[BOOST_FIND_HEADER([boost/crc.hpp])
485 # BOOST_DATE_TIME([PREFERRED-RT-OPT])
486 # -----------------------------------
487 # Look for Boost.Date_Time. For the documentation of PREFERRED-RT-OPT, see the
488 @@ -538,7 +685,7 @@ BOOST_DEFUN([Filesystem],
489 # added as of 1.35.0. If we have a version <1.35, we must not attempt to
490 # find Boost.System as it didn't exist by then.
491 if test $boost_major_version -ge 135; then
494 fi # end of the Boost.System check.
495 boost_filesystem_save_LIBS=$LIBS
496 boost_filesystem_save_LDFLAGS=$LDFLAGS
497 @@ -548,23 +695,34 @@ LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
498 BOOST_FIND_LIB([filesystem], [$1],
499 [boost/filesystem/path.hpp], [boost::filesystem::path p;])
500 if test $enable_static_boost = yes && test $boost_major_version -ge 135; then
501 - AC_SUBST([BOOST_FILESYSTEM_LIBS], ["$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"])
502 + BOOST_FILESYSTEM_LIBS="$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"
504 LIBS=$boost_filesystem_save_LIBS
505 LDFLAGS=$boost_filesystem_save_LDFLAGS
511 +# Look for Boost.Flyweight.
512 +BOOST_DEFUN([Flyweight],
513 +[dnl There's a hidden dependency on pthreads.
514 +AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl
515 +BOOST_FIND_HEADER([boost/flyweight.hpp])
516 +AC_SUBST([BOOST_FLYWEIGHT_LIBS], [$boost_cv_pthread_flag])
522 -# Look for Boost.Foreach
523 +# Look for Boost.Foreach.
524 BOOST_DEFUN([Foreach],
525 [BOOST_FIND_HEADER([boost/foreach.hpp])])
530 -# Look for Boost.Format
531 +# Look for Boost.Format.
532 # Note: we can't check for boost/format/format_fwd.hpp because the header isn't
533 # standalone. It can't be compiled because it triggers the following error:
534 # boost/format/detail/config_macros.hpp:88: error: 'locale' in namespace 'std'
535 @@ -580,6 +738,14 @@ BOOST_DEFUN([Function],
536 [BOOST_FIND_HEADER([boost/function.hpp])])
541 +# Look for Boost.Geometry (new since 1.47.0).
542 +BOOST_DEFUN([Geometry],
543 +[BOOST_FIND_HEADER([boost/geometry.hpp])
547 # BOOST_GRAPH([PREFERRED-RT-OPT])
548 # -------------------------------
549 # Look for Boost.Graphs. For the documentation of PREFERRED-RT-OPT, see the
550 @@ -615,9 +781,18 @@ BOOST_DEFUN([Lambda],
551 [BOOST_FIND_HEADER([boost/lambda/lambda.hpp])])
556 +# Look for Boost.Locale
557 +BOOST_DEFUN([Locale],
558 +[BOOST_FIND_LIB([locale], [$1],
559 + [boost/locale.hpp],
560 + [[boost::locale::generator gen; std::locale::global(gen(""));]])
563 # BOOST_LOG([PREFERRED-RT-OPT])
564 # -----------------------------
565 -# Look for Boost.Log For the documentation of PREFERRED-RT-OPT, see the
566 +# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the
567 # documentation of BOOST_FIND_LIB above.
569 [BOOST_FIND_LIB([log], [$1],
570 @@ -628,12 +803,12 @@ BOOST_DEFUN([Log],
572 # BOOST_LOG_SETUP([PREFERRED-RT-OPT])
573 # -----------------------------------
574 -# Look for Boost.Log For the documentation of PREFERRED-RT-OPT, see the
575 +# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the
576 # documentation of BOOST_FIND_LIB above.
577 BOOST_DEFUN([Log_Setup],
578 [AC_REQUIRE([BOOST_LOG])dnl
579 BOOST_FIND_LIB([log_setup], [$1],
580 - [boost/log/utility/init/from_settings.hpp],
581 + [boost/log/utility/setup/from_settings.hpp],
582 [boost::log::basic_settings<char> bs; bs.empty();])
585 @@ -650,6 +825,29 @@ BOOST_DEFUN([Math],
586 [BOOST_FIND_HEADER([boost/math/special_functions.hpp])])
589 +# BOOST_MPI([PREFERRED-RT-OPT])
590 +# -------------------------------
591 +# Look for Boost MPI. For the documentation of PREFERRED-RT-OPT, see the
592 +# documentation of BOOST_FIND_LIB above. Uses MPICXX variable if it is
593 +# set, otherwise tries CXX
596 +[boost_save_CXX=${CXX}
597 +boost_save_CXXCPP=${CXXCPP}
598 +if test x"${MPICXX}" != x; then
600 + CXXCPP="${MPICXX} -E"
602 +BOOST_FIND_LIB([mpi], [$1],
606 + boost::mpi::environment env(argc,argv);])
607 +CXX=${boost_save_CXX}
608 +CXXCPP=${boost_save_CXXCPP}
614 # Look for Boost.MultiArray
615 @@ -657,6 +855,14 @@ BOOST_DEFUN([MultiArray],
616 [BOOST_FIND_HEADER([boost/multi_array.hpp])])
619 +# BOOST_NUMERIC_UBLAS()
620 +# --------------------------
621 +# Look for Boost.NumericUblas (Basic Linear Algebra)
622 +BOOST_DEFUN([Numeric_Ublas],
623 +[BOOST_FIND_HEADER([boost/numeric/ublas/vector.hpp])
624 +])# BOOST_NUMERIC_UBLAS
627 # BOOST_NUMERIC_CONVERSION()
628 # --------------------------
629 # Look for Boost.NumericConversion (policy-based numeric conversion)
630 @@ -679,6 +885,12 @@ BOOST_DEFUN([Preprocessor],
631 [BOOST_FIND_HEADER([boost/preprocessor/repeat.hpp])])
635 +# --------------------
636 +# Look for Boost.Range
637 +BOOST_DEFUN([Range],
638 +[BOOST_FIND_HEADER([boost/range/adaptors.hpp])])
642 # Look for Boost.Unordered
643 @@ -725,9 +937,9 @@ BOOST_DEFUN([Python],
644 _BOOST_PYTHON_CONFIG([LDFLAGS], [ldflags])
645 _BOOST_PYTHON_CONFIG([LIBS], [libs])
646 m4_pattern_allow([^BOOST_PYTHON_MODULE$])dnl
647 -BOOST_FIND_LIB([python], [$1],
648 - [boost/python.hpp],
649 - [], [BOOST_PYTHON_MODULE(empty) {}])
650 +BOOST_FIND_LIBS([python], [python python3], [$1],
651 + [boost/python.hpp],
652 + [], [BOOST_PYTHON_MODULE(empty) {}])
653 CPPFLAGS=$boost_python_save_CPPFLAGS
654 LDFLAGS=$boost_python_save_LDFLAGS
655 LIBS=$boost_python_save_LIBS
656 @@ -774,17 +986,13 @@ BOOST_DEFUN([Signals],
657 [boost::signal<void ()> s;])
663 -# Look for Boost.Signals2
665 +# Look for Boost.Signals2 (new since 1.39.0).
666 BOOST_DEFUN([Signals2],
667 -[BOOST_FIND_HEADER([boost/signals2.hpp])])
671 -# Look for Boost.CRC
673 -[BOOST_FIND_HEADER([boost/crc.hpp])])
674 +[BOOST_FIND_HEADER([boost/signals2.hpp])
679 @@ -837,19 +1045,18 @@ BOOST_FIND_LIB([unit_test_framework], [$
683 -# BOOST_THREADS([PREFERRED-RT-OPT])
684 +# BOOST_THREAD([PREFERRED-RT-OPT])
685 # ---------------------------------
686 # Look for Boost.Thread. For the documentation of PREFERRED-RT-OPT, see the
687 # documentation of BOOST_FIND_LIB above.
688 -# FIXME: Provide an alias "BOOST_THREAD".
689 -BOOST_DEFUN([Threads],
690 +BOOST_DEFUN([Thread],
691 [dnl Having the pthread flag is required at least on GCC3 where
692 dnl boost/thread.hpp would complain if we try to compile without
693 dnl -pthread on GNU/Linux.
694 AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl
695 -boost_threads_save_LIBS=$LIBS
696 -boost_threads_save_LDFLAGS=$LDFLAGS
697 -boost_threads_save_CPPFLAGS=$CPPFLAGS
698 +boost_thread_save_LIBS=$LIBS
699 +boost_thread_save_LDFLAGS=$LDFLAGS
700 +boost_thread_save_CPPFLAGS=$CPPFLAGS
701 # Link-time dependency from thread to system was added as of 1.49.0.
702 if test $boost_major_version -ge 149; then
704 @@ -857,36 +1064,26 @@ fi # end of the Boost.System check.
705 m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
706 LIBS="$LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag"
707 LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
708 -# Yes, we *need* to put the -pthread thing in CPPFLAGS because with GCC3,
709 -# boost/thread.hpp will trigger a #error if -pthread isn't used:
710 -# boost/config/requires_threads.hpp:47:5: #error "Compiler threading support
711 -# is not turned on. Please set the correct command line options for
712 -# threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)"
713 CPPFLAGS="$CPPFLAGS $boost_cv_pthread_flag"
715 # When compiling for the Windows platform, the threads library is named
719 - BOOST_FIND_LIB([thread_win32], [$1],
720 - [boost/thread.hpp], [boost::thread t; boost::mutex m;])
721 - BOOST_THREAD_LDFLAGS=$BOOST_THREAD_WIN32_LDFLAGS
722 - BOOST_THREAD_LDPATH=$BOOST_THREAD_WIN32_LDPATH
723 - BOOST_THREAD_LIBS=$BOOST_THREAD_WIN32_LIBS
726 - BOOST_FIND_LIB([thread], [$1],
727 - [boost/thread.hpp], [boost::thread t; boost::mutex m;])
729 + (*mingw*) boost_thread_lib_ext=_win32;;
731 +BOOST_FIND_LIBS([thread], [thread$boost_thread_lib_ext],
733 + [boost/thread.hpp], [boost::thread t; boost::mutex m;])
735 BOOST_THREAD_LIBS="$BOOST_THREAD_LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag"
736 BOOST_THREAD_LDFLAGS="$BOOST_SYSTEM_LDFLAGS"
737 BOOST_CPPFLAGS="$BOOST_CPPFLAGS $boost_cv_pthread_flag"
738 -LIBS=$boost_threads_save_LIBS
739 -LDFLAGS=$boost_threads_save_LDFLAGS
740 -CPPFLAGS=$boost_threads_save_CPPFLAGS
742 +LIBS=$boost_thread_save_LIBS
743 +LDFLAGS=$boost_thread_save_LDFLAGS
744 +CPPFLAGS=$boost_thread_save_CPPFLAGS
747 +AU_ALIAS([BOOST_THREADS], [BOOST_THREAD])
751 @@ -935,10 +1132,23 @@ BOOST_DEFUN([Variant],
752 BOOST_FIND_HEADER([boost/variant.hpp])])
755 +# BOOST_POINTER_CONTAINER()
756 +# ------------------------
757 +# Look for Boost.PointerContainer
758 +BOOST_DEFUN([Pointer_Container],
759 +[BOOST_FIND_HEADER([boost/ptr_container/ptr_deque.hpp])
760 +BOOST_FIND_HEADER([boost/ptr_container/ptr_list.hpp])
761 +BOOST_FIND_HEADER([boost/ptr_container/ptr_vector.hpp])
762 +BOOST_FIND_HEADER([boost/ptr_container/ptr_array.hpp])
763 +BOOST_FIND_HEADER([boost/ptr_container/ptr_set.hpp])
764 +BOOST_FIND_HEADER([boost/ptr_container/ptr_map.hpp])
765 +])# BOOST_POINTER_CONTAINER
768 # BOOST_WAVE([PREFERRED-RT-OPT])
769 # ------------------------------
770 # NOTE: If you intend to use Wave/Spirit with thread support, make sure you
771 -# call BOOST_THREADS first.
772 +# call BOOST_THREAD first.
773 # Look for Boost.Wave. For the documentation of PREFERRED-RT-OPT, see the
774 # documentation of BOOST_FIND_LIB above.
776 @@ -973,8 +1183,16 @@ BOOST_DEFUN([Xpressive],
778 # _BOOST_PTHREAD_FLAG()
779 # ---------------------
780 -# Internal helper for BOOST_THREADS. Based on ACX_PTHREAD:
781 -# http://autoconf-archive.cryp.to/acx_pthread.html
782 +# Internal helper for BOOST_THREAD. Computes boost_cv_pthread_flag
783 +# which must be used in CPPFLAGS and LIBS.
785 +# Yes, we *need* to put the -pthread thing in CPPFLAGS because with GCC3,
786 +# boost/thread.hpp will trigger a #error if -pthread isn't used:
787 +# boost/config/requires_threads.hpp:47:5: #error "Compiler threading support
788 +# is not turned on. Please set the correct command line options for
789 +# threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)"
791 +# Based on ACX_PTHREAD: http://autoconf-archive.cryp.to/acx_pthread.html
792 AC_DEFUN([_BOOST_PTHREAD_FLAG],
793 [AC_REQUIRE([AC_PROG_CXX])dnl
794 AC_REQUIRE([AC_CANONICAL_HOST])dnl
795 @@ -1042,6 +1260,14 @@ AC_LANG_POP([C++])dnl
796 m4_define([_BOOST_gcc_test],
797 ["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC @ gcc$1$2"])dnl
799 +# _BOOST_mingw_test(MAJOR, MINOR)
800 +# -----------------------------
801 +# Internal helper for _BOOST_FIND_COMPILER_TAG.
802 +m4_define([_BOOST_mingw_test],
803 +["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC && \
804 + (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
805 + || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw$1$2"])dnl
808 # _BOOST_FIND_COMPILER_TAG()
809 # --------------------------
810 @@ -1051,7 +1277,8 @@ m4_define([_BOOST_gcc_test],
811 AC_DEFUN([_BOOST_FIND_COMPILER_TAG],
812 [AC_REQUIRE([AC_PROG_CXX])dnl
813 AC_REQUIRE([AC_CANONICAL_HOST])dnl
814 -AC_CACHE_CHECK([for the toolset name used by Boost for $CXX], [boost_cv_lib_tag],
815 +AC_CACHE_CHECK([for the toolset name used by Boost for $CXX],
816 + [boost_cv_lib_tag],
817 [boost_cv_lib_tag=unknown
818 if test x$boost_cv_inc_path != xno; then
819 AC_LANG_PUSH([C++])dnl
820 @@ -1069,14 +1296,31 @@ if test x$boost_cv_inc_path != xno; then
821 # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines
822 # the same defines as GCC's).
824 + _BOOST_mingw_test(5, 1) \
825 + _BOOST_gcc_test(5, 1) \
826 + _BOOST_mingw_test(5, 0) \
827 + _BOOST_gcc_test(5, 0) \
828 + _BOOST_mingw_test(4, 10) \
829 + _BOOST_gcc_test(4, 10) \
830 + _BOOST_mingw_test(4, 9) \
831 + _BOOST_gcc_test(4, 9) \
832 + _BOOST_mingw_test(4, 8) \
833 _BOOST_gcc_test(4, 8) \
834 + _BOOST_mingw_test(4, 7) \
835 _BOOST_gcc_test(4, 7) \
836 + _BOOST_mingw_test(4, 6) \
837 _BOOST_gcc_test(4, 6) \
838 + _BOOST_mingw_test(4, 5) \
839 _BOOST_gcc_test(4, 5) \
840 + _BOOST_mingw_test(4, 4) \
841 _BOOST_gcc_test(4, 4) \
842 + _BOOST_mingw_test(4, 3) \
843 _BOOST_gcc_test(4, 3) \
844 + _BOOST_mingw_test(4, 2) \
845 _BOOST_gcc_test(4, 2) \
846 + _BOOST_mingw_test(4, 1) \
847 _BOOST_gcc_test(4, 1) \
848 + _BOOST_mingw_test(4, 0) \
849 _BOOST_gcc_test(4, 0) \
850 "defined __GNUC__ && __GNUC__ == 3 && !defined __ICC \
851 && (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
852 @@ -1142,6 +1386,7 @@ fi])dnl end of AC_CACHE_CHECK
853 # Thread) flavors of Boost. Sets boost_guess_use_mt accordingly.
854 AC_DEFUN([_BOOST_GUESS_WHETHER_TO_USE_MT],
855 [# Check whether we do better use `mt' even though we weren't ask to.
856 +AC_LANG_PUSH([C++])dnl
857 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
858 #if defined _REENTRANT || defined _MT || defined __MT__
860 @@ -1149,6 +1394,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
861 # error MT not needed
863 ]])], [boost_guess_use_mt=:], [boost_guess_use_mt=false])
864 +AC_LANG_POP([C++])dnl
867 # _BOOST_AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
868 @@ -1172,11 +1418,11 @@ boost_use_source=:
869 test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false &&
870 _AS_ECHO_LOG([re-using the existing conftest.$ac_objext])
871 AS_IF([_AC_DO_STDERR($ac_link) && {
872 - test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
873 - test ! -s conftest.err
874 + test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
875 + test ! -s conftest.err
876 } && test -s conftest$ac_exeext && {
877 - test "$cross_compiling" = yes ||
878 - $as_executable_p conftest$ac_exeext
879 + test "$cross_compiling" = yes ||
880 + $as_executable_p conftest$ac_exeext
881 dnl FIXME: use AS_TEST_X instead when 2.61 is widespread enough.