| 1 | # boost.m4: Locate Boost headers and libraries for autoconf-based projects.
 | 
|---|
| 2 | # Copyright (C) 2007-2011, 2014  Benoit Sigoure <tsuna@lrde.epita.fr>
 | 
|---|
| 3 | #
 | 
|---|
| 4 | # This program is free software: you can redistribute it and/or modify
 | 
|---|
| 5 | # it under the terms of the GNU General Public License as published by
 | 
|---|
| 6 | # the Free Software Foundation, either version 3 of the License, or
 | 
|---|
| 7 | # (at your option) any later version.
 | 
|---|
| 8 | #
 | 
|---|
| 9 | # Additional permission under section 7 of the GNU General Public
 | 
|---|
| 10 | # License, version 3 ("GPLv3"):
 | 
|---|
| 11 | #
 | 
|---|
| 12 | # If you convey this file as part of a work that contains a
 | 
|---|
| 13 | # configuration script generated by Autoconf, you may do so under
 | 
|---|
| 14 | # terms of your choice.
 | 
|---|
| 15 | #
 | 
|---|
| 16 | # This program is distributed in the hope that it will be useful,
 | 
|---|
| 17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
|---|
| 18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
|---|
| 19 | # GNU General Public License for more details.
 | 
|---|
| 20 | #
 | 
|---|
| 21 | # You should have received a copy of the GNU General Public License
 | 
|---|
| 22 | # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
|---|
| 23 | 
 | 
|---|
| 24 | m4_define([_BOOST_SERIAL], [m4_translit([
 | 
|---|
| 25 | # serial 36
 | 
|---|
| 26 | ], [#
 | 
|---|
| 27 | ], [])])
 | 
|---|
| 28 | 
 | 
|---|
| 29 | # Original sources can be found at http://github.com/tsuna/boost.m4
 | 
|---|
| 30 | # You can fetch the latest version of the script by doing:
 | 
|---|
| 31 | #   wget http://github.com/tsuna/boost.m4/raw/master/build-aux/boost.m4
 | 
|---|
| 32 | 
 | 
|---|
| 33 | # ------ #
 | 
|---|
| 34 | # README #
 | 
|---|
| 35 | # ------ #
 | 
|---|
| 36 | 
 | 
|---|
| 37 | # This file provides several macros to use the various Boost libraries.
 | 
|---|
| 38 | # The first macro is BOOST_REQUIRE.  It will simply check if it's possible to
 | 
|---|
| 39 | # find the Boost headers of a given (optional) minimum version and it will
 | 
|---|
| 40 | # define BOOST_CPPFLAGS accordingly.  It will add an option --with-boost to
 | 
|---|
| 41 | # your configure so that users can specify non standard locations.
 | 
|---|
| 42 | # If the user's environment contains BOOST_ROOT and --with-boost was not
 | 
|---|
| 43 | # specified, --with-boost=$BOOST_ROOT is implicitly used.
 | 
|---|
| 44 | # For more README and documentation, go to http://github.com/tsuna/boost.m4
 | 
|---|
| 45 | # Note: THESE MACROS ASSUME THAT YOU USE LIBTOOL.  If you don't, don't worry,
 | 
|---|
| 46 | # simply read the README, it will show you what to do step by step.
 | 
|---|
| 47 | 
 | 
|---|
| 48 | m4_pattern_forbid([^_?(BOOST|Boost)_])
 | 
|---|
| 49 | 
 | 
|---|
| 50 | 
 | 
|---|
| 51 | # _BOOST_SED_CPP(SED-PROGRAM, PROGRAM,
 | 
|---|
| 52 | #                [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
 | 
|---|
| 53 | # --------------------------------------------------------
 | 
|---|
| 54 | # Same as AC_EGREP_CPP, but leave the result in conftest.i.
 | 
|---|
| 55 | #
 | 
|---|
| 56 | # SED-PROGRAM is *not* overquoted, as in AC_EGREP_CPP.  It is expanded
 | 
|---|
| 57 | # in double-quotes, so escape your double quotes.
 | 
|---|
| 58 | #
 | 
|---|
| 59 | # It could be useful to turn this into a macro which extracts the
 | 
|---|
| 60 | # value of any macro.
 | 
|---|
| 61 | m4_define([_BOOST_SED_CPP],
 | 
|---|
| 62 | [AC_LANG_PUSH([C++])dnl
 | 
|---|
| 63 | AC_LANG_PREPROC_REQUIRE()dnl
 | 
|---|
| 64 | AC_REQUIRE([AC_PROG_SED])dnl
 | 
|---|
| 65 | AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])])
 | 
|---|
| 66 | AS_IF([dnl eval is necessary to expand ac_cpp.
 | 
|---|
| 67 | dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
 | 
|---|
| 68 | dnl Beware of Windows end-of-lines, for instance if we are running
 | 
|---|
| 69 | dnl some Windows programs under Wine.  In that case, boost/version.hpp
 | 
|---|
| 70 | dnl is certainly using "\r\n", but the regular Unix shell will only
 | 
|---|
| 71 | dnl strip `\n' with backquotes, not the `\r'.  This results in
 | 
|---|
| 72 | dnl boost_cv_lib_version='1_37\r' for instance, which breaks
 | 
|---|
| 73 | dnl everything else.
 | 
|---|
| 74 | dnl Cannot use 'dnl' after [$4] because a trailing dnl may break AC_CACHE_CHECK
 | 
|---|
| 75 | dnl
 | 
|---|
| 76 | dnl Beware that GCC 5, when expanding macros, may embed # line directives
 | 
|---|
| 77 | dnl a within single line:
 | 
|---|
| 78 | dnl
 | 
|---|
| 79 | dnl # 1 "conftest.cc"
 | 
|---|
| 80 | dnl # 1 "<built-in>"
 | 
|---|
| 81 | dnl # 1 "<command-line>"
 | 
|---|
| 82 | dnl # 1 "conftest.cc"
 | 
|---|
| 83 | dnl # 1 "/opt/local/include/boost/version.hpp" 1 3
 | 
|---|
| 84 | dnl # 2 "conftest.cc" 2
 | 
|---|
| 85 | dnl boost-lib-version =
 | 
|---|
| 86 | dnl # 2 "conftest.cc" 3
 | 
|---|
| 87 | dnl                    "1_56"
 | 
|---|
| 88 | dnl
 | 
|---|
| 89 | dnl So get rid of the # and empty lines, and glue the remaining ones together.
 | 
|---|
| 90 | (eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
 | 
|---|
| 91 |   grep -v '#' |
 | 
|---|
| 92 |   grep -v '^[[[:space:]]]*$' |
 | 
|---|
| 93 |   tr -d '\r' |
 | 
|---|
| 94 |   tr -s '\n' ' ' |
 | 
|---|
| 95 |   $SED -n -e "$1" >conftest.i 2>&1],
 | 
|---|
| 96 |   [$3],
 | 
|---|
| 97 |   [$4])
 | 
|---|
| 98 | rm -rf conftest*
 | 
|---|
| 99 | AC_LANG_POP([C++])dnl
 | 
|---|
| 100 | ])# _BOOST_SED_CPP
 | 
|---|
| 101 | 
 | 
|---|
| 102 | 
 | 
|---|
| 103 | 
 | 
|---|
| 104 | # BOOST_REQUIRE([VERSION], [ACTION-IF-NOT-FOUND])
 | 
|---|
| 105 | # -----------------------------------------------
 | 
|---|
| 106 | # Look for Boost.  If version is given, it must either be a literal of the form
 | 
|---|
| 107 | # "X.Y.Z" where X, Y and Z are integers (the ".Z" part being optional) or a
 | 
|---|
| 108 | # variable "$var".
 | 
|---|
| 109 | # Defines the value BOOST_CPPFLAGS.  This macro only checks for headers with
 | 
|---|
| 110 | # the required version, it does not check for any of the Boost libraries.
 | 
|---|
| 111 | # On # success, defines HAVE_BOOST.  On failure, calls the optional
 | 
|---|
| 112 | # ACTION-IF-NOT-FOUND action if one was supplied.
 | 
|---|
| 113 | # Otherwise aborts with an error message.
 | 
|---|
| 114 | AC_DEFUN_ONCE([BOOST_REQUIRE],
 | 
|---|
| 115 | [AC_REQUIRE([AC_PROG_CXX])dnl
 | 
|---|
| 116 | AC_REQUIRE([AC_PROG_GREP])dnl
 | 
|---|
| 117 | echo "$as_me: this is boost.m4[]_BOOST_SERIAL" >&AS_MESSAGE_LOG_FD
 | 
|---|
| 118 | boost_save_IFS=$IFS
 | 
|---|
| 119 | boost_version_req=$1
 | 
|---|
| 120 | IFS=.
 | 
|---|
| 121 | set x $boost_version_req 0 0 0
 | 
|---|
| 122 | IFS=$boost_save_IFS
 | 
|---|
| 123 | shift
 | 
|---|
| 124 | boost_version_req=`expr "$[1]" '*' 100000 + "$[2]" '*' 100 + "$[3]"`
 | 
|---|
| 125 | boost_version_req_string=$[1].$[2].$[3]
 | 
|---|
| 126 | AC_ARG_WITH([boost],
 | 
|---|
| 127 |    [AS_HELP_STRING([--with-boost=DIR],
 | 
|---|
| 128 |                    [prefix of Boost $1 @<:@guess@:>@])])dnl
 | 
|---|
| 129 | AC_ARG_VAR([BOOST_ROOT],[Location of Boost installation])dnl
 | 
|---|
| 130 | # If BOOST_ROOT is set and the user has not provided a value to
 | 
|---|
| 131 | # --with-boost, then treat BOOST_ROOT as if it the user supplied it.
 | 
|---|
| 132 | if test x"$BOOST_ROOT" != x; then
 | 
|---|
| 133 |   if test x"$with_boost" = x; then
 | 
|---|
| 134 |     AC_MSG_NOTICE([Detected BOOST_ROOT; continuing with --with-boost=$BOOST_ROOT])
 | 
|---|
| 135 |     with_boost=$BOOST_ROOT
 | 
|---|
| 136 |   else
 | 
|---|
| 137 |     AC_MSG_NOTICE([Detected BOOST_ROOT=$BOOST_ROOT, but overridden by --with-boost=$with_boost])
 | 
|---|
| 138 |   fi
 | 
|---|
| 139 | fi
 | 
|---|
| 140 | AC_SUBST([DISTCHECK_CONFIGURE_FLAGS],
 | 
|---|
| 141 |          ["$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'"])dnl
 | 
|---|
| 142 | boost_save_CPPFLAGS=$CPPFLAGS
 | 
|---|
| 143 |   AC_CACHE_CHECK([for Boost headers version >= $boost_version_req_string],
 | 
|---|
| 144 |     [boost_cv_inc_path],
 | 
|---|
| 145 |     [boost_cv_inc_path=no
 | 
|---|
| 146 | AC_LANG_PUSH([C++])dnl
 | 
|---|
| 147 | m4_pattern_allow([^BOOST_VERSION$])dnl
 | 
|---|
| 148 |     AC_LANG_CONFTEST([AC_LANG_PROGRAM([[#include <boost/version.hpp>
 | 
|---|
| 149 | #if !defined BOOST_VERSION
 | 
|---|
| 150 | # error BOOST_VERSION is not defined
 | 
|---|
| 151 | #elif BOOST_VERSION < $boost_version_req
 | 
|---|
| 152 | # error Boost headers version < $boost_version_req
 | 
|---|
| 153 | #endif
 | 
|---|
| 154 | ]])])
 | 
|---|
| 155 |     # If the user provided a value to --with-boost, use it and only it.
 | 
|---|
| 156 |     case $with_boost in #(
 | 
|---|
| 157 |       ''|yes) set x '' /opt/local/include /usr/local/include /opt/include \
 | 
|---|
| 158 |                  /usr/include C:/Boost/include;; #(
 | 
|---|
| 159 |       *)      set x "$with_boost/include" "$with_boost";;
 | 
|---|
| 160 |     esac
 | 
|---|
| 161 |     shift
 | 
|---|
| 162 |     for boost_dir
 | 
|---|
| 163 |     do
 | 
|---|
| 164 |     # Without --layout=system, Boost (or at least some versions) installs
 | 
|---|
| 165 |     # itself in <prefix>/include/boost-<version>.  This inner loop helps to
 | 
|---|
| 166 |     # find headers in such directories.
 | 
|---|
| 167 |     #
 | 
|---|
| 168 |     # Any ${boost_dir}/boost-x_xx directories are searched in reverse version
 | 
|---|
| 169 |     # order followed by ${boost_dir}.  The final '.' is a sentinel for
 | 
|---|
| 170 |     # searching $boost_dir" itself.  Entries are whitespace separated.
 | 
|---|
| 171 |     #
 | 
|---|
| 172 |     # I didn't indent this loop on purpose (to avoid over-indented code)
 | 
|---|
| 173 |     boost_layout_system_search_list=`cd "$boost_dir" 2>/dev/null \
 | 
|---|
| 174 |         && ls -1 | "${GREP}" '^boost-' | sort -rn -t- -k2 \
 | 
|---|
| 175 |         && echo .`
 | 
|---|
| 176 |     for boost_inc in $boost_layout_system_search_list
 | 
|---|
| 177 |     do
 | 
|---|
| 178 |       if test x"$boost_inc" != x.; then
 | 
|---|
| 179 |         boost_inc="$boost_dir/$boost_inc"
 | 
|---|
| 180 |       else
 | 
|---|
| 181 |         boost_inc="$boost_dir" # Uses sentinel in boost_layout_system_search_list
 | 
|---|
| 182 |       fi
 | 
|---|
| 183 |       if test x"$boost_inc" != x; then
 | 
|---|
| 184 |         # We are going to check whether the version of Boost installed
 | 
|---|
| 185 |         # in $boost_inc is usable by running a compilation that
 | 
|---|
| 186 |         # #includes it.  But if we pass a -I/some/path in which Boost
 | 
|---|
| 187 |         # is not installed, the compiler will just skip this -I and
 | 
|---|
| 188 |         # use other locations (either from CPPFLAGS, or from its list
 | 
|---|
| 189 |         # of system include directories).  As a result we would use
 | 
|---|
| 190 |         # header installed on the machine instead of the /some/path
 | 
|---|
| 191 |         # specified by the user.  So in that precise case (trying
 | 
|---|
| 192 |         # $boost_inc), make sure the version.hpp exists.
 | 
|---|
| 193 |         #
 | 
|---|
| 194 |         # Use test -e as there can be symlinks.
 | 
|---|
| 195 |         test -e "$boost_inc/boost/version.hpp" || continue
 | 
|---|
| 196 |         CPPFLAGS="$CPPFLAGS -I$boost_inc"
 | 
|---|
| 197 |       fi
 | 
|---|
| 198 |       AC_COMPILE_IFELSE([], [boost_cv_inc_path=yes], [boost_cv_version=no])
 | 
|---|
| 199 |       if test x"$boost_cv_inc_path" = xyes; then
 | 
|---|
| 200 |         if test x"$boost_inc" != x; then
 | 
|---|
| 201 |           boost_cv_inc_path=$boost_inc
 | 
|---|
| 202 |         fi
 | 
|---|
| 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 |         boost_errmsg="cannot find Boost headers version >= $boost_version_req_string"
 | 
|---|
| 212 |         m4_if([$2], [],  [AC_MSG_ERROR([$boost_errmsg])],
 | 
|---|
| 213 |                         [AC_MSG_NOTICE([$boost_errmsg])])
 | 
|---|
| 214 |         $2
 | 
|---|
| 215 |         ;;#(
 | 
|---|
| 216 |       yes)
 | 
|---|
| 217 |         BOOST_CPPFLAGS=
 | 
|---|
| 218 |         ;;#(
 | 
|---|
| 219 |       *)
 | 
|---|
| 220 |         AC_SUBST([BOOST_CPPFLAGS], ["-I$boost_cv_inc_path"])dnl
 | 
|---|
| 221 |         ;;
 | 
|---|
| 222 |     esac
 | 
|---|
| 223 |   if test x"$boost_cv_inc_path" != xno; then
 | 
|---|
| 224 |   AC_DEFINE([HAVE_BOOST], [1],
 | 
|---|
| 225 |             [Defined if the requested minimum BOOST version is satisfied])
 | 
