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