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