|---|
| 226 |   AC_CACHE_CHECK([for Boost's header version],
 | 
|---|
| 227 |     [boost_cv_lib_version],
 | 
|---|
| 228 |     [m4_pattern_allow([^BOOST_LIB_VERSION$])dnl
 | 
|---|
| 229 |      _BOOST_SED_CPP([[/^boost-lib-version = /{s///;s/[\" ]//g;p;q;}]],
 | 
|---|
| 230 |                     [#include <boost/version.hpp>
 | 
|---|
| 231 | boost-lib-version = BOOST_LIB_VERSION],
 | 
|---|
| 232 |     [boost_cv_lib_version=`cat conftest.i`])])
 | 
|---|
| 233 |     # e.g. "134" for 1_34_1 or "135" for 1_35
 | 
|---|
| 234 |     boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'`
 | 
|---|
| 235 |     case $boost_major_version in #(
 | 
|---|
| 236 |       '' | *[[!0-9]]*)
 | 
|---|
| 237 |         AC_MSG_ERROR([invalid value: boost_major_version='$boost_major_version'])
 | 
|---|
| 238 |         ;;
 | 
|---|
| 239 |     esac
 | 
|---|
| 240 | fi
 | 
|---|
| 241 | CPPFLAGS=$boost_save_CPPFLAGS
 | 
|---|
| 242 | ])# BOOST_REQUIRE
 | 
|---|
| 243 | 
 | 
|---|
| 244 | 
 | 
|---|
| 245 | # BOOST_STATIC()
 | 
|---|
| 246 | # --------------
 | 
|---|
| 247 | # Add the "--enable-static-boost" configure argument. If this argument is given
 | 
|---|
| 248 | # on the command line, static versions of the libraries will be looked up.
 | 
|---|
| 249 | AC_DEFUN([BOOST_STATIC],
 | 
|---|
| 250 |   [AC_ARG_ENABLE([static-boost],
 | 
|---|
| 251 |      [AS_HELP_STRING([--enable-static-boost],
 | 
|---|
| 252 |                [Prefer the static boost libraries over the shared ones [no]])],
 | 
|---|
| 253 |      [enable_static_boost=yes],
 | 
|---|
| 254 |      [enable_static_boost=no])])# BOOST_STATIC
 | 
|---|
| 255 | 
 | 
|---|
| 256 | 
 | 
|---|
| 257 | # BOOST_FIND_HEADER([HEADER-NAME], [ACTION-IF-NOT-FOUND], [ACTION-IF-FOUND])
 | 
|---|
| 258 | # --------------------------------------------------------------------------
 | 
|---|
| 259 | # Wrapper around AC_CHECK_HEADER for Boost headers.  Useful to check for
 | 
|---|
| 260 | # some parts of the Boost library which are only made of headers and don't
 | 
|---|
| 261 | # require linking (such as Boost.Foreach).
 | 
|---|
| 262 | #
 | 
|---|
| 263 | # Default ACTION-IF-NOT-FOUND: Fail with a fatal error unless Boost couldn't be
 | 
|---|
| 264 | # found in the first place, in which case by default a notice is issued to the
 | 
|---|
| 265 | # user.  Presumably if we haven't died already it's because it's OK to not have
 | 
|---|
| 266 | # Boost, which is why only a notice is issued instead of a hard error.
 | 
|---|
| 267 | #
 | 
|---|
| 268 | # Default ACTION-IF-FOUND: define the preprocessor symbol HAVE_<HEADER-NAME> in
 | 
|---|
| 269 | # case of success # (where HEADER-NAME is written LIKE_THIS, e.g.,
 | 
|---|
| 270 | # HAVE_BOOST_FOREACH_HPP).
 | 
|---|
| 271 | AC_DEFUN([BOOST_FIND_HEADER],
 | 
|---|
| 272 | [AC_REQUIRE([BOOST_REQUIRE])dnl
 | 
|---|
| 273 | if test x"$boost_cv_inc_path" = xno; then
 | 
|---|
| 274 |   m4_default([$2], [AC_MSG_NOTICE([Boost not available, not searching for $1])])
 | 
|---|
| 275 | else
 | 
|---|
| 276 | AC_LANG_PUSH([C++])dnl
 | 
|---|
| 277 | boost_save_CPPFLAGS=$CPPFLAGS
 | 
|---|
| 278 | CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
 | 
|---|
| 279 | AC_CHECK_HEADER([$1],
 | 
|---|
| 280 |   [m4_default([$3], [AC_DEFINE(AS_TR_CPP([HAVE_$1]), [1],
 | 
|---|
| 281 |                                [Define to 1 if you have <$1>])])],
 | 
|---|
| 282 |   [m4_default([$2], [AC_MSG_ERROR([cannot find $1])])])
 | 
|---|
| 283 | CPPFLAGS=$boost_save_CPPFLAGS
 | 
|---|
| 284 | AC_LANG_POP([C++])dnl
 | 
|---|
| 285 | fi
 | 
|---|
| 286 | ])# BOOST_FIND_HEADER
 | 
|---|
| 287 | 
 | 
|---|
| 288 | 
 | 
|---|
| 289 | # BOOST_FIND_LIBS([COMPONENT-NAME], [CANDIDATE-LIB-NAMES],
 | 
|---|
| 290 | #                 [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
 | 
|---|
| 291 | #                 [CXX-PROLOGUE], [CXX-POST-INCLUDE-PROLOGUE],
 | 
|---|
| 292 | #                 [ERROR_ON_UNUSABLE])
 | 
|---|
| 293 | # --------------------------------------------------------------
 | 
|---|
| 294 | # Look for the Boost library COMPONENT-NAME (e.g., `thread', for
 | 
|---|
| 295 | # libboost_thread) under the possible CANDIDATE-LIB-NAMES (e.g.,
 | 
|---|
| 296 | # "thread_win32 thread").  Check that HEADER-NAME works and check that
 | 
|---|
| 297 | # libboost_LIB-NAME can link with the code CXX-TEST.  The optional
 | 
|---|
| 298 | # argument CXX-PROLOGUE can be used to include some C++ code before
 | 
|---|
| 299 | # the `main' function. The CXX-POST-INCLUDE-PROLOGUE can be used to
 | 
|---|
| 300 | # include some code before the `main' function, but after the
 | 
|---|
| 301 | # `#include <HEADER-NAME>'.
 | 
|---|
| 302 | #
 | 
|---|
| 303 | # Invokes BOOST_FIND_HEADER([HEADER-NAME]) (see above).
 | 
|---|
| 304 | #
 | 
|---|
| 305 | # Boost libraries typically come compiled with several flavors (with different
 | 
|---|
| 306 | # runtime options) so PREFERRED-RT-OPT is the preferred suffix.  A suffix is one
 | 
|---|
| 307 | # or more of the following letters: sgdpn (in that order).  s = static
 | 
|---|
| 308 | # runtime, d = debug build, g = debug/diagnostic runtime, p = STLPort build,
 | 
|---|
| 309 | # n = (unsure) STLPort build without iostreams from STLPort (it looks like `n'
 | 
|---|
| 310 | # must always be used along with `p').  Additionally, PREFERRED-RT-OPT can
 | 
|---|
| 311 | # start with `mt-' to indicate that there is a preference for multi-thread
 | 
|---|
| 312 | # builds.  Some sample values for PREFERRED-RT-OPT: (nothing), mt, d, mt-d, gdp
 | 
|---|
| 313 | # ...  If you want to make sure you have a specific version of Boost
 | 
|---|
| 314 | # (eg, >= 1.33) you *must* invoke BOOST_REQUIRE before this macro.
 | 
|---|
| 315 | #
 | 
|---|
| 316 | # ERROR_ON_UNUSABLE can be set to "no" if the caller does not want their
 | 
|---|
| 317 | # configure to fail
 | 
|---|
| 318 | AC_DEFUN([BOOST_FIND_LIBS],
 | 
|---|
| 319 | [AC_REQUIRE([BOOST_REQUIRE])dnl
 | 
|---|
| 320 | AC_REQUIRE([_BOOST_FIND_COMPILER_TAG])dnl
 | 
|---|
| 321 | AC_REQUIRE([BOOST_STATIC])dnl
 | 
|---|
| 322 | AC_REQUIRE([_BOOST_GUESS_WHETHER_TO_USE_MT])dnl
 | 
|---|
| 323 | if test x"$boost_cv_inc_path" = xno; then
 | 
|---|
| 324 |   AC_MSG_NOTICE([Boost not available, not searching for the Boost $1 library])
 | 
|---|
| 325 | else
 | 
|---|
| 326 | dnl The else branch is huge and wasn't indented on purpose.
 | 
|---|
| 327 | AC_LANG_PUSH([C++])dnl
 | 
|---|
| 328 | AS_VAR_PUSHDEF([Boost_lib], [boost_cv_lib_$1])dnl
 | 
|---|
| 329 | AS_VAR_PUSHDEF([Boost_lib_LDFLAGS], [boost_cv_lib_$1_LDFLAGS])dnl
 | 
|---|
| 330 | AS_VAR_PUSHDEF([Boost_lib_LDPATH], [boost_cv_lib_$1_LDPATH])dnl
 | 
|---|
| 331 | AS_VAR_PUSHDEF([Boost_lib_LIBS], [boost_cv_lib_$1_LIBS])dnl
 | 
|---|
| 332 | AS_IF([test x"$8" = "xno"], [not_found_header='true'])
 | 
|---|
| 333 | BOOST_FIND_HEADER([$4], [$not_found_header])
 | 
|---|
| 334 | boost_save_CPPFLAGS=$CPPFLAGS
 | 
|---|
| 335 | CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
 | 
|---|
| 336 | AC_CACHE_CHECK([for the Boost $1 library], [Boost_lib],
 | 
|---|
| 337 |                [_BOOST_FIND_LIBS($@)])
 | 
|---|
| 338 | case $Boost_lib in #(
 | 
|---|
| 339 |   (yes) _AC_MSG_LOG_CONFTEST
 | 
|---|
| 340 |     AC_DEFINE(AS_TR_CPP([HAVE_BOOST_$1]), [1], [Defined if the Boost $1 library is available])dnl
 | 
|---|
| 341 |     AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS])dnl
 | 
|---|
| 342 |     AC_SUBST(AS_TR_CPP([BOOST_$1_LDPATH]), [$Boost_lib_LDPATH])dnl
 | 
|---|
| 343 |     AC_SUBST([BOOST_LDPATH], [$Boost_lib_LDPATH])dnl
 | 
|---|
| 344 |     AC_SUBST(AS_TR_CPP([BOOST_$1_LIBS]), [$Boost_lib_LIBS])dnl
 | 
|---|
| 345 |     ;;
 | 
|---|
| 346 |   (no) _AC_MSG_LOG_CONFTEST
 | 
|---|
| 347 |     AS_IF([test x"$8" != "xno"], [
 | 
|---|
| 348 |       AC_MSG_ERROR([cannot find flags to link with the Boost $1 library (libboost-$1)])
 | 
|---|
| 349 |     ])
 | 
|---|
| 350 |     ;;
 | 
|---|
| 351 | esac
 | 
|---|
| 352 | CPPFLAGS=$boost_save_CPPFLAGS
 | 
|---|
| 353 | AS_VAR_POPDEF([Boost_lib])dnl
 | 
|---|
| 354 | AS_VAR_POPDEF([Boost_lib_LDFLAGS])dnl
 | 
|---|
| 355 | AS_VAR_POPDEF([Boost_lib_LDPATH])dnl
 | 
|---|
| 356 | AS_VAR_POPDEF([Boost_lib_LIBS])dnl
 | 
|---|
| 357 | AC_LANG_POP([C++])dnl
 | 
|---|
| 358 | fi
 | 
|---|
| 359 | ])
 | 
|---|
| 360 | 
 | 
|---|
| 361 | 
 | 
|---|
| 362 | # BOOST_FIND_LIB([LIB-NAME],
 | 
|---|
| 363 | #                [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
 | 
|---|
| 364 | #                [CXX-PROLOGUE], [CXX-POST-INCLUDE-PROLOGUE],
 | 
|---|
| 365 | #                [ERROR_ON_UNUSABLE])
 | 
|---|
| 366 | # --------------------------------------------------------------
 | 
|---|
| 367 | # Backward compatibility wrapper for BOOST_FIND_LIBS.
 | 
|---|
| 368 | # ERROR_ON_UNUSABLE can be set to "no" if the caller does not want their
 | 
|---|
| 369 | # configure to fail
 | 
|---|
| 370 | AC_DEFUN([BOOST_FIND_LIB],
 | 
|---|
| 371 | [BOOST_FIND_LIBS([$1], $@)])
 | 
|---|
| 372 | 
 | 
|---|
| 373 | 
 | 
|---|
| 374 | # _BOOST_FIND_LIBS([LIB-NAME], [CANDIDATE-LIB-NAMES],
 | 
|---|
| 375 | #                 [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
 | 
|---|
| 376 | #                 [CXX-PROLOGUE], [CXX-POST-INCLUDE-PROLOGUE],
 | 
|---|
| 377 | #                 [ERROR_ON_UNUSABLE])
 | 
|---|
| 378 | # --------------------------------------------------------------
 | 
|---|
| 379 | # Real implementation of BOOST_FIND_LIBS: rely on these local macros:
 | 
|---|
| 380 | # Boost_lib, Boost_lib_LDFLAGS, Boost_lib_LDPATH, Boost_lib_LIBS
 | 
|---|
| 381 | #
 | 
|---|
| 382 | # The algorithm is as follows: first look for a given library name
 | 
|---|
| 383 | # according to the user's PREFERRED-RT-OPT.  For each library name, we
 | 
|---|
| 384 | # prefer to use the ones that carry the tag (toolset name).  Each
 | 
|---|
| 385 | # library is searched through the various standard paths were Boost is
 | 
|---|
| 386 | # usually installed.  If we can't find the standard variants, we try
 | 
|---|
| 387 | # to enforce -mt (for instance on MacOSX, libboost_thread.dylib
 | 
|---|
| 388 | # doesn't exist but there's -obviously- libboost_thread-mt.dylib).
 | 
|---|
| 389 | #
 | 
|---|
| 390 | # ERROR_ON_UNUSABLE can be set to "no" if the caller does not want their
 | 
|---|
| 391 | # configure to fail
 | 
