Changeset 9982 for m4/boost.m4


Ignore:
Timestamp:
Jul 15, 2011, 10:33:39 AM (13 years ago)
Author:
Christoph Mayer
Message:

-neue boost.m4 version notwendig für gcc 4.5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • m4/boost.m4

    r9981 r9982  
    11# boost.m4: Locate Boost headers and libraries for autoconf-based projects.
    2 # Copyright (C) 2007  Benoit Sigoure <tsuna@lrde.epita.fr>
     2# Copyright (C) 2007, 2008, 2009, 2010, 2011  Benoit Sigoure <tsuna@lrde.epita.fr>
    33#
    44# This program is free software: you can redistribute it and/or modify
     
    2222# along with this program.  If not, see <http://www.gnu.org/licenses/>.
    2323
    24 # serial 8
    25 # Original sources can be found at http://repo.or.cz/w/boost.m4.git
     24m4_define([_BOOST_SERIAL], [m4_translit([
     25# serial 16
     26], [#
     27], [])])
     28
     29# Original sources can be found at http://github.com/tsuna/boost.m4
    2630# You can fetch the latest version of the script by doing:
    27 #   wget 'http://repo.or.cz/w/boost.m4.git?a=blob_plain;f=build-aux/boost.m4;hb=HEAD' -O boost.m4
     31#   wget http://github.com/tsuna/boost.m4/raw/master/build-aux/boost.m4
    2832
    2933# ------ #
     
    3640# define BOOST_CPPFLAGS accordingly.  It will add an option --with-boost to
    3741# your configure so that users can specify non standard locations.
    38 # For more README and documentation, go to http://repo.or.cz/w/boost.m4.git
     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
    3945# Note: THESE MACROS ASSUME THAT YOU USE LIBTOOL.  If you don't, don't worry,
    4046# simply read the README, it will show you what to do step by step.
    4147
    42 m4_pattern_forbid([^_?BOOST_])
    43 
    44 # BOOST_REQUIRE([VERSION])
    45 # ------------------------
     48m4_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.
     61m4_define([_BOOST_SED_CPP],
     62[AC_LANG_PREPROC_REQUIRE()dnl
     63AC_REQUIRE([AC_PROG_SED])dnl
     64AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])])
     65AS_IF([dnl eval is necessary to expand ac_cpp.
     66dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
     67dnl Beware of Windows end-of-lines, for instance if we are running
     68dnl some Windows programs under Wine.  In that case, boost/version.hpp
     69dnl is certainly using "\r\n", but the regular Unix shell will only
     70dnl strip `\n' with backquotes, not the `\r'.  This results in
     71dnl boost_cv_lib_version='1_37\r' for instance, which breaks
     72dnl everything else.
     73dnl Cannot use 'dnl' after [$4] because a trailing dnl may break AC_CACHE_CHECK
     74(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
     75  tr -d '\r' |
     76  $SED -n -e "$1" >conftest.i 2>&1],
     77  [$3],
     78  [$4])
     79rm -rf conftest*
     80])# AC_EGREP_CPP
     81
     82
     83
     84# BOOST_REQUIRE([VERSION], [ACTION-IF-NOT-FOUND])
     85# -----------------------------------------------
    4686# Look for Boost.  If version is given, it must either be a literal of the form
    4787# "X.Y.Z" where X, Y and Z are integers (the ".Z" part being optional) or a
     
    4989# Defines the value BOOST_CPPFLAGS.  This macro only checks for headers with
    5090# the required version, it does not check for any of the Boost libraries.
    51 # FIXME: Add a 2nd optional argument so that it's not fatal if Boost isn't found
    52 # and add an AC_DEFINE to tell whether HAVE_BOOST.
     91# On # success, defines HAVE_BOOST.  On failure, calls the optional
     92# ACTION-IF-NOT-FOUND action if one was supplied.
     93# Otherwise aborts with an error message.
    5394AC_DEFUN([BOOST_REQUIRE],
    54 [dnl First find out what kind of argument we have.
    55 dnl If we have an empty argument, there is no constraint on the version of
    56 dnl Boost to use.  If it's a literal version number, we can split it in M4 (so
    57 dnl the resulting configure script will be smaller/faster).  Otherwise we do
    58 dnl the splitting at runtime.
    59 m4_bmatch([$1],
    60   [^ *$], [m4_pushdef([BOOST_VERSION_REQ], [])dnl
    61            boost_version_major=0
    62            boost_version_minor=0
    63            boost_version_subminor=0
    64 ],
    65   [^[0-9]+\([-._][0-9]+\)*$],
    66     [m4_pushdef([BOOST_VERSION_REQ], [ version >= $1])dnl
    67      boost_version_major=m4_bregexp([$1], [^\([0-9]+\)], [\1])
    68      boost_version_minor=m4_bregexp([$1], [^[0-9]+[-._]\([0-9]+\)], [\1])
    69      boost_version_subminor=m4_bregexp([$1], [^[0-9]+[-._][0-9]+[-._]\([0-9]+\)], [\1])
    70 ],
    71   [^\$[a-zA-Z_]+$],
    72     [m4_pushdef([BOOST_VERSION_REQ], [])dnl
    73      boost_version_major=`expr "X$1" : 'X\([[^-._]]*\)'`
    74      boost_version_minor=`expr "X$1" : 'X[[0-9]]*[[-._]]\([[^-._]]*\)'`
    75      boost_version_subminor=`expr "X$1" : 'X[[0-9]]*[[-._]][[0-9]]*[[-._]]\([[0-9]]*\)'`
    76      case $boost_version_major:$boost_version_minor in #(
    77        *: | :* | *[[^0-9]]*:* | *:*[[^0-9]]*)
    78          AC_MSG_ERROR([[Invalid argument for REQUIRE_BOOST: `$1']])
    79          ;;
    80      esac
    81 ],
    82   [m4_fatal(Invalid argument: `$1')]
    83 )dnl
     95[AC_REQUIRE([AC_PROG_CXX])dnl
     96AC_REQUIRE([AC_PROG_GREP])dnl
     97echo "$as_me: this is boost.m4[]_BOOST_SERIAL" >&AS_MESSAGE_LOG_FD
     98boost_save_IFS=$IFS
     99boost_version_req=$1
     100IFS=.
     101set x $boost_version_req 0 0 0
     102IFS=$boost_save_IFS
     103shift
     104boost_version_req=`expr "$[1]" '*' 100000 + "$[2]" '*' 100 + "$[3]"`
     105boost_version_req_string=$[1].$[2].$[3]
    84106AC_ARG_WITH([boost],
    85107   [AS_HELP_STRING([--with-boost=DIR],
    86                    [prefix of Boost]BOOST_VERSION_REQ[ @<:@guess@:>@])])dnl
     108                   [prefix of Boost $1 @<:@guess@:>@])])dnl
     109AC_ARG_VAR([BOOST_ROOT],[Location of Boost installation])dnl
     110# If BOOST_ROOT is set and the user has not provided a value to
     111# --with-boost, then treat BOOST_ROOT as if it the user supplied it.
     112if test x"$BOOST_ROOT" != x; then
     113  if test x"$with_boost" = x; then
     114    AC_MSG_NOTICE([Detected BOOST_ROOT; continuing with --with-boost=$BOOST_ROOT])
     115    with_boost=$BOOST_ROOT
     116  else
     117    AC_MSG_NOTICE([Detected BOOST_ROOT=$BOOST_ROOT, but overridden by --with-boost=$with_boost])
     118  fi
     119fi
    87120AC_SUBST([DISTCHECK_CONFIGURE_FLAGS],
    88          ["$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'"])
    89   AC_CACHE_CHECK([for Boost headers[]BOOST_VERSION_REQ],
     121         ["$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'"])dnl
     122boost_save_CPPFLAGS=$CPPFLAGS
     123  AC_CACHE_CHECK([for Boost headers version >= $boost_version_req_string],
    90124    [boost_cv_inc_path],
    91125    [boost_cv_inc_path=no
    92126AC_LANG_PUSH([C++])dnl
    93     boost_subminor_chk=
    94     test x"$boost_version_subminor" != x \
    95       && boost_subminor_chk="|| (B_V_MAJ == $boost_version_major \
    96 && B_V_MIN == $boost_version_minor \
    97 && B_V_SUB < $boost_version_subminor)"
    98     for boost_dir in "$with_boost/include" '' \
    99              /opt/local/include /usr/local/include /opt/include /usr/include \
    100              "$with_boost" C:/Boost/include
     127m4_pattern_allow([^BOOST_VERSION$])dnl
     128    AC_LANG_CONFTEST([AC_LANG_PROGRAM([[#include <boost/version.hpp>
     129#if !defined BOOST_VERSION
     130# error BOOST_VERSION is not defined
     131#elif BOOST_VERSION < $boost_version_req
     132# error Boost headers version < $boost_version_req
     133#endif
     134]])])
     135    # If the user provided a value to --with-boost, use it and only it.
     136    case $with_boost in #(
     137      ''|yes) set x '' /opt/local/include /usr/local/include /opt/include \
     138                 /usr/include C:/Boost/include;; #(
     139      *)      set x "$with_boost/include" "$with_boost";;
     140    esac
     141    shift
     142    for boost_dir
    101143    do
    102144    # Without --layout=system, Boost (or at least some versions) installs
    103145    # itself in <prefix>/include/boost-<version>.  This inner loop helps to
    104146    # find headers in such directories.
     147    #
     148    # Any ${boost_dir}/boost-x_xx directories are searched in reverse version
     149    # order followed by ${boost_dir}.  The final '.' is a sentinel for
     150    # searching $boost_dir" itself.  Entries are whitespace separated.
     151    #
    105152    # I didn't indent this loop on purpose (to avoid over-indented code)
    106     for boost_inc in "$boost_dir" "$boost_dir"/boost-*
     153    boost_layout_system_search_list=`cd "$boost_dir" 2>/dev/null \
     154        && ls -1 | "${GREP}" '^boost-' | sort -rn -t- -k2 \
     155        && echo .`
     156    for boost_inc in $boost_layout_system_search_list
    107157    do
    108       # $boost_inc can often be a symlink, so keep -e here.
    109       test -e "$boost_inc" || continue
    110       # Ensure that version.hpp exists: we're going to read it.  Moreover,
    111       # Boost could be reachable thanks to the default include path so we can
    112       # mistakenly accept a wrong include path without this check.
    113       test -e "$boost_inc/boost/version.hpp" || continue
    114       boost_save_CPPFLAGS=$CPPFLAGS
    115       test x"$boost_inc" != x && CPPFLAGS="$CPPFLAGS -I$boost_inc"
    116 m4_pattern_allow([^BOOST_VERSION$])dnl
    117       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <boost/version.hpp>
    118 #ifndef BOOST_VERSION
    119 # error BOOST_VERSION is not defined
    120 #endif
    121 #define B_V_MAJ (BOOST_VERSION / 100000)
    122 #define B_V_MIN (BOOST_VERSION / 100 % 1000)
    123 #define B_V_SUB (BOOST_VERSION % 100)
    124 #if (B_V_MAJ < $boost_version_major) \
    125    || (B_V_MAJ == $boost_version_major \
    126        && B_V_MIN < $boost_version_minor) $boost_subminor_chk
    127 # error Boost headers version < $1
    128 #endif
    129 ]])], [boost_cv_inc_path=yes], [boost_cv_version=no])
    130       CPPFLAGS=$boost_save_CPPFLAGS
     158      if test x"$boost_inc" != x.; then
     159        boost_inc="$boost_dir/$boost_inc"
     160      else
     161        boost_inc="$boost_dir" # Uses sentinel in boost_layout_system_search_list
     162      fi
     163      if test x"$boost_inc" != x; then
     164        # We are going to check whether the version of Boost installed
     165        # in $boost_inc is usable by running a compilation that
     166        # #includes it.  But if we pass a -I/some/path in which Boost
     167        # is not installed, the compiler will just skip this -I and
     168        # use other locations (either from CPPFLAGS, or from its list
     169        # of system include directories).  As a result we would use
     170        # header installed on the machine instead of the /some/path
     171        # specified by the user.  So in that precise case (trying
     172        # $boost_inc), make sure the version.hpp exists.
     173        #
     174        # Use test -e as there can be symlinks.
     175        test -e "$boost_inc/boost/version.hpp" || continue
     176        CPPFLAGS="$CPPFLAGS -I$boost_inc"
     177      fi
     178      AC_COMPILE_IFELSE([], [boost_cv_inc_path=yes], [boost_cv_version=no])
    131179      if test x"$boost_cv_inc_path" = xyes; then
    132180        if test x"$boost_inc" != x; then
     
    141189    case $boost_cv_inc_path in #(
    142190      no)
    143         AC_MSG_ERROR([Could not find Boost headers[]BOOST_VERSION_REQ])
     191        boost_errmsg="cannot find Boost headers version >= $boost_version_req_string"
     192        m4_if([$2], [],  [AC_MSG_ERROR([$boost_errmsg])],
     193                        [AC_MSG_NOTICE([$boost_errmsg])])
     194        $2
    144195        ;;#(
    145196      yes)
     
    147198        ;;#(
    148199      *)
    149         BOOST_CPPFLAGS="-I$boost_cv_inc_path"
     200        AC_SUBST([BOOST_CPPFLAGS], ["-I$boost_cv_inc_path"])dnl
    150201        ;;
    151202    esac
    152 AC_SUBST([BOOST_CPPFLAGS])dnl
     203  if test x"$boost_cv_inc_path" != xno; then
     204  AC_DEFINE([HAVE_BOOST], [1],
     205            [Defined if the requested minimum BOOST version is satisfied])
    153206  AC_CACHE_CHECK([for Boost's header version],
    154207    [boost_cv_lib_version],
    155208    [m4_pattern_allow([^BOOST_LIB_VERSION$])dnl
    156     boost_cv_lib_version=unknown
    157     boost_sed_version='/^.*BOOST_LIB_VERSION.*"\([[^"]]*\)".*$/!d;s//\1/'
    158     boost_version_hpp="$boost_inc/boost/version.hpp"
    159     test -e "$boost_version_hpp" \
    160       && boost_cv_lib_version=`sed "$boost_sed_version" "$boost_version_hpp"`
    161     ])
     209     _BOOST_SED_CPP([/^boost-lib-version = /{s///;s/\"//g;p;q;}],
     210                    [#include <boost/version.hpp>
     211boost-lib-version = BOOST_LIB_VERSION],
     212    [boost_cv_lib_version=`cat conftest.i`])])
    162213    # e.g. "134" for 1_34_1 or "135" for 1_35
    163214    boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'`
    164     case $boost_major_version in
    165       '' | *[[^0-9]]*)
    166         AC_MSG_ERROR([Invalid value: boost_major_version=$boost_major_version])
     215    case $boost_major_version in #(
     216      '' | *[[!0-9]]*)
     217        AC_MSG_ERROR([invalid value: boost_major_version=$boost_major_version])
    167218        ;;
    168219    esac
    169 m4_popdef([BOOST_VERSION_REQ])dnl
     220fi
     221CPPFLAGS=$boost_save_CPPFLAGS
    170222])# BOOST_REQUIRE
    171223
     224# BOOST_STATIC()
     225# --------------
     226# Add the "--enable-static-boost" configure argument. If this argument is given
     227# on the command line, static versions of the libraries will be looked up.
     228AC_DEFUN([BOOST_STATIC],
     229  [AC_ARG_ENABLE([static-boost],
     230     [AC_HELP_STRING([--enable-static-boost],
     231               [Prefer the static boost libraries over the shared ones [no]])],
     232     [enable_static_boost=yes],
     233     [enable_static_boost=no])])# BOOST_STATIC
    172234
    173235# BOOST_FIND_HEADER([HEADER-NAME], [ACTION-IF-NOT-FOUND], [ACTION-IF-FOUND])
     
    177239# require linking (such as Boost.Foreach).
    178240#
    179 # Default ACTION-IF-NOT-FOUND: Fail with a fatal error.
     241# Default ACTION-IF-NOT-FOUND: Fail with a fatal error unless Boost couldn't be
     242# found in the first place, in which case by default a notice is issued to the
     243# user.  Presumably if we haven't died already it's because it's OK to not have
     244# Boost, which is why only a notice is issued instead of a hard error.
    180245#
    181246# Default ACTION-IF-FOUND: define the preprocessor symbol HAVE_<HEADER-NAME> in
     
    184249AC_DEFUN([BOOST_FIND_HEADER],
    185250[AC_REQUIRE([BOOST_REQUIRE])dnl
     251if test x"$boost_cv_inc_path" = xno; then
     252  m4_default([$2], [AC_MSG_NOTICE([Boost not available, not searching for $1])])
     253else
    186254AC_LANG_PUSH([C++])dnl
    187255boost_save_CPPFLAGS=$CPPFLAGS
     
    193261CPPFLAGS=$boost_save_CPPFLAGS
    194262AC_LANG_POP([C++])dnl
     263fi
    195264])# BOOST_FIND_HEADER
    196265
     
    218287# (eg, >= 1.33) you *must* invoke BOOST_REQUIRE before this macro.
    219288AC_DEFUN([BOOST_FIND_LIB],
    220 [AC_REQUIRE([_BOOST_FIND_COMPILER_TAG])dnl
    221 AC_REQUIRE([BOOST_REQUIRE])dnl
     289[AC_REQUIRE([BOOST_REQUIRE])dnl
     290AC_REQUIRE([_BOOST_FIND_COMPILER_TAG])dnl
     291AC_REQUIRE([BOOST_STATIC])dnl
    222292AC_REQUIRE([_BOOST_GUESS_WHETHER_TO_USE_MT])dnl
     293if test x"$boost_cv_inc_path" = xno; then
     294  AC_MSG_NOTICE([Boost not available, not searching for the Boost $1 library])
     295else
     296dnl The else branch is huge and wasn't intended on purpose.
    223297AC_LANG_PUSH([C++])dnl
    224298AS_VAR_PUSHDEF([Boost_lib], [boost_cv_lib_$1])dnl
    225299AS_VAR_PUSHDEF([Boost_lib_LDFLAGS], [boost_cv_lib_$1_LDFLAGS])dnl
     300AS_VAR_PUSHDEF([Boost_lib_LDPATH], [boost_cv_lib_$1_LDPATH])dnl
    226301AS_VAR_PUSHDEF([Boost_lib_LIBS], [boost_cv_lib_$1_LIBS])dnl
    227302BOOST_FIND_HEADER([$3])
     
    242317    *) boost_mt=; boost_rtopt=$2;;
    243318  esac
     319  if test $enable_static_boost = yes; then
     320    boost_rtopt="s$boost_rtopt"
     321  fi
    244322  # Find the proper debug variant depending on what we've been asked to find.
    245323  case $boost_rtopt in #(
     
    278356  AC_COMPILE_IFELSE([],
    279357    [ac_objext=do_not_rm_me_plz],
    280     [AC_MSG_ERROR([Cannot compile a test that uses Boost $1])])
     358    [AC_MSG_ERROR([cannot compile a test that uses Boost $1])])
    281359  ac_objext=$boost_save_ac_objext
    282360  boost_failed_libs=
     
    302380    test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include}
    303381    for boost_ldpath in "$boost_tmp_lib/lib" '' \
    304              /opt/local/lib /usr/local/lib /opt/lib /usr/lib \
    305              "$with_boost" C:/Boost/lib /lib /usr/lib64 /lib64
     382             /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \
     383             "$with_boost" C:/Boost/lib /lib*
    306384    do
    307385      test -e "$boost_ldpath" || continue
     
    326404      LIBS=$boost_save_LIBS
    327405      if test x"$Boost_lib" = xyes; then
    328         Boost_lib_LDFLAGS="-L$boost_ldpath -R$boost_ldpath"
     406        Boost_lib_LDFLAGS="-L$boost_ldpath -Wl,-R$boost_ldpath"
     407        Boost_lib_LDPATH="$boost_ldpath"
    329408        break 6
    330409      else
     
    340419])
    341420case $Boost_lib in #(
    342   no) AC_MSG_ERROR([Could not find the flags to link with Boost $1])
     421  no) _AC_MSG_LOG_CONFTEST
     422    AC_MSG_ERROR([cannot find the flags to link with Boost $1])
    343423    ;;
    344424esac
    345 AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS])
    346 AC_SUBST(AS_TR_CPP([BOOST_$1_LIBS]), [$Boost_lib_LIBS])
     425AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS])dnl
     426AC_SUBST(AS_TR_CPP([BOOST_$1_LDPATH]), [$Boost_lib_LDPATH])dnl
     427AC_SUBST([BOOST_LDPATH], [$Boost_lib_LDPATH])dnl
     428AC_SUBST(AS_TR_CPP([BOOST_$1_LIBS]), [$Boost_lib_LIBS])dnl
    347429CPPFLAGS=$boost_save_CPPFLAGS
    348430AS_VAR_POPDEF([Boost_lib])dnl
    349431AS_VAR_POPDEF([Boost_lib_LDFLAGS])dnl
     432AS_VAR_POPDEF([Boost_lib_LDPATH])dnl
    350433AS_VAR_POPDEF([Boost_lib_LIBS])dnl
    351434AC_LANG_POP([C++])dnl
     435fi
    352436])# BOOST_FIND_LIB
    353437
     
    361445# version of each library (among other things).
    362446
     447# BOOST_DEFUN(LIBRARY, CODE)
     448# --------------------------
     449# Define BOOST_<LIBRARY-UPPERCASE> as a macro that runs CODE.
     450#
     451# Use indir to avoid the warning on underquoted macro name given to AC_DEFUN.
     452m4_define([BOOST_DEFUN],
     453[m4_indir([AC_DEFUN],
     454          m4_toupper([BOOST_$1]),
     455[m4_pushdef([BOOST_Library], [$1])dnl
     456$2
     457m4_popdef([BOOST_Library])dnl
     458])
     459])
     460
     461# BOOST_ARRAY()
     462# -------------
     463# Look for Boost.Array
     464BOOST_DEFUN([Array],
     465[BOOST_FIND_HEADER([boost/array.hpp])])
     466
    363467
    364468# BOOST_ASIO()
    365469# ------------
    366470# Look for Boost.Asio (new in Boost 1.35).
    367 AC_DEFUN([BOOST_ASIO],
     471BOOST_DEFUN([Asio],
    368472[AC_REQUIRE([BOOST_SYSTEM])dnl
    369473BOOST_FIND_HEADER([boost/asio.hpp])])
     
    373477# ------------
    374478# Look for Boost.Bind
    375 AC_DEFUN([BOOST_BIND],
     479BOOST_DEFUN([Bind],
    376480[BOOST_FIND_HEADER([boost/bind.hpp])])
    377481
     
    380484# ------------------
    381485# Look for Boost.Conversion (cast / lexical_cast)
    382 AC_DEFUN([BOOST_CONVERSION],
     486BOOST_DEFUN([Conversion],
    383487[BOOST_FIND_HEADER([boost/cast.hpp])
    384488BOOST_FIND_HEADER([boost/lexical_cast.hpp])
     
    390494# Look for Boost.Date_Time.  For the documentation of PREFERRED-RT-OPT, see the
    391495# documentation of BOOST_FIND_LIB above.
    392 AC_DEFUN([BOOST_DATE_TIME],
     496BOOST_DEFUN([Date_Time],
    393497[BOOST_FIND_LIB([date_time], [$1],
    394498                [boost/date_time/posix_time/posix_time.hpp],
     
    403507# Do not check for boost/filesystem.hpp because this file was introduced in
    404508# 1.34.
    405 AC_DEFUN([BOOST_FILESYSTEM],
     509BOOST_DEFUN([Filesystem],
    406510[# Do we have to check for Boost.System?  This link-time dependency was
    407511# added as of 1.35.0.  If we have a version <1.35, we must not attempt to
     
    417521BOOST_FIND_LIB([filesystem], [$1],
    418522                [boost/filesystem/path.hpp], [boost::filesystem::path p;])
     523if test $enable_static_boost = yes && test $boost_major_version -ge 135; then
     524    AC_SUBST([BOOST_FILESYSTEM_LIBS], ["$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"])
     525fi
    419526LIBS=$boost_filesystem_save_LIBS
    420527LDFLAGS=$boost_filesystem_save_LDFLAGS
     
    425532# ---------------
    426533# Look for Boost.Foreach
    427 AC_DEFUN([BOOST_FOREACH],
     534BOOST_DEFUN([Foreach],
    428535[BOOST_FIND_HEADER([boost/foreach.hpp])])
    429536
     
    436543# boost/format/detail/config_macros.hpp:88: error: 'locale' in namespace 'std'
    437544#                                                  does not name a type
    438 AC_DEFUN([BOOST_FORMAT],
     545BOOST_DEFUN([Format],
    439546[BOOST_FIND_HEADER([boost/format.hpp])])
    440547
     
    443550# ----------------
    444551# Look for Boost.Function
    445 AC_DEFUN([BOOST_FUNCTION],
     552BOOST_DEFUN([Function],
    446553[BOOST_FIND_HEADER([boost/function.hpp])])
    447554
     
    451558# Look for Boost.Graphs.  For the documentation of PREFERRED-RT-OPT, see the
    452559# documentation of BOOST_FIND_LIB above.
    453 AC_DEFUN([BOOST_GRAPH],
     560BOOST_DEFUN([Graph],
    454561[BOOST_FIND_LIB([graph], [$1],
    455562                [boost/graph/adjacency_list.hpp], [boost::adjacency_list<> g;])
     
    458565
    459566# BOOST_IOSTREAMS([PREFERRED-RT-OPT])
    460 # -------------------------------
     567# -----------------------------------
    461568# Look for Boost.IOStreams.  For the documentation of PREFERRED-RT-OPT, see the
    462569# documentation of BOOST_FIND_LIB above.
    463 AC_DEFUN([BOOST_IOSTREAMS],
     570BOOST_DEFUN([IOStreams],
    464571[BOOST_FIND_LIB([iostreams], [$1],
    465572                [boost/iostreams/device/file_descriptor.hpp],
    466                 [boost::iostreams::file_descriptor fd(0); fd.close();])
     573                [boost::iostreams::file_descriptor fd; fd.close();])
    467574])# BOOST_IOSTREAMS
    468575
     
    471578# ------------
    472579# Look for Boost.Functional/Hash
    473 AC_DEFUN([BOOST_HASH],
     580BOOST_DEFUN([Hash],
    474581[BOOST_FIND_HEADER([boost/functional/hash.hpp])])
    475582
     
    478585# --------------
    479586# Look for Boost.Lambda
    480 AC_DEFUN([BOOST_LAMBDA],
     587BOOST_DEFUN([Lambda],
    481588[BOOST_FIND_HEADER([boost/lambda/lambda.hpp])])
     589
     590
     591# BOOST_LOG([PREFERRED-RT-OPT])
     592# -----------------------------
     593# Look for Boost.Log For the documentation of PREFERRED-RT-OPT, see the
     594# documentation of BOOST_FIND_LIB above.
     595BOOST_DEFUN([Log],
     596[BOOST_FIND_LIB([log], [$1],
     597    [boost/log/core/core.hpp],
     598    [boost::log::attribute a; a.get_value();])
     599])# BOOST_LOG
     600
     601
     602# BOOST_LOG_SETUP([PREFERRED-RT-OPT])
     603# -----------------------------------
     604# Look for Boost.Log For the documentation of PREFERRED-RT-OPT, see the
     605# documentation of BOOST_FIND_LIB above.
     606BOOST_DEFUN([Log_Setup],
     607[AC_REQUIRE([BOOST_LOG])dnl
     608BOOST_FIND_LIB([log_setup], [$1],
     609    [boost/log/utility/init/from_settings.hpp],
     610    [boost::log::basic_settings<char> bs; bs.empty();])
     611])# BOOST_LOG_SETUP
     612
     613
     614# BOOST_MATH()
     615# ------------
     616# Look for Boost.Math
     617# TODO: This library isn't header-only but it comes in multiple different
     618# flavors that don't play well with BOOST_FIND_LIB (e.g, libboost_math_c99,
     619# libboost_math_c99f, libboost_math_c99l, libboost_math_tr1,
     620# libboost_math_tr1f, libboost_math_tr1l).  This macro must be fixed to do the
     621# right thing anyway.
     622BOOST_DEFUN([Math],
     623[BOOST_FIND_HEADER([boost/math/special_functions.hpp])])
     624
     625
     626# BOOST_MULTIARRAY()
     627# ------------------
     628# Look for Boost.MultiArray
     629BOOST_DEFUN([MultiArray],
     630[BOOST_FIND_HEADER([boost/multi_array.hpp])])
     631
     632
     633# BOOST_NUMERIC_CONVERSION()
     634# --------------------------
     635# Look for Boost.NumericConversion (policy-based numeric conversion)
     636BOOST_DEFUN([Numeric_Conversion],
     637[BOOST_FIND_HEADER([boost/numeric/conversion/converter.hpp])
     638])# BOOST_NUMERIC_CONVERSION
     639
     640
     641# BOOST_OPTIONAL()
     642# ----------------
     643# Look for Boost.Optional
     644BOOST_DEFUN([Optional],
     645[BOOST_FIND_HEADER([boost/optional.hpp])])
    482646
    483647
     
    485649# --------------------
    486650# Look for Boost.Preprocessor
    487 AC_DEFUN([BOOST_PREPROCESSOR],
     651BOOST_DEFUN([Preprocessor],
    488652[BOOST_FIND_HEADER([boost/preprocessor/repeat.hpp])])
     653
     654
     655# BOOST_UNORDERED()
     656# -----------------
     657# Look for Boost.Unordered
     658BOOST_DEFUN([Unordered],
     659[BOOST_FIND_HEADER([boost/unordered_map.hpp])])
     660
     661
     662# BOOST_UUID()
     663# ------------
     664# Look for Boost.Uuid
     665BOOST_DEFUN([Uuid],
     666[BOOST_FIND_HEADER([boost/uuid/uuid.hpp])])
    489667
    490668
    491669# BOOST_PROGRAM_OPTIONS([PREFERRED-RT-OPT])
    492670# -----------------------------------------
    493 # Look for Boost.Program_options.  For the documentation of PREFERRED-RT-OPT, see
    494 # the documentation of BOOST_FIND_LIB above.
    495 AC_DEFUN([BOOST_PROGRAM_OPTIONS],
     671# Look for Boost.Program_options.  For the documentation of PREFERRED-RT-OPT,
     672# see the documentation of BOOST_FIND_LIB above.
     673BOOST_DEFUN([Program_Options],
    496674[BOOST_FIND_LIB([program_options], [$1],
    497675                [boost/program_options.hpp],
     
    500678
    501679
     680
     681# _BOOST_PYTHON_CONFIG(VARIABLE, FLAG)
     682# ------------------------------------
     683# Save VARIABLE, and define it via `python-config --FLAG`.
     684# Substitute BOOST_PYTHON_VARIABLE.
     685m4_define([_BOOST_PYTHON_CONFIG],
     686[AC_SUBST([BOOST_PYTHON_$1],
     687          [`python-config --$2 2>/dev/null`])dnl
     688boost_python_save_$1=$$1
     689$1="$$1 $BOOST_PYTHON_$1"])
     690
     691
     692# BOOST_PYTHON([PREFERRED-RT-OPT])
     693# --------------------------------
     694# Look for Boost.Python.  For the documentation of PREFERRED-RT-OPT,
     695# see the documentation of BOOST_FIND_LIB above.
     696BOOST_DEFUN([Python],
     697[_BOOST_PYTHON_CONFIG([CPPFLAGS], [includes])
     698_BOOST_PYTHON_CONFIG([LDFLAGS],   [ldflags])
     699_BOOST_PYTHON_CONFIG([LIBS],      [libs])
     700m4_pattern_allow([^BOOST_PYTHON_MODULE$])dnl
     701BOOST_FIND_LIB([python], [$1],
     702               [boost/python.hpp],
     703               [], [BOOST_PYTHON_MODULE(empty) {}])
     704CPPFLAGS=$boost_python_save_CPPFLAGS
     705LDFLAGS=$boost_python_save_LDFLAGS
     706LIBS=$boost_python_save_LIBS
     707])# BOOST_PYTHON
     708
     709
    502710# BOOST_REF()
    503711# -----------
    504712# Look for Boost.Ref
    505 AC_DEFUN([BOOST_REF],
     713BOOST_DEFUN([Ref],
    506714[BOOST_FIND_HEADER([boost/ref.hpp])])
    507715
     
    511719# Look for Boost.Regex.  For the documentation of PREFERRED-RT-OPT, see the
    512720# documentation of BOOST_FIND_LIB above.
    513 AC_DEFUN([BOOST_REGEX],
     721BOOST_DEFUN([Regex],
    514722[BOOST_FIND_LIB([regex], [$1],
    515723                [boost/regex.hpp],
     
    522730# Look for Boost.Serialization.  For the documentation of PREFERRED-RT-OPT, see
    523731# the documentation of BOOST_FIND_LIB above.
    524 AC_DEFUN([BOOST_SERIALIZATION],
     732BOOST_DEFUN([Serialization],
    525733[BOOST_FIND_LIB([serialization], [$1],
    526734                [boost/archive/text_oarchive.hpp],
     
    534742# Look for Boost.Signals.  For the documentation of PREFERRED-RT-OPT, see the
    535743# documentation of BOOST_FIND_LIB above.
    536 AC_DEFUN([BOOST_SIGNALS],
     744BOOST_DEFUN([Signals],
    537745[BOOST_FIND_LIB([signals], [$1],
    538746                [boost/signal.hpp],
     
    544752# -----------------
    545753# Look for Boost.SmartPtr
    546 AC_DEFUN([BOOST_SMART_PTR],
     754BOOST_DEFUN([Smart_Ptr],
    547755[BOOST_FIND_HEADER([boost/scoped_ptr.hpp])
    548756BOOST_FIND_HEADER([boost/shared_ptr.hpp])
     
    550758
    551759
     760# BOOST_STATICASSERT()
     761# --------------------
     762# Look for Boost.StaticAssert
     763BOOST_DEFUN([StaticAssert],
     764[BOOST_FIND_HEADER([boost/static_assert.hpp])])
     765
     766
    552767# BOOST_STRING_ALGO()
    553768# -------------------
    554769# Look for Boost.StringAlgo
    555 AC_DEFUN([BOOST_STRING_ALGO],
     770BOOST_DEFUN([String_Algo],
    556771[BOOST_FIND_HEADER([boost/algorithm/string.hpp])
    557772])
     
    563778# documentation of BOOST_FIND_LIB above.  This library was introduced in Boost
    564779# 1.35.0.
    565 AC_DEFUN([BOOST_SYSTEM],
     780BOOST_DEFUN([System],
    566781[BOOST_FIND_LIB([system], [$1],
    567782                [boost/system/error_code.hpp],
     
    574789# Look for Boost.Test.  For the documentation of PREFERRED-RT-OPT, see the
    575790# documentation of BOOST_FIND_LIB above.
    576 AC_DEFUN([BOOST_TEST],
     791BOOST_DEFUN([Test],
    577792[m4_pattern_allow([^BOOST_CHECK$])dnl
    578793BOOST_FIND_LIB([unit_test_framework], [$1],
     
    589804# documentation of BOOST_FIND_LIB above.
    590805# FIXME: Provide an alias "BOOST_THREAD".
    591 AC_DEFUN([BOOST_THREADS],
     806BOOST_DEFUN([Threads],
    592807[dnl Having the pthread flag is required at least on GCC3 where
    593808dnl boost/thread.hpp would complain if we try to compile without
     
    604819CPPFLAGS="$CPPFLAGS $boost_cv_pthread_flag"
    605820BOOST_FIND_LIB([thread], [$1],
    606                 [boost/thread.hpp], [boost::thread t; boost::mutex m;])
     821               [boost/thread.hpp], [boost::thread t; boost::mutex m;])
    607822BOOST_THREAD_LIBS="$BOOST_THREAD_LIBS $boost_cv_pthread_flag"
    608823BOOST_CPPFLAGS="$BOOST_CPPFLAGS $boost_cv_pthread_flag"
     
    615830# -----------------
    616831# Look for Boost.Tokenizer
    617 AC_DEFUN([BOOST_TOKENIZER],
     832BOOST_DEFUN([Tokenizer],
    618833[BOOST_FIND_HEADER([boost/tokenizer.hpp])])
    619834
     
    622837# ---------------
    623838# Look for Boost.Tribool
    624 AC_DEFUN([BOOST_TRIBOOL],
     839BOOST_DEFUN([Tribool],
    625840[BOOST_FIND_HEADER([boost/logic/tribool_fwd.hpp])
    626841BOOST_FIND_HEADER([boost/logic/tribool.hpp])
     
    631846# -------------
    632847# Look for Boost.Tuple
    633 AC_DEFUN([BOOST_TUPLE],
     848BOOST_DEFUN([Tuple],
    634849[BOOST_FIND_HEADER([boost/tuple/tuple.hpp])])
     850
     851
     852# BOOST_TYPETRAITS()
     853# --------------------
     854# Look for Boost.TypeTraits
     855BOOST_DEFUN([TypeTraits],
     856[BOOST_FIND_HEADER([boost/type_traits.hpp])])
    635857
    636858
     
    639861# Look for Boost.Utility (noncopyable, result_of, base-from-member idiom,
    640862# etc.)
    641 AC_DEFUN([BOOST_UTILITY],
     863BOOST_DEFUN([Utility],
    642864[BOOST_FIND_HEADER([boost/utility.hpp])])
    643865
     
    646868# ---------------
    647869# Look for Boost.Variant.
    648 AC_DEFUN([BOOST_VARIANT],
     870BOOST_DEFUN([Variant],
    649871[BOOST_FIND_HEADER([boost/variant/variant_fwd.hpp])
    650872BOOST_FIND_HEADER([boost/variant.hpp])])
     
    657879# Look for Boost.Wave.  For the documentation of PREFERRED-RT-OPT, see the
    658880# documentation of BOOST_FIND_LIB above.
    659 AC_DEFUN([BOOST_WAVE],
     881BOOST_DEFUN([Wave],
    660882[AC_REQUIRE([BOOST_FILESYSTEM])dnl
    661883AC_REQUIRE([BOOST_DATE_TIME])dnl
     
    678900# -----------------
    679901# Look for Boost.Xpressive (new since 1.36.0).
    680 AC_DEFUN([BOOST_XPRESSIVE],
     902BOOST_DEFUN([Xpressive],
    681903[BOOST_FIND_HEADER([boost/xpressive/xpressive.hpp])])
    682904
     
    766988AC_DEFUN([_BOOST_FIND_COMPILER_TAG],
    767989[AC_REQUIRE([AC_PROG_CXX])dnl
     990AC_REQUIRE([AC_CANONICAL_HOST])dnl
    768991AC_CACHE_CHECK([for the toolset name used by Boost for $CXX], [boost_cv_lib_tag],
    769 [AC_LANG_PUSH([C++])dnl
    770   boost_cv_lib_tag=unknown
     992[boost_cv_lib_tag=unknown
     993if test x$boost_cv_inc_path != xno; then
     994  AC_LANG_PUSH([C++])dnl
    771995  # The following tests are mostly inspired by boost/config/auto_link.hpp
    772996  # The list is sorted to most recent/common to oldest compiler (in order
     
    7821006  # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines
    7831007  # the same defines as GCC's).
    784   # TODO: Move the test on GCC 4.4 up once it's released.
    7851008  for i in \
     1009    _BOOST_gcc_test(4, 6) \
     1010    _BOOST_gcc_test(4, 5) \
     1011    _BOOST_gcc_test(4, 4) \
    7861012    _BOOST_gcc_test(4, 3) \
    7871013    _BOOST_gcc_test(4, 2) \
     
    7931019    _BOOST_gcc_test(3, 4) \
    7941020    _BOOST_gcc_test(3, 3) \
    795     "defined _MSC_VER && _MSC_VER >= 1400 @ vc80" \
     1021    "defined _MSC_VER && _MSC_VER >= 1500 @ vc90" \
     1022    "defined _MSC_VER && _MSC_VER == 1400 @ vc80" \
    7961023    _BOOST_gcc_test(3, 2) \
    7971024    "defined _MSC_VER && _MSC_VER == 1310 @ vc71" \
     
    8021029    "defined __ICL @ iw" \
    8031030    "defined _MSC_VER && _MSC_VER == 1300 @ vc7" \
    804     _BOOST_gcc_test(4, 4) \
    8051031    _BOOST_gcc_test(2, 95) \
    8061032    "defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \
     
    8201046  done
    8211047AC_LANG_POP([C++])dnl
    822 ])
    8231048  case $boost_cv_lib_tag in #(
    8241049    # Some newer (>= 1.35?) versions of Boost seem to only use "gcc" as opposed
    8251050    # to "gcc41" for instance.
     1051    *-gcc | *'-gcc ') :;; #(  Don't re-add -gcc: it's already in there.
    8261052    gcc*)
     1053      boost_tag_x=
     1054      case $host_os in #(
     1055        darwin*)
     1056          if test $boost_major_version -ge 136; then
     1057            # The `x' added in r46793 of Boost.
     1058            boost_tag_x=x
     1059          fi;;
     1060      esac
    8271061      # We can specify multiple tags in this variable because it's used by
    8281062      # BOOST_FIND_LIB that does a `for tag in -$boost_cv_lib_tag' ...
    829       boost_cv_lib_tag="$boost_cv_lib_tag -gcc"
     1063      boost_cv_lib_tag="$boost_tag_x$boost_cv_lib_tag -${boost_tag_x}gcc"
    8301064      ;; #(
    8311065    unknown)
     
    8341068      ;;
    8351069  esac
     1070fi])dnl end of AC_CACHE_CHECK
    8361071])# _BOOST_FIND_COMPILER_TAG
    8371072
     
    8591094# you will try to link a conftest.o left behind by a previous test.
    8601095# Used to aggressively optimize BOOST_FIND_LIB (see the big comment in this
    861 # macro)
     1096# macro).
     1097#
     1098# Don't use "break" in the actions, as it would short-circuit some code
     1099# this macro runs after the actions.
    8621100m4_define([_BOOST_AC_LINK_IFELSE],
    8631101[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
    8641102rm -f conftest$ac_exeext
    865 boost_ac_ext_save=$ac_ext
     1103boost_save_ac_ext=$ac_ext
    8661104boost_use_source=:
    8671105# If we already have a .o, re-use it.  We change $ac_ext so that $ac_link
     
    8821120       fi
    8831121       $3])
     1122ac_objext=$boost_save_ac_objext
     1123ac_ext=$boost_save_ac_ext
    8841124dnl Delete also the IPA/IPO (Inter Procedural Analysis/Optimization)
    8851125dnl information created by the PGI compiler (conftest_ipa8_conftest.oo),
     
    8881128      conftest$ac_exeext m4_ifval([$1], [conftest.$ac_ext])[]dnl
    8891129])# _BOOST_AC_LINK_IFELSE
     1130
     1131# Local Variables:
     1132# mode: autoconf
     1133# End:
Note: See TracChangeset for help on using the changeset viewer.