Update NEWS for 3.1.0
[geos.git] / configure.in
blob12e0be0cfe5eb17f9f01d46bd8ed398ed8e668cf
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.7.1
17 dnl -- Version info for the CAPI
18 CAPI_INTERFACE_CURRENT=6
19 CAPI_INTERFACE_REVISION=0
20 CAPI_INTERFACE_AGE=5
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=1
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 # Set default CXXFLAGS and CFLAGS if not set by the user
112 # -pedantic: ISO does not support long long
113 # we add -Wno-long-long to avoid those messages
114 WARNFLAGS=""
115 AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -pedantic], [dummy], [-pedantic], [], [WARNFLAGS="$WARNFLAGS -pedantic"], [])
116 AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -Wall], [dummy], [-Wall], [], [WARNFLAGS="$WARNFLAGS -Wall"], [])
117 AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -ansi], [dummy], [-ansi], [], [WARNFLAGS="$WARNFLAGS -ansi"], [])
118 AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -Wno-long-long], [dummy], [-Wno-long-long], [], [WARNFLAGS="$WARNFLAGS -Wno-long-long"], [])
119 CXXFLAGS="${CXXFLAGS} ${WARNFLAGS}"
120 CFLAGS="${CFLAGS} ${WARNFLAGS}"
122 dnl --------------------------------------------------------------------
123 dnl - Look for a 64bit integer (do after CFLAGS is set)
124 dnl --------------------------------------------------------------------
126 dnl Find a working 64bit integer
127 PGAC_TYPE_64BIT_INT([int64_t])
128 if test x"$HAVE_INT64_T_64" = x"no" ; then
129   PGAC_TYPE_64BIT_INT([long int])
130   if test x"$HAVE_LONG_INT_64" = x"no" ; then
131     PGAC_TYPE_64BIT_INT([long long int])
132   fi
138 dnl --------------------------------------------------------------------
139 dnl - check whether python is required for the build
140 dnl --------------------------------------------------------------------
142 AC_ARG_ENABLE(python, [  --enable-python    Enable build of python module],
143         [case "${enableval}" in
144                 yes) use_python=true ;;
145                 no)  use_python=false ;;
146                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-python) ;;
147         esac],
148         [use_python=false]
152 dnl --------------------------------------------------------------------
153 dnl - check whether ruby is required for the build
154 dnl --------------------------------------------------------------------
156 AC_ARG_ENABLE(ruby, [  --enable-ruby    Enable build of ruby module],
157         [case "${enableval}" in
158                 yes) use_ruby=true ;;
159                 no)  use_ruby=false ;;
160                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ruby) ;;
161         esac],
162         [use_ruby=false]
166 dnl --------------------------------------------------------------------
167 dnl - check for swig if python or ruby are enabled
168 dnl --------------------------------------------------------------------
170 use_swig=false
171 if test x"$use_python" = xtrue || test x"$use_ruby" = xtrue; then
172         AC_PROG_SWIG(1.3.28)
173         if test x"$SWIG" != "x"; then
174             SWIG_ENABLE_CXX     
175             AC_SUBST(SWIG)           
177             use_swig=true 
178         fi
180 AM_CONDITIONAL(ENABLE_SWIG, [ test x"$use_swig" = xtrue ])
183 dnl --------------------------------------------------------------------
184 dnl - check for python if enabled
185 dnl --------------------------------------------------------------------
187 if test x"$use_python" = xtrue; then
188         dnl Check for Python 
189         AM_PATH_PYTHON  
190         SWIG_PYTHON
192         if test x"$PYTHON" = "x"; then
193                 use_python=false
194         fi
195         
196         AC_SUBST(PYTHON)
197         AC_SUBST(SWIG_PYTHON_CPPFLAGS)
198         AC_SUBST(SWIG_PYTHON_OPT)
200 AM_CONDITIONAL(ENABLE_PYTHON, [test x"$use_python" = xtrue])
203 dnl --------------------------------------------------------------------
204 dnl - check for ruby if enabled
205 dnl --------------------------------------------------------------------
207 if test x"$use_ruby" = xtrue; then
208         dnl Check for Ruby 
209         AC_RUBY_DEVEL
211         if test x"$RUBY" = x; then
212                 use_ruby=false
213         fi
216 AM_CONDITIONAL(ENABLE_RUBY, [ test x"$use_ruby" = xtrue ])
219 dnl --------------------------------------------------------------------
220 dnl - check for boost 
221 dnl --------------------------------------------------------------------
223 dnl -- AX_BOOST(1.32)
224 dnl -- if test "x$ax_cv_boost_unit_test_framework" = "xyes"; then
225 dnl --  use_boost_utf=yes
226 dnl -- else
227 dnl --  use_boost_utf=no
228 dnl -- fi
229 dnl -- AM_CONDITIONAL(ENABLE_BOOST_UTF, [test "x$use_boost_utf" = "xyes"])
231 dnl things to substitute in output ----------------------------------------
232 AC_SUBST(VERSION)
233 AC_SUBST(VERSION_MAJOR)
234 AC_SUBST(VERSION_MINOR)
235 AC_SUBST(VERSION_PATCH)
236 AC_SUBST(INTERFACE_CURRENT)
237 AC_SUBST(INTERFACE_REVISION)
238 AC_SUBST(INTERFACE_AGE)
239 AC_SUBST(JTS_PORT)
240 AC_SUBST(CAPI_VERSION)
241 AC_SUBST(CAPI_VERSION_MAJOR)
242 AC_SUBST(CAPI_VERSION_MINOR)
243 AC_SUBST(CAPI_VERSION_PATCH)
244 AC_SUBST(CAPI_INTERFACE_CURRENT)
245 AC_SUBST(CAPI_INTERFACE_REVISION)
246 AC_SUBST(CAPI_INTERFACE_AGE)
248 dnl output stuff ----------------------------------------------------------
250 AC_OUTPUT([
251         Makefile 
252         build/Makefile
253         build/msvc80/Makefile
254         build/msvc80/geos_c_dll/Makefile
255         build/msvc80/geos_lib/Makefile
256         build/msvc80/geos_python/Makefile
257         build/msvc80/geos_ruby/Makefile
258         build/msvc80/geos_unit/Makefile
259         build/msvc90/Makefile
260         build/msvc90/geos_c_dll/Makefile
261         build/msvc90/geos_lib/Makefile
262         build/msvc90/geos_python/Makefile
263         build/msvc90/geos_ruby/Makefile
264         build/msvc90/geos_unit/Makefile
265         capi/Makefile
266         capi/geos_c.h
267         doc/Doxyfile
268         doc/Makefile
269         macros/Makefile
270         source/Makefile 
271         source/algorithm/Makefile
272         source/algorithm/locate/Makefile
273         source/geom/Makefile
274         source/geom/prep/Makefile
275         source/geom/util/Makefile
276         source/geomgraph/Makefile
277         source/geomgraph/index/Makefile
278         source/headers/Makefile
279         source/headers/geos/Makefile
280         source/headers/geos/algorithm/Makefile
281         source/headers/geos/algorithm/locate/Makefile
282         source/headers/geos/geom/Makefile
283         source/headers/geos/geom/prep/Makefile
284         source/headers/geos/geom/util/Makefile
285         source/headers/geos/geomgraph/Makefile
286         source/headers/geos/geomgraph/index/Makefile
287         source/headers/geos/index/Makefile
288         source/headers/geos/index/bintree/Makefile
289         source/headers/geos/index/chain/Makefile
290         source/headers/geos/index/intervalrtree/Makefile
291         source/headers/geos/index/quadtree/Makefile
292         source/headers/geos/index/strtree/Makefile
293         source/headers/geos/index/sweepline/Makefile
294         source/headers/geos/io/Makefile
295         source/headers/geos/noding/Makefile
296         source/headers/geos/noding/snapround/Makefile
297         source/headers/geos/operation/Makefile
298         source/headers/geos/operation/buffer/Makefile
299         source/headers/geos/operation/distance/Makefile
300         source/headers/geos/operation/linemerge/Makefile
301         source/headers/geos/operation/overlay/Makefile
302         source/headers/geos/operation/polygonize/Makefile
303         source/headers/geos/operation/predicate/Makefile
304         source/headers/geos/operation/relate/Makefile
305         source/headers/geos/operation/union/Makefile
306         source/headers/geos/operation/valid/Makefile
307         source/headers/geos/planargraph/Makefile
308         source/headers/geos/planargraph/algorithm/Makefile
309         source/headers/geos/precision/Makefile
310         source/headers/geos/simplify/Makefile
311         source/headers/geos/util/Makefile
312         source/headers/geos/version.h
313         source/index/Makefile
314         source/index/bintree/Makefile
315         source/index/chain/Makefile
316         source/index/intervalrtree/Makefile
317         source/index/quadtree/Makefile
318         source/index/strtree/Makefile
319         source/index/sweepline/Makefile
320         source/io/Makefile
321         source/noding/Makefile
322         source/noding/snapround/Makefile
323         source/operation/Makefile
324         source/operation/buffer/Makefile
325         source/operation/distance/Makefile
326         source/operation/linemerge/Makefile
327         source/operation/overlay/Makefile
328         source/operation/polygonize/Makefile
329         source/operation/predicate/Makefile
330         source/operation/relate/Makefile
331         source/operation/union/Makefile
332         source/operation/valid/Makefile
333         source/planargraph/Makefile
334         source/precision/Makefile
335         source/simplify/Makefile
336         source/util/Makefile
337         swig/geos.i
338         swig/Makefile
339         swig/python/Makefile
340         swig/python/tests/Makefile
341         swig/ruby/Makefile
342         swig/ruby/test/Makefile
343         tests/Makefile
344         tests/bigtest/Makefile
345         tests/unit/Makefile
346         tests/tut/Makefile
347         tests/xmltester/Makefile
348         tools/Makefile
349         tools/geos-config
350         ])
354 dnl -- echo "---------------------------------------"
355 dnl -- echo "Boost UTF: $use_boost_utf"
356 echo "Swig: $use_swig"
357 echo "Python: $use_python"
358 echo "Ruby: $use_ruby"
359 dnl -- echo "---------------------------------------"