|---|
| 392 | AC_DEFUN([_BOOST_FIND_LIBS],
 | 
|---|
| 393 | [Boost_lib=no
 | 
|---|
| 394 |   case "$3" in #(
 | 
|---|
| 395 |     (mt | mt- | mt-x64) boost_mt=-mt-x64; boost_rtopt=;; #(
 | 
|---|
| 396 |     (mt* | mt-*) boost_mt=-mt-x64; boost_rtopt=`expr "X$3" : 'Xmt-*\(.*\)'`;; #(
 | 
|---|
| 397 |     (*) boost_mt=; boost_rtopt=$3;;
 | 
|---|
| 398 |   esac
 | 
|---|
| 399 |   if test $enable_static_boost = yes; then
 | 
|---|
| 400 |     boost_rtopt="s$boost_rtopt"
 | 
|---|
| 401 |   fi
 | 
|---|
| 402 |   # Find the proper debug variant depending on what we've been asked to find.
 | 
|---|
| 403 |   case $boost_rtopt in #(
 | 
|---|
| 404 |     (*d*) boost_rt_d=$boost_rtopt;; #(
 | 
|---|
| 405 |     (*[[sgpn]]*) # Insert the `d' at the right place (in between `sg' and `pn')
 | 
|---|
| 406 |       boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #(
 | 
|---|
| 407 |     (*) boost_rt_d='-d';;
 | 
|---|
| 408 |   esac
 | 
|---|
| 409 |   # If the PREFERRED-RT-OPT are not empty, prepend a `-'.
 | 
|---|
| 410 |   test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt"
 | 
|---|
| 411 |   $boost_guess_use_mt && boost_mt=-mt
 | 
|---|
| 412 |   # Look for the abs path the static archive.
 | 
|---|
| 413 |   # $libext is computed by Libtool but let's make sure it's non empty.
 | 
|---|
| 414 |   test -z "$libext" &&
 | 
|---|
| 415 |     AC_MSG_ERROR([the libext variable is empty, did you invoke Libtool?])
 | 
|---|
| 416 |   boost_save_ac_objext=$ac_objext
 | 
|---|
| 417 |   # Generate the test file.
 | 
|---|
| 418 |   AC_LANG_CONFTEST([AC_LANG_PROGRAM([$7
 | 
|---|
| 419 | #include <$4>
 | 
|---|
| 420 | $6], [$5])])
 | 
|---|
| 421 | dnl Optimization hacks: compiling C++ is slow, especially with Boost.  What
 | 
|---|
| 422 | dnl we're trying to do here is guess the right combination of link flags
 | 
|---|
| 423 | dnl (LIBS / LDFLAGS) to use a given library.  This can take several
 | 
|---|
| 424 | dnl iterations before it succeeds and is thus *very* slow.  So what we do
 | 
|---|
| 425 | dnl instead is that we compile the code first (and thus get an object file,
 | 
|---|
| 426 | dnl typically conftest.o).  Then we try various combinations of link flags
 | 
|---|
| 427 | dnl until we succeed to link conftest.o in an executable.  The problem is
 | 
|---|
| 428 | dnl that the various TRY_LINK / COMPILE_IFELSE macros of Autoconf always
 | 
|---|
| 429 | dnl remove all the temporary files including conftest.o.  So the trick here
 | 
|---|
| 430 | dnl is to temporarily change the value of ac_objext so that conftest.o is
 | 
|---|
| 431 | dnl preserved accross tests.  This is obviously fragile and I will burn in
 | 
|---|
| 432 | dnl hell for not respecting Autoconf's documented interfaces, but in the
 | 
|---|
| 433 | dnl mean time, it optimizes the macro by a factor of 5 to 30.
 | 
|---|
| 434 | dnl Another small optimization: the first argument of AC_COMPILE_IFELSE left
 | 
|---|
| 435 | dnl empty because the test file is generated only once above (before we
 | 
|---|
| 436 | dnl start the for loops).
 | 
|---|
| 437 |   AC_COMPILE_IFELSE([],
 | 
|---|
| 438 |     [ac_objext=do_not_rm_me_plz],
 | 
|---|
| 439 |     [AS_IF([test x"$8" != x"no"], [
 | 
|---|
| 440 |        AC_MSG_ERROR([cannot compile a test that uses Boost $1])
 | 
|---|
| 441 |      ])
 | 
|---|
| 442 |     ])
 | 
|---|
| 443 |   ac_objext=$boost_save_ac_objext
 | 
|---|
| 444 |   boost_failed_libs=
 | 
|---|
| 445 | # Don't bother to ident the following nested for loops, only the 2
 | 
|---|
| 446 | # innermost ones matter.
 | 
|---|
| 447 | for boost_lib_ in $2; do
 | 
|---|
| 448 | for boost_tag_ in -$boost_cv_lib_tag ''; do
 | 
|---|
| 449 | for boost_ver_ in -$boost_cv_lib_version ''; do
 | 
|---|
| 450 | for boost_mt_ in $boost_mt -mt -mt-x64 ''; do
 | 
|---|
| 451 | for boost_rtopt_ in $boost_rtopt '' -d; do
 | 
|---|
| 452 |   for boost_full_suffix in \
 | 
|---|
| 453 |     $boost_last_suffix \
 | 
|---|
| 454 |     x$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \
 | 
|---|
| 455 |     x$boost_tag_$boost_rtopt_$boost_ver_ \
 | 
|---|
| 456 |     x$boost_tag_$boost_mt_$boost_ver_ \
 | 
|---|
| 457 |     x$boost_tag_$boost_ver_
 | 
|---|
| 458 |   do
 | 
|---|
| 459 |     boost_real_suffix=`echo "$boost_full_suffix" | sed 's/^x//'`
 | 
|---|
| 460 |     boost_lib="boost_$boost_lib_$boost_real_suffix"
 | 
|---|
| 461 |     # Avoid testing twice the same lib
 | 
|---|
| 462 |     case $boost_failed_libs in #(
 | 
|---|
| 463 |       (*@$boost_lib@*) continue;;
 | 
|---|
| 464 |     esac
 | 
|---|
| 465 |     # If with_boost is empty, we'll search in /lib first, which is not quite
 | 
|---|
| 466 |     # right so instead we'll try to a location based on where the headers are.
 | 
|---|
| 467 |     boost_tmp_lib=$with_boost
 | 
|---|
| 468 |     test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include}
 | 
|---|
| 469 |     for boost_ldpath in "$boost_tmp_lib/lib" '' \
 | 
|---|
| 470 |              /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \
 | 
|---|
| 471 |              "$with_boost" C:/Boost/lib /lib*
 | 
|---|
| 472 |     do
 | 
|---|
| 473 |       # Don't waste time with directories that don't exist.
 | 
|---|
| 474 |       if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then
 | 
|---|
| 475 |         continue
 | 
|---|
| 476 |       fi
 | 
|---|
| 477 |       boost_save_LDFLAGS=$LDFLAGS
 | 
|---|
| 478 |       # Are we looking for a static library?
 | 
|---|
| 479 |       case $boost_ldpath:$boost_rtopt_ in #(
 | 
|---|
| 480 |         (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt)
 | 
|---|
| 481 |           Boost_lib_LIBS="$boost_ldpath/lib$boost_lib.$libext"
 | 
|---|
| 482 |           test -e "$Boost_lib_LIBS" || continue;; #(
 | 
|---|
| 483 |         (*) # No: use -lboost_foo to find the shared library.
 | 
|---|
| 484 |           Boost_lib_LIBS="-l$boost_lib";;
 | 
|---|
| 485 |       esac
 | 
|---|
| 486 |       boost_save_LIBS=$LIBS
 | 
|---|
| 487 |       LIBS="$Boost_lib_LIBS $LIBS"
 | 
|---|
| 488 |       test x"$boost_ldpath" != x && LDFLAGS="$LDFLAGS -L$boost_ldpath"
 | 
|---|
| 489 | dnl First argument of AC_LINK_IFELSE left empty because the test file is
 | 
|---|
| 490 | dnl generated only once above (before we start the for loops).
 | 
|---|
| 491 |       _BOOST_AC_LINK_IFELSE([],
 | 
|---|
| 492 |                             [Boost_lib=yes], [Boost_lib=no])
 | 
|---|
| 493 |       ac_objext=$boost_save_ac_objext
 | 
|---|
| 494 |       LDFLAGS=$boost_save_LDFLAGS
 | 
|---|
| 495 |       LIBS=$boost_save_LIBS
 | 
|---|
| 496 |       if test x"$Boost_lib" = xyes; then
 | 
|---|
| 497 |         # Check or used cached result of whether or not using -R or
 | 
|---|
| 498 |         # -rpath makes sense.  Some implementations of ld, such as for
 | 
|---|
| 499 |         # Mac OSX, require -rpath but -R is the flag known to work on
 | 
|---|
| 500 |         # other systems.  https://github.com/tsuna/boost.m4/issues/19
 | 
|---|
| 501 |         AC_CACHE_VAL([boost_cv_rpath_link_ldflag],
 | 
|---|
| 502 |           [case $boost_ldpath in
 | 
|---|
| 503 |            '') # Nothing to do.
 | 
|---|
| 504 |              boost_cv_rpath_link_ldflag=
 | 
|---|
| 505 |              boost_rpath_link_ldflag_found=yes;;
 | 
|---|
| 506 |            *)
 | 
|---|
| 507 |             for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do
 | 
|---|
| 508 |               LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
 | 
|---|
| 509 |               LIBS="$Boost_lib_LIBS $boost_save_LIBS"
 | 
|---|
| 510 |               _BOOST_AC_LINK_IFELSE([],
 | 
|---|
| 511 |                 [boost_rpath_link_ldflag_found=yes
 | 
|---|
| 512 |                 break],
 | 
|---|
| 513 |                 [boost_rpath_link_ldflag_found=no])
 | 
|---|
| 514 |             done
 | 
|---|
| 515 |             ;;
 | 
|---|
| 516 |           esac
 | 
|---|
| 517 |           AS_IF([test "x$boost_rpath_link_ldflag_found" != "xyes"],
 | 
|---|
| 518 |             [AC_MSG_ERROR([Unable to determine whether to use -R or -rpath])])
 | 
|---|
| 519 |           LDFLAGS=$boost_save_LDFLAGS
 | 
|---|
| 520 |           LIBS=$boost_save_LIBS
 | 
|---|
| 521 |           ])
 | 
|---|
| 522 |         test x"$boost_ldpath" != x &&
 | 
|---|
| 523 |           Boost_lib_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
 | 
|---|
| 524 |         Boost_lib_LDPATH="$boost_ldpath"
 | 
|---|
| 525 |         boost_last_suffix="$boost_full_suffix"
 | 
|---|
| 526 |         break 7
 | 
|---|
| 527 |       else
 | 
|---|
| 528 |         boost_failed_libs="$boost_failed_libs@$boost_lib@"
 | 
|---|
| 529 |       fi
 | 
|---|
| 530 |     done
 | 
|---|
| 531 |   done
 | 
|---|
| 532 | done
 | 
|---|
| 533 | done
 | 
|---|
| 534 | done
 | 
|---|
| 535 | done
 | 
|---|
| 536 | done # boost_lib_
 | 
|---|
| 537 | rm -f conftest.$ac_objext
 | 
|---|
| 538 | ])
 | 
|---|
| 539 | 
 | 
|---|
| 540 | 
 | 
|---|
| 541 | 
 | 
|---|
| 542 | # --------------------------------------- #
 | 
|---|
| 543 | # Checks for the various Boost libraries. #
 | 
|---|
| 544 | # --------------------------------------- #
 | 
|---|
| 545 | 
 | 
|---|
| 546 | # List of boost libraries: http://www.boost.org/libs/libraries.htm
 | 
|---|
| 547 | # The page http://beta.boost.org/doc/libs is useful: it gives the first release
 | 
|---|
| 548 | # version of each library (among other things).
 | 
|---|
| 549 | 
 | 
|---|
| 550 | # BOOST_DEFUN(LIBRARY, CODE)
 | 
|---|
| 551 | # --------------------------
 | 
|---|
| 552 | # Define BOOST_<LIBRARY-UPPERCASE> as a macro that runs CODE.
 | 
|---|
| 553 | #
 | 
|---|
| 554 | # Use indir to avoid the warning on underquoted macro name given to AC_DEFUN.
 | 
|---|
| 555 | m4_define([BOOST_DEFUN],
 | 
|---|
| 556 | [m4_indir([AC_DEFUN],
 | 
|---|
| 557 |           m4_toupper([BOOST_$1]),
 | 
|---|
| 558 | [m4_pushdef([BOOST_Library], [$1])dnl
 | 
|---|
| 559 | $2
 | 
|---|
| 560 | m4_popdef([BOOST_Library])dnl
 | 
|---|
| 561 | ])
 | 
|---|
| 562 | ])
 | 
|---|
| 563 | 
 | 
|---|
| 564 | 
 | 
|---|
| 565 | # BOOST_ANY()
 | 
|---|
| 566 | # ------------
 | 
|---|
| 567 | # Look for Boost.Any
 | 
|---|
| 568 | BOOST_DEFUN([Any],
 | 
|---|
| 569 | [BOOST_FIND_HEADER([boost/any.hpp])])
 | 
|---|
| 570 | 
 | 
|---|
| 571 | 
 | 
|---|
| 572 | # BOOST_ARRAY()
 | 
|---|
| 573 | # -------------
 | 
|---|
| 574 | # Look for Boost.Array
 | 
|---|
| 575 | BOOST_DEFUN([Array],
 | 
|---|
| 576 | [BOOST_FIND_HEADER([boost/array.hpp])])
 | 
|---|
| 577 | 
 | 
|---|
| 578 | 
 | 
|---|
| 579 | # BOOST_ASIO()
 | 
|---|
| 580 | # ------------
 | 
|---|
| 581 | # Look for Boost.Asio (new in Boost 1.35).
 | 
|---|
| 582 | BOOST_DEFUN([Asio],
 | 
|---|
| 583 | [AC_REQUIRE([BOOST_SYSTEM])dnl
 | 
|---|
| 584 | BOOST_FIND_HEADER([boost/asio.hpp])])
 | 
|---|
| 585 | 
 | 
|---|
| 586 | # BOOST_BIMAP()
 | 
|---|
| 587 | # ------------
 | 
|---|
| 588 | # Look for Boost.Bimap
 | 
|---|
| 589 | BOOST_DEFUN([Bimap],
 | 
|---|
| 590 | [BOOST_FIND_HEADER([boost/bimap.hpp])])
 | 
|---|
| 591 | 
 | 
|---|
| 592 | 
 | 
|---|
| 593 | # BOOST_ASSIGN()
 | 
|---|
| 594 | # -------------
 | 
|---|
| 595 | # Look for Boost.Assign
 | 
|---|
| 596 | BOOST_DEFUN([Assign],
 | 
|---|
| 597 | [BOOST_FIND_HEADER([boost/assign.hpp])])
 | 
|---|
| 598 | 
 | 
|---|
| 599 | 
 | 
|---|
| 600 | # BOOST_ATOMIC([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
 | 
|---|
| 601 | # -------------------------------
 | 
|---|
| 602 | # Look for Boost.Atomic.  For the documentation of PREFERRED-RT-OPT, see the
 | 
|---|
| 603 | # documentation of BOOST_FIND_LIB above.
 | 
