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)]);
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) ;;
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) ;;
233 dnl --------------------------------------------------------------------
234 dnl - check for swig if python or ruby are enabled
235 dnl --------------------------------------------------------------------
238 if test x"$use_python" = xtrue || test x"$use_ruby" = xtrue; then
240 if test x"$SWIG" != "x"; then
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
259 if test x"$PYTHON" = "x"; then
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
278 if test x"$RUBY" = x; then
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
294 dnl -- use_boost_utf=no
296 dnl -- AM_CONDITIONAL(ENABLE_BOOST_UTF, [test "x$use_boost_utf" = "xyes"])
298 dnl things to substitute in output ----------------------------------------
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)
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 ----------------------------------------------------------
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
338 source/algorithm/Makefile
339 source/algorithm/locate/Makefile
340 source/algorithm/distance/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
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
412 swig/python/tests/Makefile
414 swig/ruby/test/Makefile
416 tests/bigtest/Makefile
419 tests/perf/operation/Makefile
420 tests/perf/operation/buffer/Makefile
421 tests/xmltester/Makefile
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 "---------------------------------------"