]> git.street.me.uk Git - andy/viking.git/blame - configure.ac
[QA] Replace g_mapped_file_free
[andy/viking.git] / configure.ac
CommitLineData
9903c388
EB
1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.59)
5bea959d 5AC_INIT(viking, 1.3.2)
c00602be 6AM_INIT_AUTOMAKE([dist-bzip2 dist-zip])
9903c388 7dnl AC_CONFIG_SRCDIR([src/main.c])
8fe95819 8AC_CONFIG_HEADERS([src/config.h])
e5c58469 9GTK_DOC_CHECK(1.0)
9903c388
EB
10
11# Checks for programs.
972d7785 12AC_PROG_CC
9903c388 13AC_PROG_MAKE_SET
b6e6dfbd 14AC_PROG_RANLIB
8f661d80 15AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
9903c388 16
a5daec1c
GB
17# I18N
18GETTEXT_PACKAGE=viking
19AC_SUBST(GETTEXT_PACKAGE)
20AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
21
22AM_GLIB_DEFINE_LOCALEDIR(LOCALEDIR)
23
24AM_GLIB_GNU_GETTEXT
d44b1562 25IT_PROG_INTLTOOL([0.35.0])
a5daec1c
GB
26
27AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS'])
28
29dnl This will cause the automake generated makefiles to pass the
30dnl correct flags to aclocal.
31ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
32AC_SUBST(ACLOCAL_AMFLAGS)
33
9903c388
EB
34# Checks for header files.
35AC_HEADER_STDC
5cd09d57 36AC_CHECK_HEADERS([malloc.h netdb.h netinet/in.h stdlib.h string.h sys/param.h sys/socket.h sys/types.h sys/wait.h unistd.h math.h utime.h X11/Xlib.h])
9903c388
EB
37
38# Checks for typedefs, structures, and compiler characteristics.
39AC_C_CONST
40AC_TYPE_MODE_T
41
fa3eb9d6 42# Checks for library functions or symbols
9903c388
EB
43AC_FUNC_STAT
44AC_FUNC_STRTOD
c44594ee 45AC_CHECK_FUNCS([floor gethostbyname memset mkdtemp pow realpath socket sqrt strcasecmp strchr strdup strncasecmp strtol strtoul])
fabfa349
JB
46AC_CHECK_LIB(m, tan)
47AC_CHECK_LIB(z, inflate)
fa3eb9d6 48AC_CHECK_LIB(X11, XSetErrorHandler)
9903c388 49
dad55b79 50# Expat
fa1b5a5f
GB
51AM_WITH_EXPAT
52
3292ba8b 53# Curl
f901dcdf 54LIBCURL_CHECK_CONFIG([yes],[],[],[AC_MSG_ERROR([libcurl is needed but not found])])
3292ba8b 55
bf0922c7 56# gdk-pixbuf-csource
fa1b5a5f 57AC_CHECK_PROG([GDK_PIXBUF_CSOURCE],gdk-pixbuf-csource,[yes])
4dc7f2cc 58if test "x$GDK_PIXBUF_CSOURCE" != "xyes"
fa1b5a5f
GB
59then
60 AC_MSG_ERROR([gdk-pixbuf-csource is needed but not found])
61fi
62
bf0922c7
GB
63dnl ------------------
64dnl | Pkgconfig checks |---------------------------------------
65dnl ------------------
66
67PKG_CHECK_MODULES(PACKAGE, [
c9570f86 68 glib-2.0 >= 2.14
bf0922c7 69 gthread-2.0 >= 2.2
274e14bd 70 gtk+-2.0 >= 2.12
314084b8 71 gio-2.0 >= 2.12
bf0922c7
GB
72])
73
74AC_SUBST(PACKAGE_CFLAGS)
75AC_SUBST(PACKAGE_LIBS)
76
f8b8a0b5
GB
77dnl -------------
78dnl | User Manual |---------------------------------------
79dnl -------------
80GNOME_DOC_INIT
dad55b79 81
bca29d33
GB
82dnl ---------------------------------------------------------------------------
83dnl - Use deprecated options (default enabled for devs, disabled in releases)
84dnl ---------------------------------------------------------------------------
85
79452f0e
GB
86AC_ARG_ENABLE(deprecations,
87 [AC_HELP_STRING([--enable-deprecations],
bca29d33
GB
88 [warn about deprecated usages [default=no]])],
89 [ac_cv_enable_deprecations=$enableval],
90 [ac_cv_enable_deprecations=no])
91AC_CACHE_CHECK([whether to enable deprecated features],
92 [ac_cv_enable_deprecations], [ac_cv_enable_deprecations=no])
79452f0e 93
bca29d33 94if test "x$ac_cv_enable_deprecations" = "xyes"; then
79452f0e 95 DISABLE_DEPRECATED_CFLAGS="\
bca29d33
GB
96-DG_DISABLE_SINGLE_INCLUDES \
97-DGSEAL_ENABLE \
79452f0e
GB
98-DG_DISABLE_DEPRECATED \
99-DGDK_DISABLE_DEPRECATED \
bca29d33
GB
100-DGDK_PIXBUF_DISABLE_DEPRECATED \
101-DGTK_DISABLE_SINGLE_INCLUDES \
102-DGTK_DISABLE_DEPRECATED"
103 CPPFLAGS="$CPPFLAGS $DISABLE_DEPRECATED_CFLAGS"
79452f0e 104fi
dad55b79 105
734652bf
EB
106# Options
107AC_ARG_ENABLE(alphabetized-trw, AC_HELP_STRING([--enable-alphabetized-trw],
108 [enable alphabetized track & waypoints (default is enable)]),
109 [ac_cv_enable_alpha_trw=$enableval],
110 [ac_cv_enable_alpha_trw=yes])
111AC_CACHE_CHECK([whether to enable alphabetized track & waypoint],
112 [ac_cv_enable_alpha_trw], [ac_cv_enable_alpha_trw=yes])
113case $ac_cv_enable_alpha_trw in
114 yes)
115 AC_DEFINE(VIK_CONFIG_ALPHABETIZED_TRW, [], [NO ALPHABETIZED TRW])
116 ;;
117esac
118
9f58c4b4
GB
119AC_ARG_ENABLE(bing, AC_HELP_STRING([--enable-bing],
120 [enable Bing stuff (default is enable)]),
121 [ac_cv_enable_bing=$enableval],
122 [ac_cv_enable_bing=yes])
123AC_CACHE_CHECK([whether to enable Bing stuff],
124 [ac_cv_enable_bing], [ac_cv_enable_bing=yes])
125case $ac_cv_enable_bing in
126 yes)
127 AC_DEFINE(VIK_CONFIG_BING, [], [BING STUFF])
128 ;;
129esac
130AM_CONDITIONAL([BING], [test x$ac_cv_enable_bing = xyes])
131
cdcaf41c 132AC_ARG_ENABLE(google, AC_HELP_STRING([--enable-google],
ebf1bd39 133 [enable Google stuff (Goto and External Open) (default is enable)]),
cdcaf41c
QT
134 [ac_cv_enable_google=$enableval],
135 [ac_cv_enable_google=yes])
136AC_CACHE_CHECK([whether to enable Google stuff],
137 [ac_cv_enable_google], [ac_cv_enable_google=yes])
138case $ac_cv_enable_google in
139 yes)
140 AC_DEFINE(VIK_CONFIG_GOOGLE, [], [GOOGLE STUFF])
141 ;;
142esac
143AM_CONDITIONAL([GOOGLE], [test x$ac_cv_enable_google = xyes])
144
ebf1bd39
RN
145
146AC_ARG_ENABLE(google-directions, AC_HELP_STRING([--enable-google-directions],
147 [enable Google Directions (default is disabled because it does not work)]),
148 [ac_cv_enable_google_directions=$enableval],
149 [ac_cv_enable_google_directions=no])
150AC_CACHE_CHECK([whether to enable Google directions],
151 [ac_cv_enable_google_directions], [ac_cv_enable_google_directions=yes])
152case $ac_cv_enable_google_directions in
153 yes)
154 AC_DEFINE(VIK_CONFIG_GOOGLE_DIRECTIONS, [], [GOOGLE DIRECTIONS])
155 ;;
156esac
157
cdcaf41c
QT
158AC_ARG_ENABLE(terraserver, AC_HELP_STRING([--enable-terraserver],
159 [enable Terraserver stuff (default is enable)]),
160 [ac_cv_enable_terraserver=$enableval],
161 [ac_cv_enable_terraserver=yes])
162AC_CACHE_CHECK([whether to enable Terraserver stuff],
163 [ac_cv_enable_terraserver], [ac_cv_enable_terraserver=yes])
164case $ac_cv_enable_terraserver in
165 yes)
166 AC_DEFINE(VIK_CONFIG_TERRASERVER, [], [TERRASERVER STUFF])
167 ;;
168esac
169AM_CONDITIONAL([TERRASERVER], [test x$ac_cv_enable_terraserver = xyes])
170
171AC_ARG_ENABLE(expedia, AC_HELP_STRING([--enable-expedia],
06f31fd5 172 [enable Expedia stuff (default is disable)]),
cdcaf41c 173 [ac_cv_enable_expedia=$enableval],
06f31fd5 174 [ac_cv_enable_expedia=no])
cdcaf41c
QT
175AC_CACHE_CHECK([whether to enable Expedia stuff],
176 [ac_cv_enable_expedia], [ac_cv_enable_expedia=yes])
177case $ac_cv_enable_expedia in
178 yes)
179 AC_DEFINE(VIK_CONFIG_EXPEDIA, [], [EXPEDIA STUFF])
180 ;;
181esac
182AM_CONDITIONAL([EXPEDIA], [test x$ac_cv_enable_expedia = xyes])
183
ca9eb04a
GB
184# OpenStreetMap http://www.openstreetmap.org/
185AC_ARG_ENABLE(openstreetmap, AC_HELP_STRING([--enable-openstreetmap],
186 [enable OpenStreetMap stuff (default is enable)]),
187 [ac_cv_enable_openstreetmap=$enableval],
188 [ac_cv_enable_openstreetmap=yes])
189AC_CACHE_CHECK([whether to enable OpenStreetMap stuff],
190 [ac_cv_enable_openstreetmap], [ac_cv_enable_openstreetmap=yes])
191case $ac_cv_enable_openstreetmap in
192 yes)
193 AC_DEFINE(VIK_CONFIG_OPENSTREETMAP, [], [OPENSTREETMAP STUFF])
194 ;;
195esac
196AM_CONDITIONAL([OPENSTREETMAP], [test x$ac_cv_enable_openstreetmap = xyes])
197
96c3f0d5
GB
198# BlueMarble
199AC_ARG_ENABLE(bluemarble, AC_HELP_STRING([--enable-bluemarble],
200 [enable BlueMarble stuff (default is enable)]),
201 [ac_cv_enable_bluemarble=$enableval],
202 [ac_cv_enable_bluemarble=yes])
203AC_CACHE_CHECK([whether to enable BlueMarble stuff],
204 [ac_cv_enable_bluemarble], [ac_cv_enable_bluemarble=yes])
205case $ac_cv_enable_bluemarble in
206 yes)
207 AC_DEFINE(VIK_CONFIG_BLUEMARBLE, [], [BLUEMARBLE STUFF])
208 ;;
209esac
210AM_CONDITIONAL([BLUEMARBLE], [test x$ac_cv_enable_bluemarble = xyes])
211
da03b29d
GB
212# GeoNames http://www.geonames.org/
213AC_ARG_ENABLE(geonames, AC_HELP_STRING([--enable-geonames],
214 [enable Geonames stuff (default is enable)]),
215 [ac_cv_enable_geonames=$enableval],
216 [ac_cv_enable_geonames=yes])
217AC_CACHE_CHECK([whether to enable Geonames stuff],
218 [ac_cv_enable_geonames], [ac_cv_enable_geonames=yes])
219case $ac_cv_enable_geonames in
220 yes)
221 AC_DEFINE(VIK_CONFIG_GEONAMES, [], [GEONAMES STUFF])
222 ;;
223esac
224AM_CONDITIONAL([GEONAMES], [test x$ac_cv_enable_geonames = xyes])
225
1ef9e637 226AC_ARG_ENABLE(geocaches, AC_HELP_STRING([--enable-geocaches],
a0d39f7e 227 [enable Geocaches Acquire (default is disable).]),
1ef9e637
QT
228 [ac_cv_enable_geocaches=$enableval],
229 [ac_cv_enable_geocaches=no])
230AC_CACHE_CHECK([whether to enable Geocaches Acquire],
231 [ac_cv_enable_geocaches], [ac_cv_enable_geocaches=yes])
232case $ac_cv_enable_geocaches in
233 yes)
234 AC_DEFINE(VIK_CONFIG_GEOCACHES, [], [GEOCACHES STUFF])
235 ;;
236esac
237AM_CONDITIONAL([GEOCACHES], [test x$ac_cv_enable_geocaches = xyes])
238
f75d0233
RN
239AC_ARG_ENABLE(geotag, AC_HELP_STRING([--enable-geotag],
240 [enable Geotag Support (default is enable).]),
241 [ac_cv_enable_geotag=$enableval],
242 [ac_cv_enable_geotag=yes])
243AC_CACHE_CHECK([whether to enable Geotag Support],
244 [ac_cv_enable_geotag], [ac_cv_enable_geotag=yes])
245case $ac_cv_enable_geotag in
246 yes)
247 AC_CHECK_LIB(exif,exif_loader_new,,AC_MSG_ERROR([libexif is needed for Geotag features[,] but is not found. The feature can be disabled with --disable-geotag]))
248 AC_DEFINE(VIK_CONFIG_GEOTAG, [], [GEOTAG STUFF])
249 ;;
250esac
251AM_CONDITIONAL([GEOTAG], [test x$ac_cv_enable_geotag = xyes])
252
dd84b6d1
GB
253AC_ARG_ENABLE(spotmaps, AC_HELP_STRING([--enable-spotmaps],
254 [enable SPOTMaps map (default is enable).]),
255 [ac_cv_enable_spotmaps=$enableval],
256 [ac_cv_enable_spotmaps=yes])
257AC_CACHE_CHECK([whether to enable SPOTMaps map],
258 [ac_cv_enable_spotmaps], [ac_cv_enable_spotmaps=yes])
259case $ac_cv_enable_spotmaps in
260 yes)
261 AC_DEFINE(VIK_CONFIG_SPOTMAPS, [], [SPOTMAPS STUFF])
262 ;;
263esac
264AM_CONDITIONAL([SPOTMAPS], [test x$ac_cv_enable_spotmaps = xyes])
265
8c721f83
EB
266
267AC_ARG_ENABLE(dem24k, AC_HELP_STRING([--enable-dem24k],
268 [enable USGS 24k DEM (default is disable) download source. Requires dem24k.pl script in path.]),
269 [ac_cv_enable_dem24k=$enableval],
270 [ac_cv_enable_dem24k=no])
271AC_CACHE_CHECK([whether to enable USGS DEM 24k download source],
272 [ac_cv_enable_dem24k], [ac_cv_enable_dem24k=yes])
273case $ac_cv_enable_dem24k in
274 yes)
275 AC_DEFINE(VIK_CONFIG_DEM24K, [], [DEM24K STUFF])
276 ;;
277esac
278AM_CONDITIONAL([DEM24K], [test x$ac_cv_enable_dem24k = xyes])
279
001a86db
QT
280# Realtime GPS tracking
281AC_ARG_ENABLE(realtime-gps-tracking, AC_HELP_STRING([--enable-realtime-gps-tracking],
282 [enable realtime GPS tracking (default is enable)]),
283 [ac_cv_enable_realtimegpstracking=$enableval],
284 [ac_cv_enable_realtimegpstracking=yes])
285AC_CACHE_CHECK([whether to enable Realtime GPS Tracking stuff],
286 [ac_cv_enable_realtimegpstracking], [ac_cv_enable_realtimegpstracking=yes])
287case $ac_cv_enable_realtimegpstracking in
288 yes)
975e9067 289 AC_CHECK_LIB(gps,gps_close,,AC_MSG_ERROR([libgps is needed for Realtime GPS Tracking feature[,] but not found. The feature can be disable with --disable-realtime-gps-tracking]))
8956d2ef 290 AC_DEFINE(VIK_CONFIG_REALTIME_GPS_TRACKING, [], [REALTIME GPS TRACKING STUFF])
001a86db
QT
291 ;;
292esac
293AM_CONDITIONAL([REALTIME_GPS_TRACKING], [test x$ac_cv_enable_realtimegpstracking = xyes])
294
ba4a5e11
GB
295AC_ARG_WITH(search,
296 [AC_HELP_STRING([--with-search],
297 [specify google or geonames for searching (default is google)])],
298 [case "x$withval" in
299 "xgoogle")
300 VIK_CONFIG_SEARCH=VIK_CONFIG_SEARCH_GOOGLE
301 ;;
302 "xgeonames")
303 VIK_CONFIG_SEARCH=VIK_CONFIG_SEARCH_GEONAMES
304 ;;
305 *)
306 AC_MSG_ERROR([Please, set a value for search method])
307 esac],
308 [VIK_CONFIG_SEARCH=VIK_CONFIG_SEARCH_GOOGLE])
309AC_DEFINE_UNQUOTED(VIK_CONFIG_SEARCH_GOOGLE, 1,
310 [Id. for searching via GOOGLE])
311AC_DEFINE_UNQUOTED(VIK_CONFIG_SEARCH_GEONAMES, 2,
312 [Id. for searching via GEONAMES])
313AC_DEFINE_UNQUOTED(VIK_CONFIG_SEARCH, ${VIK_CONFIG_SEARCH},
314 [Method for the search])
315
316
1bc9b120
GB
317AC_ARG_WITH(mapcache,
318 [AC_HELP_STRING([--with-mapcache],
e6e277a8 319 [specify the size of the map cache in MB (default is 128)])],
1bc9b120
GB
320 [if test "x$withval" = "xno"; then
321 VIK_CONFIG_MAPCACHE_SIZE=0;
322 elif test "x$withval" = "xyes"; then
e6e277a8 323 AC_MSG_ERROR([Please, set a value for size of the map cache in MB])
1bc9b120
GB
324 else
325 VIK_CONFIG_MAPCACHE_SIZE=${withval}
326 fi],
e6e277a8 327 [VIK_CONFIG_MAPCACHE_SIZE=128])
1bc9b120
GB
328AC_DEFINE_UNQUOTED(VIK_CONFIG_MAPCACHE_SIZE, ${VIK_CONFIG_MAPCACHE_SIZE},
329 [Size of the map cache])
330
5e108809
GB
331
332AC_ARG_WITH(tileage,
333 [AC_HELP_STRING([--with-tileage],
7965485d 334 [specify the age of a tile before checking it (default is 7 days)])],
5e108809
GB
335 [if test "x$withval" = "xno"; then
336 VIK_CONFIG_DEFAULT_TILE_AGE=0;
337 elif test "x$withval" = "xyes"; then
338 AC_MSG_ERROR([Please, set a value for age of tiles])
339 else
340 VIK_CONFIG_DEFAULT_TILE_AGE=${withval}
341 fi],
7965485d 342 [VIK_CONFIG_DEFAULT_TILE_AGE=604800])
5e108809 343AC_DEFINE_UNQUOTED(VIK_CONFIG_DEFAULT_TILE_AGE, ${VIK_CONFIG_DEFAULT_TILE_AGE},
8276d332 344 [Age of tiles before checking it (in seconds)])
5e108809 345
e5140ce8
GB
346dnl man pages processing
347DB2MAN_XSL=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl
348AC_SUBST(DB2MAN_XSL)
349AC_PATH_PROG(XP,xsltproc)
eb6a42c9 350AM_CONDITIONAL([HAVE_XSLTPROC],[test "x$XP" != "x"])
e5140ce8
GB
351AM_CONDITIONAL([GEN_MANPAGES],[test "x$XP" != "x" && test -r "$DB2MAN_XSL"])
352
a5daec1c
GB
353dnl This will cause the automake generated makefiles to pass the
354dnl correct flags to aclocal.
355ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
356AC_SUBST(ACLOCAL_AMFLAGS)
357
a07e9f61 358AM_CONDITIONAL([VIKING_DOC], test x${enable_gtk_doc} = xyes)
8e11c259 359
734652bf 360# Configuration
a07e9f61
RN
361AC_CONFIG_FILES([
362 Makefile
363 src/Makefile
364 src/icons/Makefile
365 po/Makefile.in
366 data/Makefile
367 test/Makefile])
368AM_COND_IF([VIKING_DOC],
369 [AC_CONFIG_FILES([
370 help/Makefile
371 doc/Makefile
372 doc/reference/Makefile
373 doc/examples/Makefile])])
374
af2740eb
QT
375AC_OUTPUT([
376 viking.spec
377 ])
001a86db
QT
378
379dnl Output the configuration summary
380echo ""
381echo "==========================================="
382echo "$PACKAGE $VERSION"
383echo "-------------------------------------------"
384echo "Alphabetized track & waypoints : $ac_cv_enable_alpha_trw"
9f58c4b4 385echo "Bing Maps : $ac_cv_enable_bing"
ebf1bd39
RN
386echo "Google Goto : $ac_cv_enable_google"
387echo "Google Directions (Broken) : $ac_cv_enable_google_directions"
001a86db 388echo "Terraserver Maps : $ac_cv_enable_terraserver"
c21cf491 389echo "Expedia Maps : $ac_cv_enable_expedia"
001a86db 390echo "Open Street Map : $ac_cv_enable_openstreetmap"
f7d8a3c2 391echo "BlueMarble : $ac_cv_enable_bluemarble"
dd84b6d1 392echo "SPOTMaps : $ac_cv_enable_spotmaps"
da03b29d 393echo "Geonames : $ac_cv_enable_geonames"
de63aedb 394echo "Geocaches Acquire : $ac_cv_enable_geocaches"
f75d0233 395echo "Geotag Support : $ac_cv_enable_geotag"
001a86db
QT
396echo "USGS 24k DEM : $ac_cv_enable_dem24k"
397echo "Realtime GPS Tracking : $ac_cv_enable_realtimegpstracking"
398echo "Size of map cache (in memory) : ${VIK_CONFIG_MAPCACHE_SIZE}"
5e108809 399echo "Age of tiles (in seconds) : ${VIK_CONFIG_DEFAULT_TILE_AGE}"
a07e9f61 400echo "Documentation (+HTML) : ${enable_gtk_doc} (HTML: ${enable_gtk_doc_html})"
001a86db
QT
401echo "-------------------------------------------"
402echo ""
403echo "Configure finished, type 'make' to build."
404