|---|
| 604 | BOOST_DEFUN([Atomic],
 | 
|---|
| 605 | [BOOST_FIND_LIB([atomic], [$1],
 | 
|---|
| 606 |                 [boost/atomic.hpp],
 | 
|---|
| 607 |                 [boost::atomic<int> a;],
 | 
|---|
| 608 |                 [ ],
 | 
|---|
| 609 |                 [#ifdef HAVE_UNISTD_H
 | 
|---|
| 610 | #include <unistd.h>
 | 
|---|
| 611 | #endif
 | 
|---|
| 612 | #ifdef HAVE_STDINT_H
 | 
|---|
| 613 | #include <stdint.h>
 | 
|---|
| 614 | #endif], [$2])
 | 
|---|
| 615 | ])# BOOST_ATOMIC
 | 
|---|
| 616 | 
 | 
|---|
| 617 | 
 | 
|---|
| 618 | # BOOST_BIND()
 | 
|---|
| 619 | # ------------
 | 
|---|
| 620 | # Look for Boost.Bind.
 | 
|---|
| 621 | BOOST_DEFUN([Bind],
 | 
|---|
| 622 | [BOOST_FIND_HEADER([boost/bind.hpp])])
 | 
|---|
| 623 | 
 | 
|---|
| 624 | 
 | 
|---|
| 625 | # BOOST_CAST()
 | 
|---|
| 626 | # ------------
 | 
|---|
| 627 | # Look for Boost.Cast
 | 
|---|
| 628 | BOOST_DEFUN([Cast],
 | 
|---|
| 629 | [BOOST_FIND_HEADER([boost/cast.hpp])])
 | 
|---|
| 630 | 
 | 
|---|
| 631 | 
 | 
|---|
| 632 | # BOOST_CHRONO([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
 | 
|---|
| 633 | # --------------
 | 
|---|
| 634 | # Look for Boost.Chrono.
 | 
|---|
| 635 | BOOST_DEFUN([Chrono],
 | 
|---|
| 636 | [# Do we have to check for Boost.System?  This link-time dependency was
 | 
|---|
| 637 | # added as of 1.35.0.  If we have a version <1.35, we must not attempt to
 | 
|---|
| 638 | # find Boost.System as it didn't exist by then.
 | 
|---|
| 639 | if test $boost_major_version -ge 135; then
 | 
|---|
| 640 |   BOOST_SYSTEM([$1], [$2])
 | 
|---|
| 641 | fi # end of the Boost.System check.
 | 
|---|
| 642 | boost_filesystem_save_LIBS=$LIBS
 | 
|---|
| 643 | boost_filesystem_save_LDFLAGS=$LDFLAGS
 | 
|---|
| 644 | m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
 | 
|---|
| 645 | LIBS="$LIBS $BOOST_SYSTEM_LIBS"
 | 
|---|
| 646 | LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
 | 
|---|
| 647 | BOOST_FIND_LIB([chrono], [$1],
 | 
|---|
| 648 |                 [boost/chrono.hpp],
 | 
|---|
| 649 |                 [boost::chrono::thread_clock d;], [], [], [$2])
 | 
|---|
| 650 | if test $enable_static_boost = yes && test $boost_major_version -ge 135; then
 | 
|---|
| 651 |   BOOST_CHRONO_LIBS="$BOOST_CHRONO_LIBS $BOOST_SYSTEM_LIBS"
 | 
|---|
| 652 | fi
 | 
|---|
| 653 | LIBS=$boost_filesystem_save_LIBS
 | 
|---|
| 654 | LDFLAGS=$boost_filesystem_save_LDFLAGS
 | 
|---|
| 655 | ])# BOOST_CHRONO
 | 
|---|
| 656 | 
 | 
|---|
| 657 | 
 | 
|---|
| 658 | # BOOST_CONTEXT([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
 | 
|---|
| 659 | # -----------------------------------
 | 
|---|
| 660 | # Look for Boost.Context.  For the documentation of PREFERRED-RT-OPT, see the
 | 
|---|
| 661 | # documentation of BOOST_FIND_LIB above.
 | 
|---|
| 662 | #
 | 
|---|
| 663 | # * This library was introduced in Boost 1.51.0
 | 
|---|
| 664 | # * The signatures of make_fcontext() and jump_fcontext were changed in 1.56.0
 | 
|---|
| 665 | # * A dependency on boost_thread appears in 1.57.0
 | 
|---|
| 666 | # * The implementation details were moved to boost::context::detail in 1.61.0
 | 
|---|
| 667 | # * 1.61 also introduces execution_context_v2, which is the "lowest common
 | 
|---|
| 668 | #   denominator" for boost::context presence since then.
 | 
|---|
| 669 | # * boost::context::fiber was introduced in 1.69 and execution_context_v2 was
 | 
|---|
| 670 | #   removed in 1.72
 | 
|---|
| 671 | BOOST_DEFUN([Context],
 | 
|---|
| 672 | [boost_context_save_LIBS=$LIBS
 | 
|---|
| 673 |  boost_context_save_LDFLAGS=$LDFLAGS
 | 
|---|
| 674 | if test $boost_major_version -ge 157; then
 | 
|---|
| 675 |   BOOST_THREAD([$1], [$2])
 | 
|---|
| 676 |   m4_pattern_allow([^BOOST_THREAD_(LIBS|LDFLAGS)$])dnl
 | 
|---|
| 677 |   LIBS="$LIBS $BOOST_THREAD_LIBS"
 | 
|---|
| 678 |   LDFLAGS="$LDFLAGS $BOOST_THREAD_LDFLAGS"
 | 
|---|
| 679 | fi
 | 
|---|
| 680 | 
 | 
|---|
| 681 | if test $boost_major_version -ge 169; then
 | 
|---|
| 682 | 
 | 
|---|
| 683 | BOOST_FIND_LIB([context], [$1],
 | 
|---|
| 684 |                 [boost/context/fiber.hpp], [[
 | 
|---|
| 685 | namespace ctx=boost::context;
 | 
|---|
| 686 | int a;
 | 
|---|
| 687 | ctx::fiber source{[&a](ctx::fiber&& sink){
 | 
|---|
| 688 |     a=0;
 | 
|---|
| 689 |     int b=1;
 | 
|---|
| 690 |     for(;;){
 | 
|---|
| 691 |         sink=std::move(sink).resume();
 | 
|---|
| 692 |         int next=a+b;
 | 
|---|
| 693 |         a=b;
 | 
|---|
| 694 |         b=next;
 | 
|---|
| 695 |     }
 | 
|---|
| 696 |     return std::move(sink);
 | 
|---|
| 697 | }};
 | 
|---|
| 698 | for (int j=0;j<10;++j) {
 | 
|---|
| 699 |     source=std::move(source).resume();
 | 
|---|
| 700 | }
 | 
|---|
| 701 | return a == 34;
 | 
|---|
| 702 | ]], [], [], [$2])
 | 
|---|
| 703 | 
 | 
|---|
| 704 | elif test $boost_major_version -ge 161; then
 | 
|---|
| 705 | 
 | 
|---|
| 706 | BOOST_FIND_LIB([context], [$1],
 | 
|---|
| 707 |                 [boost/context/execution_context_v2.hpp], [[
 | 
|---|
| 708 | namespace ctx=boost::context;
 | 
|---|
| 709 | int res=0;
 | 
|---|
| 710 | int n=35;
 | 
|---|
| 711 | ctx::execution_context<int> source(
 | 
|---|
| 712 |     [n, &res](ctx::execution_context<int> sink, int) mutable {
 | 
|---|
| 713 |         int a=0;
 | 
|---|
| 714 |         int b=1;
 | 
|---|
| 715 |         while(n-->0){
 | 
|---|
| 716 |             auto result=sink(a);
 | 
|---|
| 717 |             sink=std::move(std::get<0>(result));
 | 
|---|
| 718 |             auto next=a+b;
 | 
|---|
| 719 |             a=b;
 | 
|---|
| 720 |             b=next;
 | 
|---|
| 721 |         }
 | 
|---|
| 722 |         return sink;
 | 
|---|
| 723 |     });
 | 
|---|
| 724 | for(int i=0;i<10;++i){
 | 
|---|
| 725 |     auto result=source(i);
 | 
|---|
| 726 |     source=std::move(std::get<0>(result));
 | 
|---|
| 727 |     res = std::get<1>(result);
 | 
|---|
| 728 | }
 | 
|---|
| 729 | return res == 34;
 | 
|---|
| 730 | ]], [], [], [$2])
 | 
|---|
| 731 | 
 | 
|---|
| 732 | else
 | 
|---|
| 733 | 
 | 
|---|
| 734 | BOOST_FIND_LIB([context], [$1],
 | 
|---|
| 735 |                 [boost/context/fcontext.hpp],[[
 | 
|---|
| 736 | 
 | 
|---|
| 737 | // creates a stack
 | 
|---|
| 738 | void * stack_pointer = new void*[4096];
 | 
|---|
| 739 | std::size_t const size = sizeof(void*[4096]);
 | 
|---|
| 740 | 
 | 
|---|
| 741 | #if BOOST_VERSION <= 105100
 | 
|---|
| 742 | ctx::make_fcontext(&fc, f);
 | 
|---|
| 743 | return ctx::jump_fcontext(&fcm, &fc, 3) == 6;
 | 
|---|
| 744 | 
 | 
|---|
| 745 | #else
 | 
|---|
| 746 | 
 | 
|---|
| 747 | fc = ctx::make_fcontext(stack_pointer, size, f);
 | 
|---|
| 748 | return ctx::jump_fcontext(&fcm, fc, 3) == 6;
 | 
|---|
| 749 | 
 | 
|---|
| 750 | #endif
 | 
|---|
| 751 | 
 | 
|---|
| 752 | 
 | 
|---|
| 753 | ]],[dnl
 | 
|---|
| 754 | 
 | 
|---|
| 755 | #include <boost/version.hpp>
 | 
|---|
| 756 | #if BOOST_VERSION <= 105100
 | 
|---|
| 757 | 
 | 
|---|
| 758 | namespace ctx = boost::ctx;
 | 
|---|
| 759 | 
 | 
|---|
| 760 | static ctx::fcontext_t fcm, fc;
 | 
|---|
| 761 | 
 | 
|---|
| 762 | static void f(intptr_t i) {
 | 
|---|
| 763 |     ctx::jump_fcontext(&fc, &fcm, i * 2);
 | 
|---|
| 764 | }
 | 
|---|
| 765 | 
 | 
|---|
| 766 | #elif BOOST_VERSION <= 105500
 | 
|---|
| 767 | 
 | 
|---|
| 768 | namespace ctx = boost::context;
 | 
|---|
| 769 | 
 | 
|---|
| 770 | // context
 | 
|---|
| 771 | static ctx::fcontext_t fcm, *fc;
 | 
|---|
| 772 | 
 | 
|---|
| 773 | // context-function
 | 
|---|
| 774 | static void f(intptr_t i) {
 | 
|---|
| 775 |     ctx::jump_fcontext(fc, &fcm, i * 2);
 | 
|---|
| 776 | }
 | 
|---|
| 777 | 
 | 
|---|
| 778 | #else
 | 
|---|
| 779 | 
 | 
|---|
| 780 | namespace ctx = boost::context;
 | 
|---|
| 781 | 
 | 
|---|
| 782 | // context
 | 
|---|
| 783 | static ctx::fcontext_t fcm, fc;
 | 
|---|
| 784 | 
 | 
|---|
| 785 | // context-function
 | 
|---|
| 786 | static void f(intptr_t i) {
 | 
|---|
| 787 |     ctx::jump_fcontext(&fc, fcm, i * 2);
 | 
|---|
| 788 | }
 | 
|---|
| 789 | #endif
 | 
|---|
| 790 | ], [], [], [$2])
 | 
|---|
| 791 | 
 | 
|---|
| 792 | fi
 | 
|---|
| 793 | 
 | 
|---|
| 794 | LIBS=$boost_context_save_LIBS
 | 
|---|
| 795 | LDFLAGS=$boost_context_save_LDFLAGS
 | 
|---|
| 796 | ])# BOOST_CONTEXT
 | 
|---|
| 797 | 
 | 
|---|
| 798 | 
 | 
|---|
| 799 | # BOOST_CONVERSION()
 | 
|---|
| 800 | # ------------------
 | 
|---|
| 801 | # Look for Boost.Conversion (cast / lexical_cast)
 | 
|---|
| 802 | BOOST_DEFUN([Conversion],
 | 
|---|
| 803 | [BOOST_FIND_HEADER([boost/cast.hpp])
 | 
|---|
| 804 | BOOST_FIND_HEADER([boost/lexical_cast.hpp])
 | 
|---|
| 805 | ])# BOOST_CONVERSION
 | 
|---|
| 806 | 
 | 
|---|
| 807 | 
 | 
|---|
| 808 | # BOOST_COROUTINE([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
 | 
|---|
| 809 | # -----------------------------------
 | 
|---|
| 810 | # Look for Boost.Coroutine.  For the documentation of PREFERRED-RT-OPT, see the
 | 
|---|
| 811 | # documentation of BOOST_FIND_LIB above.  This library was introduced in Boost
 | 
|---|
| 812 | # 1.53.0
 | 
|---|
| 813 | BOOST_DEFUN([Coroutine],
 | 
|---|
| 814 | [
 | 
|---|
| 815 | boost_coroutine_save_LIBS=$LIBS
 | 
|---|
| 816 | boost_coroutine_save_LDFLAGS=$LDFLAGS
 | 
|---|
| 817 | # Link-time dependency from coroutine to context
 | 
|---|
| 818 | BOOST_CONTEXT([$1], [$2])
 | 
|---|
| 819 | # Starting from Boost 1.55 a dependency on Boost.System is added
 | 
|---|
| 820 | if test $boost_major_version -ge 155; then
 | 
|---|
| 821 |   BOOST_SYSTEM([$1], [$2])
 | 
|---|
| 822 | fi
 | 
|---|
| 823 | m4_pattern_allow([^BOOST_(CONTEXT|SYSTEM)_(LIBS|LDFLAGS)])
 | 
|---|
| 824 | LIBS="$LIBS $BOOST_CONTEXT_LIBS $BOOST_SYSTEM_LIBS"
 | 
|---|
| 825 | LDFLAGS="$LDFLAGS $BOOST_CONTEXT_LDFLAGS"
 | 
|---|
| 826 | 
 | 
|---|
| 827 | # in 1.53 coroutine was a header only library
 | 
|---|
| 828 | if test $boost_major_version -eq 153; then
 | 
|---|
| 829 |   AS_IF([test x"$2" = "xno"], [not_found_header='true'])
 | 
|---|
| 830 |   BOOST_FIND_HEADER([boost/coroutine/coroutine.hpp], [$not_found_header])
 | 
|---|
| 831 | else
 | 
|---|
| 832 |   BOOST_FIND_LIB([coroutine], [$1],
 | 
|---|
| 833 |                   [boost/coroutine/coroutine.hpp],
 | 
|---|
| 834 |                   [
 | 
|---|
| 835 |   #include <boost/version.hpp>
 | 
|---|
| 836 |   #if   BOOST_VERSION <= 105500
 | 
|---|
| 837 |   boost::coroutines::coroutine<int(int)> coro; coro.get();
 | 
|---|
| 838 |   #else
 | 
|---|
| 839 |   boost::coroutines::asymmetric_coroutine<int>::pull_type coro; coro.get();
 | 
|---|
| 840 |   #endif
 | 
|---|
| 841 |   ], [], [], [$2])
 | 
|---|
| 842 | fi
 | 
|---|
| 843 | # Link-time dependency from coroutine to context, existed only in 1.53, in 1.54
 | 
|---|
| 844 | # coroutine doesn't use context from its headers but from its library.
 | 
|---|
| 845 | if test $boost_major_version -eq 153 || test $enable_static_boost = yes && test $boost_major_version -ge 154; then
 | 
|---|
| 846 |   BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_CONTEXT_LIBS"
 | 
|---|
| 847 |   BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_CONTEXT_LDFLAGS"
 | 
|---|
| 848 | fi
 | 
|---|
| 849 | if test $enable_static_boost = yes && test $boost_major_version -ge 155; then
 | 
|---|
| 850 |   BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_SYSTEM_LIBS"
 | 
|---|
| 851 |   BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_SYSTEM_LDFLAGS"
 | 
|---|
| 852 | fi
 | 
|---|
| 853 | LIBS=$boost_coroutine_save_LIBS
 | 
|---|
| 854 | LDFLAGS=$boost_coroutine_save_LDFLAGS
 | 
|---|
| 855 | ])# BOOST_COROUTINE
 | 
|---|
| 856 | 
 | 
|---|
| 857 | 
 | 
|---|
| 858 | # BOOST_CRC()
 | 
|---|
| 859 | # -----------
 | 
|---|
| 860 | # Look for Boost.CRC
 | 
|---|
| 861 | BOOST_DEFUN([CRC],
 | 
|---|
| 862 | [BOOST_FIND_HEADER([boost/crc.hpp])
 | 
|---|
| 863 | ])# BOOST_CRC
 | 
|---|
| 864 | 
 | 
|---|
| 865 | 
 | 
|---|
| 866 | # BOOST_DATE_TIME([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
 | 
|---|
| 867 | # -----------------------------------
 | 
|---|
| 868 | # Look for Boost.Date_Time.  For the documentation of PREFERRED-RT-OPT, see the
 | 
|---|
| 869 | # documentation of BOOST_FIND_LIB above.
 | 
|---|
| 870 | BOOST_DEFUN([Date_Time],
 | 
|---|
| 871 | [BOOST_FIND_LIB([date_time], [$1],
 | 
|---|
| 872 |                 [boost/date_time/posix_time/posix_time.hpp],
 | 
|---|
| 873 |                 [boost::posix_time::ptime t;], [], [], [$2])
 | 
|---|
| 874 | ])# BOOST_DATE_TIME
 | 
|---|
| 875 | 
 | 
|---|
| 876 | 
 | 
|---|
| 877 | # BOOST_EXCEPTION()
 | 
|---|
| 878 | # ------------
 | 
|---|
| 879 | # Look for Boost.Exception
 | 
|---|
| 880 | BOOST_DEFUN([Exception],
 | 
|---|
| 881 | [BOOST_FIND_HEADER([boost/exception/all.hpp])])
 | 
|---|
| 882 | 
 | 
|---|
| 883 | 
 | 
|---|
| 884 | # BOOST_FILESYSTEM([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
 | 
|---|
| 885 | # ------------------------------------
 | 
|---|
| 886 | # Look for Boost.Filesystem.  For the documentation of PREFERRED-RT-OPT, see
 | 
|---|
| 887 | # the documentation of BOOST_FIND_LIB above.
 | 
|---|
| 888 | # Do not check for boost/filesystem.hpp because this file was introduced in
 | 
|---|
| 889 | # 1.34.
 | 
|---|
| 890 | BOOST_DEFUN([Filesystem],
 | 
|---|
| 891 | [# Do we have to check for Boost.System?  This link-time dependency was
 | 
|---|
| 892 | # added as of 1.35.0.  If we have a version <1.35, we must not attempt to
 | 
|---|
| 893 | # find Boost.System as it didn't exist by then.
 | 
|---|
| 894 | if test $boost_major_version -ge 135; then
 | 
|---|
| 895 |   BOOST_SYSTEM([$1], [$2])
 | 
|---|
| 896 | fi # end of the Boost.System check.
 | 
|---|
| 897 | boost_filesystem_save_LIBS=$LIBS
 | 
|---|
| 898 | boost_filesystem_save_LDFLAGS=$LDFLAGS
 | 
|---|
| 899 | m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
 | 
|---|
| 900 | LIBS="$LIBS $BOOST_SYSTEM_LIBS"
 | 
|---|
| 901 | LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
 | 
|---|
| 902 | BOOST_FIND_LIB([filesystem], [$1],
 | 
|---|
| 903 |                 [boost/filesystem/path.hpp], [boost::filesystem::path p;],
 | 
|---|
| 904 |                 [], [], [$2])
 | 
|---|
| 905 | if test $enable_static_boost = yes && test $boost_major_version -ge 135; then
 | 
|---|
| 906 |   BOOST_FILESYSTEM_LIBS="$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"
 | 
|---|
| 907 | fi
 | 
|---|
| 908 | LIBS=$boost_filesystem_save_LIBS
 | 
|---|
| 909 | LDFLAGS=$boost_filesystem_save_LDFLAGS
 | 
|---|
| 910 | ])# BOOST_FILESYSTEM
 | 
|---|
| 911 | 
 | 
|---|
| 912 | 
 | 
|---|
| 913 | # BOOST_FLYWEIGHT()
 | 
|---|
| 914 | # -----------------
 | 
|---|
| 915 | # Look for Boost.Flyweight.
 | 
|---|
| 916 | BOOST_DEFUN([Flyweight],
 | 
|---|
| 917 | [dnl There's a hidden dependency on pthreads.
 | 
|---|
| 918 | AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl
 | 
|---|
| 919 | BOOST_FIND_HEADER([boost/flyweight.hpp])
 | 
|---|
| 920 | AC_SUBST([BOOST_FLYWEIGHT_LIBS], [$boost_cv_pthread_flag])
 | 
|---|
| 921 | ])
 | 
|---|
| 922 | 
 | 
|---|
| 923 | 
 | 
|---|
| 924 | # BOOST_FOREACH()
 | 
|---|
| 925 | # ---------------
 | 
|---|
| 926 | # Look for Boost.Foreach.
 | 
|---|
| 927 | BOOST_DEFUN([Foreach],
 | 
|---|
| 928 | [BOOST_FIND_HEADER([boost/foreach.hpp])])
 | 
|---|
| 929 | 
 | 
|---|
| 930 | 
 | 
|---|
| 931 | # BOOST_FORMAT()
 | 
|---|
| 932 | # --------------
 | 
|---|
| 933 | # Look for Boost.Format.
 | 
|---|
| 934 | # Note: we can't check for boost/format/format_fwd.hpp because the header isn't
 | 
|---|
| 935 | # standalone.  It can't be compiled because it triggers the following error:
 | 
|---|
| 936 | # boost/format/detail/config_macros.hpp:88: error: 'locale' in namespace 'std'
 | 
|---|
| 937 | #                                                  does not name a type
 | 
|---|
| 938 | BOOST_DEFUN([Format],
 | 
|---|
| 939 | [BOOST_FIND_HEADER([boost/format.hpp])])
 | 
|---|
| 940 | 
 | 
|---|
| 941 | 
 | 
|---|
| 942 | # BOOST_FUNCTION()
 | 
|---|
| 943 | # ----------------
 | 
|---|
| 944 | # Look for Boost.Function
 | 
|---|
| 945 | BOOST_DEFUN([Function],
 | 
|---|
| 946 | [BOOST_FIND_HEADER([boost/function.hpp])])
 | 
|---|
| 947 | 
 | 
|---|
| 948 | 
 | 
|---|
| 949 | # BOOST_FUSION()
 | 
|---|
| 950 | # -----------------
 | 
|---|
| 951 | # Look for Boost.Fusion
 | 
|---|
| 952 | BOOST_DEFUN([Fusion],
 | 
|---|
| 953 | [BOOST_FIND_HEADER([boost/fusion/sequence.hpp])])
 | 
|---|
| 954 | 
 | 
|---|
| 955 | 
 | 
|---|
| 956 | # BOOST_GEOMETRY()
 | 
|---|
| 957 | # ----------------
 | 
|---|
| 958 | # Look for Boost.Geometry (new since 1.47.0).
 | 
|---|
| 959 | BOOST_DEFUN([Geometry],
 | 
|---|
| 960 | [BOOST_FIND_HEADER([boost/geometry.hpp])
 | 
|---|
| 961 | ])# BOOST_GEOMETRY
 | 
|---|
| 962 | 
 | 
|---|
| 963 | 
 | 
|---|
| 964 | # BOOST_GRAPH([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
 | 
|---|
| 965 | # -------------------------------
 | 
|---|
| 966 | # Look for Boost.Graphs.  For the documentation of PREFERRED-RT-OPT, see the
 | 
|---|
| 967 | # documentation of BOOST_FIND_LIB above.
 | 
|---|
| 968 | BOOST_DEFUN([Graph],
 | 
|---|
| 969 | [boost_graph_save_LIBS=$LIBS
 | 
|---|
| 970 | boost_graph_save_LDFLAGS=$LDFLAGS
 | 
|---|
| 971 | # Link-time dependency from graph to regex was added as of 1.40.0.
 | 
|---|
| 972 | if test $boost_major_version -ge 140; then
 | 
|---|
| 973 |   BOOST_REGEX([$1], [$2])
 | 
|---|
| 974 |   m4_pattern_allow([^BOOST_REGEX_(LIBS|LDFLAGS)$])dnl
 | 
|---|
| 975 |   LIBS="$LIBS $BOOST_REGEX_LIBS"
 | 
|---|
| 976 |   LDFLAGS="$LDFLAGS $BOOST_REGEX_LDFLAGS"
 | 
|---|
| 977 | fi
 | 
|---|
| 978 | BOOST_FIND_LIB([graph], [$1],
 | 
|---|
| 979 |                 [boost/graph/adjacency_list.hpp], [boost::adjacency_list<> g;],
 | 
|---|
| 980 |                 [], [], [$2])
 | 
|---|
| 981 | LIBS=$boost_graph_save_LIBS
 | 
|---|
| 982 | LDFLAGS=$boost_graph_save_LDFLAGS
 | 
|---|
| 983 | ])# BOOST_GRAPH
 | 
|---|
| 984 | 
 | 
|---|
| 985 | 
 | 
|---|
| 986 | # BOOST_HASH()
 | 
|---|
| 987 | # ------------
 | 
|---|
| 988 | # Look for Boost.Functional/Hash
 | 
|---|
| 989 | BOOST_DEFUN([Hash],
 | 
|---|
| 990 | [BOOST_FIND_HEADER([boost/functional/hash.hpp])])
 | 
|---|
| 991 | 
 | 
|---|
| 992 | 
 | 
|---|
| 993 | # BOOST_IOSTREAMS([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
 | 
|---|
| 994 | # -----------------------------------
 | 
|---|
| 995 | # Look for Boost.IOStreams.  For the documentation of PREFERRED-RT-OPT, see the
 | 
|---|
| 996 | # documentation of BOOST_FIND_LIB above.
 | 
|---|
| 997 | BOOST_DEFUN([IOStreams],
 | 
|---|
| 998 | [BOOST_FIND_LIB([iostreams], [$1],
 | 
|---|
| 999 |                 [boost/iostreams/device/file_descriptor.hpp],
 | 
|---|
| 1000 |                 [boost::iostreams::file_descriptor fd; fd.close();],
 | 
|---|
| 1001 |                 [], [], [$2])
 | 
|---|
| 1002 | ])# BOOST_IOSTREAMS
 | 
|---|
| 1003 | 
 | 
|---|
| 1004 | 
 | 
|---|
| 1005 | # BOOST_ITERATOR()
 | 
|---|
| 1006 | # ------------
 | 
|---|
| 1007 | # Look for Boost.Iterator
 | 
|---|
| 1008 | BOOST_DEFUN([Iterator],
 | 
|---|
| 1009 | [BOOST_FIND_HEADER([boost/iterator/iterator_adaptor.hpp])])
 | 
|---|
| 1010 | 
 | 
|---|
| 1011 | 
 | 
|---|
| 1012 | # BOOST_LAMBDA()
 | 
|---|
| 1013 | # --------------
 | 
|---|
| 1014 | # Look for Boost.Lambda
 | 
|---|
| 1015 | BOOST_DEFUN([Lambda],
 | 
|---|
| 1016 | [BOOST_FIND_HEADER([boost/lambda/lambda.hpp])])
 | 
|---|
| 1017 | 
 | 
|---|
| 1018 | 
 | 
|---|
| 1019 | # BOOST_LOCALE([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
 | 
|---|
| 1020 | # --------------
 | 
|---|
| 1021 | # Look for Boost.Locale
 | 
|---|
| 1022 | BOOST_DEFUN([Locale],
 | 
|---|
| 1023 | [
 | 
|---|
| 1024 | boost_locale_save_LIBS=$LIBS
 | 
|---|
| 1025 | boost_locale_save_LDFLAGS=$LDFLAGS
 | 
|---|
| 1026 | # require SYSTEM for boost-1.50.0 and up
 | 
|---|
| 1027 | if test $boost_major_version -ge 150; then
 | 
|---|
| 1028 |   BOOST_SYSTEM([$1], [$2])
 | 
|---|
| 1029 |   m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
 | 
|---|
| 1030 |   LIBS="$LIBS $BOOST_SYSTEM_LIBS"
 | 
|---|
| 1031 |   LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
 | 
|---|
| 1032 | fi # end of the Boost.System check.
 | 
|---|
| 1033 | BOOST_FIND_LIB([locale], [$1],
 | 
|---|
| 1034 |     [boost/locale.hpp],
 | 
|---|
| 1035 |     [[boost::locale::generator gen; std::locale::global(gen(""));]], [], [], [$2])
 | 
|---|
| 1036 | LIBS=$boost_locale_save_LIBS
 | 
|---|
| 1037 | LDFLAGS=$boost_locale_save_LDFLAGS
 | 
|---|
| 1038 | ])# BOOST_LOCALE
 | 
|---|
| 1039 | 
 | 
|---|
| 1040 | # BOOST_LOG([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
 | 
|---|
| 1041 | # -----------------------------
 | 
|---|
| 1042 | # Look for Boost.Log.  For the documentation of PREFERRED-RT-OPT, see the
 | 
|---|
| 1043 | # documentation of BOOST_FIND_LIB above.
 | 
|---|
| 1044 | BOOST_DEFUN([Log],
 | 
|---|
| 1045 | [boost_log_save_LIBS=$LIBS
 | 
|---|
| 1046 | boost_log_save_LDFLAGS=$LDFLAGS
 | 
|---|
| 1047 | BOOST_SYSTEM([$1], [$2])
 | 
|---|
| 1048 | BOOST_FILESYSTEM([$1], [$2])
 | 
|---|
| 1049 | BOOST_DATE_TIME([$1], [$2])
 | 
|---|
| 1050 | m4_pattern_allow([^BOOST_(SYSTEM|FILESYSTEM|DATE_TIME)_(LIBS|LDFLAGS)$])dnl
 | 
|---|
| 1051 | LIBS="$LIBS $BOOST_DATE_TIME_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"
 | 
|---|
| 1052 | LDFLAGS="$LDFLAGS $BOOST_DATE_TIME_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS $BOOST_SYSTEM_LDFLAGS"
 | 
|---|
| 1053 | BOOST_FIND_LIB([log], [$1],
 | 
|---|
| 1054 |     [boost/log/core/core.hpp],
 | 
|---|
| 1055 |     [boost::log::attribute a; a.get_value();], [], [], [$2])
 | 
|---|
| 1056 | LIBS=$boost_log_save_LIBS
 | 
|---|
| 1057 | LDFLAGS=$boost_log_save_LDFLAGS
 | 
|---|
| 1058 | ])# BOOST_LOG
 | 
|---|
| 1059 | 
 | 
|---|
| 1060 | 
 | 
|---|
| 1061 | # BOOST_LOG_SETUP([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
 | 
|---|
| 1062 | # -----------------------------------
 | 
|---|
| 1063 | # Look for Boost.Log.  For the documentation of PREFERRED-RT-OPT, see the
 | 
|---|
| 1064 | # documentation of BOOST_FIND_LIB above.
 | 
|---|
| 1065 | BOOST_DEFUN([Log_Setup],
 | 
|---|
| 1066 | [boost_log_setup_save_LIBS=$LIBS
 | 
|---|
| 1067 | boost_log_setup_save_LDFLAGS=$LDFLAGS
 | 
|---|
| 1068 | BOOST_LOG([$1])
 | 
|---|
| 1069 | m4_pattern_allow([^BOOST_LOG_(LIBS|LDFLAGS)$])dnl
 | 
|---|
| 1070 | LIBS="$LIBS $BOOST_LOG_LIBS"
 | 
|---|
| 1071 | LDFLAGS="$LDFLAGS $BOOST_LOG_LDFLAGS"
 | 
|---|
| 1072 | BOOST_FIND_LIB([log_setup], [$1],
 | 
|---|
| 1073 |     [boost/log/utility/setup/from_settings.hpp],
 | 
|---|
| 1074 |     [boost::log::basic_settings<char> bs; bs.empty();], [], [], [$2])
 | 
|---|
| 1075 | LIBS=$boost_log_setup_save_LIBS
 | 
|---|
| 1076 | LDFLAGS=$boost_log_setup_save_LDFLAGS
 | 
|---|
| 1077 | ])# BOOST_LOG_SETUP
 | 
|---|
| 1078 | 
 | 
|---|
| 1079 | 
 | 
|---|
| 1080 | # BOOST_MATH()
 | 
|---|
| 1081 | # ------------
 | 
|---|
| 1082 | # Look for Boost.Math
 | 
|---|
| 1083 | # TODO: This library isn't header-only but it comes in multiple different
 | 
|---|
| 1084 | # flavors that don't play well with BOOST_FIND_LIB (e.g, libboost_math_c99,
 | 
|---|
| 1085 | # libboost_math_c99f, libboost_math_c99l, libboost_math_tr1,
 | 
|---|
| 1086 | # libboost_math_tr1f, libboost_math_tr1l).  This macro must be fixed to do the
 | 
|---|
| 1087 | # right thing anyway.
 | 
|---|
| 1088 | BOOST_DEFUN([Math],
 | 
|---|
| 1089 | [BOOST_FIND_HEADER([boost/math/special_functions.hpp])])
 | 
|---|
| 1090 | 
 | 
|---|
| 1091 | 
 | 
|---|
| 1092 | # BOOST_MPI([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
 | 
|---|
| 1093 | # -------------------------------
 | 
|---|
| 1094 | # Look for Boost MPI.  For the documentation of PREFERRED-RT-OPT, see the
 | 
|---|
| 1095 | # documentation of BOOST_FIND_LIB above.  Uses MPICXX variable if it is
 | 
|---|
| 1096 | # set, otherwise tries CXX
 | 
|---|
| 1097 | #
 | 
|---|
| 1098 | BOOST_DEFUN([MPI],
 | 
|---|
| 1099 | [boost_save_CXX=${CXX}
 | 
|---|
| 1100 | boost_save_CXXCPP=${CXXCPP}
 | 
|---|
| 1101 | if test x"${MPICXX}" != x; then
 | 
|---|
| 1102 |   CXX=${MPICXX}
 | 
|---|
| 1103 |   CXXCPP="${MPICXX} -E"
 | 
|---|
| 1104 | fi
 | 
|---|
| 1105 | BOOST_FIND_LIB([mpi], [$1],
 | 
|---|
| 1106 |                [boost/mpi.hpp],
 | 
|---|
| 1107 |                [int argc = 0;
 | 
|---|
| 1108 |                 char **argv = 0;
 | 
|---|
| 1109 |                 boost::mpi::environment env(argc,argv);],
 | 
|---|
| 1110 |                [], [], [$2])
 | 
|---|
| 1111 | CXX=${boost_save_CXX}
 | 
|---|
| 1112 | CXXCPP=${boost_save_CXXCPP}
 | 
|---|
| 1113 | ])# BOOST_MPI
 | 
|---|
| 1114 | 
 | 
|---|
| 1115 | 
 | 
|---|
| 1116 | # BOOST_MPL()
 | 
|---|
| 1117 | # ------------------
 | 
|---|
| 1118 | # Look for Boost.MPL
 | 
|---|
| 1119 | BOOST_DEFUN([MPL],
 | 
|---|
| 1120 | [BOOST_FIND_HEADER([boost/mpl/for_each.hpp])])
 | 
|---|
| 1121 | 
 | 
|---|
| 1122 | 
 | 
|---|
| 1123 | # BOOST_MULTIARRAY()
 | 
|---|
| 1124 | # ------------------
 | 
|---|
| 1125 | # Look for Boost.MultiArray
 | 
|---|
| 1126 | BOOST_DEFUN([MultiArray],
 | 
|---|
| 1127 | [BOOST_FIND_HEADER([boost/multi_array.hpp])])
 | 
|---|
| 1128 | 
 | 
|---|
| 1129 | 
 | 
|---|
| 1130 | # BOOST_MULTIINDEXCCONTAINER()
 | 
|---|
| 1131 | # ------------------
 | 
|---|
| 1132 | # Look for Boost.MultiIndexContainer
 | 
|---|
| 1133 | BOOST_DEFUN([MultiIndexContainer],
 | 
|---|
| 1134 | [BOOST_FIND_HEADER([boost/multi_index_container.hpp])])
 | 
|---|
| 1135 | 
 | 
|---|
| 1136 | 
 | 
|---|
| 1137 | # BOOST_NUMERIC_UBLAS()
 | 
|---|
| 1138 | # --------------------------
 | 
|---|
| 1139 | # Look for Boost.NumericUblas (Basic Linear Algebra)
 | 
|---|
| 1140 | BOOST_DEFUN([Numeric_Ublas],
 | 
|---|
| 1141 | [BOOST_FIND_HEADER([boost/numeric/ublas/vector.hpp])
 | 
|---|
| 1142 | ])# BOOST_NUMERIC_UBLAS
 | 
|---|
| 1143 | 
 | 
|---|
| 1144 | 
 | 
|---|
| 1145 | # BOOST_NUMERIC_CONVERSION()
 | 
|---|
| 1146 | # --------------------------
 | 
|---|
| 1147 | # Look for Boost.NumericConversion (policy-based numeric conversion)
 | 
|---|
| 1148 | BOOST_DEFUN([Numeric_Conversion],
 | 
|---|
| 1149 | [BOOST_FIND_HEADER([boost/numeric/conversion/converter.hpp])
 | 
|---|
| 1150 | ])# BOOST_NUMERIC_CONVERSION
 | 
|---|
| 1151 | 
 | 
|---|
| 1152 | 
 | 
|---|
| 1153 | # BOOST_NUMPY([PREFERRED-RT-OPT])
 | 
|---|
| 1154 | # --------------------------------
 | 
|---|
| 1155 | # Look for Boost.Python.Numpy.  For the documentation of PREFERRED-RT-OPT,
 | 
|---|
| 1156 | # see the documentation of BOOST_FIND_LIB above.
 | 
|---|
| 1157 | BOOST_DEFUN([Numpy],
 | 
|---|
| 1158 | [m4_pattern_allow([^BOOST_PYTHON_(LIBS|LDFLAGS)$])dnl
 | 
|---|
| 1159 | LIBS="$LIBS $BOOST_PYTHON_LIBS $BOOST_PYTHON_LIB"
 | 
|---|
| 1160 | LDFLAGS="$LDFLAGS $BOOST_PYTHON_LDFLAGS"
 | 
|---|
| 1161 | CPPFLAGS="$CPPFLAGS $BOOST_PYTHON_CPPFLAGS"
 | 
|---|
| 1162 | BOOST_FIND_LIBS([numpy], [numpy numpy3], [$1],
 | 
|---|
| 1163 |                 [boost/python/numpy.hpp],
 | 
|---|
| 1164 |                 [ boost::python::numpy::initialize();], [])
 | 
|---|
| 1165 | CPPFLAGS=$boost_numpy_save_CPPFLAGS
 | 
|---|
| 1166 | LDFLAGS=$boost_numpy_save_LDFLAGS
 | 
|---|
| 1167 | LIBS=$boost_numpy_save_LIBS
 | 
|---|
| 1168 | ])# BOOST_NUMPY
 | 
|---|
| 1169 | 
 | 
|---|
| 1170 | 
 | 
|---|
| 1171 | # BOOST_OPTIONAL()
 | 
|---|
| 1172 | # ----------------
 | 
|---|
| 1173 | # Look for Boost.Optional
 | 
|---|
| 1174 | BOOST_DEFUN([Optional],
 | 
|---|
| 1175 | [BOOST_FIND_HEADER([boost/optional.hpp])])
 | 
|---|
| 1176 | 
 | 
|---|
| 1177 | 
 | 
|---|
| 1178 | # BOOST_PREPROCESSOR()
 | 
|---|
| 1179 | # --------------------
 | 
|---|
| 1180 | # Look for Boost.Preprocessor
 | 
|---|
| 1181 | BOOST_DEFUN([Preprocessor],
 | 
|---|
| 1182 | [BOOST_FIND_HEADER([boost/preprocessor/repeat.hpp])])
 | 
|---|
| 1183 | 
 | 
|---|
| 1184 | 
 | 
|---|
| 1185 | # BOOST_PROPERTY_TREE([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
 | 
|---|
| 1186 | # -----------------------------------------
 | 
|---|
| 1187 | # Look for Boost.Property_Tree.  For the documentation of PREFERRED-RT-OPT,
 | 
|---|
| 1188 | # see the documentation of BOOST_FIND_LIB above.
 | 
|---|
| 1189 | BOOST_DEFUN([Property_Tree],
 | 
|---|
| 1190 | [BOOST_FIND_LIB([property_tree], [$1],
 | 
|---|
| 1191 |                 [boost/property_tree/ptree.hpp],
 | 
|---|
| 1192 |                 [boost::property_tree::ptree pt; boost::property_tree::read_xml d("test", pt);],
 | 
|---|
| 1193 |                 [], [], [$2])
 | 
|---|
| 1194 | ])# BOOST_PROPERTY_TREE
 | 
|---|
| 1195 | 
 | 
|---|
| 1196 | 
 | 
|---|
| 1197 | # BOOST_RANDOM()
 | 
|---|
| 1198 | # --------------------
 | 
|---|
| 1199 | # Look for Boost.Random
 | 
|---|
| 1200 | BOOST_DEFUN([Random],
 | 
|---|
| 1201 | [BOOST_FIND_HEADER([boost/random/random_number_generator.hpp])])
 | 
|---|
| 1202 | 
 | 
|---|
| 1203 | 
 | 
|---|
| 1204 | # BOOST_RANGE()
 | 
|---|
| 1205 | # --------------------
 | 
|---|
| 1206 | # Look for Boost.Range
 | 
|---|
| 1207 | BOOST_DEFUN([Range],
 | 
|---|
| 1208 | [BOOST_FIND_HEADER([boost/range/adaptors.hpp])])
 | 
|---|
| 1209 | 
 | 
|---|
| 1210 | # BOOST_UNORDERED()
 | 
|---|
| 1211 | # -----------------
 | 
|---|
| 1212 | # Look for Boost.Unordered
 | 
|---|
| 1213 | BOOST_DEFUN([Unordered],
 | 
|---|
| 1214 | [BOOST_FIND_HEADER([boost/unordered_map.hpp])])
 | 
|---|
| 1215 | 
 | 
|---|
| 1216 | 
 | 
|---|
| 1217 | # BOOST_UUID()
 | 
|---|
| 1218 | # ------------
 | 
|---|
| 1219 | # Look for Boost.Uuid
 | 
|---|
| 1220 | BOOST_DEFUN([Uuid],
 | 
|---|
| 1221 | [BOOST_FIND_HEADER([boost/uuid/uuid.hpp])])
 | 
|---|
| 1222 | 
 | 
|---|
| 1223 | 
 | 
|---|
| 1224 | # BOOST_PROGRAM_OPTIONS([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
 | 
|---|
| 1225 | # -----------------------------------------
 | 
|---|
| 1226 | # Look for Boost.Program_options.  For the documentation of PREFERRED-RT-OPT,
 | 
|---|
| 1227 | # see the documentation of BOOST_FIND_LIB above.
 | 
|---|
| 1228 | BOOST_DEFUN([Program_Options],
 | 
|---|
| 1229 | [BOOST_FIND_LIB([program_options], [$1],
 | 
|---|
| 1230 |                 [boost/program_options.hpp],
 | 
|---|
| 1231 |                 [boost::program_options::options_description d("test");],
 | 
|---|
| 1232 |                 [], [], [$2])
 | 
|---|
| 1233 | ])# BOOST_PROGRAM_OPTIONS
 | 
|---|
| 1234 | 
 | 
|---|
| 1235 | 
 | 
|---|
| 1236 | 
 | 
|---|
| 1237 | # _BOOST_PYTHON_CONFIG(VARIABLE, FLAG, OPT)
 | 
|---|
| 1238 | # ------------------------------------
 | 
|---|
| 1239 | # Save VARIABLE, and define it via `python-config --FLAG`.
 | 
|---|
| 1240 | # Substitute BOOST_PYTHON_VARIABLE.
 | 
|---|
| 1241 | m4_define([_BOOST_PYTHON_CONFIG],
 | 
|---|
| 1242 | [AC_SUBST([BOOST_PYTHON_$1],
 | 
|---|
| 1243 |           [$3`python-config --$2 2>/dev/null`])dnl
 | 
|---|
| 1244 | boost_python_save_$1=$$1
 | 
|---|
| 1245 | $1="$$1 $BOOST_PYTHON_$1"])
 | 
|---|
| 1246 | 
 | 
|---|
| 1247 | 
 | 
|---|
| 1248 | # BOOST_PYTHON([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
 | 
|---|
| 1249 | # --------------------------------
 | 
|---|
| 1250 | # Look for Boost.Python.  For the documentation of PREFERRED-RT-OPT,
 | 
|---|
| 1251 | # see the documentation of BOOST_FIND_LIB above.
 | 
|---|
| 1252 | BOOST_DEFUN([Python],
 | 
|---|
| 1253 | [_BOOST_PYTHON_CONFIG([CPPFLAGS], [includes])
 | 
|---|
| 1254 | _BOOST_PYTHON_CONFIG([LDFLAGS],   [ldflags])
 | 
|---|
| 1255 | _BOOST_PYTHON_CONFIG([LIBS],      [libs], [""])
 | 
|---|
| 1256 | AC_SUBST([BOOST_PYTHON_LIB], [$BOOST_PYTHON_LIBS])
 | 
|---|
| 1257 | m4_pattern_allow([^BOOST_PYTHON_MODULE$])dnl
 | 
|---|
| 1258 | BOOST_FIND_LIBS([python], [python python3], [$1],
 | 
|---|
| 1259 |                 [boost/python.hpp],
 | 
|---|
| 1260 |                 [], [BOOST_PYTHON_MODULE(empty) {}], [], [$2])
 | 
|---|
| 1261 | CPPFLAGS=$boost_python_save_CPPFLAGS
 | 
|---|
| 1262 | LDFLAGS=$boost_python_save_LDFLAGS
 | 
|---|
| 1263 | LIBS=$boost_python_save_LIBS
 | 
|---|
| 1264 | ])# BOOST_PYTHON
 | 
|---|
| 1265 | 
 | 
|---|
| 1266 | 
 | 
|---|
| 1267 | # BOOST_REF()
 | 
|---|
| 1268 | # -----------
 | 
|---|
| 1269 | # Look for Boost.Ref
 | 
|---|
| 1270 | BOOST_DEFUN([Ref],
 | 
|---|
| 1271 | [BOOST_FIND_HEADER([boost/ref.hpp])])
 | 
|---|
| 1272 | 
 | 
|---|
| 1273 | 
 | 
|---|
| 1274 | # BOOST_REGEX([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
 | 
|---|
| 1275 | # -------------------------------
 | 
|---|
| 1276 | # Look for Boost.Regex.  For the documentation of PREFERRED-RT-OPT, see the
 | 
|---|
| 1277 | # documentation of BOOST_FIND_LIB above.
 | 
|---|
| 1278 | BOOST_DEFUN([Regex],
 | 
|---|
| 1279 | [BOOST_FIND_LIB([regex], [$1],
 | 
|---|
| 1280 |                 [boost/regex.hpp],
 | 
|---|
| 1281 |                 [boost::regex exp("*"); boost::regex_match("foo", exp);],
 | 
|---|
| 1282 |                 [], [], [$2])
 | 
|---|
| 1283 | ])# BOOST_REGEX
 | 
|---|
| 1284 | 
 | 
|---|
| 1285 | 
 | 
|---|
| 1286 | # BOOST_SCOPE_EXIT()
 | 
|---|
| 1287 | # ------------
 | 
|---|
| 1288 | # Look for Boost.ScopeExit.
 | 
|---|
| 1289 | BOOST_DEFUN([SCOPE_EXIT],
 | 
|---|
| 1290 | [BOOST_FIND_HEADER([boost/scope_exit.hpp])])
 | 
|---|
| 1291 | 
 | 
|---|
| 1292 | 
 | 
|---|
| 1293 | # BOOST_SERIALIZATION([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
 | 
|---|
| 1294 | # ---------------------------------------
 | 
|---|
| 1295 | # Look for Boost.Serialization.  For the documentation of PREFERRED-RT-OPT, see
 | 
|---|
| 1296 | # the documentation of BOOST_FIND_LIB above.
 | 
|---|
| 1297 | BOOST_DEFUN([Serialization],
 | 
|---|
| 1298 | [BOOST_FIND_LIB([serialization], [$1],
 | 
|---|
| 1299 |                 [boost/archive/text_oarchive.hpp],
 | 
|---|
| 1300 |                 [std::ostream* o = 0; // Cheap way to get an ostream...
 | 
|---|
| 1301 |                 boost::archive::text_oarchive t(*o);],
 | 
|---|
| 1302 |                 [], [], [$2])
 | 
|---|
| 1303 | ])# BOOST_SERIALIZATION
 | 
|---|
| 1304 | 
 | 
|---|
| 1305 | 
 | 
|---|
| 1306 | # BOOST_SIGNALS([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
 | 
|---|
| 1307 | # ---------------------------------
 | 
|---|
| 1308 | # Look for Boost.Signals.  For the documentation of PREFERRED-RT-OPT, see the
 | 
|---|
| 1309 | # documentation of BOOST_FIND_LIB above.
 | 
|---|
| 1310 | BOOST_DEFUN([Signals],
 | 
|---|
| 1311 | [BOOST_FIND_LIB([signals], [$1],
 | 
|---|
| 1312 |                 [boost/signal.hpp],
 | 
|---|
| 1313 |                 [boost::signal<void ()> s;],
 | 
|---|
| 1314 |                 [], [], [$2])
 | 
|---|
| 1315 | ])# BOOST_SIGNALS
 | 
|---|
| 1316 | 
 | 
|---|
| 1317 | 
 | 
|---|
| 1318 | # BOOST_SIGNALS2()
 | 
|---|
| 1319 | # ----------------
 | 
|---|
| 1320 | # Look for Boost.Signals2 (new since 1.39.0).
 | 
|---|
| 1321 | BOOST_DEFUN([Signals2],
 | 
|---|
| 1322 | [BOOST_FIND_HEADER([boost/signals2.hpp])
 | 
|---|
| 1323 | ])# BOOST_SIGNALS2
 | 
|---|
| 1324 | 
 | 
|---|
| 1325 | 
 | 
|---|
| 1326 | # BOOST_SMART_PTR()
 | 
|---|
| 1327 | # -----------------
 | 
|---|
| 1328 | # Look for Boost.SmartPtr
 | 
|---|
| 1329 | BOOST_DEFUN([Smart_Ptr],
 | 
|---|
| 1330 | [BOOST_FIND_HEADER([boost/scoped_ptr.hpp])
 | 
|---|
| 1331 | BOOST_FIND_HEADER([boost/shared_ptr.hpp])
 | 
|---|
| 1332 | ])
 | 
|---|
| 1333 | 
 | 
|---|
| 1334 | 
 | 
|---|
| 1335 | # BOOST_STATICASSERT()
 | 
|---|
| 1336 | # --------------------
 | 
|---|
| 1337 | # Look for Boost.StaticAssert
 | 
|---|
| 1338 | BOOST_DEFUN([StaticAssert],
 | 
|---|
| 1339 | [BOOST_FIND_HEADER([boost/static_assert.hpp])])
 | 
|---|
| 1340 | 
 | 
|---|
| 1341 | 
 | 
|---|
| 1342 | # BOOST_STRING_ALGO()
 | 
|---|
| 1343 | # -------------------
 | 
|---|
| 1344 | # Look for Boost.StringAlgo
 | 
|---|
| 1345 | BOOST_DEFUN([String_Algo],
 | 
|---|
| 1346 | [BOOST_FIND_HEADER([boost/algorithm/string.hpp])
 | 
|---|
| 1347 | ])
 | 
|---|
| 1348 | 
 | 
|---|
| 1349 | 
 | 
|---|
| 1350 | # BOOST_SYSTEM([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
 | 
|---|
| 1351 | # --------------------------------
 | 
|---|
| 1352 | # Look for Boost.System.  For the documentation of PREFERRED-RT-OPT, see the
 | 
|---|
| 1353 | # documentation of BOOST_FIND_LIB above.  This library was introduced in Boost
 | 
|---|
| 1354 | # 1.35.0.
 | 
|---|
| 1355 | BOOST_DEFUN([System],
 | 
|---|
| 1356 | [BOOST_FIND_LIB([system], [$1],
 | 
|---|
| 1357 |                 [boost/system/error_code.hpp],
 | 
|---|
| 1358 |                 [boost::system::error_code e; e.clear();], [], [], [$2])
 | 
|---|
| 1359 | ])# BOOST_SYSTEM
 | 
|---|
| 1360 | 
 | 
|---|
| 1361 | 
 | 
|---|
| 1362 | # BOOST_TEST([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
 | 
|---|
| 1363 | # ------------------------------
 | 
|---|
| 1364 | # Look for Boost.Test.  For the documentation of PREFERRED-RT-OPT, see the
 | 
|---|
| 1365 | # documentation of BOOST_FIND_LIB above.
 | 
|---|
| 1366 | BOOST_DEFUN([Test],
 | 
|---|
| 1367 | [m4_pattern_allow([^BOOST_CHECK$])dnl
 | 
|---|
| 1368 | BOOST_FIND_LIB([unit_test_framework], [$1],
 | 
|---|
| 1369 |                [boost/test/unit_test.hpp], [BOOST_CHECK(2 == 2);],
 | 
|---|
| 1370 |                [using boost::unit_test::test_suite;
 | 
|---|
| 1371 |                test_suite* init_unit_test_suite(int argc, char ** argv)
 | 
|---|
| 1372 |                { return NULL; }], [], [$2])
 | 
|---|
| 1373 | ])# BOOST_TEST
 | 
|---|
| 1374 | 
 | 
|---|
| 1375 | 
 | 
|---|
| 1376 | # BOOST_THREAD([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
 | 
|---|
| 1377 | # ---------------------------------
 | 
|---|
| 1378 | # Look for Boost.Thread.  For the documentation of PREFERRED-RT-OPT, see the
 | 
|---|
| 1379 | # documentation of BOOST_FIND_LIB above.
 | 
|---|
| 1380 | BOOST_DEFUN([Thread],
 | 
|---|
| 1381 | [dnl Having the pthread flag is required at least on GCC3 where
 | 
|---|
| 1382 | dnl boost/thread.hpp would complain if we try to compile without
 | 
|---|
| 1383 | dnl -pthread on GNU/Linux.
 | 
|---|
| 1384 | AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl
 | 
|---|
| 1385 | boost_thread_save_LIBS=$LIBS
 | 
|---|
| 1386 | boost_thread_save_LDFLAGS=$LDFLAGS
 | 
|---|
| 1387 | boost_thread_save_CPPFLAGS=$CPPFLAGS
 | 
|---|
| 1388 | # Link-time dependency from thread to system was added as of 1.49.0.
 | 
|---|
| 1389 | if test $boost_major_version -ge 149; then
 | 
|---|
| 1390 | BOOST_SYSTEM([$1], [$2])
 | 
|---|
| 1391 | fi # end of the Boost.System check.
 | 
|---|
| 1392 | m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
 | 
|---|
| 1393 | LIBS="$LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag"
 | 
|---|
| 1394 | LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
 | 
|---|
| 1395 | CPPFLAGS="$CPPFLAGS $boost_cv_pthread_flag"
 | 
|---|
| 1396 | 
 | 
|---|
| 1397 | # When compiling for the Windows platform, the threads library is named
 | 
|---|
| 1398 | # differently.  This suffix doesn't exist in new versions of Boost, or
 | 
|---|
| 1399 | # possibly new versions of GCC on mingw I am assuming it's Boost's change for
 | 
|---|
| 1400 | # now and I am setting version to 1.48, for lack of knowledge as to when this
 | 
|---|
| 1401 | # change occurred.
 | 
|---|
| 1402 | if test $boost_major_version -lt 148; then
 | 
|---|
| 1403 |   case $host_os in
 | 
|---|
| 1404 |     (*mingw*) boost_thread_lib_ext=_win32;;
 | 
|---|
| 1405 |   esac
 | 
|---|
| 1406 | fi
 | 
|---|
| 1407 | BOOST_FIND_LIBS([thread], [thread$boost_thread_lib_ext],
 | 
|---|
| 1408 |                 [$1],
 | 
|---|
| 1409 |                 [boost/thread.hpp], [boost::thread t; boost::mutex m;], [], [], [$2])
 | 
|---|
| 1410 | 
 | 
|---|
| 1411 | case $host_os in
 | 
|---|
| 1412 |   (*mingw*) boost_thread_w32_socket_link=-lws2_32;;
 | 
|---|
| 1413 | esac
 | 
|---|
| 1414 | 
 | 
|---|
| 1415 | BOOST_THREAD_LIBS="$BOOST_THREAD_LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag $boost_thread_w32_socket_link"
 | 
|---|
| 1416 | BOOST_THREAD_LDFLAGS="$BOOST_SYSTEM_LDFLAGS"
 | 
|---|
| 1417 | BOOST_CPPFLAGS="$BOOST_CPPFLAGS $boost_cv_pthread_flag"
 | 
|---|
| 1418 | LIBS=$boost_thread_save_LIBS
 | 
|---|
| 1419 | LDFLAGS=$boost_thread_save_LDFLAGS
 | 
|---|
| 1420 | CPPFLAGS=$boost_thread_save_CPPFLAGS
 | 
|---|
| 1421 | ])# BOOST_THREAD
 | 
|---|
| 1422 | 
 | 
|---|
| 1423 | AU_ALIAS([BOOST_THREADS], [BOOST_THREAD])
 | 
|---|
| 1424 | 
 | 
|---|
| 1425 | 
 | 
|---|
| 1426 | # BOOST_TOKENIZER()
 | 
|---|
| 1427 | # -----------------
 | 
|---|
| 1428 | # Look for Boost.Tokenizer
 | 
|---|
| 1429 | BOOST_DEFUN([Tokenizer],
 | 
|---|
| 1430 | [BOOST_FIND_HEADER([boost/tokenizer.hpp])])
 | 
|---|
| 1431 | 
 | 
|---|
| 1432 | 
 | 
|---|
| 1433 | # BOOST_TRIBOOL()
 | 
|---|
| 1434 | # ---------------
 | 
|---|
| 1435 | # Look for Boost.Tribool
 | 
|---|
| 1436 | BOOST_DEFUN([Tribool],
 | 
|---|
| 1437 | [BOOST_FIND_HEADER([boost/logic/tribool_fwd.hpp])
 | 
|---|
| 1438 | BOOST_FIND_HEADER([boost/logic/tribool.hpp])
 | 
|---|
| 1439 | ])
 | 
|---|
| 1440 | 
 | 
|---|
| 1441 | 
 | 
|---|
| 1442 | # BOOST_TUPLE()
 | 
|---|
| 1443 | # -------------
 | 
|---|
| 1444 | # Look for Boost.Tuple
 | 
|---|
| 1445 | BOOST_DEFUN([Tuple],
 | 
|---|
| 1446 | [BOOST_FIND_HEADER([boost/tuple/tuple.hpp])])
 | 
|---|
| 1447 | 
 | 
|---|
| 1448 | 
 | 
|---|
| 1449 | # BOOST_TYPETRAITS()
 | 
|---|
| 1450 | # --------------------
 | 
|---|
| 1451 | # Look for Boost.TypeTraits
 | 
|---|
| 1452 | BOOST_DEFUN([TypeTraits],
 | 
|---|
| 1453 | [BOOST_FIND_HEADER([boost/type_traits.hpp])])
 | 
|---|
| 1454 | 
 | 
|---|
| 1455 | 
 | 
|---|
| 1456 | # BOOST_UTILITY()
 | 
|---|
| 1457 | # ---------------
 | 
|---|
| 1458 | # Look for Boost.Utility (noncopyable, result_of, base-from-member idiom,
 | 
|---|
| 1459 | # etc.)
 | 
|---|
| 1460 | BOOST_DEFUN([Utility],
 | 
|---|
| 1461 | [BOOST_FIND_HEADER([boost/utility.hpp])])
 | 
|---|
| 1462 | 
 | 
|---|
| 1463 | 
 | 
|---|
| 1464 | # BOOST_VARIANT()
 | 
|---|
| 1465 | # ---------------
 | 
|---|
| 1466 | # Look for Boost.Variant.
 | 
|---|
| 1467 | BOOST_DEFUN([Variant],
 | 
|---|
| 1468 | [BOOST_FIND_HEADER([boost/variant/variant_fwd.hpp])
 | 
|---|
| 1469 | BOOST_FIND_HEADER([boost/variant.hpp])])
 | 
|---|
| 1470 | 
 | 
|---|
| 1471 | 
 | 
|---|
| 1472 | # BOOST_POINTER_CONTAINER()
 | 
|---|
| 1473 | # ------------------------
 | 
|---|
| 1474 | # Look for Boost.PointerContainer
 | 
|---|
| 1475 | BOOST_DEFUN([Pointer_Container],
 | 
|---|
| 1476 | [BOOST_FIND_HEADER([boost/ptr_container/ptr_deque.hpp])
 | 
|---|
| 1477 | BOOST_FIND_HEADER([boost/ptr_container/ptr_list.hpp])
 | 
|---|
| 1478 | BOOST_FIND_HEADER([boost/ptr_container/ptr_vector.hpp])
 | 
|---|
| 1479 | BOOST_FIND_HEADER([boost/ptr_container/ptr_array.hpp])
 | 
|---|
| 1480 | BOOST_FIND_HEADER([boost/ptr_container/ptr_set.hpp])
 | 
|---|
| 1481 | BOOST_FIND_HEADER([boost/ptr_container/ptr_map.hpp])
 | 
|---|
| 1482 | ])# BOOST_POINTER_CONTAINER
 | 
|---|
| 1483 | 
 | 
|---|
| 1484 | 
 | 
|---|
| 1485 | # BOOST_WAVE([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
 | 
|---|
| 1486 | # ------------------------------
 | 
|---|
| 1487 | # NOTE: If you intend to use Wave/Spirit with thread support, make sure you
 | 
|---|
| 1488 | # call BOOST_THREAD first.
 | 
|---|
| 1489 | # Look for Boost.Wave.  For the documentation of PREFERRED-RT-OPT, see the
 | 
|---|
| 1490 | # documentation of BOOST_FIND_LIB above.
 | 
|---|
| 1491 | BOOST_DEFUN([Wave],
 | 
|---|
| 1492 | [AC_REQUIRE([BOOST_FILESYSTEM])dnl
 | 
|---|
| 1493 | AC_REQUIRE([BOOST_DATE_TIME])dnl
 | 
|---|
| 1494 | boost_wave_save_LIBS=$LIBS
 | 
|---|
| 1495 | boost_wave_save_LDFLAGS=$LDFLAGS
 | 
|---|
| 1496 | m4_pattern_allow([^BOOST_((FILE)?SYSTEM|DATE_TIME|THREAD)_(LIBS|LDFLAGS)$])dnl
 | 
|---|
| 1497 | LIBS="$LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_DATE_TIME_LIBS \
 | 
|---|
| 1498 | $BOOST_THREAD_LIBS"
 | 
|---|
| 1499 | LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS \
 | 
|---|
| 1500 | $BOOST_DATE_TIME_LDFLAGS $BOOST_THREAD_LDFLAGS"
 | 
|---|
| 1501 | BOOST_FIND_LIB([wave], [$1],
 | 
|---|
| 1502 |                 [boost/wave.hpp],
 | 
|---|
| 1503 |                 [boost::wave::token_id id; get_token_name(id);], [], [], [$2])
 | 
|---|
| 1504 | LIBS=$boost_wave_save_LIBS
 | 
|---|
| 1505 | LDFLAGS=$boost_wave_save_LDFLAGS
 | 
|---|
| 1506 | ])# BOOST_WAVE
 | 
|---|
| 1507 | 
 | 
|---|
| 1508 | 
 | 
|---|
| 1509 | # BOOST_XPRESSIVE()
 | 
|---|
| 1510 | # -----------------
 | 
|---|
| 1511 | # Look for Boost.Xpressive (new since 1.36.0).
 | 
|---|
| 1512 | BOOST_DEFUN([Xpressive],
 | 
|---|
| 1513 | [BOOST_FIND_HEADER([boost/xpressive/xpressive.hpp])])
 | 
|---|
| 1514 | 
 | 
|---|
| 1515 | 
 | 
|---|
| 1516 | # ----------------- #
 | 
|---|
| 1517 | # Internal helpers. #
 | 
|---|
| 1518 | # ----------------- #
 | 
|---|
| 1519 | 
 | 
|---|
| 1520 | 
 | 
|---|
| 1521 | # _BOOST_PTHREAD_FLAG()
 | 
|---|
| 1522 | # ---------------------
 | 
|---|
| 1523 | # Internal helper for BOOST_THREAD.  Computes boost_cv_pthread_flag
 | 
|---|
| 1524 | # which must be used in CPPFLAGS and LIBS.
 | 
|---|
| 1525 | #
 | 
|---|
| 1526 | # Yes, we *need* to put the -pthread thing in CPPFLAGS because with GCC3,
 | 
|---|
| 1527 | # boost/thread.hpp will trigger a #error if -pthread isn't used:
 | 
|---|
| 1528 | #   boost/config/requires_threads.hpp:47:5: #error "Compiler threading support
 | 
|---|
| 1529 | #   is not turned on. Please set the correct command line options for
 | 
|---|
| 1530 | #   threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)"
 | 
|---|
| 1531 | #
 | 
|---|
| 1532 | # Based on ACX_PTHREAD: http://autoconf-archive.cryp.to/acx_pthread.html
 | 
|---|
| 1533 | AC_DEFUN([_BOOST_PTHREAD_FLAG],
 | 
|---|
| 1534 | [AC_REQUIRE([AC_PROG_CXX])dnl
 | 
|---|
| 1535 | AC_REQUIRE([AC_CANONICAL_HOST])dnl
 | 
|---|
| 1536 | AC_LANG_PUSH([C++])dnl
 | 
|---|
| 1537 | AC_CACHE_CHECK([for the flags needed to use pthreads], [boost_cv_pthread_flag],
 | 
|---|
| 1538 | [ boost_cv_pthread_flag=
 | 
|---|
| 1539 |   # The ordering *is* (sometimes) important.  Some notes on the
 | 
|---|
| 1540 |   # individual items follow:
 | 
|---|
| 1541 |   # (none): in case threads are in libc; should be tried before -Kthread and
 | 
|---|
| 1542 |   #       other compiler flags to prevent continual compiler warnings
 | 
|---|
| 1543 |   # -lpthreads: AIX (must check this before -lpthread)
 | 
|---|
| 1544 |   # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
 | 
|---|
| 1545 |   # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
 | 
|---|
| 1546 |   # -llthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
 | 
|---|
| 1547 |   # -pthread: GNU Linux/GCC (kernel threads), BSD/GCC (userland threads)
 | 
|---|
| 1548 |   # -pthreads: Solaris/GCC
 | 
|---|
| 1549 |   # -mthreads: MinGW32/GCC, Lynx/GCC
 | 
|---|
| 1550 |   # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
 | 
|---|
| 1551 |   #      doesn't hurt to check since this sometimes defines pthreads too;
 | 
|---|
| 1552 |   #      also defines -D_REENTRANT)
 | 
|---|
| 1553 |   #      ... -mt is also the pthreads flag for HP/aCC
 | 
|---|
| 1554 |   # -lpthread: GNU Linux, etc.
 | 
|---|
| 1555 |   # --thread-safe: KAI C++
 | 
|---|
| 1556 |   case $host_os in #(
 | 
|---|
| 1557 |     *solaris*)
 | 
|---|
| 1558 |       # On Solaris (at least, for some versions), libc contains stubbed
 | 
|---|
| 1559 |       # (non-functional) versions of the pthreads routines, so link-based
 | 
|---|
| 1560 |       # tests will erroneously succeed.  (We need to link with -pthreads/-mt/
 | 
|---|
| 1561 |       # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
 | 
|---|
| 1562 |       # a function called by this macro, so we could check for that, but
 | 
|---|
| 1563 |       # who knows whether they'll stub that too in a future libc.)  So,
 | 
|---|
| 1564 |       # we'll just look for -pthreads and -lpthread first:
 | 
|---|
| 1565 |       boost_pthread_flags="-pthreads -lpthread -mt -pthread";; #(
 | 
|---|
| 1566 |     *)
 | 
|---|
| 1567 |       boost_pthread_flags="-lpthreads -Kthread -kthread -llthread -pthread \
 | 
|---|
| 1568 |                            -pthreads -mthreads -lpthread --thread-safe -mt";;
 | 
|---|
| 1569 |   esac
 | 
|---|
| 1570 |   # Generate the test file.
 | 
|---|
| 1571 |   AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <pthread.h>
 | 
|---|
| 1572 |     void *f(void*){ return 0; }],
 | 
|---|
| 1573 |     [pthread_t th; pthread_create(&th,0,f,0); pthread_join(th,0);
 | 
|---|
| 1574 |     pthread_attr_t attr; pthread_attr_init(&attr); pthread_cleanup_push(0, 0);
 | 
|---|
| 1575 |     pthread_cleanup_pop(0);])])
 | 
