File: configure.ac

package info (click to toggle)
spatialite-gui 2.0.0~devel2-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 6,308 kB
  • ctags: 5,379
  • sloc: cpp: 93,011; sh: 11,192; makefile: 65
file content (328 lines) | stat: -rw-r--r-- 14,467 bytes parent folder | download | duplicates (3)
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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.61)
AC_INIT(spatialite-gui, 2.0.0-devel, a.furieri@lqt.it)
AC_LANG(C)
AC_CONFIG_MACRO_DIR([m4])

AM_INIT_AUTOMAKE([foreign])
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([ENABLE_LIBXML2],
            [Should be defined in order to enable LIBXML2 support.])
AH_TEMPLATE([OMIT_WEBP],
            [Should be defined in order to disable WebP support.])
AH_TEMPLATE([OPENJPEG_2_1],
            [testing for OpenJpeg 2.1])
AH_TEMPLATE([OMIT_OPENJPEG],
            [Should be defined in order to disable OpenJpeg support.])
AH_TEMPLATE([OMIT_CHARLS],
            [Should be defined in order to disable CharLS support.])
AH_TEMPLATE([OMIT_RL2EXTRA],
            [Should be defined in order to disable RasterLite2 extended support.])
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.])

# 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

AC_ARG_WITH([wxconfig],
      [AS_HELP_STRING([--with-wxconfig=FILE], [specify an alternative wx-config file])],
	[WXCONFIG="$withval"], [WXCONFIG=""])
if test "x$WXCONFIG" = "x"; then
      # WXCONFIG was not specified, so search within the current path
      AC_PATH_PROG([WXCONFIG], [wx-config])	
      # If we couldn't find wx-config, display an error
      if test "x$WXCONFIG" = "x"; then
              AC_MSG_ERROR([could not find wx-config within the current path. You may need to try re-running configure with a --with-wxconfig parameter.])
      fi
else
      # WXCONFIG was specified; display a message to the user
      if test "x$WXCONFIG" = "xyes"; then
              AC_MSG_ERROR([you must specify a parameter to --with-wxconfig, e.g. --with-wxconfig=/path/to/wx-config])
      else
              if test -f $WXCONFIG; then
                      AC_MSG_RESULT([Using user-specified wx-config file: $WXCONFIG])
              else
                      AC_MSG_ERROR([the user-specified wx-config file $WXCONFIG does not exist])
              fi     
      fi
fi
CXXFLAGS=`$WXCONFIG --cxxflags`
AM_CXXFLAGS=`$WXCONFIG --cxxflags`
WX_LIBS=`$WXCONFIG --libs std,aui`
AC_SUBST(WX_LIBS)

# 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 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_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'

#-----------------------------------------------------------------------
#   --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-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

