File: configure.ac

package info (click to toggle)
spatialite-tools 4.4.0~rc1-1~exp5
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 3,224 kB
  • sloc: ansic: 40,808; sh: 11,192; xml: 1,920; makefile: 107
file content (254 lines) | stat: -rw-r--r-- 11,345 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.61)
AC_INIT(spatialite-tools, 4.4.0-RC1, a.furieri@lqt.it)
AC_LANG(C)
AC_CONFIG_MACRO_DIR([m4])

AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE
AM_CONFIG_HEADER(config.h)

# supporting SPATIALITE_AMALGAMATION
AH_TEMPLATE([SPATIALITE_AMALGAMATION],
	    [must be defined when using libspatialite-amalgamation])
AH_TEMPLATE([OMIT_FREEXL],
            [Should be defined in order to disable FREEXL support.])
AH_TEMPLATE([OMIT_READOSM],
            [Should be defined in order to disable ReadOSM support.])
AH_TEMPLATE([ENABLE_LIBXML2],
            [Should be defined in order to enable LIBXML2 support.])
AH_TEMPLATE([HAVE_DECL_SQLITE_CONFIG_URI],
            [depending on SQLite library version.])
AH_TEMPLATE([HAVE_DECL_SQLITE_DBSTATUS_LOOKASIDE_USED],
            [depending on SQLite library version.])
AH_TEMPLATE([HAVE_DECL_SQLITE_DBSTATUS_LOOKASIDE_HIT],
            [depending on SQLite library version.])
AH_TEMPLATE([HAVE_DECL_SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE],
            [depending on SQLite library version.])
AH_TEMPLATE([HAVE_DECL_SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL],
            [depending on SQLite library version.])
AH_TEMPLATE([HAVE_DECL_SQLITE_DBSTATUS_CACHE_USED],
            [depending on SQLite library version.])
AH_TEMPLATE([HAVE_DECL_SQLITE_DBSTATUS_CACHE_HIT],
            [depending on SQLite library version.])
AH_TEMPLATE([HAVE_DECL_SQLITE_DBSTATUS_CACHE_MISS],
            [depending on SQLite library version.])
AH_TEMPLATE([HAVE_DECL_SQLITE_DBSTATUS_CACHE_WRITE],
            [depending on SQLite library version.])
AH_TEMPLATE([HAVE_DECL_SQLITE_DBSTATUS_SCHEMA_USED],
            [depending on SQLite library version.])
AH_TEMPLATE([HAVE_DECL_SQLITE_DBSTATUS_STMT_USED],
            [depending on SQLite library version.])
AH_TEMPLATE([HAVE_DECL_SQLITE_STMTSTATUS_FULLSCAN_STEP],
            [depending on SQLite library version.])
AH_TEMPLATE([HAVE_DECL_SQLITE_STMTSTATUS_SORT],
            [depending on SQLite library version.])
AH_TEMPLATE([HAVE_DECL_SQLITE_STMTSTATUS_AUTOINDEX],
            [depending on SQLite library version.])
AH_TEMPLATE([HAVE_DECL_SQLITE_DBSTATUS_STMT_USED],
            [depending on SQLite library version.])
AH_TEMPLATE([HAVE_DECL_SQLITE_TESTCTRL_EXPLAIN_STMT],
            [depending on SQLite library version.])
AH_TEMPLATE([HAVE_DECL_SQLITE_FCNTL_VFSNAME],
            [depending on SQLite library version.])