|---|
| 1576 |   for boost_pthread_flag in '' $boost_pthread_flags; do
 | 
|---|
| 1577 |     boost_pthread_ok=false
 | 
|---|
| 1578 | dnl Re-use the test file already generated.
 | 
|---|
| 1579 |     boost_pthreads__save_LIBS=$LIBS
 | 
|---|
| 1580 |     LIBS="$LIBS $boost_pthread_flag"
 | 
|---|
| 1581 |     AC_LINK_IFELSE([],
 | 
|---|
| 1582 |       [if grep ".*$boost_pthread_flag" conftest.err; then
 | 
|---|
| 1583 |          echo "This flag seems to have triggered warnings" >&AS_MESSAGE_LOG_FD
 | 
|---|
| 1584 |        else
 | 
|---|
| 1585 |          boost_pthread_ok=:; boost_cv_pthread_flag=$boost_pthread_flag
 | 
|---|
| 1586 |        fi])
 | 
|---|
| 1587 |     LIBS=$boost_pthreads__save_LIBS
 | 
|---|
| 1588 |     $boost_pthread_ok && break
 | 
|---|
| 1589 |   done
 | 
|---|
| 1590 | ])
 | 
|---|
| 1591 | AC_LANG_POP([C++])dnl
 | 
|---|
| 1592 | ])# _BOOST_PTHREAD_FLAG
 | 
