source: m4/ax_codepatterns.m4@ 56f73b

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 56f73b was ad011c, checked in by Frederik Heber <heber@…>, 14 years ago

CodePatterns places all includes now in subfolder CodePatterns/.

  • change all includes accordingly.
  • this was necessary as Helpers and Patterns are not very distinctive names for include folders. Already now, we had a conflict between Helpers from CodePatterns and Helpers from this project.
  • changed compilation test in ax_codepatterns.m4 when changing CodePatterns includes.
  • Property mode set to 100644
File size: 7.5 KB
Line 
1dnl
2dnl AM_PATH_CODEPATTERNS(MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
3dnl
4
5AC_DEFUN([AM_PATH_CODEPATTERNS],
6[
7AC_REQUIRE([AX_BOOST_THREAD])
8
9AC_ARG_WITH(codepatterns,[ --with-codepatterns=PFX Prefix where CodePatterns is installed (optional)],
10 codepatterns_prefix="$withval", codepatterns_prefix="")
11AC_ARG_WITH(codepatterns_include,[ --with-codepatterns_include=INCLUDE Where CodePatterns' includes are installed (optional)],
12 codepatterns_include_prefix="$withval", codepatterns_include_prefix="")
13AC_ARG_WITH(cp_cv_codepatterns_libs,[ --with-cp_cv_codepatterns_libs=LIBPATH Where CodePatterns' libs are installed (optional)],
14 cp_cv_codepatterns_libs_prefix="$withval", cp_cv_codepatterns_libs_prefix="")
15
16 codepatterns_version_min=$1
17
18 CodePatterns_CFLAGS=""
19 CodePatterns_LIBS=""
20 CodePatterns_LDFLAGS=""
21
22
23 codepatterns_pkgconfig=""
24 # try to set PKG_CONFIG_PATH
25 if test x$codepatterns_prefix != xno; then
26 if test -z $PKG_CONFIG_PATH; then
27 export PKG_CONFIG_PATH="$codepatterns_prefix/lib/pkgconfig/"
28 else
29 export PKG_CONFIG_PATH="$codepatterns_prefix/lib/pkgconfig/:$PKG_CONFIG_PATH"
30 fi
31 fi
32 # 1. test whether pkg-config works
33 CodePatterns_CONFIG=""
34 #AC_MSG_NOTICE([PKG_CONFIG_PATH is $PKG_CONFIG_PATH])
35 PKG_CHECK_MODULES([CodePatterns], [CodePatterns >= $codepatterns_version_min], [
36 codepatterns_pkgconfig=yes
37 CodePatterns_CONFIG="pkg-config CodePatterns"
38 ], [
39 # 2. if failed, test for binary codepatterns-config
40 AC_PATH_PROG(CodePatterns_CONFIG, codepatterns-config, no)
41 if test x$CodePatterns_CONFIG = xno && test x$codepatterns_prefix != x ; then
42 AC_MSG_CHECKING([for alternative codepatterns-config location])
43 if test -e $codepatterns_prefix/bin/codepatterns-config; then
44 codepatterns_pkgconfig=no
45 CodePatterns_CONFIG="$codepatterns_prefix/bin/codepatterns-config"
46 AC_MSG_RESULT([yes])
47 else
48 AC_MSG_RESULT([no])
49 fi
50 fi
51 ])
52
53 # try to set values via CodePatterns_CONFIG
54 if test ! -z "$CodePatterns_CONFIG"; then
55 CodePatterns_CFLAGS=`$CodePatterns_CONFIG --cflags`
56 if test x$codepatterns_pkgconfig = xno; then
57 CodePatterns_LIBS=`$CodePatterns_CONFIG --ldflags --libs`
58 else
59 CodePatterns_LIBS=`$CodePatterns_CONFIG --libs`
60 fi
61 #AC_MSG_NOTICE([codepatterns-config found and used.])
62 fi
63
64 # else set by hand (or rather by --with..)
65 if test x$codepatterns_include_prefix != x ; then
66 if test -e $codepatterns_include_prefix/include; then
67 CodePatterns_CFLAGS="$codepatterns_include_prefix/include"
68 AC_MSG_NOTICE([codepatterns include found and used.])
69 else
70 AC_MSG_WARN([codepatterns include not found at $codepatterns_include_prefix/include.])
71 fi
72 fi
73 if test x$cp_cv_codepatterns_libs_prefix != x ; then
74 if test -e "$cp_cv_codepatterns_libs_prefix/lib/libCodePatterns.so"; then
75 CodePatterns_LIBS="-L$cp_cv_codepatterns_libs_prefix/lib -lCodePatterns"
76 AC_MSG_NOTICE([codepatterns libs found and used.])
77 else
78 AC_MSG_WARN([codepatterns libs not found at $cp_cv_codepatterns_libs_prefix.])
79 fi
80 fi
81
82 codepatterns="no"
83 if test "x$CodePatterns_CFLAGS" != "x"; then
84 if test "x$CodePatterns_LIBS" != "x"; then
85 codepatterns="yes"
86 fi
87 fi
88
89
90 if test x$codepatterns_pkgconfig != xyes; then
91 # check version of lib
92 no_codepatterns=""
93 codepatterns_version=no
94 if test x$codepatterns = xyes; then
95 AC_MSG_CHECKING(for CodePatterns - version >= $codepatterns_version_min)
96 if test "x$CodePatterns_CONFIG" != "x"; then
97 codepatterns_version=`$CodePatterns_CONFIG --version`
98 else
99 codepatterns_version=""
100 fi
101
102 codepatterns_major_version=`echo $codepatterns_version | \
103 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
104 codepatterns_minor_version=`echo $codepatterns_version | \
105 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
106 codepatterns_micro_version=`echo $codepatterns_version | \
107 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
108
109 #AC_MSG_NOTICE([Version found is: $codepatterns_major_version.$codepatterns_minor_version.$codepatterns_micro_version])
110 #AC_MSG_NOTICE([Version required is: $codepatterns_version_min])
111
112 codepatterns_major_min=`echo $codepatterns_version_min | \
113 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
114 if test "x${codepatterns_major_min}" = "x" ; then
115 codepatterns_major_min=0
116 fi
117
118 codepatterns_minor_min=`echo $codepatterns_version_min | \
119 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
120 if test "x${codepatterns_minor_min}" = "x" ; then
121 codepatterns_minor_min=0
122 fi
123
124 codepatterns_micro_min=`echo $codepatterns_version_min | \
125 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
126 if test "x${codepatterns_micro_min}" = "x" ; then
127 codepatterns_micro_min=0
128 fi
129
130 if test $codepatterns_major_version -lt $codepatterns_major_min; then
131 codepatterns_version_proper=0
132 fi
133 if test $codepatterns_major_version -gt $codepatterns_major_min; then
134 codepatterns_version_proper=1
135 else
136 if test $codepatterns_minor_version -lt $codepatterns_minor_min; then
137 codepatterns_version_proper=0
138 fi
139 if test $codepatterns_minor_version -gt $codepatterns_minor_min; then
140 codepatterns_version_proper=1
141 else
142 if test $codepatterns_micro_version -ge $codepatterns_micro_min; then
143 codepatterns_version_proper=1
144 else
145 codepatterns_version_proper=0
146 fi
147 fi
148 fi
149 #AC_MSG_NOTICE([$codepatterns_version_proper])
150
151 if test $codepatterns_version_proper = 1 ; then
152 codepatterns_version=yes
153 AC_MSG_RESULT([$codepatterns_major_version.$codepatterns_minor_version.$codepatterns_micro_version])
154 else
155 AC_MSG_RESULT(no)
156 codepatterns_version=no
157 fi
158 fi
159
160 # check presence of lib
161 SAVE_CPPFLAGS="$CPPFLAGS"
162 SAVE_LIBS="$LIBS"
163 CPPFLAGS="$CodePatterns_CFLAGS"
164 LIBS="$CodePatterns_LIBS -lboost_thread"
165 if test x$codepatterns_version = xyes; then
166 AC_CACHE_CHECK(for CodePatterns lib, cp_cv_codepatterns_lib, [
167 AC_LANG_PUSH([C++])
168 AC_LINK_IFELSE(
169 [
170 AC_LANG_PROGRAM([
171#include "CodePatterns/Singleton.hpp"
172#include "CodePatterns/Singleton_impl.hpp"
173
174// some necessary stubs
175class SingletonStub : public Singleton <SingletonStub>{
176 friend class Singleton<SingletonStub>;
177private:
178 SingletonStub(){
179 count1++;
180 }
181 // explicit copy constructor to catch if this is ever called
182 SingletonStub(const SingletonStub&){}
183 virtual ~SingletonStub(){
184 count2++;
185 }
186public:
187 static int count1;
188 static int count2;
189};
190
191int SingletonStub::count1 = 0;
192int SingletonStub::count2 = 0;
193
194CONSTRUCT_SINGLETON(SingletonStub);
195
196], [
197SingletonStub::getInstance();
198])
199 ],[
200 cp_cv_codepatterns_lib="yes"
201 ], [
202 cp_cv_codepatterns_lib="no"
203 ]
204 )
205 AC_LANG_POP([C++])
206 ])
207 fi
208 CPPFLAGS="$SAVE_CPPFLAGS"
209 LIBS="$SAVE_LIBS"
210
211 if test "x$cp_cv_codepatterns_lib" = xyes ; then
212 ifelse([$2], , :, [$2])
213 else
214 CodePatterns_CFLAGS=""
215 CodePatterns_LDFLAGS=""
216 CodePatterns_LIBS=""
217 ifelse([$3], , :, [$3])
218 fi
219 fi
220
221 AC_SUBST(CodePatterns_CFLAGS)
222 AC_SUBST(CodePatterns_LDFLAGS)
223 AC_SUBST(CodePatterns_LIBS)
224])
225
Note: See TracBrowser for help on using the repository browser.