# Checks for header files.
AC_CHECK_HEADERS(stdlib.h,, [AC_MSG_ERROR([cannot find stdlib.h, bailing out])])
AC_CHECK_HEADERS(stdio.h,, [AC_MSG_ERROR([cannot find stdio.h, bailing out])])
AC_CHECK_HEADERS(string.h,, [AC_MSG_ERROR([cannot find string.h, bailing out])])
AC_CHECK_HEADERS(memory.h,, [AC_MSG_ERROR([cannot find memory.h, bailing out])])
AC_CHECK_HEADERS(math.h,, [AC_MSG_ERROR([cannot find math.h, bailing out])])
AC_CHECK_HEADERS(float.h,, [AC_MSG_ERROR([cannot find float.h, bailing out])])
AC_CHECK_HEADERS(fcntl.h,, [AC_MSG_ERROR([cannot find fcntl.h, bailing out])])
AC_CHECK_HEADERS(inttypes.h,, [AC_MSG_ERROR([cannot find inttypes.h, bailing out])])
AC_CHECK_HEADERS(stddef.h,, [AC_MSG_ERROR([cannot find stddef.h, bailing out])])
AC_CHECK_HEADERS(stdint.h,, [AC_MSG_ERROR([cannot find stdint.h, bailing out])])
AC_CHECK_HEADERS(sys/time.h,, [AC_MSG_ERROR([cannot find sys/time.h, bailing out])])
AC_CHECK_HEADERS(unistd.h,, [AC_MSG_ERROR([cannot find unistd.h, bailing out])])
AC_CHECK_HEADERS(sqlite3.h,, [AC_MSG_ERROR([cannot find sqlite3.h, bailing out])])
AC_CHECK_HEADERS(sqlite3ext.h,, [AC_MSG_ERROR([cannot find sqlite3ext.h, bailing out])])

# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
AC_C_VOLATILE

# Checks for library functions.
AC_FUNC_LSTAT
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_FUNC_MEMCMP
AC_FUNC_STAT
AC_FUNC_STRFTIME
AC_CHECK_FUNCS([memset sqrt strcasecmp strerror strncasecmp strstr fdatasync ftruncate getcwd gettimeofday localtime_r memmove strerror])
 