|---|
| 1593 | 
 | 
|---|
| 1594 | 
 | 
|---|
| 1595 | # _BOOST_gcc_test(MAJOR, MINOR)
 | 
|---|
| 1596 | # -----------------------------
 | 
|---|
| 1597 | # Internal helper for _BOOST_FIND_COMPILER_TAG.
 | 
|---|
| 1598 | m4_define([_BOOST_gcc_test],
 | 
|---|
| 1599 | ["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC @ gcc$1$2"])dnl
 | 
|---|
| 1600 | 
 | 
|---|
| 1601 | # _BOOST_mingw_test(MAJOR, MINOR)
 | 
|---|
| 1602 | # -----------------------------
 | 
|---|
| 1603 | # Internal helper for _BOOST_FIND_COMPILER_TAG.
 | 
|---|
| 1604 | m4_define([_BOOST_mingw_test],
 | 
|---|
| 1605 | ["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC && \
 | 
|---|
| 1606 |   (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
 | 
|---|
| 1607 |          || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw$1$2"])dnl
 | 
|---|
| 1608 | 
 | 
|---|
| 1609 | 
 | 
|---|
| 1610 | # _BOOST_FIND_COMPILER_TAG()
 | 
|---|
| 1611 | # --------------------------
 | 
|---|
| 1612 | # Internal.  When Boost is installed without --layout=system, each library
 | 
|---|
| 1613 | # filename will hold a suffix that encodes the compiler used during the
 | 
|---|
| 1614 | # build.  The Boost build system seems to call this a `tag'.
 | 
|---|
| 1615 | AC_DEFUN([_BOOST_FIND_COMPILER_TAG],
 | 
|---|
| 1616 | [AC_REQUIRE([AC_PROG_CXX])dnl
 | 
|---|
| 1617 | AC_REQUIRE([AC_CANONICAL_HOST])dnl
 | 
|---|
| 1618 | AC_CACHE_CHECK([for the toolset name used by Boost for $CXX],
 | 
|---|
| 1619 |                [boost_cv_lib_tag],
 | 
|---|
| 1620 | [boost_cv_lib_tag=unknown
 | 
|---|
| 1621 | if test x$boost_cv_inc_path != xno; then
 | 
|---|
| 1622 |   AC_LANG_PUSH([C++])dnl
 | 
|---|
| 1623 |   # The following tests are mostly inspired by boost/config/auto_link.hpp
 | 
|---|
| 1624 |   # The list is sorted to most recent/common to oldest compiler (in order
 | 
|---|
| 1625 |   # to increase the likelihood of finding the right compiler with the
 | 
|---|
| 1626 |   # least number of compilation attempt).
 | 
|---|
| 1627 |   # Beware that some tests are sensible to the order (for instance, we must
 | 
|---|
| 1628 |   # look for MinGW before looking for GCC3).
 | 
|---|
| 1629 |   # I used one compilation test per compiler with a #error to recognize
 | 
|---|
| 1630 |   # each compiler so that it works even when cross-compiling (let me know
 | 
|---|
| 1631 |   # if you know a better approach).
 | 
|---|
| 1632 |   # Known missing tags (known from Boost's tools/build/v2/tools/common.jam):
 | 
|---|
| 1633 |   #   como, edg, kcc, bck, mp, sw, tru, xlc
 | 
|---|
| 1634 |   # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines
 | 
|---|
| 1635 |   # the same defines as GCC's).
 | 
|---|
| 1636 |   for i in \
 | 
|---|
| 1637 |     "defined __clang__ && __clang_major__ == 12 && __clang_minor__ == 0 @ clang120" \
 | 
|---|
| 1638 |     "defined __clang__ && __clang_major__ == 11 && __clang_minor__ == 1 @ clang111" \
 | 
|---|
| 1639 |     "defined __clang__ && __clang_major__ == 11 && __clang_minor__ == 0 @ clang110" \
 | 
|---|
| 1640 |     "defined __clang__ && __clang_major__ == 10 && __clang_minor__ == 0 @ clang100" \
 | 
|---|
| 1641 |     "defined __clang__ && __clang_major__ == 9 && __clang_minor__ == 0 @ clang90" \
 | 
|---|
| 1642 |     "defined __clang__ && __clang_major__ == 8 && __clang_minor__ == 0 @ clang80" \
 | 
|---|
| 1643 |     "defined __clang__ && __clang_major__ == 7 && __clang_minor__ == 0 @ clang70" \
 | 
|---|
| 1644 |     "defined __clang__ && __clang_major__ == 6 && __clang_minor__ == 0 @ clang60" \
 | 
|---|
| 1645 |     "defined __clang__ && __clang_major__ == 5 && __clang_minor__ == 0 @ clang50" \
 | 
|---|
| 1646 |     "defined __clang__ && __clang_major__ == 4 && __clang_minor__ == 0 @ clang40" \
 | 
|---|
| 1647 |     "defined __clang__ && __clang_major__ == 3 && __clang_minor__ == 9 @ clang39" \
 | 
|---|
| 1648 |     "defined __clang__ && __clang_major__ == 3 && __clang_minor__ == 8 @ clang38" \
 | 
|---|
| 1649 |     "defined __clang__ && __clang_major__ == 3 && __clang_minor__ == 7 @ clang37" \
 | 
|---|
| 1650 |     _BOOST_mingw_test(11, 1) \
 | 
|---|
| 1651 |     _BOOST_gcc_test(11, 1) \
 | 
|---|
| 1652 |     _BOOST_mingw_test(10, 3) \
 | 
|---|
| 1653 |     _BOOST_gcc_test(10, 3) \
 | 
|---|
| 1654 |     _BOOST_mingw_test(10, 2) \
 | 
|---|
| 1655 |     _BOOST_gcc_test(10, 2) \
 | 
|---|
| 1656 |     _BOOST_mingw_test(10, 1) \
 | 
|---|
| 1657 |     _BOOST_gcc_test(10, 1) \
 | 
|---|
| 1658 |     _BOOST_mingw_test(9, 4) \
 | 
|---|
| 1659 |     _BOOST_gcc_test(9, 4) \
 | 
|---|
| 1660 |     _BOOST_mingw_test(9, 3) \
 | 
|---|
| 1661 |     _BOOST_gcc_test(9, 3) \
 | 
|---|
| 1662 |     _BOOST_mingw_test(9, 2) \
 | 
|---|
| 1663 |     _BOOST_gcc_test(9, 2) \
 | 
|---|
| 1664 |     _BOOST_mingw_test(9, 1) \
 | 
|---|
| 1665 |     _BOOST_gcc_test(9, 1) \
 | 
|---|
| 1666 |     _BOOST_mingw_test(9, 0) \
 | 
|---|
| 1667 |     _BOOST_gcc_test(9, 0) \
 | 
|---|
| 1668 |     _BOOST_mingw_test(8, 5) \
 | 
|---|
| 1669 |     _BOOST_gcc_test(8, 5) \
 | 
|---|
| 1670 |     _BOOST_mingw_test(8, 4) \
 | 
|---|
| 1671 |     _BOOST_gcc_test(8, 4) \
 | 
|---|
| 1672 |     _BOOST_mingw_test(8, 3) \
 | 
|---|
| 1673 |     _BOOST_gcc_test(8, 3) \
 | 
|---|
| 1674 |     _BOOST_mingw_test(8, 2) \
 | 
|---|
| 1675 |     _BOOST_gcc_test(8, 2) \
 | 
|---|
| 1676 |     _BOOST_mingw_test(8, 1) \
 | 
|---|
| 1677 |     _BOOST_gcc_test(8, 1) \
 | 
|---|
| 1678 |     _BOOST_mingw_test(8, 0) \
 | 
|---|
| 1679 |     _BOOST_gcc_test(8, 0) \
 | 
|---|
| 1680 |     _BOOST_mingw_test(7, 5) \
 | 
|---|
| 1681 |     _BOOST_gcc_test(7, 5) \
 | 
|---|
| 1682 |     _BOOST_mingw_test(7, 4) \
 | 
|---|
| 1683 |     _BOOST_gcc_test(7, 4) \
 | 
|---|
| 1684 |     _BOOST_mingw_test(7, 3) \
 | 
|---|
| 1685 |     _BOOST_gcc_test(7, 3) \
 | 
|---|
| 1686 |     _BOOST_mingw_test(7, 2) \
 | 
|---|
| 1687 |     _BOOST_gcc_test(7, 2) \
 | 
|---|
| 1688 |     _BOOST_mingw_test(7, 1) \
 | 
|---|
| 1689 |     _BOOST_gcc_test(7, 1) \
 | 
|---|
| 1690 |     _BOOST_mingw_test(7, 0) \
 | 
|---|
| 1691 |     _BOOST_gcc_test(7, 0) \
 | 
|---|
| 1692 |     _BOOST_mingw_test(6, 5) \
 | 
|---|
| 1693 |     _BOOST_gcc_test(6, 5) \
 | 
|---|
| 1694 |     _BOOST_mingw_test(6, 4) \
 | 
|---|
| 1695 |     _BOOST_gcc_test(6, 4) \
 | 
|---|
| 1696 |     _BOOST_mingw_test(6, 3) \
 | 
|---|
| 1697 |     _BOOST_gcc_test(6, 3) \
 | 
|---|
| 1698 |     _BOOST_mingw_test(6, 2) \
 | 
|---|
| 1699 |     _BOOST_gcc_test(6, 2) \
 | 
|---|
| 1700 |     _BOOST_mingw_test(6, 1) \
 | 
|---|
| 1701 |     _BOOST_gcc_test(6, 1) \
 | 
|---|
| 1702 |     _BOOST_mingw_test(6, 0) \
 | 
|---|
| 1703 |     _BOOST_gcc_test(6, 0) \
 | 
|---|
| 1704 |     _BOOST_mingw_test(5, 5) \
 | 
|---|
| 1705 |     _BOOST_gcc_test(5, 5) \
 | 
|---|
| 1706 |     _BOOST_mingw_test(5, 4) \
 | 
|---|
| 1707 |     _BOOST_gcc_test(5, 4) \
 | 
|---|
| 1708 |     _BOOST_mingw_test(5, 3) \
 | 
|---|
| 1709 |     _BOOST_gcc_test(5, 3) \
 | 
|---|
| 1710 |     _BOOST_mingw_test(5, 2) \
 | 
|---|
| 1711 |     _BOOST_gcc_test(5, 2) \
 | 
|---|
| 1712 |     _BOOST_mingw_test(5, 1) \
 | 
|---|
| 1713 |     _BOOST_gcc_test(5, 1) \
 | 
|---|
| 1714 |     _BOOST_mingw_test(5, 0) \
 | 
|---|
| 1715 |     _BOOST_gcc_test(5, 0) \
 | 
|---|
| 1716 |     _BOOST_mingw_test(4, 10) \
 | 
|---|
| 1717 |     _BOOST_gcc_test(4, 10) \
 | 
|---|
| 1718 |     _BOOST_mingw_test(4, 9) \
 | 
|---|
| 1719 |     _BOOST_gcc_test(4, 9) \
 | 
|---|
| 1720 |     _BOOST_mingw_test(4, 8) \
 | 
|---|
| 1721 |     _BOOST_gcc_test(4, 8) \
 | 
|---|
| 1722 |     _BOOST_mingw_test(4, 7) \
 | 
|---|
| 1723 |     _BOOST_gcc_test(4, 7) \
 | 
|---|
| 1724 |     _BOOST_mingw_test(4, 6) \
 | 
|---|
| 1725 |     _BOOST_gcc_test(4, 6) \
 | 
|---|
| 1726 |     _BOOST_mingw_test(4, 5) \
 | 
|---|
| 1727 |     _BOOST_gcc_test(4, 5) \
 | 
|---|
| 1728 |     _BOOST_mingw_test(4, 4) \
 | 
|---|
| 1729 |     _BOOST_gcc_test(4, 4) \
 | 
|---|
| 1730 |     _BOOST_mingw_test(4, 3) \
 | 
|---|
| 1731 |     _BOOST_gcc_test(4, 3) \
 | 
|---|
| 1732 |     _BOOST_mingw_test(4, 2) \
 | 
|---|
| 1733 |     _BOOST_gcc_test(4, 2) \
 | 
|---|
| 1734 |     _BOOST_mingw_test(4, 1) \
 | 
|---|
| 1735 |     _BOOST_gcc_test(4, 1) \
 | 
|---|
| 1736 |     _BOOST_mingw_test(4, 0) \
 | 
|---|
| 1737 |     _BOOST_gcc_test(4, 0) \
 | 
|---|
| 1738 |     "defined __GNUC__ && __GNUC__ == 3 && !defined __ICC \
 | 
|---|
| 1739 |      && (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
 | 
|---|
| 1740 |          || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw" \
 | 
|---|
| 1741 |     _BOOST_gcc_test(3, 4) \
 | 
|---|
| 1742 |     _BOOST_gcc_test(3, 3) \
 | 
|---|
| 1743 |     "defined _MSC_VER && _MSC_VER >= 1500 @ vc90" \
 | 
|---|
| 1744 |     "defined _MSC_VER && _MSC_VER == 1400 @ vc80" \
 | 
|---|
| 1745 |     _BOOST_gcc_test(3, 2) \
 | 
|---|
| 1746 |     "defined _MSC_VER && _MSC_VER == 1310 @ vc71" \
 | 
|---|
| 1747 |     _BOOST_gcc_test(3, 1) \
 | 
|---|
| 1748 |     _BOOST_gcc_test(3, 0) \
 | 
|---|
| 1749 |     "defined __BORLANDC__ @ bcb" \
 | 
|---|
| 1750 |     "defined __ICC && (defined __unix || defined __unix__) @ il" \
 | 
|---|
| 1751 |     "defined __ICL @ iw" \
 | 
|---|
| 1752 |     "defined _MSC_VER && _MSC_VER == 1300 @ vc7" \
 | 
|---|
| 1753 |     _BOOST_gcc_test(2, 95) \
 | 
|---|
| 1754 |     "defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \
 | 
|---|
| 1755 |     "defined _MSC_VER && _MSC_VER < 1300 && !defined UNDER_CE @ vc6" \
 | 
|---|
| 1756 |     "defined _MSC_VER && _MSC_VER < 1300 && defined UNDER_CE @ evc4" \
 | 
|---|
| 1757 |     "defined __MWERKS__ && __MWERKS__ <= 0x31FF @ cw8"
 | 
|---|
| 1758 |   do
 | 
|---|
| 1759 |     boost_tag_test=`expr "X$i" : 'X\([[^@]]*\) @ '`
 | 
|---|
| 1760 |     boost_tag=`expr "X$i" : 'X[[^@]]* @ \(.*\)'`
 | 
|---|
| 1761 |     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 | 
|---|
| 1762 | #if $boost_tag_test
 | 
|---|
| 1763 | /* OK */
 | 
|---|
| 1764 | #else
 | 
|---|
| 1765 | # error $boost_tag_test
 | 
|---|
| 1766 | #endif
 | 
|---|
| 1767 | ]])], [boost_cv_lib_tag=$boost_tag; break], [])
 | 
|---|
| 1768 |   done
 | 
|---|
| 1769 | AC_LANG_POP([C++])dnl
 | 
|---|
| 1770 |   case $boost_cv_lib_tag in #(
 | 
|---|
| 1771 |     # Some newer (>= 1.35?) versions of Boost seem to only use "gcc" as opposed
 | 
|---|
| 1772 |     # to "gcc41" for instance.
 | 
|---|
| 1773 |     *-gcc | *'-gcc ') :;; #(  Don't re-add -gcc: it's already in there.
 | 
|---|
| 1774 |     gcc*)
 | 
|---|
| 1775 |       boost_tag_x=
 | 
|---|
| 1776 |       case $host_os in #(
 | 
|---|
| 1777 |         darwin*)
 | 
