Changeset 6309fd
- Timestamp:
- Aug 17, 2014, 4:07:55 PM (11 years ago)
- Children:
- ec61ec
- Parents:
- 0ab195
- Files:
-
- 7 edited
-
configure.ac (modified) (1 diff)
-
m4/boost.m4 (modified) (38 diffs)
-
src/Helpers/Makefile.am (modified) (1 diff)
-
src/Makefile.am (modified) (5 diffs)
-
src/Observer/Makefile.am (modified) (1 diff)
-
src/Patterns/Makefile.am (modified) (1 diff)
-
src/unittests/Makefile.am (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
configure.ac
r0ab195 r6309fd 9 9 AC_CONFIG_MACRO_DIR([m4]) 10 10 11 AM_INIT_AUTOMAKE([dist-bzip2 1.11 parallel-tests color-tests ])11 AM_INIT_AUTOMAKE([dist-bzip2 1.11 parallel-tests color-tests subdir-objects]) 12 12 13 13 # Checks for programs. -
m4/boost.m4
r0ab195 r6309fd 1 1 # boost.m4: Locate Boost headers and libraries for autoconf-based projects. 2 # Copyright (C) 2007 , 2008, 2009, 2010, 2011Benoit Sigoure <tsuna@lrde.epita.fr>2 # Copyright (C) 2007-2011, 2014 Benoit Sigoure <tsuna@lrde.epita.fr> 3 3 # 4 4 # This program is free software: you can redistribute it and/or modify … … 23 23 24 24 m4_define([_BOOST_SERIAL], [m4_translit([ 25 # serial 1625 # serial 22 26 26 ], [# 27 27 ], [])]) … … 60 60 # value of any macro. 61 61 m4_define([_BOOST_SED_CPP], 62 [AC_LANG_PREPROC_REQUIRE()dnl 62 [AC_LANG_PUSH([C++])dnl 63 AC_LANG_PREPROC_REQUIRE()dnl 63 64 AC_REQUIRE([AC_PROG_SED])dnl 64 65 AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])]) … … 78 79 [$4]) 79 80 rm -rf conftest* 80 ])# AC_EGREP_CPP 81 AC_LANG_POP([C++])dnl 82 ])# _BOOST_SED_CPP 81 83 82 84 … … 222 224 ])# BOOST_REQUIRE 223 225 226 224 227 # BOOST_STATIC() 225 228 # -------------- … … 228 231 AC_DEFUN([BOOST_STATIC], 229 232 [AC_ARG_ENABLE([static-boost], 230 [A C_HELP_STRING([--enable-static-boost],233 [AS_HELP_STRING([--enable-static-boost], 231 234 [Prefer the static boost libraries over the shared ones [no]])], 232 235 [enable_static_boost=yes], 233 236 [enable_static_boost=no])])# BOOST_STATIC 237 234 238 235 239 # BOOST_FIND_HEADER([HEADER-NAME], [ACTION-IF-NOT-FOUND], [ACTION-IF-FOUND]) … … 265 269 266 270 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. 275 281 # 276 282 # Invokes BOOST_FIND_HEADER([HEADER-NAME]) (see above). … … 286 292 # ... If you want to make sure you have a specific version of Boost 287 293 # (eg, >= 1.33) you *must* invoke BOOST_REQUIRE before this macro. 288 AC_DEFUN([BOOST_FIND_LIB ],294 AC_DEFUN([BOOST_FIND_LIBS], 289 295 [AC_REQUIRE([BOOST_REQUIRE])dnl 290 296 AC_REQUIRE([_BOOST_FIND_COMPILER_TAG])dnl … … 300 306 AS_VAR_PUSHDEF([Boost_lib_LDPATH], [boost_cv_lib_$1_LDPATH])dnl 301 307 AS_VAR_PUSHDEF([Boost_lib_LIBS], [boost_cv_lib_$1_LIBS])dnl 302 BOOST_FIND_HEADER([$ 3])308 BOOST_FIND_HEADER([$4]) 303 309 boost_save_CPPFLAGS=$CPPFLAGS 304 310 CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" 305 # Now let's try to find the library. The algorithm is as follows: first look306 # for a given library name according to the user's PREFERRED-RT-OPT. For each307 # 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 is309 # usually installed. If we can't find the standard variants, we try to310 # enforce -mt (for instance on MacOSX, libboost_threads.dylib doesn't exist311 # but there's -obviously- libboost_threads-mt.dylib).312 311 AC_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($@)]) 313 case $Boost_lib in #( 314 (no) _AC_MSG_LOG_CONFTEST 315 AC_MSG_ERROR([cannot find the flags to link with Boost $1]) 316 ;; 317 esac 318 AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS])dnl 319 AC_SUBST(AS_TR_CPP([BOOST_$1_LDPATH]), [$Boost_lib_LDPATH])dnl 320 AC_SUBST([BOOST_LDPATH], [$Boost_lib_LDPATH])dnl 321 AC_SUBST(AS_TR_CPP([BOOST_$1_LIBS]), [$Boost_lib_LIBS])dnl 322 CPPFLAGS=$boost_save_CPPFLAGS 323 AS_VAR_POPDEF([Boost_lib])dnl 324 AS_VAR_POPDEF([Boost_lib_LDFLAGS])dnl 325 AS_VAR_POPDEF([Boost_lib_LDPATH])dnl 326 AS_VAR_POPDEF([Boost_lib_LIBS])dnl 327 AC_LANG_POP([C++])dnl 328 fi 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. 337 AC_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). 355 AC_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;; 318 361 esac 319 362 if test $enable_static_boost = yes; then … … 322 365 # Find the proper debug variant depending on what we've been asked to find. 323 366 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') 326 369 boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #( 327 *) boost_rt_d='-d';;370 (*) boost_rt_d='-d';; 328 371 esac 329 372 # If the PREFERRED-RT-OPT are not empty, prepend a `-'. … … 336 379 boost_save_ac_objext=$ac_objext 337 380 # 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])]) 340 383 dnl Optimization hacks: compiling C++ is slow, especially with Boost. What 341 384 dnl we're trying to do here is guess the right combination of link flags … … 359 402 ac_objext=$boost_save_ac_objext 360 403 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. 406 for boost_lib_ in $2; do 363 407 for boost_tag_ in -$boost_cv_lib_tag ''; do 364 408 for boost_ver_ in -$boost_cv_lib_version ''; do … … 366 410 for boost_rtopt_ in $boost_rtopt '' -d; do 367 411 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_ 372 416 do 373 417 # Avoid testing twice the same lib 374 418 case $boost_failed_libs in #( 375 *@$boost_lib@*) continue;;419 (*@$boost_lib@*) continue;; 376 420 esac 377 421 # If with_boost is empty, we'll search in /lib first, which is not quite … … 383 427 "$with_boost" C:/Boost/lib /lib* 384 428 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 386 433 boost_save_LDFLAGS=$LDFLAGS 387 434 # Are we looking for a static library? 388 435 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) 390 437 Boost_lib_LIBS="$boost_ldpath/lib$boost_lib.$libext" 391 438 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. 393 440 Boost_lib_LIBS="-l$boost_lib";; 394 441 esac … … 404 451 LIBS=$boost_save_LIBS 405 452 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" 407 480 Boost_lib_LDPATH="$boost_ldpath" 408 break 6481 break 7 409 482 else 410 483 boost_failed_libs="$boost_failed_libs@$boost_lib@" … … 416 489 done 417 490 done 491 done # boost_lib_ 418 492 rm -f conftest.$ac_objext 419 493 ]) 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 437 495 438 496 … … 476 534 # BOOST_BIND() 477 535 # ------------ 478 # Look for Boost.Bind 536 # Look for Boost.Bind. 479 537 BOOST_DEFUN([Bind], 480 538 [BOOST_FIND_HEADER([boost/bind.hpp])]) 539 540 541 # BOOST_CHRONO() 542 # -------------- 543 # Look for Boost.Chrono. 544 BOOST_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. 548 if test $boost_major_version -ge 135; then 549 BOOST_SYSTEM([$1]) 550 fi # end of the Boost.System check. 551 boost_filesystem_save_LIBS=$LIBS 552 boost_filesystem_save_LDFLAGS=$LDFLAGS 553 m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl 554 LIBS="$LIBS $BOOST_SYSTEM_LIBS" 555 LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS" 556 BOOST_FIND_LIB([chrono], [$1], 557 [boost/chrono.hpp], 558 [boost::chrono::thread_clock d;]) 559 if test $enable_static_boost = yes && test $boost_major_version -ge 135; then 560 BOOST_FILESYSTEM_LIBS="$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS" 561 fi 562 LIBS=$boost_filesystem_save_LIBS 563 LDFLAGS=$boost_filesystem_save_LDFLAGS 564 ])# BOOST_CHRONO 481 565 482 566 … … 488 572 BOOST_FIND_HEADER([boost/lexical_cast.hpp]) 489 573 ])# BOOST_CONVERSION 574 575 576 # BOOST_CRC() 577 # ----------- 578 # Look for Boost.CRC 579 BOOST_DEFUN([CRC], 580 [BOOST_FIND_HEADER([boost/crc.hpp]) 581 ])# BOOST_CRC 490 582 491 583 … … 519 611 # find Boost.System as it didn't exist by then. 520 612 if test $boost_major_version -ge 135; then 521 BOOST_SYSTEM([$1])613 BOOST_SYSTEM([$1]) 522 614 fi # end of the Boost.System check. 523 615 boost_filesystem_save_LIBS=$LIBS … … 529 621 [boost/filesystem/path.hpp], [boost::filesystem::path p;]) 530 622 if 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" 532 624 fi 533 625 LIBS=$boost_filesystem_save_LIBS … … 536 628 537 629 630 # BOOST_FLYWEIGHT() 631 # ----------------- 632 # Look for Boost.Flyweight. 633 BOOST_DEFUN([Flyweight], 634 [dnl There's a hidden dependency on pthreads. 635 AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl 636 BOOST_FIND_HEADER([boost/flyweight.hpp]) 637 AC_SUBST([BOOST_FLYWEIGHT_LIBS], [$boost_cv_pthread_flag]) 638 ]) 639 640 538 641 # BOOST_FOREACH() 539 642 # --------------- 540 # Look for Boost.Foreach 643 # Look for Boost.Foreach. 541 644 BOOST_DEFUN([Foreach], 542 645 [BOOST_FIND_HEADER([boost/foreach.hpp])]) … … 545 648 # BOOST_FORMAT() 546 649 # -------------- 547 # Look for Boost.Format 650 # Look for Boost.Format. 548 651 # Note: we can't check for boost/format/format_fwd.hpp because the header isn't 549 652 # standalone. It can't be compiled because it triggers the following error: … … 559 662 BOOST_DEFUN([Function], 560 663 [BOOST_FIND_HEADER([boost/function.hpp])]) 664 665 666 # BOOST_GEOMETRY() 667 # ---------------- 668 # Look for Boost.Geometry (new since 1.47.0). 669 BOOST_DEFUN([Geometry], 670 [BOOST_FIND_HEADER([boost/geometry.hpp]) 671 ])# BOOST_GEOMETRY 561 672 562 673 … … 605 716 # BOOST_LOG([PREFERRED-RT-OPT]) 606 717 # ----------------------------- 607 # Look for Boost.Log For the documentation of PREFERRED-RT-OPT, see the718 # Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the 608 719 # documentation of BOOST_FIND_LIB above. 609 720 BOOST_DEFUN([Log], … … 616 727 # BOOST_LOG_SETUP([PREFERRED-RT-OPT]) 617 728 # ----------------------------------- 618 # Look for Boost.Log For the documentation of PREFERRED-RT-OPT, see the729 # Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the 619 730 # documentation of BOOST_FIND_LIB above. 620 731 BOOST_DEFUN([Log_Setup], 621 732 [AC_REQUIRE([BOOST_LOG])dnl 622 733 BOOST_FIND_LIB([log_setup], [$1], 623 [boost/log/utility/ init/from_settings.hpp],734 [boost/log/utility/setup/from_settings.hpp], 624 735 [boost::log::basic_settings<char> bs; bs.empty();]) 625 736 ])# BOOST_LOG_SETUP … … 638 749 639 750 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 # 757 BOOST_DEFUN([MPI], 758 [boost_save_CXX=${CXX} 759 boost_save_CXXCPP=${CXXCPP} 760 if test x"${MPICXX}" != x; then 761 CXX=${MPICXX} 762 CXXCPP="${MPICXX} -E" 763 fi 764 BOOST_FIND_LIB([mpi], [$1], 765 [boost/mpi.hpp], 766 [int argc = 0; 767 char **argv = 0; 768 boost::mpi::environment env(argc,argv);]) 769 CXX=${boost_save_CXX} 770 CXXCPP=${boost_save_CXXCPP} 771 ])# BOOST_MPI 772 773 640 774 # BOOST_MULTIARRAY() 641 775 # ------------------ … … 643 777 BOOST_DEFUN([MultiArray], 644 778 [BOOST_FIND_HEADER([boost/multi_array.hpp])]) 779 780 781 # BOOST_NUMERIC_UBLAS() 782 # -------------------------- 783 # Look for Boost.NumericUblas (Basic Linear Algebra) 784 BOOST_DEFUN([Numeric_Ublas], 785 [BOOST_FIND_HEADER([boost/numeric/ublas/vector.hpp]) 786 ])# BOOST_NUMERIC_UBLAS 645 787 646 788 … … 713 855 _BOOST_PYTHON_CONFIG([LIBS], [libs]) 714 856 m4_pattern_allow([^BOOST_PYTHON_MODULE$])dnl 715 BOOST_FIND_LIB ([python], [$1],716 [boost/python.hpp],717 [], [BOOST_PYTHON_MODULE(empty) {}])857 BOOST_FIND_LIBS([python], [python python3], [$1], 858 [boost/python.hpp], 859 [], [BOOST_PYTHON_MODULE(empty) {}]) 718 860 CPPFLAGS=$boost_python_save_CPPFLAGS 719 861 LDFLAGS=$boost_python_save_LDFLAGS … … 761 903 [boost::signal<void ()> s;]) 762 904 ])# BOOST_SIGNALS 905 906 907 # BOOST_SIGNALS2() 908 # ---------------- 909 # Look for Boost.Signals2 (new since 1.39.0). 910 BOOST_DEFUN([Signals2], 911 [BOOST_FIND_HEADER([boost/signals2.hpp]) 912 ])# BOOST_SIGNALS2 763 913 764 914 … … 813 963 814 964 815 # BOOST_THREAD S([PREFERRED-RT-OPT])965 # BOOST_THREAD([PREFERRED-RT-OPT]) 816 966 # --------------------------------- 817 967 # Look for Boost.Thread. For the documentation of PREFERRED-RT-OPT, see the 818 968 # documentation of BOOST_FIND_LIB above. 819 # FIXME: Provide an alias "BOOST_THREAD". 820 BOOST_DEFUN([Threads], 969 BOOST_DEFUN([Thread], 821 970 [dnl Having the pthread flag is required at least on GCC3 where 822 971 dnl boost/thread.hpp would complain if we try to compile without 823 972 dnl -pthread on GNU/Linux. 824 973 AC_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)" 974 boost_thread_save_LIBS=$LIBS 975 boost_thread_save_LDFLAGS=$LDFLAGS 976 boost_thread_save_CPPFLAGS=$CPPFLAGS 977 # Link-time dependency from thread to system was added as of 1.49.0. 978 if test $boost_major_version -ge 149; then 979 BOOST_SYSTEM([$1]) 980 fi # end of the Boost.System check. 981 m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl 982 LIBS="$LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag" 983 LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS" 833 984 CPPFLAGS="$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. 988 case $host_os in 989 (*mingw*) boost_thread_lib_ext=_win32;; 990 esac 991 BOOST_FIND_LIBS([thread], [thread$boost_thread_lib_ext], 992 [$1], 993 [boost/thread.hpp], [boost::thread t; boost::mutex m;]) 994 995 BOOST_THREAD_LIBS="$BOOST_THREAD_LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag" 996 BOOST_THREAD_LDFLAGS="$BOOST_SYSTEM_LDFLAGS" 837 997 BOOST_CPPFLAGS="$BOOST_CPPFLAGS $boost_cv_pthread_flag" 838 LIBS=$boost_threads_save_LIBS 839 CPPFLAGS=$boost_threads_save_CPPFLAGS 840 ])# BOOST_THREADS 998 LIBS=$boost_thread_save_LIBS 999 LDFLAGS=$boost_thread_save_LDFLAGS 1000 CPPFLAGS=$boost_thread_save_CPPFLAGS 1001 ])# BOOST_THREAD 1002 1003 AU_ALIAS([BOOST_THREADS], [BOOST_THREAD]) 841 1004 842 1005 … … 887 1050 888 1051 1052 # BOOST_POINTER_CONTAINER() 1053 # ------------------------ 1054 # Look for Boost.PointerContainer 1055 BOOST_DEFUN([Pointer_Container], 1056 [BOOST_FIND_HEADER([boost/ptr_container/ptr_deque.hpp]) 1057 BOOST_FIND_HEADER([boost/ptr_container/ptr_list.hpp]) 1058 BOOST_FIND_HEADER([boost/ptr_container/ptr_vector.hpp]) 1059 BOOST_FIND_HEADER([boost/ptr_container/ptr_array.hpp]) 1060 BOOST_FIND_HEADER([boost/ptr_container/ptr_set.hpp]) 1061 BOOST_FIND_HEADER([boost/ptr_container/ptr_map.hpp]) 1062 ])# BOOST_POINTER_CONTAINER 1063 1064 889 1065 # BOOST_WAVE([PREFERRED-RT-OPT]) 890 1066 # ------------------------------ 891 1067 # NOTE: If you intend to use Wave/Spirit with thread support, make sure you 892 # call BOOST_THREAD Sfirst.1068 # call BOOST_THREAD first. 893 1069 # Look for Boost.Wave. For the documentation of PREFERRED-RT-OPT, see the 894 1070 # documentation of BOOST_FIND_LIB above. … … 899 1075 boost_wave_save_LDFLAGS=$LDFLAGS 900 1076 m4_pattern_allow([^BOOST_((FILE)?SYSTEM|DATE_TIME|THREAD)_(LIBS|LDFLAGS)$])dnl 901 LIBS="$LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_DATE_TIME_LIBS \1077 LIBS="$LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_DATE_TIME_LIBS \ 902 1078 $BOOST_THREAD_LIBS" 903 LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS \1079 LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS \ 904 1080 $BOOST_DATE_TIME_LDFLAGS $BOOST_THREAD_LDFLAGS" 905 1081 BOOST_FIND_LIB([wave], [$1], … … 925 1101 # _BOOST_PTHREAD_FLAG() 926 1102 # --------------------- 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 929 1113 AC_DEFUN([_BOOST_PTHREAD_FLAG], 930 1114 [AC_REQUIRE([AC_PROG_CXX])dnl … … 994 1178 ["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC @ gcc$1$2"])dnl 995 1179 1180 # _BOOST_mingw_test(MAJOR, MINOR) 1181 # ----------------------------- 1182 # Internal helper for _BOOST_FIND_COMPILER_TAG. 1183 m4_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 996 1188 997 1189 # _BOOST_FIND_COMPILER_TAG() … … 1021 1213 # the same defines as GCC's). 1022 1214 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) \ 1023 1220 _BOOST_gcc_test(4, 6) \ 1221 _BOOST_mingw_test(4,5) \ 1024 1222 _BOOST_gcc_test(4, 5) \ 1223 _BOOST_mingw_test(4,4) \ 1025 1224 _BOOST_gcc_test(4, 4) \ 1225 _BOOST_mingw_test(4,3) \ 1026 1226 _BOOST_gcc_test(4, 3) \ 1227 _BOOST_mingw_test(4,2) \ 1027 1228 _BOOST_gcc_test(4, 2) \ 1229 _BOOST_mingw_test(4,1) \ 1028 1230 _BOOST_gcc_test(4, 1) \ 1231 _BOOST_mingw_test(4,0) \ 1029 1232 _BOOST_gcc_test(4, 0) \ 1030 1233 "defined __GNUC__ && __GNUC__ == 3 && !defined __ICC \ … … 1092 1295 AC_DEFUN([_BOOST_GUESS_WHETHER_TO_USE_MT], 1093 1296 [# Check whether we do better use `mt' even though we weren't ask to. 1297 AC_LANG_PUSH([C++])dnl 1094 1298 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 1095 1299 #if defined _REENTRANT || defined _MT || defined __MT__ … … 1099 1303 #endif 1100 1304 ]])], [boost_guess_use_mt=:], [boost_guess_use_mt=false]) 1305 AC_LANG_POP([C++])dnl 1101 1306 ]) 1102 1307 … … 1122 1327 _AS_ECHO_LOG([re-using the existing conftest.$ac_objext]) 1123 1328 AS_IF([_AC_DO_STDERR($ac_link) && { 1124 test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||1125 test ! -s conftest.err1329 test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" || 1330 test ! -s conftest.err 1126 1331 } && test -s conftest$ac_exeext && { 1127 test "$cross_compiling" = yes ||1128 $as_executable_p conftest$ac_exeext1332 test "$cross_compiling" = yes || 1333 $as_executable_p conftest$ac_exeext 1129 1334 dnl FIXME: use AS_TEST_X instead when 2.61 is widespread enough. 1130 1335 }], -
src/Helpers/Makefile.am
r0ab195 r6309fd 2 2 # Also indentation by a single tab 3 3 4 INCLUDES = -I$(top_srcdir)/src/5 6 4 AM_LDFLAGS = -ldl 7 AM_CPPFLAGS = $(BOOST_CPPFLAGS)5 AM_CPPFLAGS = -I$(top_srcdir)/src/ $(BOOST_CPPFLAGS) 8 6 9 7 HELPERSOURCE = \ -
src/Makefile.am
r0ab195 r6309fd 2 2 # Also indentation by a single tab 3 3 4 INCLUDES = -I$(top_srcdir)/src/5 6 4 AM_LDFLAGS = $(BOOST_THREAD_LDFLAGS) -ldl 7 AM_CPPFLAGS = $(BOOST_CPPFLAGS)5 AM_CPPFLAGS = -I$(top_srcdir)/src/ $(BOOST_CPPFLAGS) 8 6 9 7 SUBDIRS = Helpers Patterns Observer unittests … … 20 18 codepatterns_config_SOURCES = \ 21 19 $(CONFIGSOURCES) \ 22 $(top_builddir)/src/codepatterns-config.cpp20 codepatterns-config.cpp 23 21 codepatterns_config_CPPFLAGS = $(BOOST_CPPFLAGS) 24 22 codepatterns_config_LDFLAGS = $(AM_LDFLAGS) \ … … 30 28 codepatterns_debug_config_SOURCES = \ 31 29 $(CONFIGSOURCES) \ 32 $(top_builddir)/src/codepatterns-debug-config.cpp30 codepatterns-debug-config.cpp 33 31 codepatterns_debug_config_CPPFLAGS = $(BOOST_CPPFLAGS) 34 32 codepatterns_debug_config_LDFLAGS = $(AM_LDFLAGS) \ … … 46 44 # this includes source files that need to be present at multiple points 47 45 SOURCE = \ 48 $(top_builddir)/src/version.cpp46 version.cpp 49 47 SOURCEDEBUG = \ 50 48 $(SOURCE) … … 123 121 EXTRA_DIST = $(srcdir)/.git-version 124 122 125 $(top_builddir)/src/version.cpp: $(srcdir)/.git-version123 version.cpp: $(srcdir)/.git-version 126 124 echo -e "const char *CODEPATTERNSVERSION = \"`cat <$(srcdir)/.git-version`\";\nconst char *CODEPATTERNSFULLVERSION = \"$(PACKAGE_NAME) version "`cat $(srcdir)/.git-version`"\";\n" > $@ 127 125 128 $(top_builddir)/src/codepatterns-config.cpp:126 codepatterns-config.cpp: 129 127 echo -e "const char *CODEPATTERNSCFLAGS=\"-I$(includedir) ${BOOST_CPPFLAGS}\";\nconst char *CODEPATTERNSLDFLAGS=\"-L$(libdir) $(BOOST_LDFLAGS)\";\nconst char *CODEPATTERNSLIBS=\"-lCodePatterns $(BOOST_THREAD_LIB)\";\n" > $@ 130 128 131 $(top_builddir)/src/codepatterns-debug-config.cpp:129 codepatterns-debug-config.cpp: 132 130 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 3 3 4 4 5 INCLUDES = -I$(top_srcdir)/src/6 7 5 AM_LDFLAGS = -ldl 8 AM_CPPFLAGS = $(BOOST_CPPFLAGS)6 AM_CPPFLAGS = -I$(top_srcdir)/src/ $(BOOST_CPPFLAGS) 9 7 10 8 OBSERVERSOURCE = \ -
src/Patterns/Makefile.am
r0ab195 r6309fd 3 3 4 4 5 INCLUDES = -I$(top_srcdir)/src/6 7 5 AM_LDFLAGS = -ldl 8 AM_CPPFLAGS = ${BOOST_CPPFLAGS}6 AM_CPPFLAGS = -I$(top_srcdir)/src/ ${BOOST_CPPFLAGS} 9 7 10 8 PATTERNSOURCE = -
src/unittests/Makefile.am
r0ab195 r6309fd 10 10 TESTHEADERS = 11 11 12 INCLUDES = -I$(top_srcdir)/src/13 14 12 AM_LDFLAGS = ${BOOST_THREAD_LDFLAGS} $(CPPUNIT_LIBS) -ldl 15 AM_CPPFLAGS = ${BOOST_CPPFLAGS} $(CPPUNIT_CFLAGS)13 AM_CPPFLAGS = -I$(top_srcdir)/src/ ${BOOST_CPPFLAGS} $(CPPUNIT_CFLAGS) 16 14 17 15 include $(top_srcdir)/src/Helpers/unittests/Makefile.am
Note:
See TracChangeset
for help on using the changeset viewer.
