forked from qgis/QGIS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
582 lines (498 loc) · 17.9 KB
/
configure.in
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
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
dnl Process this file with autoconf to produce a configure script.
dnl $Id$
AC_INIT
dnl AC_CONFIG_SRCDIR([libtool])
dnl header sentinals for qgsconfig.h
AH_TOP(
[#ifndef QGSCONFIG_H
#define QGSCONFIG_H
])
AH_BOTTOM(
[#endif]
)
AC_PREREQ(2.52)
AC_CONFIG_HEADERS(qgsconfig.h)
dnl ---------------------------------------------------------------------------
dnl version number
dnl Note the convention here is to name development versions with a base
dnl name of the last release, the word "devel", and an EXTRA_VERSION
dnl number. This means that development work on 0.8 will be versioned as
dnl 0.7devel1, 0.7devel2, etc.
dnl ---------------------------------------------------------------------------
MAJOR_VERSION=0
MINOR_VERSION=8
MICRO_VERSION=0
EXTRA_VERSION=0
if test $EXTRA_VERSION -eq 0; then
VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}
else
VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}-Preview-${EXTRA_VERSION}
fi
dnl ---------------------------------------------------------------------------
dnl library interfase version number
dnl change when lib interface changes
dnl see http://www.gnu.org/software/libtool/manual.html#TOC32
dnl ---------------------------------------------------------------------------
INTERFACE_VERSION=1:0:0
AM_INIT_AUTOMAKE(qgis, ${VERSION})
AC_SUBST(MAJOR_VERSION)
AC_SUBST(MINOR_VERSION)
AC_SUBST(MICRO_VERSION)
AC_SUBST(EXTRA_VERSION)
AC_SUBST(INTERFACE_VERSION)
AC_PREFIX_PROGRAM(gcc)
AC_PROG_CXX
AC_LANG([C++])
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
dnl ---------------------------------------------------------------------------
dnl Check for Endian stuff to manage big endian anomalies
dnl ---------------------------------------------------------------------------
AC_C_BIGENDIAN
AC_CHECK_HEADERS([endian.h])
AC_CHECK_HEADERS([machine/endian.h])
dnl ---------------------------------------------------------------------------
dnl check lib64 environment
dnl ---------------------------------------------------------------------------
AQ_CHECK_LIB64
dnl ---------------------------------------------------------------------------
dnl svnversion check
dnl ---------------------------------------------------------------------------
AC_CHECK_PROG(HAVE_SVNVERSION, [svnversion], [yes], [no])
dnl ---------------------------------------------------------------------------
dnl Qt check
dnl ---------------------------------------------------------------------------
AQ_CHECK_QT4
dnl ---------------------------------------------------------------------------
dnl Python
dnl ---------------------------------------------------------------------------
AX_PYTHON
dnl ---------------------------------------------------------------------------
dnl GDAL/OGR
dnl ---------------------------------------------------------------------------
AQ_CHECK_GDAL
dnl ---------------------------------------------------------------------------
dnl GEOS
dnl ---------------------------------------------------------------------------
AQ_CHECK_GEOS
if test x"$ac_geos" = "xno"; then
AC_MSG_ERROR("GEOS is required and was not found")
fi
dnl ---------------------------------------------------------------------------
dnl PROJ
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(projdir,
AC_HELP_STRING([--with-projdir=DIR],
[ Proj4 installation directory, e.g. '--with-projdir=/usr/local']),
[
if test x"$with_projlibdir" = "x" ; then
AC_MSG_CHECKING([for Proj4 library in $with_projdir/lib])
PROJ_LIB="-L$with_projdir/lib -lproj"
if test -d "$with_projdir/lib" ; then
projlibdir="$with_projdir/lib"
fi
else
AC_MSG_CHECKING([for Proj4 library in $with_projlibdir])
PROJ_LIB="-L$with_projlibdir -lproj"
if test -d "$with_projlibdir" ; then
projlibdir="$with_projlibdir"
fi
fi
if test x"$projlibdir" = "x" ; then
AC_MSG_ERROR([*** directory $projlibdir does not exist.])
else
LDFLAGS="$LDFLAGS $PROJ_LIB"
CPPFLAGS="$CPPFLAGS -I$with_projdir/include"
AC_MSG_RESULT(["$with_projdir exists"])
AC_CHECK_HEADERS(proj_api.h,
[PROJ_INC="-I$with_projdir/include"],
[AC_MSG_ERROR([*** Proj4 headers not found.])])
AC_CHECK_LIB(proj,pj_is_latlong,
[have_proj_lib=yes],
[AC_MSG_ERROR([*** Proj4 library not found.])])
fi
],
[
AC_CHECK_HEADERS(proj_api.h,[PROJ_INC=""],
[AC_MSG_ERROR([*** Proj4 headers not found.])])
]
AC_CHECK_LIB(proj,pj_is_latlong,
[
have_proj_lib=yes
PROJ_LIB="-lproj"
],
[
AC_MSG_ERROR([Proj4 is required and was not found.])
])
)
dnl A dummy section that's here just to produce some text for the
dnl configure --help output. The actual use of projlibdir is in
dnl the AC_ARG_WITH(projdir) macro
AC_ARG_WITH(projlibdir,AC_HELP_STRING([--with-projlibdir=DIR],
[ Proj4 library directory, optional, use when library is in a different directory to that derived by appending /lib to --with-projdir ]),[],[])
AC_SUBST(PROJ_INC)
AC_SUBST(PROJ_LIB)
dnl ---------------------------------------------------------------------------
dnl SQLITE
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(sqlite3dir,
AC_HELP_STRING([--with-sqlite3dir=DIR],
[ sqlite3 installation directory, e.g. '--with-sqlite3=/usr/local']),
[
AC_MSG_CHECKING([for Sqlite3 library in $with_sqlite3dir])
if test -d "$with_sqlite3dir/lib"; then
LDFLAGS="$LDFLAGS -L$with_sqlite3dir/lib"
CPPFLAGS="$CPPFLAGS -I$with_sqlite3dir/include"
AC_MSG_RESULT(["$with_sqlite3dir exists"])
AC_CHECK_HEADERS(sqlite3.h,
[SQLITE3_INC="-I$with_sqlite3dir/include"],
[
AC_MSG_ERROR([*** Sqlite3 headers not found.])
])
AC_CHECK_LIB(sqlite3,sqlite3_open,
[
have_sqlite3_lib=yes
SQLITE3_LIB="-L$with_sqlite3dir/lib -lsqlite3"
],
[
AC_MSG_ERROR([*** Sqlite3 library not found.])
])
else
AC_MSG_ERROR([*** directory $with_sqlite3dir does not exist.])
fi
],
[
AC_CHECK_HEADERS(sqlite3.h,[SQLITE3_INC=""],
[
AC_MSG_ERROR([*** Sqlite3 headers not found.])
])
AC_CHECK_LIB(sqlite3,sqlite3_open,
[
have_sqlite3_lib=yes
SQLITE3_LIB="-lsqlite3"
],
[
AC_MSG_ERROR([*** Sqlite3 library not found.])
])
]
)
AC_SUBST(SQLITE3_INC)
AC_SUBST(SQLITE3_LIB)
dnl ---------------------------------------------------------------------------
dnl PostgreSQL
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(postgresql,
AC_HELP_STRING([--with-postgresql=path],
[PostgreSQL (PostGIS) Support (full path to pg_config)]))
AC_MSG_CHECKING([for PostgreSQL])
# pg_config cannot be used with cross compiler
# we expect that libs and header files are in standard dirs
case "${host}" in
*-mingw*)
if test x"$with_postgresql" = "xyes" -o x"$with_postgresql" = "x" ; then
AC_MSG_RESULT([yes])
PG_LIB="-lpq"
PG_INC=""
AC_DEFINE([HAVE_POSTGRESQL],1,
[Define to 1 if PostgreSQL is available])
ac_postgresql="yes"
fi
;;
*)
if test x"$with_postgresql" = "xyes" -o x"$with_postgresql" = "x" ; then
AC_MSG_RESULT([yes])
AC_PATH_PROG([PG_CONFIG], [pg_config], [no])
elif test x"$with_postgresql" = "xno" ; then
AC_MSG_RESULT([no])
PG_CONFIG=no
else
AC_MSG_RESULT([yes])
PG_CONFIG="$with_postgresql/pg_config"
fi
if test x"$PG_CONFIG" != "xno" ; then
PG_LIB="-L`$PG_CONFIG --libdir` -lpq"
PG_INC="-I`$PG_CONFIG --includedir`"
AC_MSG_CHECKING([for postgreSQL libs])
AC_MSG_RESULT([$PG_LIB])
AC_DEFINE([HAVE_POSTGRESQL],1,
[Define to 1 if PostgreSQL is available])
ac_postgresql="yes"
ac_postgresql_version=`$PG_CONFIG --version | sed -e 's#PostgreSQL ##'`
postgresql_version_string="(Version $ac_postgresql_version)"
else
ac_postgresql="no"
fi
;;
esac
AC_SUBST(PG_INC)
AC_SUBST(PG_LIB)
AM_CONDITIONAL([HAVE_POSTGRESQL], [test "$ac_postgresql" = "yes"])
dnl ---------------------------------------------------------------------------
dnl checking if gdal and/or postgresql are available
dnl ---------------------------------------------------------------------------
if test x"$ac_postgresql" = "xno" -a x"$ac_gdalogr" = "xno"; then
AC_MSG_ERROR("QGIS without GDAL(with OGR support) and PostgreSQL makes no sense!")
fi
dnl ---------------------------------------------------------------------------
dnl support for lex/yacc tools - for search strings parser
dnl ---------------------------------------------------------------------------
AC_PROG_YACC
AM_PROG_LEX
# test whether they have been really found
# (by default if not found autoconf will use a stub)
if test x"$LEX" != "xflex" -a x"$LEX" != "xlex" ; then
AC_MSG_ERROR("Lex/Flex is not available!")
fi
if test x"$YACC" != "xbison" -a x"$YACC" != "xyacc" -a x"$YACC" != "xbison -y" ; then
AC_MSG_ERROR("Yacc/Bison is not available!")
fi
dnl ---------------------------------------------------------------------------
dnl SPIT plugin
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(spit,
AC_HELP_STRING([--disable-spit],
[disable Shapefile to PostgreSQL (PostGIS) import plugin (built by default with PostgreSQL support)]),
[ac_spit=$enableval], [ac_spit=yes])
AC_MSG_CHECKING([for SPIT])
if test x"$ac_spit" = "xyes"; then
if test x"$ac_postgresql" = "xyes" -a x"$ac_gdalogr" = "xyes"; then
AC_MSG_RESULT([yes])
else
ac_spit="no"
if test x"$ac_postgresql" = "xno" ; then
AC_MSG_RESULT([no (PostgreSQL not available)])
else
AC_MSG_RESULT([no (GDAL with OGR support not available)])
fi
fi
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL([HAVE_SPIT], [test "$ac_spit" = "yes"])
dnl ---------------------------------------------------------------------------
dnl GRASS package
dnl ---------------------------------------------------------------------------
AC_CHECK_LIB(util, openpty)
AC_ARG_WITH(grass,
AC_HELP_STRING([--with-grass=DIR],[GRASS Support (full path to GRASS binary package, e.g. --with-grass=/usr1/grass57/dist.i686-pc-linux-gnu)]))
AC_MSG_CHECKING([for GRASS])
if test -n "$with_grass" -a x"$with_grass" != "xno"; then
# I don't know how to add library path to AC_CHECK_LIB()
if test ! -f "$GISLIB"; then
GISLIB=`ls $with_grass/${_lib}/libgrass_gis.dylib 2> /dev/null`
fi
if test ! -f "$GISLIB"; then
GISLIB=`ls $with_grass/${_lib}/libgrass_gis.so 2> /dev/null`
fi
if test ! -f "$GISLIB"; then
GISLIB=`ls $with_grass/${_lib}/libgrass_gis.a 2> /dev/null`
fi
if test ! -f "$GISLIB"; then
GISLIB=`ls $with_grass/${_lib}/grass_gis.dll 2> /dev/null`
fi
if test ! -f "$GISLIB"; then
AC_MSG_ERROR( [GRASS library not found in $with_grass/${_lib}] )
fi
GRASS_LIB="-L$with_grass/${_lib} -lgrass_vect -lgrass_dig2 -lgrass_dbmiclient -lgrass_dbmibase -lgrass_shape -lgrass_dgl -lgrass_rtree -lgrass_gis -lgrass_datetime -lgrass_linkm -lgrass_form -lgrass_gproj"
if test "$ac_cv_lib_util_openpty" = yes; then
HAVE_OPENPTY=1
GRASS_LIB="$GRASS_LIB -lutil"
fi
GISINC=`ls $with_grass/include/grass/gis.h`
if test ! -f "$GISINC"; then
AC_MSG_ERROR( [GRASS headers not found] )
fi
GRASS_BASE="$with_grass"
GRASS_INC="$with_grass/include/"
HAVE_GRASS=1
AC_MSG_RESULT([yes])
ac_grass="yes"
else
AC_MSG_RESULT([no])
ac_grass="no"
fi
AC_SUBST(GRASS_BASE)
AC_SUBST(HAVE_GRASS)
AC_SUBST(HAVE_OPENPTY)
AC_SUBST(GRASS_LIB)
AC_SUBST(GRASS_INC)
AM_CONDITIONAL([HAVE_GRASS], [test "$ac_grass" = "yes"])
dnl ---------------------------------------------------------------------------
dnl GPX and GPS plugins
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(gpx,
AC_HELP_STRING([--disable-gpx],
[Disable the GPX provider and the GPS plugin (built by default if libexpat is found)]),
[ac_gpx=$enableval], [ac_gpx=yes])
AC_MSG_CHECKING([GPX provider and GPS plugin should be installed (default: yes)])
AC_MSG_RESULT([$ac_gpx])
have_expat_lib=no
if [ test $ac_gpx = yes ] ; then
AC_CHECK_LIB(expat, XML_ParserCreate, have_expat_lib=yes)
fi
AM_CONDITIONAL([HAVE_EXPAT], [test "$have_expat_lib" = "yes"])
dnl ---------------------------------------------------------------------------
dnl unittests
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(unittests,
AC_HELP_STRING([--enable-unittests],
[Enable the compilation of unittests]),
[ac_com=yes], [ac_com=no])
AC_MSG_CHECKING([Whether to build unit tests])
AC_MSG_RESULT([$ac_com])
AM_CONDITIONAL([WITH_UNITTESTS], [test "$ac_com" = "yes"])
dnl ---------------------------------------------------------------------------
dnl Georeferencing plugin
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(georef,
AC_HELP_STRING([--disable-georef],
[Disable the georeferencing plugin (built by default if libgsl is found)]),
[ac_georef=$enableval], [ac_georef=yes])
ac_gsl=no
AC_MSG_CHECKING([if the georeferencer plugin should be built])
AC_MSG_RESULT($ac_georef)
if [ test $ac_georef = yes ] ; then
AM_PATH_GSL(1.5.9, [ac_gsl=yes], [ac_gsl=no])
fi
AM_CONDITIONAL([HAVE_GSL], [test "$ac_gsl" = "yes"])
dnl ---------------------------------------------------------------------------
dnl WFS plugin
dnl ---------------------------------------------------------------------------
AC_MSG_CHECKING([for WFS])
if test -n "$with_wfs" -a x"$with_wfs" != "xno"; then
ac_wfs=yes
AC_DEFINE([HAVE_WFS],1,
[Define to 1 if wfs plugin/provider is requested])
AC_MSG_RESULT([yes])
else
ac_wfs=no
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL([HAVE_WFS], [test "$ac_wfs" = "yes"])
dnl ---------------------------------------------------------------------------
dnl Debugging
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug],
[Enable debuging messages [[default=no]]]),
[ac_debug=$enableval], [ac_debug=no])
AC_MSG_CHECKING([if debug statements should be sent to stdout/stderr])
if test x"$ac_debug" = "xno" ; then
DEBUG_QGIS=-DNO_DEBUG
AC_MSG_RESULT([no])
else
DEBUG_QGIS=-DQGISDEBUG
AC_MSG_RESULT([yes])
fi
AC_SUBST(DEBUG_QGIS)
#echo ${prefix}/lib
#ac_libdir=${prefix}/lib/$PACKAGE
#AC_MSG_CHECKING([plugin install directory])
#AC_MSG_RESULT([$libdir])
#echo Plugins will be installed in $libdir
AC_CONFIG_FILES([
Makefile
Makefile.win.rules
create_qm_files.sh
doc/Makefile
doc/images/Makefile
doc/install_guide/Makefile
doc/plugins/delimited_text/Makefile
doc/plugins/geoprocessing/buffer/Makefile
doc/plugins/geoprocessing/Makefile
doc/plugins/Makefile
i18n/Makefile
images/Makefile
images/developers/Makefile
images/icons/Makefile
images/north_arrows/Makefile
images/splash/Makefile
images/svg/biology/Makefile
images/svg/geometric/Makefile
images/svg/gpsicons/Makefile
images/svg/icon/Makefile
images/svg/Makefile
images/svg/north_arrows/Makefile
images/svg/symbol/Makefile
images/svg/sport/Makefile
images/themes/default/Makefile
images/themes/Makefile
images/themes/nkids/Makefile
resources/Makefile
resources/context_help/Makefile
src/Makefile
src/app/Makefile
src/core/Makefile
src/helpviewer/Makefile
src/gui/Makefile
src/mac/Contents/Makefile
src/mac/Contents/Resources/Makefile
src/mac/Makefile
src/plugins/Makefile
src/plugins/copyright_label/Makefile
src/plugins/delimited_text/Makefile
src/plugins/geoprocessing/Makefile
src/plugins/georeferencer/Makefile
src/plugins/gps_importer/Makefile
src/plugins/grass/config/Makefile
src/plugins/grass/Makefile
src/plugins/grass/modules/Makefile
src/plugins/grass/themes/default/Makefile
src/plugins/grass/themes/Makefile
src/plugins/grid_maker/Makefile
src/plugins/north_arrow/Makefile
src/plugins/scale_bar/Makefile
src/plugins/spit/Makefile
src/plugins/wfs/Makefile
src/providers/Makefile
src/providers/delimitedtext/Makefile
src/providers/gpx/Makefile
src/providers/grass/Makefile
src/providers/ogr/Makefile
src/providers/postgres/Makefile
src/providers/wms/Makefile
src/providers/wfs/Makefile
src/ui/Makefile
tools/Makefile
tools/mapserver_export/Makefile
tools/qgis_config/Makefile
qgis.spec
src/plugins/navigation/Makefile
])
AC_OUTPUT
dnl Output the configuration summary
echo ""
echo "=========================================="
echo "$PACKAGE $VERSION"
echo "------------------------------------------"
echo "GDAL/OGR : $ac_gdalogr (Version $ac_gdalogr_version)"
echo "GEOS : $ac_geos (Version $ac_geos_version)"
echo "PostgreSQL : $ac_postgresql $postgresql_version_string"
echo "GRASS : $ac_grass"
echo "SPIT : $ac_spit"
echo "Georeferencer : $ac_gsl"
echo "WFS : $ac_wfs"
echo "GPS/GPX : $have_expat_lib"
echo "PROJ4 : $have_proj_lib"
echo "SQLITE3 : $have_sqlite3_lib"
echo "Python : $ac_use_python"
echo ""
echo "CPPFLAGS : $CPPFLAGS"
echo "CXXFLAGS : $CXXFLAGS"
echo ""
echo "Debug : $ac_debug"
echo "Plugin dir : ${prefix}/lib/$PACKAGE"
echo ""
if test "$have_qtmac" = "yes"; then
echo "The binary will be installed in $prefix"
else
echo "The binary will be installed in $prefix/bin"
fi
echo ""
echo "The build is using Qt in $QTDIR"
echo "Linking with Qt using $QT_LIBS"
echo "------------------------------------------"
echo "Configure finished, type 'make' to build."