|---|
| 1778 |           if test $boost_major_version -ge 136; then
 | 
|---|
| 1779 |             # The `x' added in r46793 of Boost.
 | 
|---|
| 1780 |             boost_tag_x=x
 | 
|---|
| 1781 |           fi;;
 | 
|---|
| 1782 |       esac
 | 
|---|
| 1783 |       # We can specify multiple tags in this variable because it's used by
 | 
|---|
| 1784 |       # BOOST_FIND_LIB that does a `for tag in -$boost_cv_lib_tag' ...
 | 
|---|
| 1785 |       boost_cv_lib_tag="$boost_tag_x$boost_cv_lib_tag -${boost_tag_x}gcc"
 | 
|---|
| 1786 |       ;; #(
 | 
|---|
| 1787 |     unknown)
 | 
|---|
| 1788 |       AC_MSG_WARN([[could not figure out which toolset name to use for $CXX]])
 | 
|---|
| 1789 |       boost_cv_lib_tag=
 | 
|---|
| 1790 |       ;;
 | 
|---|
| 1791 |   esac
 | 
|---|
| 1792 | fi])dnl end of AC_CACHE_CHECK
 | 
|---|
| 1793 | ])# _BOOST_FIND_COMPILER_TAG
 | 
|---|
| 1794 | 
 | 
