source: m4/m4_ax_boost_thread.m4@ 6ef0a4

Action_Thermostats Add_AtomRandomPerturbation Add_FitFragmentPartialChargesAction Add_RotateAroundBondAction Add_SelectAtomByNameAction Added_ParseSaveFragmentResults AddingActions_SaveParseParticleParameters Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_ParticleName_to_Atom Adding_StructOpt_integration_tests AtomFragments Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.5.4 Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator CombiningParticlePotentialParsing Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_BoundInBox_CenterInBox_MoleculeActions Fix_ChargeSampling_PBC Fix_ChronosMutex Fix_FitPartialCharges Fix_FitPotential_needs_atomicnumbers Fix_ForceAnnealing Fix_IndependentFragmentGrids Fix_ParseParticles Fix_ParseParticles_split_forward_backward_Actions Fix_PopActions Fix_QtFragmentList_sorted_selection Fix_Restrictedkeyset_FragmentMolecule Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns Fix_fitting_potentials Fixes ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion FragmentAction_writes_AtomFragments FragmentMolecule_checks_bonddegrees GeometryObjects Gui_Fixes Gui_displays_atomic_force_velocity ImplicitCharges IndependentFragmentGrids IndependentFragmentGrids_IndividualZeroInstances IndependentFragmentGrids_IntegrationTest IndependentFragmentGrids_Sole_NN_Calculation JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix MoreRobust_FragmentAutomation ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PdbParser_setsAtomName PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks Rewrite_FitPartialCharges RotateToPrincipalAxisSystem_UndoRedo SaturateAtoms_findBestMatching SaturateAtoms_singleDegree StoppableMakroAction Subpackage_CodePatterns Subpackage_JobMarket Subpackage_LinearAlgebra Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg Switchable_LogView ThirdParty_MPQC_rebuilt_buildsystem TrajectoryDependenant_MaxOrder TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps TremoloParser_setsAtomName Ubuntu_1604_changes stable
Last change on this file since 6ef0a4 was 4d9c01, checked in by Tillmann Crueger <crueger@…>, 15 years ago

Fixed some problems with the usage of Boost::threads

  • Property mode set to 100644
