3 dnl configure.in - autoconf input template to produce ./configure script
5 dnl version 2.52 is required for Cygwin libtool support
8 dnl local vars to hold user's preferences --------------------------------
9 AC_INIT([source/headers/geos.h])
12 AC_CONFIG_MACRO_DIR([macros])
14 dnl -- JTS_PORT: the version of JTS this release is bound to
17 dnl -- Version info for the CAPI
18 CAPI_INTERFACE_CURRENT=7
19 CAPI_INTERFACE_REVISION=0
23 dnl -- Release versions / C++ library SONAME will use these
24 dnl -- encoding ABI break at every release
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])
43 dnl use libtool ----------------------------------------------------------
48 dnl check for programs ----------------------------------------------------
54 dnl function checks ------------------------------------------------------
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])
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);;
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);;
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()
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
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
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.
145 AC_CACHE_CHECK([for finite], ac_cv_finite,
146 [AC_TRY_LINK([#include <math.h>],
147 [double x; int y; y = finite(x);],
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);],
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
171 AC_CACHE_CHECK([for isnan], ac_cv_isnan,
172 [AC_TRY_LINK([#include <cmath>],
173 [double x; int y; y = isnan(x);],
177 if test x"$ac_cv_isnan" = x"yes"; then
178 AC_DEFINE(HAVE_ISNAN, [1], [Has isnan])
182 dnl --------------------------------------------------------------------
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)]);
204 dnl --------------------------------------------------------------------
205 dnl - check whether python is required for the build
206 dnl --------------------------------------------------------------------
208 AC_ARG_ENABLE([python], [ --enable-python Enable build of python module],
209 [case "${enableval}" in
210 yes) use_python=true ;;
211 no) use_python=false ;;
212 *) AC_MSG_ERROR(bad value ${enableval} for --enable-python) ;;
218 dnl --------------------------------------------------------------------
219 dnl - check whether ruby is required for the build
220 dnl --------------------------------------------------------------------
222 AC_ARG_ENABLE([ruby], [ --enable-ruby Enable build of ruby module],
223 [case "${enableval}" in
224 yes) use_ruby=true ;;
225 no) use_ruby=false ;;
226 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ruby) ;;
232 dnl --------------------------------------------------------------------
233 dnl - check for swig if python or ruby are enabled
234 dnl --------------------------------------------------------------------
237 if test x"$use_python" = xtrue || test x"$use_ruby" = xtrue; then
239 if test x"$SWIG" != "x"; then
246 AM_CONDITIONAL(ENABLE_SWIG, [ test x"$use_swig" = xtrue ])
249 dnl --------------------------------------------------------------------
250 dnl - check for python if enabled
251 dnl --------------------------------------------------------------------
253 if test x"$use_python" = xtrue; then
258 if test x"$PYTHON" = "x"; then
263 AC_SUBST(SWIG_PYTHON_CPPFLAGS)
264 AC_SUBST(SWIG_PYTHON_OPT)
266 AM_CONDITIONAL(ENABLE_PYTHON, [test x"$use_python" = xtrue])
269 dnl --------------------------------------------------------------------
270 dnl - check for ruby if enabled
271 dnl --------------------------------------------------------------------
273 if test x"$use_ruby" = xtrue; then
277 if test x"$RUBY" = x; then
282 AM_CONDITIONAL(ENABLE_RUBY, [ test x"$use_ruby" = xtrue ])
285 dnl --------------------------------------------------------------------
286 dnl - do operating-system specific things
287 dnl --------------------------------------------------------------------
289 AC_MSG_CHECKING([OS-specific settings])
293 AC_MSG_RESULT([${host_os}])
294 AC_MSG_CHECKING([for OS/X version])
297 # "Darwin 9.6.0" is Mac OSX 10.5.6
298 # "Darwin 10.x" would presumably be Mac OS X 10.6.x
301 AC_MSG_RESULT([Mac OS X 10.4 Tiger])
304 AC_MSG_RESULT([Mac OS X 10.5 Leopard])
307 CXXFLAGS="$CXXFLAGS -Wnon-virtual-dtor -Woverloaded-virtual"
308 AC_MSG_RESULT([Mac OS X 10.6 Snow Leopard])
311 AC_MSG_RESULT([Mac OS X (Darwin ${kernel} kernel)])
317 dnl --------------------------------------------------------------------
318 dnl - check for boost
319 dnl --------------------------------------------------------------------
321 dnl -- AX_BOOST(1.32)
322 dnl -- if test "x$ax_cv_boost_unit_test_framework" = "xyes"; then
323 dnl -- use_boost_utf=yes
325 dnl -- use_boost_utf=no
327 dnl -- AM_CONDITIONAL(ENABLE_BOOST_UTF, [test "x$use_boost_utf" = "xyes"])
329 dnl things to substitute in output ----------------------------------------
331 AC_SUBST(VERSION_MAJOR)
332 AC_SUBST(VERSION_MINOR)
333 AC_SUBST(VERSION_PATCH)
334 AC_SUBST(INTERFACE_CURRENT)
335 AC_SUBST(INTERFACE_REVISION)
336 AC_SUBST(INTERFACE_AGE)
338 AC_SUBST(CAPI_VERSION)
339 AC_SUBST(CAPI_VERSION_MAJOR)
340 AC_SUBST(CAPI_VERSION_MINOR)
341 AC_SUBST(CAPI_VERSION_PATCH)
342 AC_SUBST(CAPI_INTERFACE_CURRENT)
343 AC_SUBST(CAPI_INTERFACE_REVISION)
344 AC_SUBST(CAPI_INTERFACE_AGE)
346 dnl output stuff ----------------------------------------------------------
351 build/msvc80/Makefile
352 build/msvc80/geos_c_dll/Makefile
353 build/msvc80/geos_lib/Makefile
354 build/msvc80/geos_python/Makefile
355 build/msvc80/geos_ruby/Makefile
356 build/msvc80/geos_unit/Makefile
357 build/msvc90/Makefile
358 build/msvc90/geos_c_dll/Makefile
359 build/msvc90/geos_lib/Makefile
360 build/msvc90/geos_python/Makefile
361 build/msvc90/geos_ruby/Makefile
362 build/msvc90/geos_unit/Makefile
363 build/msvc90/geos_xmltester/Makefile
370 source/algorithm/Makefile
371 source/algorithm/locate/Makefile
372 source/algorithm/distance/Makefile
374 source/geom/prep/Makefile
375 source/geom/util/Makefile
376 source/geomgraph/Makefile
377 source/geomgraph/index/Makefile
378 source/headers/Makefile
379 source/headers/geos/Makefile
380 source/headers/geos/algorithm/Makefile
381 source/headers/geos/algorithm/locate/Makefile
382 source/headers/geos/algorithm/distance/Makefile
383 source/headers/geos/geom/Makefile
384 source/headers/geos/geom/prep/Makefile
385 source/headers/geos/geom/util/Makefile
386 source/headers/geos/geomgraph/Makefile
387 source/headers/geos/geomgraph/index/Makefile
388 source/headers/geos/index/Makefile
389 source/headers/geos/index/bintree/Makefile
390 source/headers/geos/index/chain/Makefile
391 source/headers/geos/index/intervalrtree/Makefile
392 source/headers/geos/index/quadtree/Makefile
393 source/headers/geos/index/strtree/Makefile
394 source/headers/geos/index/sweepline/Makefile
395 source/headers/geos/io/Makefile
396 source/headers/geos/linearref/Makefile
397 source/headers/geos/noding/Makefile
398 source/headers/geos/noding/snapround/Makefile
399 source/headers/geos/operation/Makefile
400 source/headers/geos/operation/buffer/Makefile
401 source/headers/geos/operation/distance/Makefile
402 source/headers/geos/operation/linemerge/Makefile
403 source/headers/geos/operation/overlay/Makefile
404 source/headers/geos/operation/overlay/snap/Makefile
405 source/headers/geos/operation/polygonize/Makefile
406 source/headers/geos/operation/predicate/Makefile
407 source/headers/geos/operation/relate/Makefile
408 source/headers/geos/operation/union/Makefile
409 source/headers/geos/operation/valid/Makefile
410 source/headers/geos/planargraph/Makefile
411 source/headers/geos/planargraph/algorithm/Makefile
412 source/headers/geos/precision/Makefile
413 source/headers/geos/simplify/Makefile
414 source/headers/geos/util/Makefile
415 source/headers/geos/version.h
416 source/index/Makefile
417 source/index/bintree/Makefile
418 source/index/chain/Makefile
419 source/index/intervalrtree/Makefile
420 source/index/quadtree/Makefile
421 source/index/strtree/Makefile
422 source/index/sweepline/Makefile
424 source/linearref/Makefile
425 source/noding/Makefile
426 source/noding/snapround/Makefile
427 source/operation/Makefile
428 source/operation/buffer/Makefile
429 source/operation/distance/Makefile
430 source/operation/linemerge/Makefile
431 source/operation/overlay/Makefile
432 source/operation/polygonize/Makefile
433 source/operation/predicate/Makefile
434 source/operation/relate/Makefile
435 source/operation/union/Makefile
436 source/operation/valid/Makefile
437 source/planargraph/Makefile
438 source/precision/Makefile
439 source/simplify/Makefile
444 swig/python/tests/Makefile
446 swig/ruby/test/Makefile
448 tests/bigtest/Makefile
451 tests/perf/operation/Makefile
452 tests/perf/operation/buffer/Makefile
453 tests/xmltester/Makefile
460 dnl -- echo "---------------------------------------"
461 dnl -- echo "Boost UTF: $use_boost_utf"
462 echo "Swig: $use_swig"
463 echo "Python: $use_python"
464 echo "Ruby: $use_ruby"
465 dnl -- echo "---------------------------------------"