#-----------------------------------------------------------------------
#   --enable-openjpeg
#
AC_ARG_ENABLE(openjpeg, [AS_HELP_STRING(
  [--enable-openjpeg], [enables OpenJpeg inclusion [default=yes]])],
  [], [enable_openjpeg=yes])
    if test x"$enable_openjpeg" != "xno"; then
    #
    # testing OpenJpeg-2 headers
    # they could be either on -/include/openjpeg-2.0
    #                   or on -/include/openjpeg-2.1
    #
    AC_CHECK_HEADERS(openjpeg-2.0/openjpeg.h)
    AC_CHECK_HEADERS(openjpeg-2.1/openjpeg.h)
    if test x"$ac_cv_header_openjpeg_2_0_openjpeg_h" != x"yes" &&
        test x"$ac_cv_header_openjpeg_2_1_openjpeg_h" != x"yes";
    then
        AC_MSG_ERROR(['OpenJpeg-2' is required but the header (openjpeg.h) doesn't seem to be installed on this system])
    fi 
    AC_CHECK_LIB(openjp2,opj_create_decompress,,AC_MSG_ERROR(['libopenjp2' is required but it doesn't seems to be installed on this system.]),-lm)
    # testing for OpenJpeg 2.0 or 2.1
    AC_COMPILE_IFELSE(  [AC_LANG_PROGRAM([[#ifdef HAVE_OPENJPEG_2_1_OPENJPEG_H
                                       #include <openjpeg-2.1/openjpeg.h>
                                       #else
                                       #include <openjpeg-2.0/openjpeg.h>
                                       #endif]],
                                     [[void *d; opj_stream_t *s; opj_stream_set_user_data (s, &d, NULL);]])],
                    [
                      AC_MSG_RESULT([yes])
                      AC_DEFINE(OPENJPEG_2_1)
                    ],
                    [AC_MSG_RESULT([no])]
                 )
else
  AC_DEFINE(OMIT_OPENJPEG)
fi
#-----------------------------------------------------------------------

#-----------------------------------------------------------------------
#   --enable-webp
#
AC_ARG_ENABLE(webp, [AS_HELP_STRING(
  [--enable-webp], [enables WebP inclusion [default=yes]])],
  [], [enable_webp=yes])
if test x"$enable_webp" != "xno"; then
    PKG_CHECK_MODULES([LIBWEBP], [libwebp], , AC_MSG_ERROR(['libwebp' is required but it doesn't seems to be installed on this system.]))
    AC_SUBST(LIBWEBP_CFLAGS)
    AC_SUBST(LIBWEBP_LIBS)
else
  AC_DEFINE(OMIT_WEBP)
fi
#-----------------------------------------------------------------------

#-----------------------------------------------------------------------
#   --enable-charls
#
AC_ARG_ENABLE(charls, [AS_HELP_STRING(
  [--enable-charls], [enables CharLS inclusion [default=yes]])],
  [], [enable_charls=yes])
if test x"$enable_charls" != "xno"; then
    AC_CHECK_HEADERS(CharLS/interface.h,, [AC_MSG_ERROR([cannot find CharLS/interface.h, bailing out])])
    AC_CHECK_LIB(CharLS,JpegLsEncode,,AC_MSG_ERROR(['libCharLS' is required but it doesn't seems to be installed on this system.]),-lm)
else
  AC_DEFINE(OMIT_CHARLS)
fi
#-----------------------------------------------------------------------

PKG_CHECK_MODULES([LIBLZMA], [liblzma], , AC_MSG_ERROR(['liblzma' is required but it doesn't seems to be installed on this system.]))
AC_SUBST(LIBLZMA_CFLAGS)
AC_SUBST(LIBLZMA_LIBS)
    
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)

PKG_CHECK_MODULES([LIBRASTERLITE2], [rasterlite2], , AC_MSG_ERROR(['librasterlite2' is required but it doesn't seem to be installed on this system.]))
AC_SUBST(LIBRASTERLITE2_CFLAGS)
AC_SUBST(LIBRASTERLITE2_LIBS)

#-----------------------------------------------------------------------
#   --enable-rl2extra
#
AC_ARG_ENABLE(rl2extra, [AS_HELP_STRING(
  [--enable-rl2extra], [enables RasterLite2 extended support [default=no]])],
  [], [enable_rl2extra=no])
if test x"$enable_rl2extra" != "xyes"; then
  AC_DEFINE(OMIT_RL2EXTRA)
fi
#-----------------------------------------------------------------------

AC_CONFIG_FILES([Makefile \
	icons/Makefile \
	win_resource/Makefile \
	gnome_resource/Makefile \
	mac_resource/Makefile])

#-----------------------------------------------------------------------
#   --enable-sqlite_stmtstatus_autoindex
#
AC_ARG_ENABLE(sqlite_stmtstatus_autoindex, [AS_HELP_STRING(
  [--enable-sqlite_stmtstatus_autoindex], [enables SQLITE_STMTSTATUS_AUTOINDEX [default=yes]])],
  [], [sqlite_stmtstatus_autoindex=yes])
if test x"$enable_sqlite_stmtstatus_autoindex" != "xno"; then
  OMIT_SQLITE_STMTSTATUS_AUTOINDEX_FLAGS=
else
  OMIT_SQLITE_STMTSTATUS_AUTOINDEX_FLAGS=-DOMIT_SQLITE_STMTSTATUS_AUTOINXED
fi
AC_SUBST(OMIT_SQLITE_STMTSTATUS_AUTOINDEX_FLAGS)

# checks for SQLite version-depending constants
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_OUTPUT