this repo has no description
1dnl
2dnl Main authors:
3dnl Guido Tack <tack@gecode.org>
4dnl
5dnl Contributing authors:
6dnl Samuel Gagnon <samuel.gagnon92@gmail.com>
7dnl
8dnl Copyright:
9dnl Guido Tack, 2004, 2005
10dnl Samuel Gagnon, 2018
11dnl
12dnl This file is part of Gecode, the generic constraint
13dnl development environment:
14dnl http://www.gecode.org
15dnl
16dnl Permission is hereby granted, free of charge, to any person obtaining
17dnl a copy of this software and associated documentation files (the
18dnl "Software"), to deal in the Software without restriction, including
19dnl without limitation the rights to use, copy, modify, merge, publish,
20dnl distribute, sublicense, and/or sell copies of the Software, and to
21dnl permit persons to whom the Software is furnished to do so, subject to
22dnl the following conditions:
23dnl
24dnl The above copyright notice and this permission notice shall be
25dnl included in all copies or substantial portions of the Software.
26dnl
27dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
28dnl EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
29dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
30dnl NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
31dnl LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
32dnl OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
33dnl WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34dnl
35dnl
36
37AC_REVISION([$Id$])
38AC_PREREQ(2.53)
39AC_INIT(GECODE, 6.3.1, users@gecode.org)
40AC_CONFIG_HEADERS([gecode/support/config.hpp])
41AC_CONFIG_SRCDIR(gecode/kernel.hh)
42
43ac_gecode_soversion=52
44AC_SUBST(GECODE_SOVERSION, ${ac_gecode_soversion})
45ac_gecode_flatzincversion=1.6
46AC_SUBST(GECODE_FLATZINC_VERSION, ${ac_gecode_flatzincversion})
47
48# checks for programs
49
50: ${CXXFLAGS=""} dnl we do not want autoconf's default
51: ${CFLAGS=""} dnl we do not want autoconf's default
52: ${DLLFLAGS=""} dnl we do not want autoconf's default
53: ${GLDFLAGS=""} dnl we do not want autoconf's default
54
55dnl include Gecode specific macros
56m4_include([gecode.m4])
57
58dnl determine the operating system
59AC_GECODE_GET_OS
60
61if test "${CXX}x" = "x" -a "${CC}x" = "x" -a "${host_os}" = "windows"; then
62 CC=cl
63 CXX=cl
64fi
65
66AC_PROG_CXX
67AC_PROG_CC
68AC_LANG(C++)
69
70AC_PROG_RANLIB
71
72dnl check whether we have certain programs we need
73AC_CHECK_PROG(PROG_DIFF, diff, [ok])
74 if test "${PROG_DIFF}x" = "x"; then
75 AC_MSG_ERROR([In order to compile Gecode, you need the diff tool.])
76 fi
77AC_CHECK_PROG(PROG_TAR, tar, [ok])
78 if test "${PROG_TAR}x" = "x"; then
79 AC_MSG_ERROR([In order to compile Gecode, you need the tar tool.])
80 fi
81AC_CHECK_PROG(PROG_MAKE, make, [ok])
82 if test "${PROG_MAKE}x" = "x"; then
83 AC_MSG_ERROR([In order to compile Gecode, you need the make tool.])
84 fi
85AC_CHECK_PROG(PROG_SED, sed, [ok])
86 if test "${PROG_SED}x" = "x"; then
87 AC_MSG_ERROR([In order to compile Gecode, you need the sed tool.])
88 fi
89AC_CHECK_PROG(PROG_PERL, perl, [ok])
90 if test "${PROG_PERL}x" = "x"; then
91 AC_MSG_ERROR([In order to compile Gecode, you need perl.])
92 fi
93
94dnl Check for environment to use when running programs in the Makefile
95AC_GECODE_RUNENVIRONMENT
96
97dnl determine which compiler we are using
98AC_CXX_COMPILER_VENDOR(ac_gecode_compiler_vendor)
99case $ac_gecode_compiler_vendor in
100gnu)
101 AC_CHECK_GCC_VERSION(4,2)
102 ;;
103intel)
104 ;;
105microsoft)
106 AC_CHECK_MSVC_VERSION(1800,2013)
107 ;;
108*)
109 ;;
110esac
111
112AC_GECODE_RESOURCE
113
114AC_LANG(C++)
115
116dnl check whether we want to build universal binaries on Mac OS X
117AC_GECODE_UNIVERSAL
118
119dnl check whether the user wants a prefix or suffixes for the libraries
120AC_GECODE_USER_SUFFIX
121
122dnl check whether we want to build a framework bundle on Mac OS X
123AC_GECODE_FRAMEWORK
124
125dnl check whether we want to build static libraries
126AC_GECODE_STATICLIBS
127
128dnl check whether we want to have assertions and debugging options
129AC_GECODE_DEBUG
130
131dnl check whether we want to have peak heap size tracking
132AC_GECODE_PEAKHEAP
133
134dnl check whether to optimize for code size
135AC_GECODE_CODESIZE
136
137dnl check whether we want to have support for finding memory leaks
138AC_GECODE_LEAK_DEBUG
139
140dnl check whether we want to use default memory allocator
141AC_GECODE_ALLOCATOR
142
143dnl check whether we want audit code in our build
144AC_GECODE_AUDIT
145
146dnl check whether we want to produce code suitable for profiling
147AC_GECODE_PROFILE
148
149dnl check whether we want to produce code instrumented for gcov
150AC_GECODE_GCOV
151
152dnl check platform specific behaviour of arithmetic
153AC_GECODE_CHECK_ARITH
154
155dnl checking for thread support
156AC_GECODE_THREADS
157
158dnl checking for timer to use
159AC_GECODE_TIMER
160
161dnl checking for freelist sizes to use
162AC_GECODE_FREELIST_32_SIZE
163AC_GECODE_FREELIST_64_SIZE
164
165case $ac_gecode_compiler_vendor in
166gnu)
167 dnl general compiler flags
168 AC_GECODE_UNIX_PATHS
169 AC_GECODE_GCC_GENERAL_SWITCHES
170 dnl check whether we want to use visibility attributes with gcc
171 AC_GECODE_GCC_VISIBILITY
172
173 if test "${enable_debug:-no}" = "no" -a "${enable_gcov:-no}" = "no"; then
174 dnl compiler flags for an optimized build
175 AC_GECODE_GCC_OPTIMIZED_SWITCHES
176 dnl compiler flags for optimize float computings
177 dnl AC_GECODE_CHECK_COMPILERFLAG([-ffast-math])
178 dnl ffast-math implies:-fno-math-errno -funsafe-math-optimizations -ffinite-math-only -fno-rounding-math -fno-signaling-nans -fcx-limited-range
179 dnl but -funsafe-math-optimizations break IEEE float comptability, so we have to avoid it
180 AC_GECODE_CHECK_COMPILERFLAG([-fno-math-errno])
181 AC_GECODE_CHECK_COMPILERFLAG([-ffinite-math-only])
182 AC_GECODE_CHECK_COMPILERFLAG([-fno-rounding-math])
183 AC_GECODE_CHECK_COMPILERFLAG([-fno-signaling-nans])
184 AC_GECODE_CHECK_COMPILERFLAG([-fcx-limited-range])
185 AC_GECODE_CHECK_COMPILERFLAG([-mthreads])
186 else
187 if test "${enable_debug:-no}" = "yes"; then
188 dnl compiler flags for a debug build
189 AC_GECODE_GCC_DEBUG_SWITCHES
190 fi
191 fi
192 AC_GECODE_CHECK_COMPILERFLAG([-Qunused-arguments])
193
194 ;;
195intel)
196 dnl flags for creating dlls
197 case $host_os in
198 windows*)
199 AC_GECODE_MSVC_SWITCHES
200 ;;
201 *)
202 dnl check whether we want to use visibility attributes with gcc
203 AC_GECODE_GCC_VISIBILITY
204 dnl general compiler flags
205 AC_GECODE_UNIX_PATHS
206 AC_GECODE_GCC_GENERAL_SWITCHES
207
208 if test "${enable_debug:-no}" = "no"; then
209 dnl compiler flags for an optimized build
210 AC_GECODE_GCC_OPTIMIZED_SWITCHES
211 else
212 dnl compiler flags for a debug build
213 AC_GECODE_GCC_DEBUG_SWITCHES
214 fi
215 ;;
216 esac
217 ;;
218microsoft)
219 AC_GECODE_MSVC_SWITCHES
220 ;;
221*)
222 AC_MSG_ERROR(Gecode currently only supports the GNU and Microsoft compilers.)
223 ;;
224esac
225
226dnl check whether we can use GNU hash_map
227AC_CHECK_HEADER([ext/hash_map],
228 [AC_DEFINE([GECODE_HAS_GNU_HASH_MAP],[],
229 [Whether GNU hash_map is available])])
230
231dnl check whether we can use unordered_map
232AC_CHECK_HEADER([unordered_map],
233 [AC_DEFINE([GECODE_HAS_UNORDERED_MAP],[],
234 [Whether unordered_map is available])])
235
236dnl find out what parts the user wants to build
237
238AC_GECODE_DOC_SWITCHES
239
240dnl ------------------------------------------------------------------
241dnl Enabling of non-variable contribs
242dnl @CONTRIBS@
243
244dnl ------------------------------------------------------------------
245dnl Definition of variable types
246
247dnl Include contributor's vtis
248dnl @VTIS@
249
250AC_GECODE_VIS
251
252AC_GECODE_VTI(float,
253 [float variable library (implies --enable-int-vars)],
254 yes,
255 [\$(top_srcdir)/gecode/float/var-imp/float.vis],
256 [enable_int_vars="yes";
257 AC_SUBST(LINKFLOAT,[${LINKLIBDIR}${LINKPREFIX}${FLOAT}${DLL_ARCH}${LINKSUFFIX}])
258 ],
259 [
260 AC_SUBST(LINKFLOAT,[])
261 ]
262 )
263
264AC_GECODE_VTI(set,
265 [finite set library (implies --enable-int-vars)],
266 yes,
267 [\$(top_srcdir)/gecode/set/var-imp/set.vis],
268 [enable_int_vars="yes";
269 AC_SUBST(LINKSET,[${LINKLIBDIR}${LINKPREFIX}${SET}${DLL_ARCH}${LINKSUFFIX}])
270 ],
271 [
272 AC_SUBST(LINKSET,[])
273 ]
274 )
275
276AC_GECODE_VTI(int, finite domain library, yes,
277 [\$(top_srcdir)/gecode/int/var-imp/int.vis \$(top_srcdir)/gecode/int/var-imp/bool.vis],
278 [
279 AC_SUBST(LINKINT,[${LINKLIBDIR}${LINKPREFIX}${INT}${DLL_ARCH}${LINKSUFFIX}])
280 ],
281 [
282 AC_SUBST(LINKINT,[])
283 ])
284
285dnl End of definition of variable types
286dnl ------------------------------------------------------------------
287
288AC_GECODE_MPFR
289AC_GECODE_QT
290AC_GECODE_GIST
291AC_GECODE_CBS
292AC_GECODE_CPPROFILER
293AC_GECODE_FLEXBISON
294AC_FUNC_MMAP
295
296AC_GECODE_ENABLE_MODULE(driver, yes,
297 [build script commandline driver library],
298 [enable_search="yes";
299 enable_int="yes";
300 ])
301
302AC_GECODE_ENABLE_MODULE(flatzinc, yes,
303 [build FlatZinc interpreter],
304 [enable_search="yes";
305 enable_driver="yes";
306 enable_minimodel="yes";
307 ])
308
309AC_GECODE_ENABLE_MODULE(driver, yes,
310 [build script commandline driver library],
311 [enable_search="yes";
312 enable_int="yes";
313 ])
314
315AC_GECODE_ENABLE_MODULE(examples, yes,
316 [build examples for the enabled variable types],
317 [enable_search="yes";
318 enable_driver="yes";
319 enable_minimodel="yes";
320 ])
321
322AC_GECODE_ENABLE_MODULE(minimodel, yes,
323 [build modeling support library for the enabled variable types])
324
325AC_GECODE_ENABLE_MODULE(search, yes,
326 [build search engines])
327
328dnl Configure contributions
329AC_CONFIG_SUBDIRS()
330dnl @SUBDIRS@
331
332AC_SUBST(VERSION, ${PACKAGE_VERSION})
333AC_SUBST(GECODE_VERSION, ${PACKAGE_VERSION})
334AC_SUBST(DLLFLAGS, ${DLLFLAGS})
335AC_SUBST(GLDFLAGS, ${GLDFLAGS})
336AC_SUBST(ALLVIS, ${ac_gecode_vis})
337
338VERSION_DASHES=`echo $PACKAGE_VERSION | sed -e s/\\\\./-/g`
339
340PACKAGE_VERSION_NUMBER=`echo $PACKAGE_VERSION | awk -F. '{print $1 * 100000 + $2 * 100 + $3}'`
341
342AC_DEFINE_UNQUOTED(GECODE_VERSION,
343 "${PACKAGE_VERSION}",
344 [Gecode version])
345AC_DEFINE_UNQUOTED(GECODE_LIBRARY_VERSION,
346 "${VERSION_DASHES}",
347 [Gecode version])
348AC_DEFINE_UNQUOTED(GECODE_VERSION_NUMBER,
349 ${PACKAGE_VERSION_NUMBER},
350 [Gecode version])
351
352AC_DEFINE_UNQUOTED(GECODE_FLATZINC_VERSION,
353 "${GECODE_FLATZINC_VERSION}",
354 [Supported version of FlatZinc]
355)
356
357ac_gecode_library_architecture=-${VERSION_DASHES}${ac_gecode_library_architecture}
358if test "$ac_gecode_compiler_vendor" == "microsoft" \
359 -o \( "$ac_gecode_compiler_vendor" == "intel" \
360 -a "$host_os" == "windows" \) ; then
361 AC_SUBST(DLL_ARCH,[${ac_gecode_library_architecture}])
362else
363 AC_SUBST(DLL_ARCH,[""])
364fi
365
366AC_CONFIG_FILES([Makefile])
367if test "${host_os}" = "windows"; then
368 AC_SUBST(BATCHFILE, ".bat")
369 AC_CONFIG_FILES([tools/flatzinc/mzn-gecode.bat:tools/flatzinc/mzn-gecode.bat.in],[chmod +x tools/flatzinc/mzn-gecode.bat])
370else
371 AC_SUBST(BATCHFILE, "")
372 AC_CONFIG_FILES([tools/flatzinc/mzn-gecode:tools/flatzinc/mzn-gecode.in],[chmod +x tools/flatzinc/mzn-gecode])
373fi
374AC_CONFIG_FILES([tools/flatzinc/gecode.msc:tools/flatzinc/gecode.msc.in])
375AC_CONFIG_FILES([doxygen.conf:doxygen/doxygen.conf.in])
376AC_CONFIG_FILES([doxygen.hh:doxygen/doxygen.hh.in])
377AC_OUTPUT