File size: 5.2 KB
Line 
1# ===========================================================================
2# http://www.nongnu.org/autoconf-archive/ax_boost_thread.html
3# ===========================================================================
4#
5# SYNOPSIS
6#
7# AX_BOOST_THREAD
8#
9# DESCRIPTION
10#
11# Test for Thread library from the Boost C++ libraries. The macro requires
12# a preceding call to AX_BOOST_BASE. Further documentation is available at
13# <http://randspringer.de/boost/index.html>.
14#
15# This macro calls:
16#
17# AC_SUBST(BOOST_THREAD_LIB)
18#
19# And sets:
20#
21# HAVE_BOOST_THREAD
22#
23# LICENSE
24#
25# Copyright (c) 2009 Thomas Porschberg <thomas@randspringer.de>
26# Copyright (c) 2009 Michael Tindal
27#
28# Copying and distribution of this file, with or without modification, are
29# permitted in any medium without royalty provided the copyright notice
30# and this notice are preserved. This file is offered as-is, without any
31# warranty.
32
33#serial 14
34
35AC_DEFUN([AX_BOOST_THREAD],
36[
37 AC_ARG_WITH([boost-thread],
38 AS_HELP_STRING([--with-boost-thread@<:@=special-lib@:>@],
39 [use the Thread library from boost - it is possible to specify a certain library for the linker
40 e.g. --with-boost-thread=boost_thread-gcc-mt ]),
41 [
42 if test "$withval" = "no"; then
43 want_boost="no"
44 elif test "$withval" = "yes"; then
45 want_boost="yes"
46 ax_boost_user_thread_lib=""
47 else
48 want_boost="yes"
49 ax_boost_user_thread_lib="$withval"
50 fi
51 ],
52 [want_boost="yes"]
53 )
54
55 if test "x$want_boost" = "xyes"; then
56 AC_REQUIRE([AC_PROG_CC])
57 AC_REQUIRE([AC_CANONICAL_BUILD])
58 CPPFLAGS_SAVED="$CPPFLAGS"
59 CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
60 export CPPFLAGS
61
62 LDFLAGS_SAVED="$LDFLAGS"
63 LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
64 export LDFLAGS
65
66 AC_CACHE_CHECK(whether the Boost::Thread library is available,
67 ax_cv_boost_thread,
68 [AC_LANG_PUSH([C++])
69 CXXFLAGS_SAVE=$CXXFLAGS
70
71 if test "x$build_os" = "xsolaris" ; then
72 CXXFLAGS="-pthreads $CXXFLAGS"
73 elif test "x$build_os" = "xming32" ; then
74 CXXFLAGS="-mthreads $CXXFLAGS"
75 else
76 CXXFLAGS="-pthread $CXXFLAGS"
77 fi
78 AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/thread/thread.hpp>]],
79 [[boost::thread_group thrds;
80 return 0;]]),
81 ax_cv_boost_thread=yes, ax_cv_boost_thread=no)
82 CXXFLAGS=$CXXFLAGS_SAVE
83 AC_LANG_POP([C++])
84 ])
85 if test "x$ax_cv_boost_thread" = "xyes"; then
86 if test "x$build_os" = "xsolaris" ; then
87 BOOST_CPPFLAGS="-pthreads $BOOST_CPPFLAGS"
88 elif test "x$build_os" = "xming32" ; then
89 BOOST_CPPFLAGS="-mthreads $BOOST_CPPFLAGS"
90 else
91 BOOST_CPPFLAGS="-pthread $BOOST_CPPFLAGS"
92 fi
93
94 AC_SUBST(BOOST_CPPFLAGS)
95
96 AC_DEFINE(HAVE_BOOST_THREAD,,[define if the Boost::Thread library is available])
97 BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
98
99 LDFLAGS_SAVE=$LDFLAGS
100 case "x$build_os" in
101 *bsd* )
102 LDFLAGS="-pthread $LDFLAGS"
103 break;
104 ;;
105 esac
106 if test "x$ax_boost_user_thread_lib" = "x"; then
107 for libextension in `ls $BOOSTLIBDIR/libboost_thread*.so* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_thread.*\)\.so.*$;\1;'` `ls $BOOSTLIBDIR/libboost_thread*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_thread.*\)\.a*$;\1;'`; do
108 ax_lib=${libextension}
109 AC_CHECK_LIB($ax_lib, exit,
110 [BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break],
111 [link_thread="no"])
112 done
113 if test "x$link_thread" != "xyes"; then
114 for libextension in `ls $BOOSTLIBDIR/boost_thread*.dll* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_thread.*\)\.dll.*$;\1;'` `ls $BOOSTLIBDIR/boost_thread*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_thread.*\)\.a*$;\1;'` ; do
115 ax_lib=${libextension}
116 AC_CHECK_LIB($ax_lib, exit,
117 [BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break],
118 [link_thread="no"])
119 done
120 fi
121
122 else
123 for ax_lib in $ax_boost_user_thread_lib boost_thread-$ax_boost_user_thread_lib; do
124 AC_CHECK_LIB($ax_lib, exit,
125 [BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break],
126 [link_thread="no"])
127 done
128
129 fi
130 if test "x$link_thread" = "xno"; then
131 AC_MSG_ERROR(Could not link against $ax_lib !)
132 else
133 case "x$build_os" in
134 *bsd* )
135 BOOST_LDFLAGS="-pthread $BOOST_LDFLAGS"
136 break;
137 ;;
138 esac
139
140 fi
141 fi
142
143 CPPFLAGS="$CPPFLAGS_SAVED"
144 LDFLAGS="$LDFLAGS_SAVED"
145 fi
146])
Note: See TracBrowser for help on using the repository browser.