source: configure.ac@ 908dc7

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 908dc7 was f99714, checked in by Frederik Heber <heber@…>, 13 years ago

FIX: Finally correctly implemented all --enable-... switches in configure.

  • The principle is: AC_ARG_ENABLE([option], [help], [if present], [if not present]). In the last we set the default value of our own variable (e.g. enable_...="no"), in the last but one we simply set enable_...=$enableval to get the value from the command line.
  • also I used AS_IF everywhere in checking the enable_... value.
  • Property mode set to 100644
File size: 9.3 KB
RevLine 
[14de469]1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.59)
[bde4a6]5AC_INIT(MoleCuilder, 1.2.0, [heber@ins.uni-bonn.de], [molecuilder], [http://trac.ins.uni-bonn.de/projects/molecuilder/])
[bf4b9f]6AC_CONFIG_AUX_DIR([build-aux])
[14de469]7AC_CONFIG_SRCDIR([src/builder.cpp])
[861874]8AC_CONFIG_HEADER([config.h libmolecuilder_config.h])
9AC_CONFIG_MACRO_DIR([m4])
[bf4b9f]10AC_CONFIG_SUBDIRS([LinearAlgebra])
[14de469]11
[dc322a]12# parallel-tests: use parallel test druver
13# color-tests: us coloring to indicate success/failure when available
14# tar-pax: use newer tar implementation with longer filename (>99 chars)
[4cf35ac]15AM_INIT_AUTOMAKE([dist-bzip2 1.5 parallel-tests color-tests tar-pax])
[14de469]16
17# Checks for programs.
[54a746]18AM_PATH_CPPUNIT(1.9.6)
[14de469]19AC_PROG_CXX
20AC_PROG_CC
[54a746]21AC_PROG_INSTALL
[14de469]22
[c015b3]23dnl Check if we have enable python
24# python module
25AC_MSG_CHECKING(whether to enable python module)
[f99714]26AC_ARG_ENABLE(
27 [python],
28 AS_HELP_STRING([--enable-python],[turn on python module [default=yes]]),
29 enable_python=$enableval,
30 enable_python="yes")
[c015b3]31AC_MSG_RESULT($enable_python)
32AS_IF([test x"$enable_python" != x"no"],[
33 # Python (for boost::python)
34 AM_PATH_PYTHON([2.2])
35 AX_PYTHON
36 AC_DEFINE(HAVE_PYTHON,1, ["Build python module and scripts."])
37])
38AM_CONDITIONAL([CONDPYTHON], [test x"$enable_python" != x"no"])
39AC_SUBST(HAVE_PYTHON)
40
41dnl Check if we have enable qtgui
[e5cec4]42# Qt programs
[f99714]43AC_ARG_WITH(
44 [Qt-bin],
45 [AS_HELP_STRING([--with-Qt-bin], [give path to Qt binaries])],
[c015b3]46 [have_qtgui_path=$withval
[f99714]47 enable_qtgui="yes"],
48 have_qtgui_path="")
[c015b3]49AC_MSG_CHECKING(whether to enable Qt-based GUI)
[f99714]50AC_ARG_ENABLE(
51 [qtgui],
52 AS_HELP_STRING([--enable-qtgui],[turn on Qt GUI compilation [default=yes]]),
53 enable_qtgui=$enableval,
54 enable_qtgui="yes")
[c015b3]55AC_MSG_RESULT($enable_qtgui)
56AS_IF([test x"$enable_qtgui" != x"no"],[
57 AC_PATH_PROGS([QT_MOC],
[e5cec4]58 [moc-qt4 moc],
59 [AC_MSG_ERROR(["Qts moc not found, please use --with-Qt-bin."])],
[c015b3]60 [$have_qtgui_path]
[e5cec4]61 )
62 AC_PATH_PROGS([QT_UIC],
63 [uic-qt4 uic],
64 [AC_MSG_ERROR(["Qts uic not found, please use --with-Qt-bin."])],
[c015b3]65 [$have_qtgui_path]
[e5cec4]66 )
[c015b3]67 PKG_CHECK_MODULES([QT], [QtCore QtGui Qt3D], [
68 ])
69 AC_SUBST([QT_CFLAGS])
70 AC_SUBST([QT_LIBS])
71 AC_DEFINE(HAVE_QTGUI,1, ["Build Qt-based GUI"])
[e5cec4]72])
[c015b3]73AM_CONDITIONAL([CONDQTGUI], [test x"$enable_qtgui" != x"no"])
74AC_SUBST(HAVE_QTGUI)
[e5cec4]75
[ec188c]76# use doxygen
77DX_HTML_FEATURE(ON)
78DX_PS_FEATURE(OFF)
79DX_PDF_FEATURE(OFF)
[3158e6]80DX_INIT_DOXYGEN(MoleCuilder, Doxyfile, ${docdir})
[ec188c]81
82# use libtool
[a0064e]83LT_INIT([static])
[861874]84
85# Define these substitions here to keep all version information in one place.
86# For information on how to properly maintain the library version information,
87# refer to the libtool manual, section "Updating library version information":
88# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
[bde4a6]89AC_SUBST([MOLECUILDER_SO_VERSION], [6:0:0])
90AC_SUBST([MOLECUILDER_API_VERSION], [1.2.0])
[06aedc]91
[dc031c]92dnl this macro is used to get the arguments supplied
93dnl to the configure script (./configure --enable-debug)
94dnl Check if we have enable debug support.
95AC_MSG_CHECKING(whether to enable debugging)
96have_debug="no"
[f99714]97AC_ARG_ENABLE(
98 [debug],
99 AS_HELP_STRING([--enable-debug],[turn on debugging [default=no]]),
100 enable_debug=$enableval,
101 enable_debug="no")
102AC_MSG_RESULT($enable_debug)
103AS_IF([test x"$enable_debug" = x"yes"],[
[dc031c]104 AC_DEFINE(MEMDEBUG,1, ["Use memory debugger."])
105 AC_DEFINE(HAVE_DEBUG,1, ["Use debug setting to compile code."])
106 have_debug="yes"
[f99714]107],[
108 AS_IF([test x"$enable_debug" = x"full"],[
109 AC_DEFINE(MEMDEBUG,1, ["Use memory debugger."])
110 AC_DEFINE(LOG_OBSERVER,1, ["Use observer log."])
111 AC_DEFINE(HAVE_DEBUG,2, ["Use debug setting to compile code."])
112 AC_DEFINE(QT_DEBUG,, ["Enable Qt debug messages."])
113 have_debug="full"
114 ],[
115 AC_DEFINE(NDEBUG,1, ["Don't compile in debugging code."])
116 AC_DEFINE(HAVE_DEBUG,0, ["Use debug setting to compile code."])
117 AC_DEFINE(QT_NO_DEBUG,, ["Disable Qt debug messages."])
118 have_debug="no"
119 ])
120])
[dc031c]121AC_SUBST(HAVE_DEBUG)
122
123dnl this macro is used to get the arguments supplied
124dnl to the configure script (./configure --enable-debug)
125dnl Check if we have enable debug support.
[f3b8a5]126AC_MSG_CHECKING(whether to enable internal caching/lazy evaluation)
[f99714]127AC_ARG_ENABLE(
128 [cache],
129 AS_HELP_STRING([--enable-cache],[turn on internal lazy evaluation [default=yes]]),
130 enable_cache=$enableval,
131 enable_cache="yes")
[f3b8a5]132AC_MSG_RESULT($enable_cache)
[f99714]133AS_IF([test x"$enable_cache" != x"no"],[
134 AC_DEFINE(HAVE_CACHE,1, ["cache variables to speed up the code."])
135],[
[dc031c]136 AC_DEFINE(NO_CACHING,1, ["Don't use caching code."])
137 AC_DEFINE(HAVE_CACHE,0, ["cache variables to speed up the code."])
[f99714]138])
[dc031c]139AC_SUBST(HAVE_CACHE)
140
[14de469]141# Checks for libraries.
[861874]142AC_CHECK_LIB(m, sqrt, , AC_MSG_ERROR([compatible libc math library not found]))
[14de469]143
[f08ae7]144# Boost
[79de12]145BOOST_REQUIRE([1.40])
[f08ae7]146
147# Boost headers only
148BOOST_ANY
149BOOST_BIND
150BOOST_CONVERSION
[79de12]151BOOST_EXCEPTION
[f08ae7]152BOOST_FOREACH
153BOOST_FUNCTION
154BOOST_PREPROCESSOR
155BOOST_RANDOM
156BOOST_SMART_PTR
[7f570c]157BOOST_STRING_ALGO
[f08ae7]158BOOST_TOKENIZER
159
160# Boost headers with libraries
[79de12]161BOOST_FILESYSTEM
162BOOST_PROGRAM_OPTIONS
[c015b3]163AS_IF([test x"$enable_python" != x"no"], [BOOST_PYTHON])
[d7d022]164BOOST_SERIALIZATION
[79de12]165BOOST_THREADS
[fa861b]166
[f08ae7]167
[22db89]168# CodePatterns library (needs corrected ax_codepatterns.m4 for boost compile flags in test)
169AM_PATH_CODEPATTERNS([1.1.7], $have_debug,,[AC_MSG_ERROR([Missing CodePatterns library, please specify PKG_CONFIG_PATH or use --with-codepatterns...])])
[3027f8]170
[14de469]171# Checks for header files.
172AC_HEADER_STDC
173AC_CHECK_HEADERS([sys/time.h])
174AC_HEADER_STDBOOL
175
[d3a46d]176AC_FUNC_MALLOC
177AC_FUNC_REALLOC
178AC_CHECK_FUNCS([floor pow sqrt strchr])
179
[14de469]180# Checks for typedefs, structures, and compiler characteristics.
181AC_C_CONST
182AC_C_INLINE
183AC_C_RESTRICT
184AC_TYPE_SIZE_T
185
186# Checks for library functions.
187# check for GNU Scientific Library
[bd3e55]188AC_CHECK_HEADERS([gsl/gsl_blas.h])
[db1a72]189AC_SEARCH_LIBS(dnrm2, gslblas gslcblas goto blas cblas)
190AC_SEARCH_LIBS(cblas_dnrm2, gslblas gslcblas blas cblas)
191AC_SEARCH_LIBS(gsl_blas_dnrm2,, gsl)
192#AC_CHECK_LIB(gsl, gsl_blas_dnrm2, , [AC_MSG_ERROR(["No working BLAS found for GSL, stopping."])])
193AC_CHECK_LIB(gsl, main)
[14de469]194
[490038]195# use CppUnit TestRunner or not
[f99714]196AC_MSG_CHECKING(whether to enable ECut TestRunnerClient)
197AC_ARG_ENABLE(
198 [ecut],
199 AS_HELP_STRING([--enable-ecut],[Use ECut TestRunnerClient [default=no]]),
200 enable_ecut=$disableval,
201 enable_ecut="no")
202AC_MSG_RESULT($enable_ecut)
203AS_IF([test x"$enable_ecut" = x"yes"],[
[9b6b2f]204 AC_DEFINE(HAVE_ECUT,1, ["Use ECut TestRunnerClient instead of our own."])
205 AC_SUBST(HAVE_ECUT)
[f99714]206])
[9b6b2f]207
[490038]208# with valgrinding testsuite or not
[f3b8a5]209AC_MSG_CHECKING(whether to enable valgrind memory checking in testsuite)
[f99714]210AC_ARG_ENABLE(
211 [valgrind],
212 AS_HELP_STRING([--enable-valgrind],[Use Valgrind on the testsuite [default=no]]),
213 enable_valgrind=$enableval,
214 enable_valgrind="no")
215AC_MSG_RESULT($enable_valgrind)
216AS_IF([test x"$enable_valgrind" = x"yes"], [
[490038]217 AC_CHECK_HEADER([valgrind/valgrind.h],
218 [
219 # check header
220 AC_DEFINE(HAVE_VALGRIND_TESTSUITE,1, ["Use Valgrind to check the testsuite."])
221 # check path
222 AC_PATH_PROG(VALGRIND, [valgrind], [/bin/false])
223 # set variables
224 AC_SUBST(HAVE_VALGRIND_TESTSUITE)
225 AC_SUBST(VALGRIND)
226 ],
227 [
228 AC_MSG_ERROR(["Valgrind support requested but headers not available."])
229 ]
230 )
[f3b8a5]231])
[490038]232
[14de469]233# Check for "extern inline", using a modified version
234# of the test for AC_C_INLINE from acspecific.mt
235AC_CACHE_CHECK([for extern inline], ac_cv_c_extern_inline,
236[ac_cv_c_extern_inline=no
237AC_TRY_COMPILE([extern $ac_cv_c_inline double foo(double x);
238extern $ac_cv_c_inline double foo(double x) { return x+1.0; };
239double foo (double x) { return x + 1.0; };],
240[ foo(1.0) ],
241[ac_cv_c_extern_inline="yes"])
242])
243
244if test "$ac_cv_c_inline" != no ; then
245 AC_DEFINE(HAVE_INLINE,1, ["May use inline routines"])
246 AC_SUBST(HAVE_INLINE)
247fi
248
[bd3e55]249#AC_MSG_NOTICE(["CFLAGS: $CFLAGS, CXXFLAGS: $CXXFLAGS, LDFLAGS: $LDFLAGS, CC: $CC, CXX:, $CXX, MPICC: $MPICC, MPILIBS: $MPILIBS, LIBS: $LIBS"])
[a19da5d]250
[0ca39c]251# test suite
[878044]252
[5079a0]253AC_CONFIG_FILES([
[689639]254 tests/Makefile])
255
256AC_CONFIG_TESTDIR(tests/CodeChecks)
[d0a719]257AC_CONFIG_FILES([
258 tests/CodeChecks/atlocal
259 tests/CodeChecks/Makefile])
[689639]260
[740d40]261AC_CONFIG_TESTDIR(tests/Fragmentations)
[038713]262AC_CONFIG_FILES([
[740d40]263 tests/Fragmentations/atlocal
264 tests/Fragmentations/Makefile])
[878044]265AC_CONFIG_FILES([tests/Fragmentations/analyzer], [chmod +x tests/Fragmentations/analyzer])
266AC_CONFIG_FILES([tests/Fragmentations/joiner], [chmod +x tests/Fragmentations/joiner])
[740d40]267AC_CONFIG_FILES([tests/Fragmentations/molecuilder], [chmod +x tests/Fragmentations/molecuilder])
[689639]268
269AC_CONFIG_TESTDIR(tests/regression)
270AC_CONFIG_FILES([
271 tests/regression/atlocal
272 tests/regression/Makefile])
273AC_CONFIG_FILES([tests/regression/molecuilder], [chmod +x tests/regression/molecuilder])
274
275AC_CONFIG_TESTDIR(tests/Tesselations)
[5079a0]276AC_CONFIG_FILES([
[a85f45]277 tests/Tesselations/atlocal
278 tests/Tesselations/Makefile])
279AC_CONFIG_FILES([tests/Tesselations/molecuilder], [chmod +x tests/Tesselations/molecuilder])
[689639]280
[5079a0]281AC_CONFIG_FILES([
282 doc/molecuilder.xml])
[861874]283AC_CONFIG_FILES([
[878044]284 MoleCuilder.pc:MoleCuilder.pc.in])
[5079a0]285AC_CONFIG_FILES([
286 Makefile
[ec188c]287 doc/Makefile
[938ffd]288 src/Makefile
[04e1fb]289 utils/Makefile
[85949a]290])
291AC_CONFIG_FILES([
[878044]292 src/unittests/Makefile
[85949a]293])
[c015b3]294# produce python scripts and tests only when python's present
295AM_COND_IF([CONDPYTHON],[
296 AC_CONFIG_TESTDIR([tests/Python])
297 AC_CONFIG_FILES([utils/boxmaker.py:utils/boxmaker.py.in], [chmod +x utils/boxmaker.py])
298 AC_CONFIG_FILES([utils/python_wrapper:utils/python_wrapper.in], [chmod +x utils/python_wrapper])
299 AC_CONFIG_FILES([tests/Python/run], [chmod +x tests/Python/run])
300 AC_CONFIG_FILES([tests/Python/atlocal])
301 AC_CONFIG_FILES([tests/Python/Makefile])
302])
[14de469]303AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.