|---|
| 1795 | 
 | 
|---|
| 1796 | # _BOOST_GUESS_WHETHER_TO_USE_MT()
 | 
|---|
| 1797 | # --------------------------------
 | 
|---|
| 1798 | # Compile a small test to try to guess whether we should favor MT (Multi
 | 
|---|
| 1799 | # Thread) flavors of Boost.  Sets boost_guess_use_mt accordingly.
 | 
|---|
| 1800 | AC_DEFUN([_BOOST_GUESS_WHETHER_TO_USE_MT],
 | 
|---|
| 1801 | [# Check whether we do better use `mt' even though we weren't ask to.
 | 
|---|
| 1802 | AC_LANG_PUSH([C++])dnl
 | 
|---|
| 1803 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 | 
|---|
| 1804 | #if defined _REENTRANT || defined _MT || defined __MT__
 | 
|---|
| 1805 | /* use -mt */
 | 
|---|
| 1806 | #else
 | 
|---|
| 1807 | # error MT not needed
 | 
|---|
| 1808 | #endif
 | 
|---|
| 1809 | ]])], [boost_guess_use_mt=:], [boost_guess_use_mt=false])
 | 
|---|
| 1810 | AC_LANG_POP([C++])dnl
 | 
|---|
| 1811 | ])
 | 
|---|
| 1812 | 
 | 
|---|
| 1813 | # _BOOST_AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
 | 
|---|
| 1814 | # -------------------------------------------------------------------
 | 
|---|
| 1815 | # Fork of _AC_LINK_IFELSE that preserves conftest.o across calls.  Fragile,
 | 
|---|
| 1816 | # will break when Autoconf changes its internals.  Requires that you manually
 | 
|---|
| 1817 | # rm -f conftest.$ac_objext in between to really different tests, otherwise
 | 
|---|
| 1818 | # you will try to link a conftest.o left behind by a previous test.
 | 
|---|
| 1819 | # Used to aggressively optimize BOOST_FIND_LIB (see the big comment in this
 | 
|---|
| 1820 | # macro).
 | 
|---|
| 1821 | #
 | 
|---|
| 1822 | # Don't use "break" in the actions, as it would short-circuit some code
 | 
|---|
| 1823 | # this macro runs after the actions.
 | 
|---|
| 1824 | m4_define([_BOOST_AC_LINK_IFELSE],
 | 
|---|
| 1825 | [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
 | 
|---|
| 1826 | rm -f conftest$ac_exeext
 | 
|---|
| 1827 | boost_save_ac_ext=$ac_ext
 | 
|---|
| 1828 | boost_use_source=:
 | 
|---|
| 1829 | # If we already have a .o, re-use it.  We change $ac_ext so that $ac_link
 | 
|---|
| 1830 | # tries to link the existing object file instead of compiling from source.
 | 
|---|
| 1831 | test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false &&
 | 
|---|
| 1832 |   _AS_ECHO_LOG([re-using the existing conftest.$ac_objext])
 | 
|---|
| 1833 | AS_IF([_AC_DO_STDERR($ac_link) && {
 | 
|---|
| 1834 |          test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
 | 
|---|
| 1835 |          test ! -s conftest.err
 | 
|---|
| 1836 |        } && test -s conftest$ac_exeext && {
 | 
|---|
| 1837 |          test "$cross_compiling" = yes ||
 | 
|---|
| 1838 |          $as_executable_p conftest$ac_exeext
 | 
|---|
| 1839 | dnl FIXME: use AS_TEST_X instead when 2.61 is widespread enough.
 | 
|---|
| 1840 |        }],
 | 
|---|
| 1841 |       [$2],
 | 
|---|
| 1842 |       [if $boost_use_source; then
 | 
|---|
| 1843 |          _AC_MSG_LOG_CONFTEST
 | 
|---|
| 1844 |        fi
 | 
|---|
| 1845 |        $3])
 | 
|---|
| 1846 | ac_objext=$boost_save_ac_objext
 | 
|---|
| 1847 | ac_ext=$boost_save_ac_ext
 | 
|---|
| 1848 | dnl Delete also the IPA/IPO (Inter Procedural Analysis/Optimization)
 | 
|---|
| 1849 | dnl information created by the PGI compiler (conftest_ipa8_conftest.oo),
 | 
|---|
| 1850 | dnl as it would interfere with the next link command.
 | 
|---|
| 1851 | rm -f core conftest.err conftest_ipa8_conftest.oo \
 | 
|---|
| 1852 |       conftest$ac_exeext m4_ifval([$1], [conftest.$ac_ext])[]dnl
 | 
|---|
| 1853 | ])# _BOOST_AC_LINK_IFELSE
 | 
|---|
| 1854 | 
 | 
|---|
| 1855 | # Local Variables:
 | 
|---|
| 1856 | # mode: autoconf
 | 
|---|
| 1857 | # End:
 | 
|---|