don't heap-allocate vectors in findLabeledEdgeRings
[geos.git] / configure.in
blob9814d8a13cc45ae435601689308d35ba77252a68
1 dnl $Id$
2 dnl
3 dnl configure.in - autoconf input template to produce ./configure script
4 dnl
5 dnl version 2.52 is required for Cygwin libtool support
6 AC_PREREQ([2.52])
8 dnl local vars to hold user's preferences --------------------------------
9 AC_INIT([source/headers/geos.h])
10 AC_CANONICAL_SYSTEM
12 AC_CONFIG_MACRO_DIR([macros])
14 dnl -- JTS_PORT: the version of JTS this release is bound to
15 JTS_PORT=1.10.0
17 dnl -- Version info for the CAPI
18 CAPI_INTERFACE_CURRENT=7
19 CAPI_INTERFACE_REVISION=0
20 CAPI_INTERFACE_AGE=6
22 dnl
23 dnl -- Release versions / C++ library SONAME will use these
24 dnl -- encoding ABI break at every release
25 dnl
26 VERSION_MAJOR=3
27 VERSION_MINOR=2
28 VERSION_PATCH=0
29 VERSION="$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH"
31 dnl CAPI_VERSION_MAJOR=$(($CAPI_INTERFACE_CURRENT-$CAPI_INTERFACE_AGE))
32 dnl the following should be more portable
33 CAPI_VERSION_MAJOR=`expr $CAPI_INTERFACE_CURRENT - $CAPI_INTERFACE_AGE`
34 CAPI_VERSION_MINOR=$CAPI_INTERFACE_AGE
35 CAPI_VERSION_PATCH=$CAPI_INTERFACE_REVISION
36 CAPI_VERSION="$CAPI_VERSION_MAJOR.$CAPI_VERSION_MINOR.$CAPI_VERSION_PATCH"
38 AM_INIT_AUTOMAKE([geos], [$VERSION], [no-define])
39 AM_CONFIG_HEADER([source/headers/config.h])
40 AM_CONFIG_HEADER([source/headers/geos/platform.h])
41 AC_PROG_CC
43 dnl use libtool ----------------------------------------------------------
44 AC_LIBTOOL_DLOPEN
45 AC_LIBTOOL_WIN32_DLL
46 AC_PROG_LIBTOOL
48 dnl check for programs ----------------------------------------------------
49 AC_PROG_CXX
50 AC_ISC_POSIX
51 AC_PROG_INSTALL
52 AC_PROG_MAKE_SET
54 dnl function checks ------------------------------------------------------
55 AC_FUNC_CLOSEDIR_VOID
56 AC_FUNC_MEMCMP
57 AC_FUNC_STRFTIME
58 AC_FUNC_VPRINTF
59 AC_FUNC_ALLOCA
60 AC_HEADER_DIRENT
61 AC_HEADER_STDC
62 AC_CHECK_HEADERS([memory.h])
63 AC_CHECK_HEADERS([unistd.h])
64 AC_CHECK_HEADERS([ieeefp.h])
65 AC_CHECK_HEADERS([sys/file.h])
66 AC_CHECK_HEADERS([sys/time.h])
67 AC_CHECK_FUNCS([strchr memcpy gettimeofday])
68 AC_HEADER_STAT
69 AC_STRUCT_TM
70 AC_TYPE_SIZE_T
71 AC_C_CONST
73 dnl --------------------------------------------------------------------
74 dnl - Check for inline and cassert settings
75 dnl --------------------------------------------------------------------
78 AC_ARG_ENABLE([inline], [  --disable-inline    Disable inlining],
79         [case "${enableval}" in
80                 yes) enable_inline=true ;;
81                 no)  enable_inline=false ;;
82                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-inline);;
83         esac],
84         [enable_inline=true]
87 AC_ARG_ENABLE([cassert], [  --disable-cassert   Disable assertion checking],
88         [case "${enableval}" in
89                 yes) enable_cassert=true ;;
90                 no)  enable_cassert=false ;;
91                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-cassert);;
92         esac],
93         [enable_cassert=true]
96 INLINE_FLAGS=
97 AC_SUBST(INLINE_FLAGS)
98 if test x"$enable_inline" = xtrue; then
99         INLINE_FLAGS="-DGEOS_INLINE"
100         CXXFLAGS="$CXXFLAGS $INLINE_FLAGS"
103 if test x"$enable_cassert" = xfalse; then
104         CXXFLAGS="$CXXFLAGS -DNDEBUG"
107 dnl --------------------------------------------------------------------
108 dnl - Append default C++ and C flags 
109 dnl --------------------------------------------------------------------
111 dnl In order for AC_LIBTOOL_COMPILER_OPTION to use
112 dnl the C compiler we need the hack below.
113 dnl It is likely a bug in the libtool macro file to
114 dnl require AC_LIBTOOL_LANG_CXX_CONFIG in *addition*
115 dnl to AC_LANG(CXX) or AC_LANG_PUSH(CXX)/AC_LANG_POP()
116 dnl 
117 AC_LIBTOOL_LANG_CXX_CONFIG
119 # Set default CXXFLAGS and CFLAGS if not set by the user
120 # -pedantic: ISO does not support long long
121 # we add -Wno-long-long to avoid those messages
122 WARNFLAGS=""
123 AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -pedantic], [dummy_cv_pedantic], [-pedantic], [], [WARNFLAGS="$WARNFLAGS -pedantic"], [])
124 AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -Wall], [dummy_cv_wall], [-Wall], [], [WARNFLAGS="$WARNFLAGS -Wall"], [])
125 AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -ansi], [dummy_cv_ansi], [-ansi], [], [WARNFLAGS="$WARNFLAGS -ansi"], [])
126 AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -Wno-long-long], [dummy_cv_no_long_long], [-Wno-long-long], [], [WARNFLAGS="$WARNFLAGS -Wno-long-long"], [])
128 # To make numerical computation more stable, we use --ffloat-store
129 NUMERICFLAGS=""
130 AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -ffloat-store], [dummy_cv_ffloat_store], [-ffloat-store], [], [NUMERICFLAGS="$NUMERICFLAGS -ffloat-store"], [])
132 DEFAULTFLAGS="${WARNFLAGS} ${NUMERICFLAGS}"
134 CXXFLAGS="${CXXFLAGS} ${DEFAULTFLAGS}"
135 CFLAGS="${CFLAGS} ${DEFAULTFLAGS}"
137 dnl --------------------------------------------------------------------
138 dnl - Look for finite and/or isfinite macros/functions
139 dnl --------------------------------------------------------------------
141 dnl These two tests need the math library or they won't link
142 dnl on OpenBSD, even if the functions exist.
143 save_LIBS=$LIBS
144 LIBS="$LIBS -lm"
145 AC_CACHE_CHECK([for finite], ac_cv_finite,
146  [AC_TRY_LINK([#include <math.h>],
147  [double x; int y; y = finite(x);],
148  ac_cv_finite=yes,
149  ac_cv_finite=no
151 if test x"$ac_cv_finite" = x"yes"; then
152   AC_DEFINE(HAVE_FINITE, [1], [Has finite])
155 AC_CACHE_CHECK([for isfinite], ac_cv_isfinite,
156  [AC_TRY_LINK([#include <math.h>],
157  [double x; int y; y = isfinite(x);],
158  ac_cv_isfinite=yes,
159  ac_cv_isfinite=no
161 if test x"$ac_cv_isfinite" = x"yes"; then
162   AC_DEFINE(HAVE_ISFINITE, [1], [Has isfinite])
165 dnl --------------------------------------------------------------------
166 dnl Test for presence of isnan function when using C++ and <cmath>
167 dnl This is for a particular bug in OS/X where <cmath> drops the definition
168 dnl of isnan().
170 AC_LANG_PUSH([C++])
171 AC_CACHE_CHECK([for isnan], ac_cv_isnan,
172  [AC_TRY_LINK([#include <cmath>],
173  [double x; int y; y = isnan(x);],
174  ac_cv_isnan=yes,
175  ac_cv_isnan=no
177 if test x"$ac_cv_isnan" = x"yes"; then
178   AC_DEFINE(HAVE_ISNAN, [1], [Has isnan])
180 AC_LANG_POP([C++])
182 dnl --------------------------------------------------------------------
184 LIBS=$save_LIBS
186 dnl --------------------------------------------------------------------
187 dnl - Look for a 64bit integer (do after CFLAGS is set)
188 dnl --------------------------------------------------------------------
190 dnl Find a working 64bit integer
191 PGAC_TYPE_64BIT_INT([int64_t])
192 if test x"$HAVE_INT64_T_64" = x"no" ; then
193   PGAC_TYPE_64BIT_INT([long int])
194   if test x"$HAVE_LONG_INT_64" = x"no" ; then
195     PGAC_TYPE_64BIT_INT([long long int])
196     if test x"$HAVE_LONG_LONG_INT_64" = x"no" ; then
197       AC_MSG_WARN([Could not find a working 64bit int type, you may experience weird bugs (undefined behaviour)]);
198     fi
199   fi
205 dnl --------------------------------------------------------------------
206 dnl - check whether python is required for the build
207 dnl --------------------------------------------------------------------
209 AC_ARG_ENABLE([python], [  --enable-python    Enable build of python module],
210         [case "${enableval}" in
211                 yes) use_python=true ;;
212                 no)  use_python=false ;;
213                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-python) ;;
214         esac],
215         [use_python=false]
219 dnl --------------------------------------------------------------------
220 dnl - check whether ruby is required for the build
221 dnl --------------------------------------------------------------------
223 AC_ARG_ENABLE([ruby], [  --enable-ruby    Enable build of ruby module],
224         [case "${enableval}" in
225                 yes) use_ruby=true ;;
226                 no)  use_ruby=false ;;
227                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ruby) ;;
228         esac],
229         [use_ruby=false]
233 dnl --------------------------------------------------------------------
234 dnl - check for swig if python or ruby are enabled
235 dnl --------------------------------------------------------------------
237 use_swig=false
238 if test x"$use_python" = xtrue || test x"$use_ruby" = xtrue; then
239         AC_PROG_SWIG(1.3.28)
240         if test x"$SWIG" != "x"; then
241             SWIG_ENABLE_CXX     
242             AC_SUBST(SWIG)           
244             use_swig=true 
245         fi
247 AM_CONDITIONAL(ENABLE_SWIG, [ test x"$use_swig" = xtrue ])
250 dnl --------------------------------------------------------------------
251 dnl - check for python if enabled
252 dnl --------------------------------------------------------------------
254 if test x"$use_python" = xtrue; then
255         dnl Check for Python 
256         AM_PATH_PYTHON  
257         SWIG_PYTHON
259         if test x"$PYTHON" = "x"; then
260                 use_python=false
261         fi
262         
263         AC_SUBST(PYTHON)
264         AC_SUBST(SWIG_PYTHON_CPPFLAGS)
265         AC_SUBST(SWIG_PYTHON_OPT)
267 AM_CONDITIONAL(ENABLE_PYTHON, [test x"$use_python" = xtrue])
270 dnl --------------------------------------------------------------------
271 dnl - check for ruby if enabled
272 dnl --------------------------------------------------------------------
274 if test x"$use_ruby" = xtrue; then
275         dnl Check for Ruby 
276         AC_RUBY_DEVEL
278         if test x"$RUBY" = x; then
279                 use_ruby=false
280         fi
283 AM_CONDITIONAL(ENABLE_RUBY, [ test x"$use_ruby" = xtrue ])
286 dnl --------------------------------------------------------------------
287 dnl - check for boost 
288 dnl --------------------------------------------------------------------
290 dnl -- AX_BOOST(1.32)
291 dnl -- if test "x$ax_cv_boost_unit_test_framework" = "xyes"; then
292 dnl --  use_boost_utf=yes
293 dnl -- else
294 dnl --  use_boost_utf=no
295 dnl -- fi
296 dnl -- AM_CONDITIONAL(ENABLE_BOOST_UTF, [test "x$use_boost_utf" = "xyes"])
298 dnl things to substitute in output ----------------------------------------
299 AC_SUBST(VERSION)
300 AC_SUBST(VERSION_MAJOR)
301 AC_SUBST(VERSION_MINOR)
302 AC_SUBST(VERSION_PATCH)
303 AC_SUBST(INTERFACE_CURRENT)
304 AC_SUBST(INTERFACE_REVISION)
305 AC_SUBST(INTERFACE_AGE)
306 AC_SUBST(JTS_PORT)
307 AC_SUBST(CAPI_VERSION)
308 AC_SUBST(CAPI_VERSION_MAJOR)
309 AC_SUBST(CAPI_VERSION_MINOR)
310 AC_SUBST(CAPI_VERSION_PATCH)
311 AC_SUBST(CAPI_INTERFACE_CURRENT)
312 AC_SUBST(CAPI_INTERFACE_REVISION)
313 AC_SUBST(CAPI_INTERFACE_AGE)
315 dnl output stuff ----------------------------------------------------------
317 AC_OUTPUT([
318         Makefile 
319         build/Makefile
320         build/msvc80/Makefile
321         build/msvc80/geos_c_dll/Makefile
322         build/msvc80/geos_lib/Makefile
323         build/msvc80/geos_python/Makefile
324         build/msvc80/geos_ruby/Makefile
325         build/msvc80/geos_unit/Makefile
326         build/msvc90/Makefile
327         build/msvc90/geos_c_dll/Makefile
328         build/msvc90/geos_lib/Makefile
329         build/msvc90/geos_python/Makefile
330         build/msvc90/geos_ruby/Makefile
331         build/msvc90/geos_unit/Makefile
332         capi/Makefile
333         capi/geos_c.h
334         doc/Doxyfile
335         doc/Makefile
336         macros/Makefile
337         source/Makefile 
338         source/algorithm/Makefile
339         source/algorithm/locate/Makefile
340         source/algorithm/distance/Makefile
341         source/geom/Makefile
342         source/geom/prep/Makefile
343         source/geom/util/Makefile
344         source/geomgraph/Makefile
345         source/geomgraph/index/Makefile
346         source/headers/Makefile
347         source/headers/geos/Makefile
348         source/headers/geos/algorithm/Makefile
349         source/headers/geos/algorithm/locate/Makefile
350         source/headers/geos/algorithm/distance/Makefile
351         source/headers/geos/geom/Makefile
352         source/headers/geos/geom/prep/Makefile
353         source/headers/geos/geom/util/Makefile
354         source/headers/geos/geomgraph/Makefile
355         source/headers/geos/geomgraph/index/Makefile
356         source/headers/geos/index/Makefile
357         source/headers/geos/index/bintree/Makefile
358         source/headers/geos/index/chain/Makefile
359         source/headers/geos/index/intervalrtree/Makefile
360         source/headers/geos/index/quadtree/Makefile
361         source/headers/geos/index/strtree/Makefile
362         source/headers/geos/index/sweepline/Makefile
363         source/headers/geos/io/Makefile
364         source/headers/geos/linearref/Makefile
365         source/headers/geos/noding/Makefile
366         source/headers/geos/noding/snapround/Makefile
367         source/headers/geos/operation/Makefile
368         source/headers/geos/operation/buffer/Makefile
369         source/headers/geos/operation/distance/Makefile
370         source/headers/geos/operation/linemerge/Makefile
371         source/headers/geos/operation/overlay/Makefile
372         source/headers/geos/operation/overlay/snap/Makefile
373         source/headers/geos/operation/polygonize/Makefile
374         source/headers/geos/operation/predicate/Makefile
375         source/headers/geos/operation/relate/Makefile
376         source/headers/geos/operation/union/Makefile
377         source/headers/geos/operation/valid/Makefile
378         source/headers/geos/planargraph/Makefile
379         source/headers/geos/planargraph/algorithm/Makefile
380         source/headers/geos/precision/Makefile
381         source/headers/geos/simplify/Makefile
382         source/headers/geos/util/Makefile
383         source/headers/geos/version.h
384         source/index/Makefile
385         source/index/bintree/Makefile
386         source/index/chain/Makefile
387         source/index/intervalrtree/Makefile
388         source/index/quadtree/Makefile
389         source/index/strtree/Makefile
390         source/index/sweepline/Makefile
391         source/io/Makefile
392         source/linearref/Makefile
393         source/noding/Makefile
394         source/noding/snapround/Makefile
395         source/operation/Makefile
396         source/operation/buffer/Makefile
397         source/operation/distance/Makefile
398         source/operation/linemerge/Makefile
399         source/operation/overlay/Makefile
400         source/operation/polygonize/Makefile
401         source/operation/predicate/Makefile
402         source/operation/relate/Makefile
403         source/operation/union/Makefile
404         source/operation/valid/Makefile
405         source/planargraph/Makefile
406         source/precision/Makefile
407         source/simplify/Makefile
408         source/util/Makefile
409         swig/geos.i
410         swig/Makefile
411         swig/python/Makefile
412         swig/python/tests/Makefile
413         swig/ruby/Makefile
414         swig/ruby/test/Makefile
415         tests/Makefile
416         tests/bigtest/Makefile
417         tests/unit/Makefile
418         tests/perf/Makefile
419         tests/perf/operation/Makefile
420         tests/perf/operation/buffer/Makefile
421         tests/xmltester/Makefile
422         tools/Makefile
423         tools/geos-config
424         ])
428 dnl -- echo "---------------------------------------"
429 dnl -- echo "Boost UTF: $use_boost_utf"
430 echo "Swig: $use_swig"
431 echo "Python: $use_python"
432 echo "Ruby: $use_ruby"
433 dnl -- echo "---------------------------------------"