]> git.street.me.uk Git - andy/viking.git/blame - configure.ac
Use settings to allow configuration of max background threads.
[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)
11748363 5AC_INIT(viking, 1.4.1, , viking, http://viking.sf.net/)
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
db7fa5f6 36AC_CHECK_HEADERS([malloc.h stdlib.h string.h sys/param.h sys/types.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
db7fa5f6 45AC_CHECK_FUNCS([floor memset mkdtemp pow realpath 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, [
aa0665e5 68 glib-2.0 >= 2.16
bf0922c7 69 gthread-2.0 >= 2.2
9b082b39 70 gtk+-2.0 >= 2.14
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 106# Options
9f58c4b4
GB
107AC_ARG_ENABLE(bing, AC_HELP_STRING([--enable-bing],
108 [enable Bing stuff (default is enable)]),
109 [ac_cv_enable_bing=$enableval],
110 [ac_cv_enable_bing=yes])
111AC_CACHE_CHECK([whether to enable Bing stuff],
112 [ac_cv_enable_bing], [ac_cv_enable_bing=yes])
113case $ac_cv_enable_bing in
114 yes)
115 AC_DEFINE(VIK_CONFIG_BING, [], [BING STUFF])
116 ;;
117esac
118AM_CONDITIONAL([BING], [test x$ac_cv_enable_bing = xyes])
119
cdcaf41c 120AC_ARG_ENABLE(google, AC_HELP_STRING([--enable-google],
55340efa 121 [enable Google stuff (default is enable)]),
cdcaf41c
QT
122 [ac_cv_enable_google=$enableval],
123 [ac_cv_enable_google=yes])
124AC_CACHE_CHECK([whether to enable Google stuff],
125 [ac_cv_enable_google], [ac_cv_enable_google=yes])
126case $ac_cv_enable_google in
127 yes)
128 AC_DEFINE(VIK_CONFIG_GOOGLE, [], [GOOGLE STUFF])
129 ;;
130esac
131AM_CONDITIONAL([GOOGLE], [test x$ac_cv_enable_google = xyes])
132
133AC_ARG_ENABLE(terraserver, AC_HELP_STRING([--enable-terraserver],
134 [enable Terraserver stuff (default is enable)]),
135 [ac_cv_enable_terraserver=$enableval],
136 [ac_cv_enable_terraserver=yes])
137AC_CACHE_CHECK([whether to enable Terraserver stuff],
138 [ac_cv_enable_terraserver], [ac_cv_enable_terraserver=yes])
139case $ac_cv_enable_terraserver in
140 yes)
141 AC_DEFINE(VIK_CONFIG_TERRASERVER, [], [TERRASERVER STUFF])
142 ;;
143esac
144AM_CONDITIONAL([TERRASERVER], [test x$ac_cv_enable_terraserver = xyes])
145
146AC_ARG_ENABLE(expedia, AC_HELP_STRING([--enable-expedia],
06f31fd5 147 [enable Expedia stuff (default is disable)]),
cdcaf41c 148 [ac_cv_enable_expedia=$enableval],
06f31fd5 149 [ac_cv_enable_expedia=no])
cdcaf41c
QT
150AC_CACHE_CHECK([whether to enable Expedia stuff],
151 [ac_cv_enable_expedia], [ac_cv_enable_expedia=yes])
152case $ac_cv_enable_expedia in
153 yes)
154 AC_DEFINE(VIK_CONFIG_EXPEDIA, [], [EXPEDIA STUFF])
155 ;;
156esac
157AM_CONDITIONAL([EXPEDIA], [test x$ac_cv_enable_expedia = xyes])
158
ca9eb04a
GB
159# OpenStreetMap http://www.openstreetmap.org/
160AC_ARG_ENABLE(openstreetmap, AC_HELP_STRING([--enable-openstreetmap],
161 [enable OpenStreetMap stuff (default is enable)]),
162 [ac_cv_enable_openstreetmap=$enableval],
163 [ac_cv_enable_openstreetmap=yes])
164AC_CACHE_CHECK([whether to enable OpenStreetMap stuff],
165 [ac_cv_enable_openstreetmap], [ac_cv_enable_openstreetmap=yes])
166case $ac_cv_enable_openstreetmap in
167 yes)
168 AC_DEFINE(VIK_CONFIG_OPENSTREETMAP, [], [OPENSTREETMAP STUFF])
169 ;;
170esac
171AM_CONDITIONAL([OPENSTREETMAP], [test x$ac_cv_enable_openstreetmap = xyes])
172
96c3f0d5
GB
173# BlueMarble
174AC_ARG_ENABLE(bluemarble, AC_HELP_STRING([--enable-bluemarble],
175 [enable BlueMarble stuff (default is enable)]),
176 [ac_cv_enable_bluemarble=$enableval],
177 [ac_cv_enable_bluemarble=yes])
178AC_CACHE_CHECK([whether to enable BlueMarble stuff],
179 [ac_cv_enable_bluemarble], [ac_cv_enable_bluemarble=yes])
180case $ac_cv_enable_bluemarble in
181 yes)
182 AC_DEFINE(VIK_CONFIG_BLUEMARBLE, [], [BLUEMARBLE STUFF])
183 ;;
184esac
185AM_CONDITIONAL([BLUEMARBLE], [test x$ac_cv_enable_bluemarble = xyes])
186
da03b29d
GB
187# GeoNames http://www.geonames.org/
188AC_ARG_ENABLE(geonames, AC_HELP_STRING([--enable-geonames],
189 [enable Geonames stuff (default is enable)]),
190 [ac_cv_enable_geonames=$enableval],
191 [ac_cv_enable_geonames=yes])
192AC_CACHE_CHECK([whether to enable Geonames stuff],
193 [ac_cv_enable_geonames], [ac_cv_enable_geonames=yes])
194case $ac_cv_enable_geonames in
195 yes)
196 AC_DEFINE(VIK_CONFIG_GEONAMES, [], [GEONAMES STUFF])
197 ;;
198esac
199AM_CONDITIONAL([GEONAMES], [test x$ac_cv_enable_geonames = xyes])
200
1ef9e637 201AC_ARG_ENABLE(geocaches, AC_HELP_STRING([--enable-geocaches],
a0d39f7e 202 [enable Geocaches Acquire (default is disable).]),
1ef9e637
QT
203 [ac_cv_enable_geocaches=$enableval],
204 [ac_cv_enable_geocaches=no])
205AC_CACHE_CHECK([whether to enable Geocaches Acquire],
206 [ac_cv_enable_geocaches], [ac_cv_enable_geocaches=yes])
207case $ac_cv_enable_geocaches in
208 yes)
209 AC_DEFINE(VIK_CONFIG_GEOCACHES, [], [GEOCACHES STUFF])
210 ;;
211esac
212AM_CONDITIONAL([GEOCACHES], [test x$ac_cv_enable_geocaches = xyes])
213
f75d0233
RN
214AC_ARG_ENABLE(geotag, AC_HELP_STRING([--enable-geotag],
215 [enable Geotag Support (default is enable).]),
216 [ac_cv_enable_geotag=$enableval],
217 [ac_cv_enable_geotag=yes])
218AC_CACHE_CHECK([whether to enable Geotag Support],
219 [ac_cv_enable_geotag], [ac_cv_enable_geotag=yes])
220case $ac_cv_enable_geotag in
221 yes)
222 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]))
223 AC_DEFINE(VIK_CONFIG_GEOTAG, [], [GEOTAG STUFF])
224 ;;
225esac
226AM_CONDITIONAL([GEOTAG], [test x$ac_cv_enable_geotag = xyes])
227
dd84b6d1
GB
228AC_ARG_ENABLE(spotmaps, AC_HELP_STRING([--enable-spotmaps],
229 [enable SPOTMaps map (default is enable).]),
230 [ac_cv_enable_spotmaps=$enableval],
231 [ac_cv_enable_spotmaps=yes])
232AC_CACHE_CHECK([whether to enable SPOTMaps map],
233 [ac_cv_enable_spotmaps], [ac_cv_enable_spotmaps=yes])
234case $ac_cv_enable_spotmaps in
235 yes)
236 AC_DEFINE(VIK_CONFIG_SPOTMAPS, [], [SPOTMAPS STUFF])
237 ;;
238esac
239AM_CONDITIONAL([SPOTMAPS], [test x$ac_cv_enable_spotmaps = xyes])
240
8c721f83
EB
241
242AC_ARG_ENABLE(dem24k, AC_HELP_STRING([--enable-dem24k],
243 [enable USGS 24k DEM (default is disable) download source. Requires dem24k.pl script in path.]),
244 [ac_cv_enable_dem24k=$enableval],
245 [ac_cv_enable_dem24k=no])
246AC_CACHE_CHECK([whether to enable USGS DEM 24k download source],
247 [ac_cv_enable_dem24k], [ac_cv_enable_dem24k=yes])
248case $ac_cv_enable_dem24k in
249 yes)
250 AC_DEFINE(VIK_CONFIG_DEM24K, [], [DEM24K STUFF])
251 ;;
252esac
253AM_CONDITIONAL([DEM24K], [test x$ac_cv_enable_dem24k = xyes])
254
001a86db
QT
255# Realtime GPS tracking
256AC_ARG_ENABLE(realtime-gps-tracking, AC_HELP_STRING([--enable-realtime-gps-tracking],
257 [enable realtime GPS tracking (default is enable)]),
258 [ac_cv_enable_realtimegpstracking=$enableval],
259 [ac_cv_enable_realtimegpstracking=yes])
260AC_CACHE_CHECK([whether to enable Realtime GPS Tracking stuff],
261 [ac_cv_enable_realtimegpstracking], [ac_cv_enable_realtimegpstracking=yes])
262case $ac_cv_enable_realtimegpstracking in
263 yes)
975e9067 264 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 265 AC_DEFINE(VIK_CONFIG_REALTIME_GPS_TRACKING, [], [REALTIME GPS TRACKING STUFF])
001a86db
QT
266 ;;
267esac
268AM_CONDITIONAL([REALTIME_GPS_TRACKING], [test x$ac_cv_enable_realtimegpstracking = xyes])
269
ba4a5e11
GB
270AC_ARG_WITH(search,
271 [AC_HELP_STRING([--with-search],
272 [specify google or geonames for searching (default is google)])],
273 [case "x$withval" in
274 "xgoogle")
275 VIK_CONFIG_SEARCH=VIK_CONFIG_SEARCH_GOOGLE
276 ;;
277 "xgeonames")
278 VIK_CONFIG_SEARCH=VIK_CONFIG_SEARCH_GEONAMES
279 ;;
280 *)
281 AC_MSG_ERROR([Please, set a value for search method])
282 esac],
283 [VIK_CONFIG_SEARCH=VIK_CONFIG_SEARCH_GOOGLE])
284AC_DEFINE_UNQUOTED(VIK_CONFIG_SEARCH_GOOGLE, 1,
285 [Id. for searching via GOOGLE])
286AC_DEFINE_UNQUOTED(VIK_CONFIG_SEARCH_GEONAMES, 2,
287 [Id. for searching via GEONAMES])
288AC_DEFINE_UNQUOTED(VIK_CONFIG_SEARCH, ${VIK_CONFIG_SEARCH},
289 [Method for the search])
290
291
1bc9b120
GB
292AC_ARG_WITH(mapcache,
293 [AC_HELP_STRING([--with-mapcache],
e6e277a8 294 [specify the size of the map cache in MB (default is 128)])],
1bc9b120
GB
295 [if test "x$withval" = "xno"; then
296 VIK_CONFIG_MAPCACHE_SIZE=0;
297 elif test "x$withval" = "xyes"; then
e6e277a8 298 AC_MSG_ERROR([Please, set a value for size of the map cache in MB])
1bc9b120
GB
299 else
300 VIK_CONFIG_MAPCACHE_SIZE=${withval}
301 fi],
e6e277a8 302 [VIK_CONFIG_MAPCACHE_SIZE=128])
1bc9b120
GB
303AC_DEFINE_UNQUOTED(VIK_CONFIG_MAPCACHE_SIZE, ${VIK_CONFIG_MAPCACHE_SIZE},
304 [Size of the map cache])
305
5e108809
GB
306
307AC_ARG_WITH(tileage,
308 [AC_HELP_STRING([--with-tileage],
7965485d 309 [specify the age of a tile before checking it (default is 7 days)])],
5e108809
GB
310 [if test "x$withval" = "xno"; then
311 VIK_CONFIG_DEFAULT_TILE_AGE=0;
312 elif test "x$withval" = "xyes"; then
313 AC_MSG_ERROR([Please, set a value for age of tiles])
314 else
315 VIK_CONFIG_DEFAULT_TILE_AGE=${withval}
316 fi],
7965485d 317 [VIK_CONFIG_DEFAULT_TILE_AGE=604800])
5e108809 318AC_DEFINE_UNQUOTED(VIK_CONFIG_DEFAULT_TILE_AGE, ${VIK_CONFIG_DEFAULT_TILE_AGE},
8276d332 319 [Age of tiles before checking it (in seconds)])
5e108809 320
e5140ce8
GB
321dnl man pages processing
322DB2MAN_XSL=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl
323AC_SUBST(DB2MAN_XSL)
324AC_PATH_PROG(XP,xsltproc)
eb6a42c9 325AM_CONDITIONAL([HAVE_XSLTPROC],[test "x$XP" != "x"])
e5140ce8
GB
326AM_CONDITIONAL([GEN_MANPAGES],[test "x$XP" != "x" && test -r "$DB2MAN_XSL"])
327
a5daec1c
GB
328dnl This will cause the automake generated makefiles to pass the
329dnl correct flags to aclocal.
330ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
331AC_SUBST(ACLOCAL_AMFLAGS)
332
a07e9f61 333AM_CONDITIONAL([VIKING_DOC], test x${enable_gtk_doc} = xyes)
8e11c259 334
734652bf 335# Configuration
a07e9f61
RN
336AC_CONFIG_FILES([
337 Makefile
338 src/Makefile
339 src/icons/Makefile
340 po/Makefile.in
341 data/Makefile
763f5c56 342 test/Makefile
d7603eb2 343 help/Makefile
763f5c56
RN
344 win32/Makefile
345 win32/installer/Makefile
346 win32/installer/pixmaps/Makefile
347 win32/installer/translations/Makefile])
a07e9f61
RN
348AM_COND_IF([VIKING_DOC],
349 [AC_CONFIG_FILES([
a07e9f61
RN
350 doc/Makefile
351 doc/reference/Makefile
352 doc/examples/Makefile])])
353
af2740eb
QT
354AC_OUTPUT([
355 viking.spec
356 ])
001a86db
QT
357
358dnl Output the configuration summary
359echo ""
360echo "==========================================="
361echo "$PACKAGE $VERSION"
362echo "-------------------------------------------"
363echo "Alphabetized track & waypoints : $ac_cv_enable_alpha_trw"
9f58c4b4 364echo "Bing Maps : $ac_cv_enable_bing"
55340efa 365echo "Google : $ac_cv_enable_google"
001a86db 366echo "Terraserver Maps : $ac_cv_enable_terraserver"
c21cf491 367echo "Expedia Maps : $ac_cv_enable_expedia"
001a86db 368echo "Open Street Map : $ac_cv_enable_openstreetmap"
f7d8a3c2 369echo "BlueMarble : $ac_cv_enable_bluemarble"
dd84b6d1 370echo "SPOTMaps : $ac_cv_enable_spotmaps"
da03b29d 371echo "Geonames : $ac_cv_enable_geonames"
de63aedb 372echo "Geocaches Acquire : $ac_cv_enable_geocaches"
f75d0233 373echo "Geotag Support : $ac_cv_enable_geotag"
001a86db
QT
374echo "USGS 24k DEM : $ac_cv_enable_dem24k"
375echo "Realtime GPS Tracking : $ac_cv_enable_realtimegpstracking"
376echo "Size of map cache (in memory) : ${VIK_CONFIG_MAPCACHE_SIZE}"
5e108809 377echo "Age of tiles (in seconds) : ${VIK_CONFIG_DEFAULT_TILE_AGE}"
a07e9f61 378echo "Documentation (+HTML) : ${enable_gtk_doc} (HTML: ${enable_gtk_doc_html})"
001a86db
QT
379echo "-------------------------------------------"
380echo ""
381echo "Configure finished, type 'make' to build."
382