# Checks for installed libraries
AC_CHECK_LIB(sqlite3,sqlite3_prepare_v2,,AC_MSG_ERROR(['libsqlite3' is required but it doesn't seem to be installed on this system.]),-lm)

AC_CONFIG_FILES([Makefile])

#-----------------------------------------------------------------------
#   --enable-readline
#
AC_ARG_ENABLE(readline, [AS_HELP_STRING(
  [--enable-readline],
  [use readline in shell tool (yes, no) [default=yes]])],
  [], [enable_readline=yes])
if test x"$enable_readline" != xno ; then
  sLIBS=$LIBS
  LIBS=""
  AC_SEARCH_LIBS(tgetent, curses, [], [])
  AC_SEARCH_LIBS(readline, readline, [], [enable_readline=no])
  AC_CHECK_FUNCS(readline, [], [])
  READLINE_LIBS=$LIBS
  LIBS=$sLIBS
fi
AC_SUBST(READLINE_LIBS)

AC_CHECK_HEADERS(expat.h,, [AC_MSG_ERROR([cannot find expat.h, bailing out])])
AC_CHECK_LIB(expat,XML_ParserCreate,,AC_MSG_ERROR(['expat' is required but it doesn't seem to be installed on this system.]))
AC_CHECK_LIB(proj,pj_init_plus,,AC_MSG_ERROR(['libproj' is required but it doesn't seem to be installed on this system.]),-lm)

#-----------------------------------------------------------------------
#   --with-geosconfig
#
AC_ARG_WITH([geosconfig],
      [AS_HELP_STRING([--with-geosconfig=FILE], [specify an alternative geos-config file])],
	[GEOSCONFIG="$withval"], [GEOSCONFIG=""])
if test "x$GEOSCONFIG" = "x"; then
      # GEOSCONFIG was not specified, so search within the current path
      AC_PATH_PROG([GEOSCONFIG], [geos-config])	
      # If we couldn't find geos-config, display an error
      if test "x$GEOSCONFIG" = "x"; then
              AC_MSG_ERROR([could not find geos-config within the current path. You may need to try re-running configure with a --with-geosconfig parameter.])
      fi
else
      # GEOSCONFIG was specified; display a message to the user
      if test "x$GEOSCONFIG" = "xyes"; then
              AC_MSG_ERROR([you must specify a parameter to --with-geosconfig, e.g. --with-geosconfig=/path/to/geos-config])
      else
              if test -f $GEOSCONFIG; then
                      AC_MSG_RESULT([Using user-specified geos-config file: $GEOSCONFIG])
              else
                      AC_MSG_ERROR([the user-specified geos-config file $GEOSCONFIG does not exist])
              fi     
      fi
fi
# Extract the linker and include flags
GEOS_LDFLAGS=`$GEOSCONFIG --ldflags`
GEOS_CPPFLAGS=-I`$GEOSCONFIG --includes`
AC_SUBST([GEOS_LDFLAGS])
AC_SUBST([GEOS_CPPFLAGS])	
# Ensure that we can parse geos_c.h
CPPFLAGS_SAVE="$CPPFLAGS"
CPPFLAGS="$GEOS_CPPFLAGS"
AC_CHECK_HEADERS([geos_c.h],, [AC_MSG_ERROR([could not find geos_c.h - you may need to specify the directory of a geos-config file using --with-geosconfig])])
CPPFLAGS="$CPPFLAGS_SAVE"	
# Ensure we can link against libgeos_c
LIBS_SAVE="$LIBS"
LIBS="$GEOS_LDFLAGS"
AC_SEARCH_LIBS(GEOSTopologyPreserveSimplify,geos_c,,AC_MSG_ERROR([could not find libgeos_c - you may need to specify the directory of a geos-config file using --with-geosconfig]))
LIBS="$LIBS_SAVE"
LIBS=$LIBS$GEOS_LDFLAGS' -lgeos_c'

PKG_CHECK_MODULES([LIBSPATIALITE], [spatialite], , AC_MSG_ERROR(['libspatialite' is required but it doesn't seem to be installed on this system.]))
AC_SUBST(LIBSPATIALITE_CFLAGS)
# testing for libspatialite-amalgamation
if test "x$(pkg-config --cflags spatialite|grep "DSPATIALITE_AMALGAMATION=1")" != "x"; then
  AC_DEFINE(SPATIALITE_AMALGAMATION, 1)
fi
AC_SUBST(LIBSPATIALITE_LIBS)

#-----------------------------------------------------------------------
#   --enable-freexl
#
AC_ARG_ENABLE(freexl, [AS_HELP_STRING(
  [--enable-freexl], [enables FreeXL inclusion [default=yes]])],
  [], [enable_freexl=yes])
if test x"$enable_freexl" != "xno"; then
  PKG_CHECK_MODULES([LIBFREEXL], [freexl], , AC_MSG_ERROR(['libfreexl' is required but it doesn't seem to be installed on this system.]))
  AC_SUBST(LIBFREEXL_CFLAGS)
  AC_SUBST(LIBFREEXL_LIBS)
else
  AC_DEFINE(OMIT_FREEXL)
fi

#-----------------------------------------------------------------------
#   --enable-readosm
#
AC_ARG_ENABLE(readosm, [AS_HELP_STRING(
  [--enable-readosm], [enables ReadOSM inclusion [default=yes]])],
  [], [enable_readosm=yes])
if test x"$enable_readosm" != "xno"; then
  AC_SUBST(LIBREADOSM_LIBS)PKG_CHECK_MODULES([LIBREADOSM], [readosm], , AC_MSG_ERROR(['libreadosm' is required but it doesn't seem to be installed on this system.]))
  AC_SUBST(LIBREADOSM_CFLAGS)
  AC_SUBST(LIBREADOSM_LIBS)
else
  AC_DEFINE(OMIT_READOSM)
  NOREADOSM="true"
fi

AM_CONDITIONAL([NO_READOSM], [test "$NOREADOSM" = "true"])

#-----------------------------------------------------------------------
#   --enable-libxml2
#
AC_ARG_ENABLE(libxml2, [AS_HELP_STRING(
  [--enable-libxml2], [enables libxml2 inclusion [default=yes]])],
  [], [enable_libxml2=yes])
if test x"$enable_libxml2" != "xno"; then
  PKG_CHECK_MODULES([LIBXML2], [libxml-2.0], , AC_MSG_ERROR(['libxml2' is required but it doesn't seem to be installed on this system.]))
  AC_SUBST(LIBXML2_CFLAGS)
  AC_SUBST(LIBXML2_LIBS)
  AC_DEFINE(ENABLE_LIBXML2)
fi

# checks for SQLite version-depending constants
AC_CHECK_DECL([SQLITE_CONFIG_URI],
  [AC_DEFINE(HAVE_DECL_SQLITE_CONFIG_URI)],[],[[#include <sqlite3.h>]])
AC_CHECK_DECL([SQLITE_DBSTATUS_LOOKASIDE_USED],
  [AC_DEFINE(HAVE_DECL_SQLITE_DBSTATUS_LOOKASIDE_USED)],[],[[#include <sqlite3.h>]])
AC_CHECK_DECL([SQLITE_DBSTATUS_LOOKASIDE_HIT],
  [AC_DEFINE(HAVE_DECL_SQLITE_DBSTATUS_LOOKASIDE_HIT)],[],[[#include <sqlite3.h>]])
AC_CHECK_DECL([SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE],
  [AC_DEFINE(HAVE_DECL_SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE)],[],[[#include <sqlite3.h>]])
AC_CHECK_DECL([SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL],
  [AC_DEFINE(HAVE_DECL_SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL)],[],[[#include <sqlite3.h>]])
AC_CHECK_DECL([SQLITE_DBSTATUS_CACHE_USED],
  [AC_DEFINE(HAVE_DECL_SQLITE_DBSTATUS_CACHE_USED)],[],[[#include <sqlite3.h>]])
AC_CHECK_DECL([SQLITE_DBSTATUS_CACHE_HIT],
  [AC_DEFINE(HAVE_DECL_SQLITE_DBSTATUS_CACHE_HIT)],[],[[#include <sqlite3.h>]])
AC_CHECK_DECL([SQLITE_DBSTATUS_CACHE_MISS],
  [AC_DEFINE(HAVE_DECL_SQLITE_DBSTATUS_CACHE_MISS)],[],[[#include <sqlite3.h>]])
AC_CHECK_DECL([SQLITE_DBSTATUS_CACHE_WRITE],
  [AC_DEFINE(HAVE_DECL_SQLITE_DBSTATUS_CACHE_WRITE)],[],[[#include <sqlite3.h>]])
AC_CHECK_DECL([SQLITE_DBSTATUS_SCHEMA_USED],
  [AC_DEFINE(HAVE_DECL_SQLITE_DBSTATUS_SCHEMA_USED)],[],[[#include <sqlite3.h>]])
AC_CHECK_DECL([SQLITE_DBSTATUS_STMT_USED],
  [AC_DEFINE(HAVE_DECL_SQLITE_DBSTATUS_STMT_USED)],[],[[#include <sqlite3.h>]])
AC_CHECK_DECL([SQLITE_STMTSTATUS_FULLSCAN_STEP],
  [AC_DEFINE(HAVE_DECL_SQLITE_STMTSTATUS_FULLSCAN_STEP)],[],[[#include <sqlite3.h>]])
AC_CHECK_DECL([SQLITE_STMTSTATUS_SORT],
  [AC_DEFINE(HAVE_DECL_SQLITE_STMTSTATUS_SORT)],[],[[#include <sqlite3.h>]])
AC_CHECK_DECL([SQLITE_STMTSTATUS_AUTOINDEX],
  [AC_DEFINE(HAVE_DECL_SQLITE_STMTSTATUS_AUTOINDEX)],[],[[#include <sqlite3.h>]])
AC_CHECK_DECL([SQLITE_TESTCTRL_EXPLAIN_STMT],
  [AC_DEFINE(HAVE_DECL_SQLITE_TESTCTRL_EXPLAIN_STMT)],[],[[#include <sqlite3.h>]])
AC_CHECK_DECL([SQLITE_FCNTL_VFSNAME],
  [AC_DEFINE(HAVE_DECL_SQLITE_FCNTL_VFSNAME)],[],[[#include <sqlite3.h>]])

AC_OUTPUT