Changeset 6309fd


Ignore:
Timestamp:
Aug 17, 2014, 4:07:55 PM (11 years ago)
Author:
Frederik Heber <heber@…>
Children:
ec61ec
Parents:
0ab195
Message:

Fixes for Ubuntu 14.04.

  • subdir-objects required for automake.
  • in Makefile.am's INCLUDES is deprecated (for AM_CPPFLAGS).
  • updated boost.m4 (serial 22) required due to boost thread depending on boost system library. (Re-)Added checks for EXCEPTION and ITERATOR.
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • configure.ac

    r0ab195 r6309fd  
    99AC_CONFIG_MACRO_DIR([m4])
    1010
    11 AM_INIT_AUTOMAKE([dist-bzip2 1.11 parallel-tests color-tests])
     11AM_INIT_AUTOMAKE([dist-bzip2 1.11 parallel-tests color-tests subdir-objects])
    1212
    1313# Checks for programs.
  • m4/boost.m4

    r0ab195 r6309fd  
    11# boost.m4: Locate Boost headers and libraries for autoconf-based projects.
    2 # Copyright (C) 2007, 2008, 2009, 2010, 2011  Benoit Sigoure <tsuna@lrde.epita.fr>
     2# Copyright (C) 2007-2011, 2014  Benoit Sigoure <tsuna@lrde.epita.fr>
    33#
    44# This program is free software: you can redistribute it and/or modify
     
    2323
    2424m4_define([_BOOST_SERIAL], [m4_translit([
    25 # serial 16
     25# serial 22
    2626], [#
    2727], [])])
     
    6060# value of any macro.
    6161m4_define([_BOOST_SED_CPP],
    62 [AC_LANG_PREPROC_REQUIRE()dnl
     62[AC_LANG_PUSH([C++])dnl
     63AC_LANG_PREPROC_REQUIRE()dnl
    6364AC_REQUIRE([AC_PROG_SED])dnl
    6465AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])])
     
    7879  [$4])
    7980rm -rf conftest*
    80 ])# AC_EGREP_CPP
     81AC_LANG_POP([C++])dnl
     82])# _BOOST_SED_CPP
    8183
    8284
     
    222224])# BOOST_REQUIRE
    223225
     226
    224227# BOOST_STATIC()
    225228# --------------
     
    228231AC_DEFUN([BOOST_STATIC],
    229232  [AC_ARG_ENABLE([static-boost],
    230      [AC_HELP_STRING([--enable-static-boost],
     233     [AS_HELP_STRING([--enable-static-boost],
    231234               [Prefer the static boost libraries over the shared ones [no]])],
    232235     [enable_static_boost=yes],
    233236     [enable_static_boost=no])])# BOOST_STATIC
     237
    234238
    235239# BOOST_FIND_HEADER([HEADER-NAME], [ACTION-IF-NOT-FOUND], [ACTION-IF-FOUND])
     
    265269
    266270
    267 # BOOST_FIND_LIB([LIB-NAME], [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
    268 #                [CXX-PROLOGUE])
    269 # -------------------------------------------------------------------------
    270 # Look for the Boost library LIB-NAME (e.g., LIB-NAME = `thread', for
    271 # libboost_thread).  Check that HEADER-NAME works and check that
    272 # libboost_LIB-NAME can link with the code CXX-TEST.  The optional argument
    273 # CXX-PROLOGUE can be used to include some C++ code before the `main'
    274 # function.
     271# BOOST_FIND_LIBS([COMPONENT-NAME], [CANDIDATE-LIB-NAMES],
     272#                 [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
     273#                 [CXX-PROLOGUE])
     274# --------------------------------------------------------------
     275# Look for the Boost library COMPONENT-NAME (e.g., `thread', for
     276# libboost_thread) under the possible CANDIDATE-LIB-NAMES (e.g.,
     277# "thread_win32 thread").  Check that HEADER-NAME works and check that
     278# libboost_LIB-NAME can link with the code CXX-TEST.  The optional
     279# argument CXX-PROLOGUE can be used to include some C++ code before
     280# the `main' function.
    275281#
    276282# Invokes BOOST_FIND_HEADER([HEADER-NAME]) (see above).
     
    286292# ...  If you want to make sure you have a specific version of Boost
    287293# (eg, >= 1.33) you *must* invoke BOOST_REQUIRE before this macro.
    288 AC_DEFUN([BOOST_FIND_LIB],
     294AC_DEFUN([BOOST_FIND_LIBS],
    289295[AC_REQUIRE([BOOST_REQUIRE])dnl
    290296AC_REQUIRE([_BOOST_FIND_COMPILER_TAG])dnl
     
    300306AS_VAR_PUSHDEF([Boost_lib_LDPATH], [boost_cv_lib_$1_LDPATH])dnl
    301307AS_VAR_PUSHDEF([Boost_lib_LIBS], [boost_cv_lib_$1_LIBS])dnl
    302 BOOST_FIND_HEADER([$3])
     308BOOST_FIND_HEADER([$4])
    303309boost_save_CPPFLAGS=$CPPFLAGS
    304310CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
    305 # Now let's try to find the library.  The algorithm is as follows: first look
    306 # for a given library name according to the user's PREFERRED-RT-OPT.  For each
    307 # library name, we prefer to use the ones that carry the tag (toolset name).
    308 # Each library is searched through the various standard paths were Boost is
    309 # usually installed.  If we can't find the standard variants, we try to
    310 # enforce -mt (for instance on MacOSX, libboost_threads.dylib doesn't exist
    311 # but there's -obviously- libboost_threads-mt.dylib).
    312311AC_CACHE_CHECK([for the Boost $1 library], [Boost_lib],
    313   [Boost_lib=no
    314   case "$2" in #(
    315     mt | mt-) boost_mt=-mt; boost_rtopt=;; #(
    316     mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X$2" : 'Xmt-*\(.*\)'`;; #(
    317     *) boost_mt=; boost_rtopt=$2;;
     312               [_BOOST_FIND_LIBS($@)])
     313case $Boost_lib in #(
     314  (no) _AC_MSG_LOG_CONFTEST
     315    AC_MSG_ERROR([cannot find the flags to link with Boost $1])
     316    ;;
     317esac
     318AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS])dnl
     319AC_SUBST(AS_TR_CPP([BOOST_$1_LDPATH]), [$Boost_lib_LDPATH])dnl
     320AC_SUBST([BOOST_LDPATH], [$Boost_lib_LDPATH])dnl
     321AC_SUBST(AS_TR_CPP([BOOST_$1_LIBS]), [$Boost_lib_LIBS])dnl
     322CPPFLAGS=$boost_save_CPPFLAGS
     323AS_VAR_POPDEF([Boost_lib])dnl
     324AS_VAR_POPDEF([Boost_lib_LDFLAGS])dnl
     325AS_VAR_POPDEF([Boost_lib_LDPATH])dnl
     326AS_VAR_POPDEF([Boost_lib_LIBS])dnl
     327AC_LANG_POP([C++])dnl
     328fi
     329])
     330
     331
     332# BOOST_FIND_LIB([LIB-NAME],
     333#                [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
     334#                [CXX-PROLOGUE])
     335# --------------------------------------------------------------
     336# Backward compatibility wrapper for BOOST_FIND_LIBS.
     337AC_DEFUN([BOOST_FIND_LIB],
     338[BOOST_FIND_LIBS([$1], $@)])
     339
     340
     341# _BOOST_FIND_LIBS([LIB-NAME], [CANDIDATE-LIB-NAMES],
     342#                 [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
     343#                 [CXX-PROLOGUE])
     344# --------------------------------------------------------------
     345# Real implementation of BOOST_FIND_LIBS: rely on these local macros:
     346# Boost_lib, Boost_lib_LDFLAGS, Boost_lib_LDPATH, Boost_lib_LIBS
     347#
     348# The algorithm is as follows: first look for a given library name
     349# according to the user's PREFERRED-RT-OPT.  For each library name, we
     350# prefer to use the ones that carry the tag (toolset name).  Each
     351# library is searched through the various standard paths were Boost is
     352# usually installed.  If we can't find the standard variants, we try
     353# to enforce -mt (for instance on MacOSX, libboost_thread.dylib
     354# doesn't exist but there's -obviously- libboost_thread-mt.dylib).
     355AC_DEFUN([_BOOST_FIND_LIBS],
     356[Boost_lib=no
     357  case "$3" in #(
     358    (mt | mt-) boost_mt=-mt; boost_rtopt=;; #(
     359    (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X$3" : 'Xmt-*\(.*\)'`;; #(
     360    (*) boost_mt=; boost_rtopt=$3;;
    318361  esac
    319362  if test $enable_static_boost = yes; then
     
    322365  # Find the proper debug variant depending on what we've been asked to find.
    323366  case $boost_rtopt in #(
    324     *d*) boost_rt_d=$boost_rtopt;; #(
    325     *[[sgpn]]*) # Insert the `d' at the right place (in between `sg' and `pn')
     367    (*d*) boost_rt_d=$boost_rtopt;; #(
     368    (*[[sgpn]]*) # Insert the `d' at the right place (in between `sg' and `pn')
    326369      boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #(
    327     *) boost_rt_d='-d';;
     370    (*) boost_rt_d='-d';;
    328371  esac
    329372  # If the PREFERRED-RT-OPT are not empty, prepend a `-'.
     
    336379  boost_save_ac_objext=$ac_objext
    337380  # Generate the test file.
    338   AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <$3>
    339 $5], [$4])])
     381  AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <$4>
     382$6], [$5])])
    340383dnl Optimization hacks: compiling C++ is slow, especially with Boost.  What
    341384dnl we're trying to do here is guess the right combination of link flags
     
    359402  ac_objext=$boost_save_ac_objext
    360403  boost_failed_libs=
    361 # Don't bother to ident the 6 nested for loops, only the 2 innermost ones
    362 # matter.
     404# Don't bother to ident the following nested for loops, only the 2
     405# innermost ones matter.
     406for boost_lib_ in $2; do
    363407for boost_tag_ in -$boost_cv_lib_tag ''; do
    364408for boost_ver_ in -$boost_cv_lib_version ''; do
     
    366410for boost_rtopt_ in $boost_rtopt '' -d; do
    367411  for boost_lib in \
    368     boost_$1$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \
    369     boost_$1$boost_tag_$boost_rtopt_$boost_ver_ \
    370     boost_$1$boost_tag_$boost_mt_$boost_ver_ \
    371     boost_$1$boost_tag_$boost_ver_
     412    boost_$boost_lib_$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \
     413    boost_$boost_lib_$boost_tag_$boost_rtopt_$boost_ver_ \
     414    boost_$boost_lib_$boost_tag_$boost_mt_$boost_ver_ \
     415    boost_$boost_lib_$boost_tag_$boost_ver_
    372416  do
    373417    # Avoid testing twice the same lib
    374418    case $boost_failed_libs in #(
    375       *@$boost_lib@*) continue;;
     419      (*@$boost_lib@*) continue;;
    376420    esac
    377421    # If with_boost is empty, we'll search in /lib first, which is not quite
     
    383427             "$with_boost" C:/Boost/lib /lib*
    384428    do
    385       test -e "$boost_ldpath" || continue
     429      # Don't waste time with directories that don't exist.
     430      if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then
     431        continue
     432      fi
    386433      boost_save_LDFLAGS=$LDFLAGS
    387434      # Are we looking for a static library?
    388435      case $boost_ldpath:$boost_rtopt_ in #(
    389         *?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt)
     436        (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt)
    390437          Boost_lib_LIBS="$boost_ldpath/lib$boost_lib.$libext"
    391438          test -e "$Boost_lib_LIBS" || continue;; #(
    392         *) # No: use -lboost_foo to find the shared library.
     439        (*) # No: use -lboost_foo to find the shared library.
    393440          Boost_lib_LIBS="-l$boost_lib";;
    394441      esac
     
    404451      LIBS=$boost_save_LIBS
    405452      if test x"$Boost_lib" = xyes; then
    406         Boost_lib_LDFLAGS="-L$boost_ldpath -Wl,-R$boost_ldpath"
     453        # Check or used cached result of whether or not using -R or
     454        # -rpath makes sense.  Some implementations of ld, such as for
     455        # Mac OSX, require -rpath but -R is the flag known to work on
     456        # other systems.  https://github.com/tsuna/boost.m4/issues/19
     457        AC_CACHE_VAL([boost_cv_rpath_link_ldflag],
     458          [case $boost_ldpath in
     459           '') # Nothing to do.
     460             boost_cv_rpath_link_ldflag=
     461             boost_rpath_link_ldflag_found=yes;;
     462           *)
     463            for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do
     464              LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
     465              LIBS="$boost_save_LIBS $Boost_lib_LIBS"
     466              _BOOST_AC_LINK_IFELSE([],
     467                [boost_rpath_link_ldflag_found=yes
     468                break],
     469                [boost_rpath_link_ldflag_found=no])
     470            done
     471            ;;
     472          esac
     473          AS_IF([test "x$boost_rpath_link_ldflag_found" != "xyes"],
     474            [AC_MSG_ERROR([Unable to determine whether to use -R or -rpath])])
     475          LDFLAGS=$boost_save_LDFLAGS
     476          LIBS=$boost_save_LIBS
     477          ])
     478        test x"$boost_ldpath" != x &&
     479          Boost_lib_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
    407480        Boost_lib_LDPATH="$boost_ldpath"
    408         break 6
     481        break 7
    409482      else
    410483        boost_failed_libs="$boost_failed_libs@$boost_lib@"
     
    416489done
    417490done
     491done # boost_lib_
    418492rm -f conftest.$ac_objext
    419493])
    420 case $Boost_lib in #(
    421   no) _AC_MSG_LOG_CONFTEST
    422     AC_MSG_ERROR([cannot find the flags to link with Boost $1])
    423     ;;
    424 esac
    425 AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS])dnl
    426 AC_SUBST(AS_TR_CPP([BOOST_$1_LDPATH]), [$Boost_lib_LDPATH])dnl
    427 AC_SUBST([BOOST_LDPATH], [$Boost_lib_LDPATH])dnl
    428 AC_SUBST(AS_TR_CPP([BOOST_$1_LIBS]), [$Boost_lib_LIBS])dnl
    429 CPPFLAGS=$boost_save_CPPFLAGS
    430 AS_VAR_POPDEF([Boost_lib])dnl
    431 AS_VAR_POPDEF([Boost_lib_LDFLAGS])dnl
    432 AS_VAR_POPDEF([Boost_lib_LDPATH])dnl
    433 AS_VAR_POPDEF([Boost_lib_LIBS])dnl
    434 AC_LANG_POP([C++])dnl
    435 fi
    436 ])# BOOST_FIND_LIB
     494
    437495
    438496
     
    476534# BOOST_BIND()
    477535# ------------
    478 # Look for Boost.Bind
     536# Look for Boost.Bind.
    479537BOOST_DEFUN([Bind],
    480538[BOOST_FIND_HEADER([boost/bind.hpp])])
     539
     540
     541# BOOST_CHRONO()
     542# --------------
     543# Look for Boost.Chrono.
     544BOOST_DEFUN([Chrono],
     545[# Do we have to check for Boost.System?  This link-time dependency was
     546# added as of 1.35.0.  If we have a version <1.35, we must not attempt to
     547# find Boost.System as it didn't exist by then.
     548if test $boost_major_version -ge 135; then
     549  BOOST_SYSTEM([$1])
     550fi # end of the Boost.System check.
     551boost_filesystem_save_LIBS=$LIBS
     552boost_filesystem_save_LDFLAGS=$LDFLAGS
     553m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
     554LIBS="$LIBS $BOOST_SYSTEM_LIBS"
     555LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
     556BOOST_FIND_LIB([chrono], [$1],
     557                [boost/chrono.hpp],
     558                [boost::chrono::thread_clock d;])
     559if test $enable_static_boost = yes && test $boost_major_version -ge 135; then
     560  BOOST_FILESYSTEM_LIBS="$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"
     561fi
     562LIBS=$boost_filesystem_save_LIBS
     563LDFLAGS=$boost_filesystem_save_LDFLAGS
     564])# BOOST_CHRONO
    481565
    482566
     
    488572BOOST_FIND_HEADER([boost/lexical_cast.hpp])
    489573])# BOOST_CONVERSION
     574
     575
     576# BOOST_CRC()
     577# -----------
     578# Look for Boost.CRC
     579BOOST_DEFUN([CRC],
     580[BOOST_FIND_HEADER([boost/crc.hpp])
     581])# BOOST_CRC
    490582
    491583
     
    519611# find Boost.System as it didn't exist by then.
    520612if test $boost_major_version -ge 135; then
    521 BOOST_SYSTEM([$1])
     613  BOOST_SYSTEM([$1])
    522614fi # end of the Boost.System check.
    523615boost_filesystem_save_LIBS=$LIBS
     
    529621                [boost/filesystem/path.hpp], [boost::filesystem::path p;])
    530622if test $enable_static_boost = yes && test $boost_major_version -ge 135; then
    531     AC_SUBST([BOOST_FILESYSTEM_LIBS], ["$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"])
     623  BOOST_FILESYSTEM_LIBS="$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"
    532624fi
    533625LIBS=$boost_filesystem_save_LIBS
     
    536628
    537629
     630# BOOST_FLYWEIGHT()
     631# -----------------
     632# Look for Boost.Flyweight.
     633BOOST_DEFUN([Flyweight],
     634[dnl There's a hidden dependency on pthreads.
     635AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl
     636BOOST_FIND_HEADER([boost/flyweight.hpp])
     637AC_SUBST([BOOST_FLYWEIGHT_LIBS], [$boost_cv_pthread_flag])
     638])
     639
     640
    538641# BOOST_FOREACH()
    539642# ---------------
    540 # Look for Boost.Foreach
     643# Look for Boost.Foreach.
    541644BOOST_DEFUN([Foreach],
    542645[BOOST_FIND_HEADER([boost/foreach.hpp])])
     
    545648# BOOST_FORMAT()
    546649# --------------
    547 # Look for Boost.Format
     650# Look for Boost.Format.
    548651# Note: we can't check for boost/format/format_fwd.hpp because the header isn't
    549652# standalone.  It can't be compiled because it triggers the following error:
     
    559662BOOST_DEFUN([Function],
    560663[BOOST_FIND_HEADER([boost/function.hpp])])
     664
     665
     666# BOOST_GEOMETRY()
     667# ----------------
     668# Look for Boost.Geometry (new since 1.47.0).
     669BOOST_DEFUN([Geometry],
     670[BOOST_FIND_HEADER([boost/geometry.hpp])
     671])# BOOST_GEOMETRY
    561672
    562673
     
    605716# BOOST_LOG([PREFERRED-RT-OPT])
    606717# -----------------------------
    607 # Look for Boost.Log For the documentation of PREFERRED-RT-OPT, see the
     718# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the
    608719# documentation of BOOST_FIND_LIB above.
    609720BOOST_DEFUN([Log],
     
    616727# BOOST_LOG_SETUP([PREFERRED-RT-OPT])
    617728# -----------------------------------
    618 # Look for Boost.Log For the documentation of PREFERRED-RT-OPT, see the
     729# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the
    619730# documentation of BOOST_FIND_LIB above.
    620731BOOST_DEFUN([Log_Setup],
    621732[AC_REQUIRE([BOOST_LOG])dnl
    622733BOOST_FIND_LIB([log_setup], [$1],
    623     [boost/log/utility/init/from_settings.hpp],
     734    [boost/log/utility/setup/from_settings.hpp],
    624735    [boost::log::basic_settings<char> bs; bs.empty();])
    625736])# BOOST_LOG_SETUP
     
    638749
    639750
     751# BOOST_MPI([PREFERRED-RT-OPT])
     752# -------------------------------
     753# Look for Boost MPI.  For the documentation of PREFERRED-RT-OPT, see the
     754# documentation of BOOST_FIND_LIB above.  Uses MPICXX variable if it is
     755# set, otherwise tries CXX
     756#
     757BOOST_DEFUN([MPI],
     758[boost_save_CXX=${CXX}
     759boost_save_CXXCPP=${CXXCPP}
     760if test x"${MPICXX}" != x; then
     761  CXX=${MPICXX}
     762  CXXCPP="${MPICXX} -E"
     763fi
     764BOOST_FIND_LIB([mpi], [$1],
     765               [boost/mpi.hpp],
     766               [int argc = 0;
     767                char **argv = 0;
     768                boost::mpi::environment env(argc,argv);])
     769CXX=${boost_save_CXX}
     770CXXCPP=${boost_save_CXXCPP}
     771])# BOOST_MPI
     772
     773
    640774# BOOST_MULTIARRAY()
    641775# ------------------
     
    643777BOOST_DEFUN([MultiArray],
    644778[BOOST_FIND_HEADER([boost/multi_array.hpp])])
     779
     780
     781# BOOST_NUMERIC_UBLAS()
     782# --------------------------
     783# Look for Boost.NumericUblas (Basic Linear Algebra)
     784BOOST_DEFUN([Numeric_Ublas],
     785[BOOST_FIND_HEADER([boost/numeric/ublas/vector.hpp])
     786])# BOOST_NUMERIC_UBLAS
    645787
    646788
     
    713855_BOOST_PYTHON_CONFIG([LIBS],      [libs])
    714856m4_pattern_allow([^BOOST_PYTHON_MODULE$])dnl
    715 BOOST_FIND_LIB([python], [$1],
    716                [boost/python.hpp],
    717                [], [BOOST_PYTHON_MODULE(empty) {}])
     857BOOST_FIND_LIBS([python], [python python3], [$1],
     858                [boost/python.hpp],
     859                [], [BOOST_PYTHON_MODULE(empty) {}])
    718860CPPFLAGS=$boost_python_save_CPPFLAGS
    719861LDFLAGS=$boost_python_save_LDFLAGS
     
    761903                [boost::signal<void ()> s;])
    762904])# BOOST_SIGNALS
     905
     906
     907# BOOST_SIGNALS2()
     908# ----------------
     909# Look for Boost.Signals2 (new since 1.39.0).
     910BOOST_DEFUN([Signals2],
     911[BOOST_FIND_HEADER([boost/signals2.hpp])
     912])# BOOST_SIGNALS2
    763913
    764914
     
    813963
    814964
    815 # BOOST_THREADS([PREFERRED-RT-OPT])
     965# BOOST_THREAD([PREFERRED-RT-OPT])
    816966# ---------------------------------
    817967# Look for Boost.Thread.  For the documentation of PREFERRED-RT-OPT, see the
    818968# documentation of BOOST_FIND_LIB above.
    819 # FIXME: Provide an alias "BOOST_THREAD".
    820 BOOST_DEFUN([Threads],
     969BOOST_DEFUN([Thread],
    821970[dnl Having the pthread flag is required at least on GCC3 where
    822971dnl boost/thread.hpp would complain if we try to compile without
    823972dnl -pthread on GNU/Linux.
    824973AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl
    825 boost_threads_save_LIBS=$LIBS
    826 boost_threads_save_CPPFLAGS=$CPPFLAGS
    827 LIBS="$LIBS $boost_cv_pthread_flag"
    828 # Yes, we *need* to put the -pthread thing in CPPFLAGS because with GCC3,
    829 # boost/thread.hpp will trigger a #error if -pthread isn't used:
    830 #   boost/config/requires_threads.hpp:47:5: #error "Compiler threading support
    831 #   is not turned on. Please set the correct command line options for
    832 #   threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)"
     974boost_thread_save_LIBS=$LIBS
     975boost_thread_save_LDFLAGS=$LDFLAGS
     976boost_thread_save_CPPFLAGS=$CPPFLAGS
     977# Link-time dependency from thread to system was added as of 1.49.0.
     978if test $boost_major_version -ge 149; then
     979BOOST_SYSTEM([$1])
     980fi # end of the Boost.System check.
     981m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
     982LIBS="$LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag"
     983LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
    833984CPPFLAGS="$CPPFLAGS $boost_cv_pthread_flag"
    834 BOOST_FIND_LIB([thread], [$1],
    835                [boost/thread.hpp], [boost::thread t; boost::mutex m;])
    836 BOOST_THREAD_LIBS="$BOOST_THREAD_LIBS $boost_cv_pthread_flag"
     985
     986# When compiling for the Windows platform, the threads library is named
     987# differently.
     988case $host_os in
     989  (*mingw*) boost_thread_lib_ext=_win32;;
     990esac
     991BOOST_FIND_LIBS([thread], [thread$boost_thread_lib_ext],
     992                [$1],
     993                [boost/thread.hpp], [boost::thread t; boost::mutex m;])
     994
     995BOOST_THREAD_LIBS="$BOOST_THREAD_LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag"
     996BOOST_THREAD_LDFLAGS="$BOOST_SYSTEM_LDFLAGS"
    837997BOOST_CPPFLAGS="$BOOST_CPPFLAGS $boost_cv_pthread_flag"
    838 LIBS=$boost_threads_save_LIBS
    839 CPPFLAGS=$boost_threads_save_CPPFLAGS
    840 ])# BOOST_THREADS
     998LIBS=$boost_thread_save_LIBS
     999LDFLAGS=$boost_thread_save_LDFLAGS
     1000CPPFLAGS=$boost_thread_save_CPPFLAGS
     1001])# BOOST_THREAD
     1002
     1003AU_ALIAS([BOOST_THREADS], [BOOST_THREAD])
    8411004
    8421005
     
    8871050
    8881051
     1052# BOOST_POINTER_CONTAINER()
     1053# ------------------------
     1054# Look for Boost.PointerContainer
     1055BOOST_DEFUN([Pointer_Container],
     1056[BOOST_FIND_HEADER([boost/ptr_container/ptr_deque.hpp])
     1057BOOST_FIND_HEADER([boost/ptr_container/ptr_list.hpp])
     1058BOOST_FIND_HEADER([boost/ptr_container/ptr_vector.hpp])
     1059BOOST_FIND_HEADER([boost/ptr_container/ptr_array.hpp])
     1060BOOST_FIND_HEADER([boost/ptr_container/ptr_set.hpp])
     1061BOOST_FIND_HEADER([boost/ptr_container/ptr_map.hpp])
     1062])# BOOST_POINTER_CONTAINER
     1063
     1064
    8891065# BOOST_WAVE([PREFERRED-RT-OPT])
    8901066# ------------------------------
    8911067# NOTE: If you intend to use Wave/Spirit with thread support, make sure you
    892 # call BOOST_THREADS first.
     1068# call BOOST_THREAD first.
    8931069# Look for Boost.Wave.  For the documentation of PREFERRED-RT-OPT, see the
    8941070# documentation of BOOST_FIND_LIB above.
     
    8991075boost_wave_save_LDFLAGS=$LDFLAGS
    9001076m4_pattern_allow([^BOOST_((FILE)?SYSTEM|DATE_TIME|THREAD)_(LIBS|LDFLAGS)$])dnl
    901 LIBS="$LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_DATE_TIME_LIBS\
     1077LIBS="$LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_DATE_TIME_LIBS \
    9021078$BOOST_THREAD_LIBS"
    903 LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS\
     1079LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS \
    9041080$BOOST_DATE_TIME_LDFLAGS $BOOST_THREAD_LDFLAGS"
    9051081BOOST_FIND_LIB([wave], [$1],
     
    9251101# _BOOST_PTHREAD_FLAG()
    9261102# ---------------------
    927 # Internal helper for BOOST_THREADS.  Based on ACX_PTHREAD:
    928 # http://autoconf-archive.cryp.to/acx_pthread.html
     1103# Internal helper for BOOST_THREAD.  Computes boost_cv_pthread_flag
     1104# which must be used in CPPFLAGS and LIBS.
     1105#
     1106# Yes, we *need* to put the -pthread thing in CPPFLAGS because with GCC3,
     1107# boost/thread.hpp will trigger a #error if -pthread isn't used:
     1108#   boost/config/requires_threads.hpp:47:5: #error "Compiler threading support
     1109#   is not turned on. Please set the correct command line options for
     1110#   threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)"
     1111#
     1112# Based on ACX_PTHREAD: http://autoconf-archive.cryp.to/acx_pthread.html
    9291113AC_DEFUN([_BOOST_PTHREAD_FLAG],
    9301114[AC_REQUIRE([AC_PROG_CXX])dnl
     
    9941178["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC @ gcc$1$2"])dnl
    9951179
     1180# _BOOST_mingw_test(MAJOR, MINOR)
     1181# -----------------------------
     1182# Internal helper for _BOOST_FIND_COMPILER_TAG.
     1183m4_define([_BOOST_mingw_test],
     1184["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC && \
     1185  (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
     1186         || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw$1$2"])dnl
     1187
    9961188
    9971189# _BOOST_FIND_COMPILER_TAG()
     
    10211213  # the same defines as GCC's).
    10221214  for i in \
     1215    _BOOST_mingw_test(4,8) \
     1216    _BOOST_gcc_test(4, 8) \
     1217    _BOOST_mingw_test(4,7) \
     1218    _BOOST_gcc_test(4, 7) \
     1219    _BOOST_mingw_test(4,6) \
    10231220    _BOOST_gcc_test(4, 6) \
     1221    _BOOST_mingw_test(4,5) \
    10241222    _BOOST_gcc_test(4, 5) \
     1223    _BOOST_mingw_test(4,4) \
    10251224    _BOOST_gcc_test(4, 4) \
     1225    _BOOST_mingw_test(4,3) \
    10261226    _BOOST_gcc_test(4, 3) \
     1227    _BOOST_mingw_test(4,2) \
    10271228    _BOOST_gcc_test(4, 2) \
     1229    _BOOST_mingw_test(4,1) \
    10281230    _BOOST_gcc_test(4, 1) \
     1231    _BOOST_mingw_test(4,0) \
    10291232    _BOOST_gcc_test(4, 0) \
    10301233    "defined __GNUC__ && __GNUC__ == 3 && !defined __ICC \
     
    10921295AC_DEFUN([_BOOST_GUESS_WHETHER_TO_USE_MT],
    10931296[# Check whether we do better use `mt' even though we weren't ask to.
     1297AC_LANG_PUSH([C++])dnl
    10941298AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
    10951299#if defined _REENTRANT || defined _MT || defined __MT__
     
    10991303#endif
    11001304]])], [boost_guess_use_mt=:], [boost_guess_use_mt=false])
     1305AC_LANG_POP([C++])dnl
    11011306])
    11021307
     
    11221327  _AS_ECHO_LOG([re-using the existing conftest.$ac_objext])
    11231328AS_IF([_AC_DO_STDERR($ac_link) && {
    1124         test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
    1125         test ! -s conftest.err
     1329        test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
     1330        test ! -s conftest.err
    11261331       } && test -s conftest$ac_exeext && {
    1127         test "$cross_compiling" = yes ||
    1128         $as_executable_p conftest$ac_exeext
     1332        test "$cross_compiling" = yes ||
     1333        $as_executable_p conftest$ac_exeext
    11291334dnl FIXME: use AS_TEST_X instead when 2.61 is widespread enough.
    11301335       }],
  • src/Helpers/Makefile.am

    r0ab195 r6309fd  
    22# Also indentation by a single tab
    33
    4 INCLUDES = -I$(top_srcdir)/src/
    5 
    64AM_LDFLAGS = -ldl
    7 AM_CPPFLAGS = $(BOOST_CPPFLAGS)
     5AM_CPPFLAGS = -I$(top_srcdir)/src/ $(BOOST_CPPFLAGS)
    86
    97HELPERSOURCE = \
  • src/Makefile.am

    r0ab195 r6309fd  
    22# Also indentation by a single tab
    33
    4 INCLUDES = -I$(top_srcdir)/src/
    5 
    64AM_LDFLAGS = $(BOOST_THREAD_LDFLAGS) -ldl
    7 AM_CPPFLAGS = $(BOOST_CPPFLAGS)
     5AM_CPPFLAGS = -I$(top_srcdir)/src/ $(BOOST_CPPFLAGS)
    86
    97SUBDIRS = Helpers Patterns Observer unittests
     
    2018codepatterns_config_SOURCES = \
    2119        $(CONFIGSOURCES) \
    22         $(top_builddir)/src/codepatterns-config.cpp
     20        codepatterns-config.cpp
    2321codepatterns_config_CPPFLAGS = $(BOOST_CPPFLAGS)
    2422codepatterns_config_LDFLAGS = $(AM_LDFLAGS) \
     
    3028codepatterns_debug_config_SOURCES = \
    3129        $(CONFIGSOURCES) \
    32         $(top_builddir)/src/codepatterns-debug-config.cpp
     30        codepatterns-debug-config.cpp
    3331codepatterns_debug_config_CPPFLAGS = $(BOOST_CPPFLAGS)
    3432codepatterns_debug_config_LDFLAGS = $(AM_LDFLAGS) \
     
    4644# this includes source files that need to be present at multiple points
    4745SOURCE =  \
    48         $(top_builddir)/src/version.cpp
     46        version.cpp
    4947SOURCEDEBUG = \
    5048        $(SOURCE)
     
    123121EXTRA_DIST = $(srcdir)/.git-version
    124122
    125 $(top_builddir)/src/version.cpp: $(srcdir)/.git-version
     123version.cpp: $(srcdir)/.git-version
    126124        echo -e "const char *CODEPATTERNSVERSION = \"`cat <$(srcdir)/.git-version`\";\nconst char *CODEPATTERNSFULLVERSION = \"$(PACKAGE_NAME) version "`cat $(srcdir)/.git-version`"\";\n" > $@
    127125
    128 $(top_builddir)/src/codepatterns-config.cpp:
     126codepatterns-config.cpp:
    129127        echo -e "const char *CODEPATTERNSCFLAGS=\"-I$(includedir) ${BOOST_CPPFLAGS}\";\nconst char *CODEPATTERNSLDFLAGS=\"-L$(libdir) $(BOOST_LDFLAGS)\";\nconst char *CODEPATTERNSLIBS=\"-lCodePatterns $(BOOST_THREAD_LIB)\";\n" > $@
    130128
    131 $(top_builddir)/src/codepatterns-debug-config.cpp:
     129codepatterns-debug-config.cpp:
    132130        echo -e "const char *CODEPATTERNSCFLAGS=\"-I$(includedir) ${BOOST_CPPFLAGS}\";\nconst char *CODEPATTERNSLDFLAGS=\"-L$(libdir) $(BOOST_LDFLAGS)\";\nconst char *CODEPATTERNSLIBS=\"-lCodePatterns-debug $(BOOST_THREAD_LIB)\";\n" > $@
  • src/Observer/Makefile.am

    r0ab195 r6309fd  
    33
    44
    5 INCLUDES = -I$(top_srcdir)/src/
    6 
    75AM_LDFLAGS = -ldl
    8 AM_CPPFLAGS = $(BOOST_CPPFLAGS)
     6AM_CPPFLAGS = -I$(top_srcdir)/src/ $(BOOST_CPPFLAGS)
    97
    108OBSERVERSOURCE = \
  • src/Patterns/Makefile.am

    r0ab195 r6309fd  
    33
    44
    5 INCLUDES = -I$(top_srcdir)/src/
    6 
    75AM_LDFLAGS = -ldl
    8 AM_CPPFLAGS = ${BOOST_CPPFLAGS}
     6AM_CPPFLAGS = -I$(top_srcdir)/src/ ${BOOST_CPPFLAGS}
    97
    108PATTERNSOURCE =
  • src/unittests/Makefile.am

    r0ab195 r6309fd  
    1010TESTHEADERS =
    1111
    12 INCLUDES = -I$(top_srcdir)/src/
    13 
    1412AM_LDFLAGS = ${BOOST_THREAD_LDFLAGS} $(CPPUNIT_LIBS) -ldl
    15 AM_CPPFLAGS = ${BOOST_CPPFLAGS} $(CPPUNIT_CFLAGS)
     13AM_CPPFLAGS = -I$(top_srcdir)/src/ ${BOOST_CPPFLAGS} $(CPPUNIT_CFLAGS)
    1614
    1715include $(top_srcdir)/src/Helpers/unittests/Makefile.am
Note: See TracChangeset for help on using the changeset viewer.