forked from viking-gps/viking
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
663 lines (599 loc) · 26.7 KB
/
configure.ac
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
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.64)
AC_INIT([viking],[1.10],[],[viking],[http://viking.sf.net/])
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([dist-bzip2 dist-zip subdir-objects])
dnl AC_CONFIG_SRCDIR([src/main.c])
AC_CONFIG_HEADERS([src/config.h])
# check for gtk-doc
m4_ifdef([GTK_DOC_CHECK], [
GTK_DOC_CHECK([1.0],[--flavour no-tmpl])
],[
AM_CONDITIONAL([ENABLE_GTK_DOC], false)
])
AC_PROG_CC
# Checks for programs.
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
AC_CHECK_PROG([XXD_COMMAND],xxd,[yes])
if test "x$XXD_COMMAND" != "xyes"
then
AC_MSG_ERROR([xxd is needed but not found - you will need to install package 'xxd' or 'vim' or similar for your system.])
fi
ac_mingw32=no
case $target_os in
*mingw32*)
ac_mingw32=yes
;;
*)
;;
esac
# I18N
GETTEXT_PACKAGE=viking
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
AM_GLIB_DEFINE_LOCALEDIR(LOCALEDIR)
AM_GNU_GETTEXT_VERSION([0.17])
AM_GNU_GETTEXT([external])
IT_PROG_INTLTOOL([0.35.0])
AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS'])
dnl This will cause the automake generated makefiles to pass the
dnl correct flags to aclocal.
ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
AC_SUBST(ACLOCAL_AMFLAGS)
# Checks for header files.
AC_CHECK_HEADERS([malloc.h sys/param.h sys/types.h unistd.h utime.h X11/Xlib.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_MODE_T
# Checks for library functions or symbols
AC_CHECK_FUNCS([floor memset mkdtemp pow realpath sqrt strcasecmp strchr strncasecmp strtol strtoul strptime fmemopen])
AC_CHECK_LIB(m, tan)
AC_CHECK_LIB(z, inflate)
AC_CHECK_LIB(X11, XSetErrorHandler)
# ATM not running automake under Windows
#AC_CHECK_PROG(USE_WINDOWS, cmd.exe, yes, no)
#AM_CONDITIONAL([WINDOWS], [test x$USE_WINDOWS = xyes])
# So pass in as an option instead
# This is only to perform slightly different build steps
# (the code uses standard WINDOWS defines for any specific different behaviour)
AC_ARG_ENABLE(windows, AS_HELP_STRING([--enable-windows],
[Perform specific Windows build steps (default is no)]),
[ac_cv_enable_windows=$enableval],
[ac_cv_enable_windows=no])
AC_CACHE_CHECK([whether to enable Windows build steps],
[ac_cv_enable_windows], [ac_cv_enable_windows=no])
AM_CONDITIONAL([WINDOWS], [test x$ac_cv_enable_windows = xyes])
# Expat
AM_WITH_EXPAT
# Curl
LIBCURL_CHECK_CONFIG([yes],[],[],[AC_MSG_ERROR([libcurl is needed but not found - you will need to install package 'libcurl4-gnutls-dev' or similar.])])
# glib-compile-resources
AC_CHECK_PROG([GLIB_COMPILE_RESOURCES],glib-compile-resources,[yes])
if test "x$GLIB_COMPILE_RESOURCES" != "xyes"
then
AC_MSG_ERROR([glib-compile-resources is needed but not found])
fi
dnl ------------------
dnl | Pkgconfig checks |---------------------------------------
dnl ------------------
# ATM JSON not used by much of our code, so could be made optional
# but it seems to be available on all relevant platforms
PKG_CHECK_MODULES(PACKAGE, [
glib-2.0 >= 2.44
gthread-2.0 >= 2.2
gio-2.0 >= 2.32
gdk-pixbuf-2.0 >= 2.26
json-glib-1.0 >= 0.16
])
AC_SUBST(PACKAGE_CFLAGS)
AC_SUBST(PACKAGE_LIBS)
dnl -------------
dnl | User Manual |---------------------------------------
dnl -------------
if test "x$ac_cv_enable_windows" = "xno"; then
YELP_HELP_INIT
fi
dnl ---------------------------------------------------------------------------
dnl - Use deprecated options (default enabled for devs, disabled in releases)
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(deprecations,
[AS_HELP_STRING([--enable-deprecations],
[warn about deprecated usages [default=no]])],
[ac_cv_enable_deprecations=$enableval],
[ac_cv_enable_deprecations=no])
AC_CACHE_CHECK([whether to enable deprecated features],
[ac_cv_enable_deprecations], [ac_cv_enable_deprecations=no])
if test "x$ac_cv_enable_deprecations" = "xyes"; then
DISABLE_DEPRECATED_CFLAGS="\
-DG_DISABLE_SINGLE_INCLUDES \
-DGSEAL_ENABLE \
-DG_DISABLE_DEPRECATED \
-DGDK_DISABLE_DEPRECATED \
-DGDK_PIXBUF_DISABLE_DEPRECATED \
-DGTK_DISABLE_SINGLE_INCLUDES \
-DGTK_DISABLE_DEPRECATED"
CPPFLAGS="$CPPFLAGS $DISABLE_DEPRECATED_CFLAGS"
fi
# Options
#
# GTK
#
# GTK version 3 (default) or 2
AC_ARG_ENABLE(gtk2, AS_HELP_STRING([--enable-gtk2],
[enable GTK2 build (default is disabled)]),
[ac_cv_enable_gtk2=$enableval],
[ac_cv_enable_gtk2=no])
AC_CACHE_CHECK([whether to enable GTK2],
[ac_cv_enable_gtk2], [ac_cv_enable_gtk2=no])
case $ac_cv_enable_gtk2 in
yes)
PKG_CHECK_MODULES([GTK], [gtk+-2.0 >= 2.22])
;;
*)
PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= 3.22])
;;
esac
AC_ARG_ENABLE(bing, AS_HELP_STRING([--enable-bing],
[enable Bing stuff (default is enable)]),
[ac_cv_enable_bing=$enableval],
[ac_cv_enable_bing=yes])
AC_CACHE_CHECK([whether to enable Bing stuff],
[ac_cv_enable_bing], [ac_cv_enable_bing=yes])
case $ac_cv_enable_bing in
yes)
AC_DEFINE(VIK_CONFIG_BING, [], [BING STUFF])
;;
esac
AM_CONDITIONAL([BING], [test x$ac_cv_enable_bing = xyes])
AC_ARG_ENABLE(google, AS_HELP_STRING([--enable-google],
[enable Google stuff (default is enable)]),
[ac_cv_enable_google=$enableval],
[ac_cv_enable_google=yes])
AC_CACHE_CHECK([whether to enable Google stuff],
[ac_cv_enable_google], [ac_cv_enable_google=yes])
case $ac_cv_enable_google in
yes)
AC_DEFINE(VIK_CONFIG_GOOGLE, [], [GOOGLE STUFF])
;;
esac
AM_CONDITIONAL([GOOGLE], [test x$ac_cv_enable_google = xyes])
AC_ARG_ENABLE(terraserver, AS_HELP_STRING([--enable-terraserver],
[enable Terraserver stuff (default is disabled as the tileserver is no longer available)]),
[ac_cv_enable_terraserver=$enableval],
[ac_cv_enable_terraserver=no])
AC_CACHE_CHECK([whether to enable Terraserver stuff],
[ac_cv_enable_terraserver], [ac_cv_enable_terraserver=yes])
case $ac_cv_enable_terraserver in
yes)
AC_DEFINE(VIK_CONFIG_TERRASERVER, [], [TERRASERVER STUFF])
;;
esac
AM_CONDITIONAL([TERRASERVER], [test x$ac_cv_enable_terraserver = xyes])
AC_ARG_ENABLE(expedia, AS_HELP_STRING([--enable-expedia],
[enable Expedia stuff (default is disable)]),
[ac_cv_enable_expedia=$enableval],
[ac_cv_enable_expedia=no])
AC_CACHE_CHECK([whether to enable Expedia stuff],
[ac_cv_enable_expedia], [ac_cv_enable_expedia=yes])
case $ac_cv_enable_expedia in
yes)
AC_DEFINE(VIK_CONFIG_EXPEDIA, [], [EXPEDIA STUFF])
;;
esac
AM_CONDITIONAL([EXPEDIA], [test x$ac_cv_enable_expedia = xyes])
# OpenStreetMap http://www.openstreetmap.org/
AC_ARG_ENABLE(openstreetmap, AS_HELP_STRING([--enable-openstreetmap],
[enable OpenStreetMap stuff (default is enable)]),
[ac_cv_enable_openstreetmap=$enableval],
[ac_cv_enable_openstreetmap=yes])
AC_CACHE_CHECK([whether to enable OpenStreetMap stuff],
[ac_cv_enable_openstreetmap], [ac_cv_enable_openstreetmap=yes])
case $ac_cv_enable_openstreetmap in
yes)
AC_DEFINE(VIK_CONFIG_OPENSTREETMAP, [], [OPENSTREETMAP STUFF])
;;
esac
AM_CONDITIONAL([OPENSTREETMAP], [test x$ac_cv_enable_openstreetmap = xyes])
# BlueMarble
AC_ARG_ENABLE(bluemarble, AS_HELP_STRING([--enable-bluemarble],
[enable BlueMarble stuff (default is enable)]),
[ac_cv_enable_bluemarble=$enableval],
[ac_cv_enable_bluemarble=yes])
AC_CACHE_CHECK([whether to enable BlueMarble stuff],
[ac_cv_enable_bluemarble], [ac_cv_enable_bluemarble=yes])
case $ac_cv_enable_bluemarble in
yes)
AC_DEFINE(VIK_CONFIG_BLUEMARBLE, [], [BLUEMARBLE STUFF])
;;
esac
AM_CONDITIONAL([BLUEMARBLE], [test x$ac_cv_enable_bluemarble = xyes])
# GeoNames http://www.geonames.org/
AC_ARG_ENABLE(geonames, AS_HELP_STRING([--enable-geonames],
[enable Geonames stuff (default is enable)]),
[ac_cv_enable_geonames=$enableval],
[ac_cv_enable_geonames=yes])
AC_CACHE_CHECK([whether to enable Geonames stuff],
[ac_cv_enable_geonames], [ac_cv_enable_geonames=yes])
case $ac_cv_enable_geonames in
yes)
AC_DEFINE(VIK_CONFIG_GEONAMES, [], [GEONAMES STUFF])
;;
esac
AM_CONDITIONAL([GEONAMES], [test x$ac_cv_enable_geonames = xyes])
AC_ARG_ENABLE(geocaches, AS_HELP_STRING([--enable-geocaches],
[enable Geocaches Acquire (default is disable).]),
[ac_cv_enable_geocaches=$enableval],
[ac_cv_enable_geocaches=no])
AC_CACHE_CHECK([whether to enable Geocaches Acquire],
[ac_cv_enable_geocaches], [ac_cv_enable_geocaches=yes])
case $ac_cv_enable_geocaches in
yes)
AC_DEFINE(VIK_CONFIG_GEOCACHES, [], [GEOCACHES STUFF])
;;
esac
AM_CONDITIONAL([GEOCACHES], [test x$ac_cv_enable_geocaches = xyes])
# GeoClue
AC_ARG_ENABLE(geoclue, AS_HELP_STRING([--enable-geoclue],
[enable GeoClue support (default is enable).]),
[ac_cv_enable_geoclue=$enableval],
[ac_cv_enable_geoclue=yes])
AC_CACHE_CHECK([whether to enable GeoClue Support],
[ac_cv_enable_geoclue], [ac_cv_enable_geoclue=yes])
case $ac_cv_enable_geoclue in
yes)
PKG_CHECK_MODULES( [LIBGEOCLUE], [libgeoclue-2.0 >= 2.4.4],
AC_CHECK_LIB(geoclue-2, main,, AC_MSG_ERROR([libgeoclue is needed but not found - you will need to install package 'libgeoclue-2-dev' or similar ])) )
;;
esac
AM_CONDITIONAL([GEOCLUE], [test x$ac_cv_enable_geoclue = xyes])
# Geotagging
AC_ARG_WITH(libexif, AS_HELP_STRING([--with-libexif], [Force usage of libexif instead of libgexiv2]))
AC_ARG_ENABLE(geotag, AS_HELP_STRING([--enable-geotag],
[enable Geotag Support (default is enable).]),
[ac_cv_enable_geotag=$enableval],
[ac_cv_enable_geotag=yes])
AC_CACHE_CHECK([whether to enable Geotag Support],
[ac_cv_enable_geotag], [ac_cv_enable_geotag=yes])
case $ac_cv_enable_geotag in
yes)
AS_IF([test x$with_libexif = xyes],
AC_CHECK_HEADER([libexif/exif-data.h],[],AC_MSG_ERROR([exif-data.h is needed but not found - you will need to install package 'libexif-dev' or similar]))
AC_CHECK_LIB(exif,exif_loader_new,, AC_MSG_ERROR([libexif is not found but it has been forcibly required])),
# gexiv2.h relies on glib so a simple compile check fails.
#AC_CHECK_HEADER([gexiv2/gexiv2.h],,AC_MSG_ERROR([Error msg...]))
AC_CHECK_LIB(gexiv2,gexiv2_metadata_new,, AC_MSG_ERROR([libgexiv2 is needed but not found - you will need to install package 'libgexiv2-dev' or similar. The feature can be disabled with --disable-geotag]))
)
AC_DEFINE(VIK_CONFIG_GEOTAG, [], [GEOTAG STUFF])
;;
esac
AM_CONDITIONAL([GEOTAG], [test x$ac_cv_enable_geotag = xyes])
AM_CONDITIONAL([GEXIV2], [test x$ac_cv_lib_gexiv2_gexiv2_metadata_new = xyes] )
# Tested with gexiv2 0.10.2, but probably would work with older versions; may be all of them...
#AM_COND_IF([GEXIV2], [PKG_CHECK_MODULES([GEXIV2], [gexiv2 >= 0.6.1])])
AM_CONDITIONAL([LIBEXIF], [test x$ac_cv_lib_exif_exif_loader_new = xyes] )
AC_ARG_ENABLE(dem24k, AS_HELP_STRING([--enable-dem24k],
[enable USGS 24k DEM (default is disable) download source. Requires dem24k.pl script in path.]),
[ac_cv_enable_dem24k=$enableval],
[ac_cv_enable_dem24k=no])
AC_CACHE_CHECK([whether to enable USGS DEM 24k download source],
[ac_cv_enable_dem24k], [ac_cv_enable_dem24k=yes])
case $ac_cv_enable_dem24k in
yes)
AC_DEFINE(VIK_CONFIG_DEM24K, [], [DEM24K STUFF])
;;
esac
AM_CONDITIONAL([DEM24K], [test x$ac_cv_enable_dem24k = xyes])
# OAuth
AC_ARG_ENABLE(oauth, AS_HELP_STRING([--enable-oauth],
[enable OAuth Support (default is enable).]),
[ac_cv_enable_oauth=$enableval],
[ac_cv_enable_oauth=yes])
AC_CACHE_CHECK([whether to enable OAuth Support],
[ac_cv_enable_oauth], [ac_cv_enable_oauth=yes])
case $ac_cv_enable_oauth in
yes)
AC_CHECK_HEADERS([oauth.h],[],[AC_MSG_ERROR([oauth.h is needed but not found - you will need to install package 'liboauth-dev' or similar. The feature can be disabled with --disable-oauth])])
AC_CHECK_LIB(oauth, oauth_sign_url2, [], [AC_MSG_ERROR([liboauth is needed but not found.])])
;;
esac
AM_CONDITIONAL([OAUTH], [test x$ac_cv_enable_oauth = xyes])
# Realtime GPS tracking
AC_ARG_ENABLE(realtime-gps-tracking, AS_HELP_STRING([--enable-realtime-gps-tracking],
[enable realtime GPS tracking (default is enable)]),
[ac_cv_enable_realtimegpstracking=$enableval],
[ac_cv_enable_realtimegpstracking=yes])
AC_CACHE_CHECK([whether to enable Realtime GPS Tracking stuff],
[ac_cv_enable_realtimegpstracking], [ac_cv_enable_realtimegpstracking=yes])
case $ac_cv_enable_realtimegpstracking in
yes)
AC_CHECK_HEADERS([gps.h],[],[AC_MSG_ERROR([gps.h is needed but not found - you will need to install package 'libgps-dev' or similar. The feature can be disabled with --disable-realtime-gps-tracking])])
AC_CHECK_LIB(gps, gps_close, [],
if test "$ac_mingw32" = "yes"; then
[LIBS="-lgps $LIBS"
AC_MSG_WARN([libgps not found! Forcing it anyway!])]
else
AC_MSG_ERROR([libgps is needed but not found.])
fi)
AC_DEFINE(VIK_CONFIG_REALTIME_GPS_TRACKING, [], [REALTIME GPS TRACKING STUFF])
;;
esac
AM_CONDITIONAL([REALTIME_GPS_TRACKING], [test x$ac_cv_enable_realtimegpstracking = xyes])
# BZIP2
AC_ARG_ENABLE(bzip2, AS_HELP_STRING([--enable-bzip2],
[enable bzip2 Support (default is enable).]),
[ac_cv_enable_bzip2=$enableval],
[ac_cv_enable_bzip2=yes])
AC_CACHE_CHECK([whether to enable bzip2 Support],
[ac_cv_enable_bzip2], [ac_cv_enable_bzip2=yes])
case $ac_cv_enable_bzip2 in
yes)
AC_CHECK_HEADERS([bzlib.h],[],[AC_MSG_ERROR([bzlib.h is needed but not found - you will need to install package 'libbz2-dev' or similar. The feature can be disabled with --disable-bzip2])])
if test "$ac_mingw32" = "yes"; then
# Using the cross compiler it bizarrely fails to detect BZ2_bzRead during the configure stage
# I SWEAR THIS WORKED AT SOME POINT - BUT ON A DIFFERENT DAY IT DOESN'T = MORE SWEARING
BZ2FUNC=main
AC_CHECK_LIB(bz2, [$BZ2FUNC], [], [LIBS="-lbz2 $LIBS"
AC_MSG_WARN([libbz2 not found! Forcing it anyway!])])
else
BZ2FUNC=BZ2_bzRead
AC_CHECK_LIB(bz2, [$BZ2FUNC], [], [AC_MSG_ERROR([libbz2 is needed but not found.])])
fi
;;
esac
AM_CONDITIONAL([BZIP2], [test x$ac_cv_enable_bzip2 = xyes])
# FILE MAGIC
AC_ARG_ENABLE(magic, AS_HELP_STRING([--enable-magic],
[enable File Magic support via libmagic (default is enable).]),
[ac_cv_enable_magic=$enableval],
[ac_cv_enable_magic=yes])
AC_CACHE_CHECK([whether to enable Magic Support],
[ac_cv_enable_magic], [ac_cv_enable_magic=yes])
case $ac_cv_enable_magic in
yes)
AC_CHECK_HEADERS([magic.h],[],[AC_MSG_ERROR([magic.h is needed but not found - you will need to install package 'libmagic-dev' or similar. The feature can be disabled with --disable-magic])])
# Using the cross compiler it fails to find libmagic.dll during the configure stage
AC_CHECK_LIB(magic, magic_open, [],
if test "$ac_mingw32" = "yes"; then
[LIBS="-lmagic $LIBS"
AC_MSG_WARN([libmagic not found! Forcing it anyway!])]
else
AC_MSG_ERROR([libmagic is needed but not found.])
fi)
;;
esac
AM_CONDITIONAL([MAGIC], [test x$ac_cv_enable_magic = xyes])
# SQL for MBTiles
AC_ARG_ENABLE(mbtiles, AS_HELP_STRING([--enable-mbtiles],
[enable MBTiles support via libsqlite3 (default is enable).]),
[ac_cv_enable_mbtiles=$enableval],
[ac_cv_enable_mbtiles=yes])
AC_CACHE_CHECK([whether to enable MBTiles Support],
[ac_cv_enable_mbtiles], [ac_cv_enable_mbtiles=yes])
case $ac_cv_enable_mbtiles in
yes)
AC_CHECK_HEADERS([sqlite3.h],[],[AC_MSG_ERROR([sqlite3.h is needed but not found - you will need to install package 'libsqlite3-dev' or similar. The feature can be disabled with --disable-mbtiles])])
AC_CHECK_LIB(sqlite3, sqlite3_open, [],
if test "$ac_mingw32" = "yes"; then
[LIBS="-lsqlite3 $LIBS"
AC_MSG_WARN([libsqlite3 not found! Forcing it anyway!])]
else
AC_MSG_ERROR([libsqlite3 is needed but not found.])
fi)
;;
esac
AM_CONDITIONAL([SQLITE], [test x$ac_cv_enable_mbtiles = xyes])
# Standard compression is handled by libz
# libzip enables a friendlier file based interface
# libzip itself depends on libz (which is required in the Viking build ATM)
# ZIP
AC_ARG_ENABLE(zip, AS_HELP_STRING([--enable-zip],
[enable zip support (default is enable).]),
[ac_cv_enable_zip=$enableval],
[ac_cv_enable_zip=yes])
AC_CACHE_CHECK([whether to enable zip Support],
[ac_cv_enable_zip], [ac_cv_enable_zip=yes])
case $ac_cv_enable_zip in
yes)
# NB As far as I can tell libzip doesn't provide any versioning info within the header code itself
# Thus supporting old versions via simple #if #else #endif directives is seemingly not possible
# Resort to checking versioning only via pkgconfig
PKG_CHECK_MODULES([LIBZIP], [libzip >= 0.11],
[ AC_CHECK_HEADERS([zip.h],[],[AC_MSG_ERROR([zip.h is needed but not found - you will need to install package 'libzip-dev' or similar. The feature can be disabled with --disable-zip])])
AC_CHECK_LIB(zip, [main], [],
if test "$ac_mingw32" = "yes"; then
[LIBS="-lzip $LIBS"
AC_MSG_WARN([libzip not found! Forcing it anyway!])]
else
AC_MSG_ERROR([libzip is needed but not found.])
fi)],
[ AC_MSG_WARN([libzip version needs to be at least 0.11, use of libzip is disabled])
ac_cv_enable_zip=no ]
)
;;
esac
AM_CONDITIONAL([ZIP], [test x$ac_cv_enable_zip = xyes])
# ATM only for MD5 Hashing which is currently only used for filename of image thumbnails
AC_ARG_ENABLE(nettle, AS_HELP_STRING([--enable-nettle],
[enable MD5 Hash support (default is enable)]),
[ac_cv_enable_nettle=$enableval],
[ac_cv_enable_nettle=yes])
AC_CACHE_CHECK([whether to enable MD5 Hash support],
[ac_cv_enable_nettle], [ac_cv_enable_nettle=yes])
case $ac_cv_enable_nettle in
yes)
AC_CHECK_HEADER([nettle/md5-compat.h],[],[AC_MSG_ERROR([nettle/md5-compat.h is needed but not found - you will need to install package 'nettle-dev' or similar. The feature can be disabled with --disable-nettle])])
AC_CHECK_LIB([nettle], [main], [],
if test "$ac_mingw32" = "yes"; then
[LIBS="-lnettle $LIBS"
AC_MSG_WARN([libnettle not found! Forcing it anyway!])]
else
AC_MSG_ERROR([libnettle is needed but not found.])
fi)
;;
esac
AM_CONDITIONAL([MD5_HASH], [test x$ac_cv_enable_nettle = xyes])
# libnova for Astronomical data
AC_ARG_ENABLE(nova, AS_HELP_STRING([--enable-nova],
[enable Astronomical data support via libnova (default is enable).]),
[ac_cv_enable_nova=$enableval],
[ac_cv_enable_nova=yes])
AC_CACHE_CHECK([whether to enable libnova Support],
[ac_cv_enable_nova], [ac_cv_enable_nova=yes])
case $ac_cv_enable_nova in
yes)
AC_CHECK_HEADERS([libnova/libnova.h],[],[AC_MSG_ERROR([libnova/libnova.h is needed but not found - you will need to install package 'libnova-dev' or similar. The feature can be disabled with --disable-nova])])
AC_CHECK_LIB(nova, ln_get_version, [], [AC_MSG_ERROR([libnova is needed but not found.])])
# Check for extended functionality
AC_MSG_CHECKING([libnova: ln_lunar_next_phase()])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[#include <libnova/libnova.h>],
[ln_lunar_next_phase(0.0, 0.0)],)],
[AC_MSG_RESULT([yes]);AC_DEFINE([HAVE_LIBNOVA_NEXT_PHASE_FUNC], [1], [Define to 1 if you have ln_lunar_next_phase().])],
[AC_MSG_RESULT([no])]
)
;;
esac
AM_CONDITIONAL([NOVA], [test x$ac_cv_enable_nova = xyes])
# Mapnik rendering layer
AC_ARG_ENABLE(mapnik, AS_HELP_STRING([--enable-mapnik],
[enable Mapnik (default is enable)]),
[ac_cv_enable_mapnik=$enableval],
[ac_cv_enable_mapnik=yes])
AC_CACHE_CHECK([whether to enable Mapnik],
[ac_cv_enable_mapnik], [ac_cv_enable_mapnik=yes])
case $ac_cv_enable_mapnik in
yes)
# C++
AC_LANG_PUSH([C++])
AC_PROG_CXX
# Mapnik3 requires C++11. Viking will use C++11 as well.
CXXFLAGS="$CXXFLAGS -std=c++11"
# Too difficult to get check working under Windows (extra dependencies needed probably Boost)- so just skip it
if test "x$ac_cv_enable_windows" = "xno"; then
AC_CHECK_HEADER([mapnik/map.hpp],[],[AC_MSG_ERROR([mapnik/map.hpp is needed but not found - you will need to install package 'libmapnik-dev' or similar. The feature can be disabled with --disable-mapnik])])
fi
AC_CHECK_LIB([mapnik], [main], [], [AC_MSG_ERROR([libmapnik is needed but not found.])])
AC_CHECK_LIB([stdc++], [main], [], [AC_MSG_ERROR([libstdc++ is needed but not found.])])
# Required for Mapnik3 build (it's also in Mapnik2 but does not need to be specified for some reason)
# it's part of libmapnik install dependencies
AC_CHECK_LIB([icuuc], [main], [], [AC_MSG_ERROR([libicuuc is needed but not found.])])
AC_LANG_POP([C++])
;;
esac
AM_CONDITIONAL([MAPNIK], [test x$ac_cv_enable_mapnik = xyes])
###
## WORK AROUND BROKEN autoconf - see http://lists.gnu.org/archive/html/bug-automake/2002-11/msg00020.html
m4_pushdef([AC_MSG_ERROR])
AC_PROG_CXX
m4_popdef([AC_MSG_ERROR])
##
dnl Compile time defined key
AC_ARG_WITH(thunderforest_apikey,
[AS_HELP_STRING([--with-thunderforest_apikey],
[API Key for Thunderforest (OSM Cyclemap) tiles.
Please register your own if you're going to distribute the
package, as requests are limited per key.])],
[VIK_CONFIG_THUNDERFOREST_KEY="\"${withval}\""],
[VIK_CONFIG_THUNDERFOREST_KEY="\"7387c111d85642b18f63608bd4cb8b4f\""])
AC_DEFINE_UNQUOTED(VIK_CONFIG_THUNDERFOREST_KEY, ${VIK_CONFIG_THUNDERFOREST_KEY}, [Thunderforest key])
AC_ARG_WITH(geonames_username,
[AS_HELP_STRING([--with-geonames_username],
[Username for the GeoNames webservice.
Please register your own if you're going to distribute the
package, as requests are limited per username.])],
[VIK_CONFIG_GEONAMES_USERNAME="\"${withval}\""],
[VIK_CONFIG_GEONAMES_USERNAME="\"$PACKAGE\""])
AC_DEFINE_UNQUOTED(VIK_CONFIG_GEONAMES_USERNAME, ${VIK_CONFIG_GEONAMES_USERNAME}, [geonames username])
AC_ARG_WITH(mapcache,
[AS_HELP_STRING([--with-mapcache],
[specify the size of the map cache in MB (default is 256)])],
[if test "x$withval" = "xno"; then
VIK_CONFIG_MAPCACHE_SIZE=0;
elif test "x$withval" = "xyes"; then
AC_MSG_ERROR([Please, set a value for size of the map cache in MB])
else
VIK_CONFIG_MAPCACHE_SIZE=${withval}
fi],
[VIK_CONFIG_MAPCACHE_SIZE=256])
AC_DEFINE_UNQUOTED(VIK_CONFIG_MAPCACHE_SIZE, ${VIK_CONFIG_MAPCACHE_SIZE},
[Size of the map cache])
AC_ARG_WITH(tileage,
[AS_HELP_STRING([--with-tileage],
[specify the age of a tile before checking it (default is 7 days)])],
[if test "x$withval" = "xno"; then
VIK_CONFIG_DEFAULT_TILE_AGE=0;
elif test "x$withval" = "xyes"; then
AC_MSG_ERROR([Please, set a value for age of tiles])
else
VIK_CONFIG_DEFAULT_TILE_AGE=${withval}
fi],
[VIK_CONFIG_DEFAULT_TILE_AGE=604800])
AC_DEFINE_UNQUOTED(VIK_CONFIG_DEFAULT_TILE_AGE, ${VIK_CONFIG_DEFAULT_TILE_AGE},
[Age of tiles before checking it (in seconds)])
AC_DEFINE(HAVE_VIKING, 1, [Enable Viking specifics in otherwise reusable code])
dnl man pages processing
AC_PATH_PROG(XSLTPROC,xsltproc)
#AM_CONDITIONAL([HAVE_XSLTPROC],[test "x$XSLTPROC" != "x"])
ISODATE="$(date --utc --date=@${SOURCE_DATE_EPOCH:-$(date +%s)} +%Y-%m-%d)"
AC_SUBST(ISODATE)
AC_DEFINE_UNQUOTED(THEYEAR, "$(date --utc --date=@${SOURCE_DATE_EPOCH:-$(date +%s)} +%Y)", [The Year])
# Configuration
AC_CONFIG_FILES([
viking.spec
mingw-viking.spec
mingw64-viking.spec
Makefile
src/Makefile
src/icons/Makefile
po/Makefile.in
data/Makefile
tools/Makefile
test/Makefile
help/Makefile
help/viking.xml
windows/Makefile
windows/installer/Makefile
windows/installer/pixmaps/Makefile
windows/installer/translations/Makefile
doc/Makefile
doc/reference/Makefile
doc/examples/Makefile])
AC_OUTPUT
dnl Output the configuration summary
AC_MSG_NOTICE(["
===========================================
$PACKAGE $PACKAGE_URL $VERSION
-------------------------------------------
GTK2 : $ac_cv_enable_gtk2
Bing Maps : $ac_cv_enable_bing
Google : $ac_cv_enable_google
Terraserver Maps : $ac_cv_enable_terraserver
Expedia Maps : $ac_cv_enable_expedia
Open Street Map : $ac_cv_enable_openstreetmap
BlueMarble : $ac_cv_enable_bluemarble
GeoClue Support : $ac_cv_enable_geoclue
Geonames : $ac_cv_enable_geonames
Geocaches Acquire : $ac_cv_enable_geocaches
Geotag Support : $ac_cv_enable_geotag (libgexiv2=$ac_cv_lib_gexiv2_gexiv2_metadata_new libexif=$ac_cv_lib_exif_exif_loader_new)
USGS 24k DEM : $ac_cv_enable_dem24k
Realtime GPS Tracking : $ac_cv_enable_realtimegpstracking
bzip2 Support : $ac_cv_enable_bzip2
File Magic Support : $ac_cv_enable_magic
MBTiles Support (SQLite3) : $ac_cv_enable_mbtiles
Zip File Support (with libzip) : $ac_cv_enable_zip
MD5 Hash Support (with libnettle): $ac_cv_enable_nettle
Mapnik Rendering Support (C++) : $ac_cv_enable_mapnik
Nova (Astronomical Data) : $ac_cv_enable_nova
OAuth : $ac_cv_enable_oauth
Size of map cache (in memory) : ${VIK_CONFIG_MAPCACHE_SIZE}
Age of tiles (in seconds) : ${VIK_CONFIG_DEFAULT_TILE_AGE}
GeoNames user : ${VIK_CONFIG_GEONAMES_USERNAME}
Documentation (+HTML) : ${enable_gtk_doc} (HTML: ${enable_gtk_doc_html})
-------------------------------------------
Configure finished, type 'make' to build.
"])