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