2 dnl configure.in - autoconf input template to produce ./configure script
4 dnl version 2.52 is required for Cygwin libtool support
7 dnl local vars to hold user's preferences --------------------------------
8 AC_INIT([include/geos.h])
11 AC_CONFIG_MACRO_DIR([macros])
13 dnl -- JTS_PORT: the version of JTS this release is bound to
16 dnl -- Version info for the CAPI
17 CAPI_INTERFACE_CURRENT=9
18 CAPI_INTERFACE_REVISION=3
22 dnl -- Release versions / C++ library SONAME will use these
23 dnl -- encoding ABI break at every release
28 VERSION="$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH"
30 dnl CAPI_VERSION_MAJOR=$(($CAPI_INTERFACE_CURRENT-$CAPI_INTERFACE_AGE))
31 dnl the following should be more portable
32 CAPI_VERSION_MAJOR=`expr $CAPI_INTERFACE_CURRENT - $CAPI_INTERFACE_AGE`
33 CAPI_VERSION_MINOR=$CAPI_INTERFACE_AGE
34 CAPI_VERSION_PATCH=$CAPI_INTERFACE_REVISION
35 CAPI_VERSION="$CAPI_VERSION_MAJOR.$CAPI_VERSION_MINOR.$CAPI_VERSION_PATCH"
37 AM_INIT_AUTOMAKE([geos], [$VERSION], [no-define])
39 AC_CONFIG_HEADERS([include/config.h] [include/geos/platform.h])
42 dnl use libtool ----------------------------------------------------------
47 dnl check for programs ----------------------------------------------------
53 dnl function checks ------------------------------------------------------
61 AC_CHECK_HEADERS([memory.h])
62 AC_CHECK_HEADERS([unistd.h])
63 AC_CHECK_HEADERS([ieeefp.h])
64 AC_CHECK_HEADERS([sys/file.h])
65 AC_CHECK_HEADERS([sys/time.h])
66 AC_CHECK_FUNCS([strchr memcpy gettimeofday])
72 dnl --------------------------------------------------------------------
73 dnl - Check for inline and cassert settings
74 dnl --------------------------------------------------------------------
77 AC_ARG_ENABLE([inline], [ --disable-inline Disable inlining],
78 [case "${enableval}" in
79 yes) enable_inline=true ;;
80 no) enable_inline=false ;;
81 *) AC_MSG_ERROR(bad value ${enableval} for --enable-inline);;
86 AC_ARG_ENABLE([cassert], [ --disable-cassert Disable assertion checking],
87 [case "${enableval}" in
88 yes) enable_cassert=true ;;
89 no) enable_cassert=false ;;
90 *) AC_MSG_ERROR(bad value ${enableval} for --enable-cassert);;
95 AC_ARG_ENABLE([glibcxx-debug], [ --enable-glibcxx-debug Enable libstdc++ debug mode],
96 [case "${enableval}" in
97 yes) enable_glibcxx_debug=true ;;
98 no) enable_glibcxx_debug=false ;;
99 *) AC_MSG_ERROR(bad value ${enableval} for --enable-glibcxx-debug);;
101 [enable_glibcxx_debug=false]
105 AC_MSG_CHECKING([if requested to force inline functions])
107 AC_SUBST(INLINE_FLAGS)
108 if test x"$enable_inline" = xtrue; then
109 INLINE_FLAGS="-DGEOS_INLINE"
110 AM_CXXFLAGS="$AM_CXXFLAGS $INLINE_FLAGS"
116 AC_MSG_CHECKING([if requested to enable assert macros])
117 if test x"$enable_cassert" = xfalse; then
118 AM_CXXFLAGS="$AM_CXXFLAGS -DNDEBUG"
124 AC_MSG_CHECKING([if requested libstdc++ debug mode])
125 if test x"$enable_glibcxx_debug" = xtrue; then
126 AM_CXXFLAGS="$AM_CXXFLAGS -D_GLIBCXX_DEBUG=1 -D_GLIBCXX_DEBUG_PEDANTIC=1"
132 dnl --------------------------------------------------------------------
133 dnl - Append default C++ and C flags
134 dnl --------------------------------------------------------------------
136 dnl In order for AC_LIBTOOL_COMPILER_OPTION to use
137 dnl the C compiler we need the hack below.
138 dnl It is likely a bug in the libtool macro file to
139 dnl require AC_LIBTOOL_LANG_CXX_CONFIG in *addition*
140 dnl to AC_LANG(CXX) or AC_LANG_PUSH(CXX)/AC_LANG_POP()
142 AC_LIBTOOL_LANG_CXX_CONFIG
144 # Set default AM_CXXFLAGS and AM_CFLAGS
145 # -pedantic: ISO does not support long long
146 # we add -Wno-long-long to avoid those messages
148 AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -pedantic], [dummy_cv_pedantic], [-pedantic], [], [WARNFLAGS="$WARNFLAGS -pedantic"], [])
149 AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -Wall], [dummy_cv_wall], [-Wall], [], [WARNFLAGS="$WARNFLAGS -Wall"], [])
150 AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -ansi], [dummy_cv_ansi], [-ansi], [], [WARNFLAGS="$WARNFLAGS -ansi"], [])
151 AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -Wno-long-long], [dummy_cv_no_long_long], [-Wno-long-long], [], [WARNFLAGS="$WARNFLAGS -Wno-long-long"], [])
153 # To make numerical computation more stable, we use --ffloat-store
155 AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -ffloat-store], [dummy_cv_ffloat_store], [-ffloat-store], [], [NUMERICFLAGS="$NUMERICFLAGS -ffloat-store"], [])
157 DEFAULTFLAGS="${WARNFLAGS} ${NUMERICFLAGS}"
159 AM_CXXFLAGS="${AM_CXXFLAGS} ${DEFAULTFLAGS}"
160 AM_CFLAGS="${AM_CFLAGS} ${DEFAULTFLAGS}"
161 AC_SUBST(AM_CXXFLAGS)
164 dnl --------------------------------------------------------------------
165 dnl - Look for finite and/or isfinite macros/functions
166 dnl --------------------------------------------------------------------
168 dnl These two tests need the math library or they won't link
169 dnl on OpenBSD, even if the functions exist.
172 AC_CACHE_CHECK([for finite], ac_cv_finite,
173 [AC_TRY_LINK([#include <math.h>],
174 [double x; int y; y = finite(x);],
178 if test x"$ac_cv_finite" = x"yes"; then
179 AC_DEFINE(HAVE_FINITE, [1], [Has finite])
182 AC_CACHE_CHECK([for isfinite], ac_cv_isfinite,
183 [AC_TRY_LINK([#include <math.h>],
184 [double x; int y; y = isfinite(x);],
188 if test x"$ac_cv_isfinite" = x"yes"; then
189 AC_DEFINE(HAVE_ISFINITE, [1], [Has isfinite])
192 dnl --------------------------------------------------------------------
193 dnl Test for presence of isnan function when using C++ and <cmath>
194 dnl This is for a particular bug in OS/X where <cmath> drops the definition
198 AC_CACHE_CHECK([for isnan], ac_cv_isnan,
199 [AC_TRY_LINK([#include <cmath>],
200 [double x; int y; y = isnan(x);],
204 if test x"$ac_cv_isnan" = x"yes"; then
205 AC_DEFINE(HAVE_ISNAN, [1], [Has isnan])
209 dnl --------------------------------------------------------------------
213 dnl --------------------------------------------------------------------
214 dnl - Look for a 64bit integer (do after CFLAGS is set)
215 dnl --------------------------------------------------------------------
217 dnl Find a working 64bit integer
218 PGAC_TYPE_64BIT_INT([int64_t])
219 if test x"$HAVE_INT64_T_64" = x"no" ; then
220 PGAC_TYPE_64BIT_INT([long int])
221 if test x"$HAVE_LONG_INT_64" = x"no" ; then
222 PGAC_TYPE_64BIT_INT([long long int])
223 if test x"$HAVE_LONG_LONG_INT_64" = x"no" ; then
224 AC_MSG_WARN([Could not find a working 64bit int type, you may experience weird bugs (undefined behaviour)]);
231 dnl --------------------------------------------------------------------
232 dnl - check whether python is required for the build
233 dnl --------------------------------------------------------------------
235 AC_ARG_ENABLE([python], [ --enable-python Enable build of python module],
236 [case "${enableval}" in
237 yes) use_python=true ;;
238 no) use_python=false ;;
239 *) AC_MSG_ERROR(bad value ${enableval} for --enable-python) ;;
245 dnl --------------------------------------------------------------------
246 dnl - check whether ruby is required for the build
247 dnl --------------------------------------------------------------------
249 AC_ARG_ENABLE([ruby], [ --enable-ruby Enable build of ruby module],
250 [case "${enableval}" in
251 yes) use_ruby=true ;;
252 no) use_ruby=false ;;
253 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ruby) ;;
258 dnl --------------------------------------------------------------------
259 dnl - check whether php is required for the build
260 dnl --------------------------------------------------------------------
262 AC_ARG_ENABLE([php], [ --enable-php Enable build of php module],
263 [case "${enableval}" in
266 *) AC_MSG_ERROR(bad value ${enableval} for --enable-php) ;;
272 dnl --------------------------------------------------------------------
273 dnl - check for swig if python, ruby or php are enabled
274 dnl --------------------------------------------------------------------
277 if test x"$use_python" = xtrue ||
278 test x"$use_ruby" = xtrue; then
280 if test x"$SWIG" != "x"; then
287 AM_CONDITIONAL(ENABLE_SWIG, [ test x"$use_swig" = xtrue ])
290 dnl --------------------------------------------------------------------
291 dnl - check for python if enabled
292 dnl --------------------------------------------------------------------
294 if test x"$use_python" = xtrue; then
299 if test x"$PYTHON" = "x"; then
304 AC_SUBST(SWIG_PYTHON_CPPFLAGS)
305 AC_SUBST(SWIG_PYTHON_OPT)
307 AM_CONDITIONAL(ENABLE_PYTHON, [test x"$use_python" = xtrue])
310 dnl --------------------------------------------------------------------
311 dnl - check for ruby if enabled
312 dnl --------------------------------------------------------------------
314 if test x"$use_ruby" = xtrue; then
318 if test x"$RUBY" = x; then
323 AM_CONDITIONAL(ENABLE_RUBY, [ test x"$use_ruby" = xtrue ])
325 dnl --------------------------------------------------------------------
326 dnl - check for php if enabled
327 dnl --------------------------------------------------------------------
329 if test x"$use_php" = xtrue; then
331 AC_PATH_PROG(PHP_CONFIG, php-config)
333 if test x"$PHP_CONFIG" = x; then
334 AC_MSG_WARN([php-config not found, php support disabled])
338 dnl TODO: check for version, we want PHP5 dev files
340 AC_PATH_PROG(PHP, php) dnl for unit testing
341 AC_PATH_PROG(PHPUNIT, phpunit) dnl for unit testing
346 AM_CONDITIONAL(ENABLE_PHP, [ test x"$use_php" = xtrue ])
347 AM_CONDITIONAL(HAVE_PHP, [ test x"$PHP" != x ])
348 AM_CONDITIONAL(HAVE_PHP_UNIT, [ test x"$PHPUNIT" != x ])
351 dnl --------------------------------------------------------------------
352 dnl - do operating-system specific things
353 dnl --------------------------------------------------------------------
355 AC_MSG_CHECKING([OS-specific settings])
359 AC_MSG_RESULT([${host_os}])
360 AC_MSG_CHECKING([for OS/X version])
363 # "Darwin 9.6.0" is Mac OSX 10.5.6
364 # "Darwin 10.x" would presumably be Mac OS X 10.6.x
367 AC_MSG_RESULT([Mac OS X 10.4 Tiger])
370 AC_MSG_RESULT([Mac OS X 10.5 Leopard])
373 dnl AM_CXXFLAGS="$AM_CXXFLAGS -Wnon-virtual-dtor -Woverloaded-virtual"
374 AC_MSG_RESULT([Mac OS X 10.6 Snow Leopard])
377 AC_MSG_RESULT([Mac OS X (Darwin ${kernel} kernel)])
383 dnl --------------------------------------------------------------------
384 dnl - check for boost
385 dnl --------------------------------------------------------------------
387 dnl -- AX_BOOST(1.32)
388 dnl -- if test "x$ax_cv_boost_unit_test_framework" = "xyes"; then
389 dnl -- use_boost_utf=yes
391 dnl -- use_boost_utf=no
393 dnl -- AM_CONDITIONAL(ENABLE_BOOST_UTF, [test "x$use_boost_utf" = "xyes"])
395 dnl things to substitute in output ----------------------------------------
397 AC_SUBST(VERSION_MAJOR)
398 AC_SUBST(VERSION_MINOR)
399 AC_SUBST(VERSION_PATCH)
400 AC_SUBST(INTERFACE_CURRENT)
401 AC_SUBST(INTERFACE_REVISION)
402 AC_SUBST(INTERFACE_AGE)
404 AC_SUBST(CAPI_VERSION)
405 AC_SUBST(CAPI_VERSION_MAJOR)
406 AC_SUBST(CAPI_VERSION_MINOR)
407 AC_SUBST(CAPI_VERSION_PATCH)
408 AC_SUBST(CAPI_INTERFACE_CURRENT)
409 AC_SUBST(CAPI_INTERFACE_REVISION)
410 AC_SUBST(CAPI_INTERFACE_AGE)
412 dnl output stuff ----------------------------------------------------------
422 src/algorithm/Makefile
423 src/algorithm/locate/Makefile
424 src/algorithm/distance/Makefile
426 src/geom/prep/Makefile
427 src/geom/util/Makefile
428 src/geomgraph/Makefile
429 src/geomgraph/index/Makefile
431 include/geos/Makefile
432 include/geos/algorithm/Makefile
433 include/geos/algorithm/locate/Makefile
434 include/geos/algorithm/distance/Makefile
435 include/geos/geom/Makefile
436 include/geos/geom/prep/Makefile
437 include/geos/geom/util/Makefile
438 include/geos/geomgraph/Makefile
439 include/geos/geomgraph/index/Makefile
440 include/geos/index/Makefile
441 include/geos/index/bintree/Makefile
442 include/geos/index/chain/Makefile
443 include/geos/index/intervalrtree/Makefile
444 include/geos/index/quadtree/Makefile
445 include/geos/index/strtree/Makefile
446 include/geos/index/sweepline/Makefile
447 include/geos/io/Makefile
448 include/geos/linearref/Makefile
449 include/geos/noding/Makefile
450 include/geos/noding/snapround/Makefile
451 include/geos/operation/Makefile
452 include/geos/operation/buffer/Makefile
453 include/geos/operation/distance/Makefile
454 include/geos/operation/linemerge/Makefile
455 include/geos/operation/overlay/Makefile
456 include/geos/operation/overlay/snap/Makefile
457 include/geos/operation/polygonize/Makefile
458 include/geos/operation/predicate/Makefile
459 include/geos/operation/relate/Makefile
460 include/geos/operation/sharedpaths/Makefile
461 include/geos/operation/union/Makefile
462 include/geos/operation/valid/Makefile
463 include/geos/planargraph/Makefile
464 include/geos/planargraph/algorithm/Makefile
465 include/geos/precision/Makefile
466 include/geos/simplify/Makefile
467 include/geos/triangulate/Makefile
468 include/geos/triangulate/quadedge/Makefile
469 include/geos/util/Makefile
470 include/geos/version.h
472 src/index/bintree/Makefile
473 src/index/chain/Makefile
474 src/index/intervalrtree/Makefile
475 src/index/quadtree/Makefile
476 src/index/strtree/Makefile
477 src/index/sweepline/Makefile
479 src/linearref/Makefile
481 src/noding/snapround/Makefile
482 src/operation/Makefile
483 src/operation/buffer/Makefile
484 src/operation/distance/Makefile
485 src/operation/linemerge/Makefile
486 src/operation/overlay/Makefile
487 src/operation/polygonize/Makefile
488 src/operation/predicate/Makefile
489 src/operation/relate/Makefile
490 src/operation/sharedpaths/Makefile
491 src/operation/union/Makefile
492 src/operation/valid/Makefile
493 src/planargraph/Makefile
494 src/precision/Makefile
495 src/simplify/Makefile
496 src/triangulate/Makefile
497 src/triangulate/quadedge/Makefile
502 swig/python/tests/Makefile
504 swig/ruby/test/Makefile
508 tests/bigtest/Makefile
511 tests/perf/operation/Makefile
512 tests/perf/operation/buffer/Makefile
513 tests/perf/operation/predicate/Makefile
514 tests/perf/capi/Makefile
515 tests/xmltester/Makefile
516 tests/geostest/Makefile
517 tests/thread/Makefile
522 dnl -- echo "---------------------------------------"
523 dnl -- echo "Boost UTF: $use_boost_utf"
524 echo "Swig: $use_swig"
525 echo "Python bindings: $use_python"
526 echo "Ruby bindings: $use_ruby"
528 echo "PHP bindings: $use_php"
529 if test x"$use_php" = xtrue; then
531 echo " PHPUNIT: $PHPUNIT"
532 if test x"$PHP" = x -o x"$PHPUNIT" = x; then
533 AC_MSG_WARN([PHP Unit testing disabled (missing PHP or PHPUNIT)])
537 dnl -- echo "---------------------------------------"