]> git.street.me.uk Git - andy/viking.git/blame - configure.ac
Add Select Request layer interface and use within the track/waypoint layer to select...
[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)
f940772b 5AC_INIT(viking, 1.1)
9903c388
EB
6AM_INIT_AUTOMAKE()
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
7de36baf 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])
9903c388
EB
37
38# Checks for typedefs, structures, and compiler characteristics.
39AC_C_CONST
40AC_TYPE_MODE_T
41
42# Checks for library functions.
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)
9903c388 48
dad55b79 49# Expat
fa1b5a5f
GB
50AM_WITH_EXPAT
51
3292ba8b 52# Curl
f901dcdf 53LIBCURL_CHECK_CONFIG([yes],[],[],[AC_MSG_ERROR([libcurl is needed but not found])])
3292ba8b 54
bf0922c7 55# gdk-pixbuf-csource
fa1b5a5f
GB
56AC_CHECK_PROG([GDK_PIXBUF_CSOURCE],gdk-pixbuf-csource,[yes])
57if test $GDK_PIXBUF_CSOURCE != "yes"
58then
59 AC_MSG_ERROR([gdk-pixbuf-csource is needed but not found])
60fi
61
bf0922c7
GB
62dnl ------------------
63dnl | Pkgconfig checks |---------------------------------------
64dnl ------------------
65
66PKG_CHECK_MODULES(PACKAGE, [
67 glib-2.0 >= 2.12
68 gthread-2.0 >= 2.2
274e14bd 69 gtk+-2.0 >= 2.12
314084b8 70 gio-2.0 >= 2.12
bf0922c7
GB
71])
72
73AC_SUBST(PACKAGE_CFLAGS)
74AC_SUBST(PACKAGE_LIBS)
75
f8b8a0b5
GB
76dnl -------------
77dnl | User Manual |---------------------------------------
78dnl -------------
79GNOME_DOC_INIT
dad55b79 80
bca29d33
GB
81dnl ---------------------------------------------------------------------------
82dnl - Use deprecated options (default enabled for devs, disabled in releases)
83dnl ---------------------------------------------------------------------------
84
79452f0e
GB
85AC_ARG_ENABLE(deprecations,
86 [AC_HELP_STRING([--enable-deprecations],
bca29d33
GB
87 [warn about deprecated usages [default=no]])],
88 [ac_cv_enable_deprecations=$enableval],
89 [ac_cv_enable_deprecations=no])
90AC_CACHE_CHECK([whether to enable deprecated features],
91 [ac_cv_enable_deprecations], [ac_cv_enable_deprecations=no])
79452f0e 92
bca29d33 93if test "x$ac_cv_enable_deprecations" = "xyes"; then
79452f0e 94 DISABLE_DEPRECATED_CFLAGS="\
bca29d33
GB
95-DG_DISABLE_SINGLE_INCLUDES \
96-DGSEAL_ENABLE \
79452f0e
GB
97-DG_DISABLE_DEPRECATED \
98-DGDK_DISABLE_DEPRECATED \
bca29d33
GB
99-DGDK_PIXBUF_DISABLE_DEPRECATED \
100-DGTK_DISABLE_SINGLE_INCLUDES \
101-DGTK_DISABLE_DEPRECATED"
102 CPPFLAGS="$CPPFLAGS $DISABLE_DEPRECATED_CFLAGS"
79452f0e 103fi
dad55b79 104
734652bf
EB
105# Options
106AC_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])
110AC_CACHE_CHECK([whether to enable alphabetized track & waypoint],
111 [ac_cv_enable_alpha_trw], [ac_cv_enable_alpha_trw=yes])
112case $ac_cv_enable_alpha_trw in
113 yes)
114 AC_DEFINE(VIK_CONFIG_ALPHABETIZED_TRW, [], [NO ALPHABETIZED TRW])
115 ;;
116esac
117
9f58c4b4
GB
118AC_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])
122AC_CACHE_CHECK([whether to enable Bing stuff],
123 [ac_cv_enable_bing], [ac_cv_enable_bing=yes])
124case $ac_cv_enable_bing in
125 yes)
126 AC_DEFINE(VIK_CONFIG_BING, [], [BING STUFF])
127 ;;
128esac
129AM_CONDITIONAL([BING], [test x$ac_cv_enable_bing = xyes])
130
cdcaf41c
QT
131AC_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])
135AC_CACHE_CHECK([whether to enable Google stuff],
136 [ac_cv_enable_google], [ac_cv_enable_google=yes])
137case $ac_cv_enable_google in
138 yes)
139 AC_DEFINE(VIK_CONFIG_GOOGLE, [], [GOOGLE STUFF])
140 ;;
141esac
142AM_CONDITIONAL([GOOGLE], [test x$ac_cv_enable_google = xyes])
143
144AC_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])
148AC_CACHE_CHECK([whether to enable Terraserver stuff],
149 [ac_cv_enable_terraserver], [ac_cv_enable_terraserver=yes])
150case $ac_cv_enable_terraserver in
151 yes)
152 AC_DEFINE(VIK_CONFIG_TERRASERVER, [], [TERRASERVER STUFF])
153 ;;
154esac
155AM_CONDITIONAL([TERRASERVER], [test x$ac_cv_enable_terraserver = xyes])
156
157AC_ARG_ENABLE(expedia, AC_HELP_STRING([--enable-expedia],
06f31fd5 158 [enable Expedia stuff (default is disable)]),
cdcaf41c 159 [ac_cv_enable_expedia=$enableval],
06f31fd5 160 [ac_cv_enable_expedia=no])
cdcaf41c
QT
161AC_CACHE_CHECK([whether to enable Expedia stuff],
162 [ac_cv_enable_expedia], [ac_cv_enable_expedia=yes])
163case $ac_cv_enable_expedia in
164 yes)
165 AC_DEFINE(VIK_CONFIG_EXPEDIA, [], [EXPEDIA STUFF])
166 ;;
167esac
168AM_CONDITIONAL([EXPEDIA], [test x$ac_cv_enable_expedia = xyes])
169
ca9eb04a
GB
170# OpenStreetMap http://www.openstreetmap.org/
171AC_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])
175AC_CACHE_CHECK([whether to enable OpenStreetMap stuff],
176 [ac_cv_enable_openstreetmap], [ac_cv_enable_openstreetmap=yes])
177case $ac_cv_enable_openstreetmap in
178 yes)
179 AC_DEFINE(VIK_CONFIG_OPENSTREETMAP, [], [OPENSTREETMAP STUFF])
180 ;;
181esac
182AM_CONDITIONAL([OPENSTREETMAP], [test x$ac_cv_enable_openstreetmap = xyes])
183
96c3f0d5
GB
184# BlueMarble
185AC_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])
189AC_CACHE_CHECK([whether to enable BlueMarble stuff],
190 [ac_cv_enable_bluemarble], [ac_cv_enable_bluemarble=yes])
191case $ac_cv_enable_bluemarble in
192 yes)
193 AC_DEFINE(VIK_CONFIG_BLUEMARBLE, [], [BLUEMARBLE STUFF])
194 ;;
195esac
196AM_CONDITIONAL([BLUEMARBLE], [test x$ac_cv_enable_bluemarble = xyes])
197
da03b29d
GB
198# GeoNames http://www.geonames.org/
199AC_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])
203AC_CACHE_CHECK([whether to enable Geonames stuff],
204 [ac_cv_enable_geonames], [ac_cv_enable_geonames=yes])
205case $ac_cv_enable_geonames in
206 yes)
207 AC_DEFINE(VIK_CONFIG_GEONAMES, [], [GEONAMES STUFF])
208 ;;
209esac
210AM_CONDITIONAL([GEONAMES], [test x$ac_cv_enable_geonames = xyes])
211
1ef9e637 212AC_ARG_ENABLE(geocaches, AC_HELP_STRING([--enable-geocaches],
a0d39f7e 213 [enable Geocaches Acquire (default is disable).]),
1ef9e637
QT
214 [ac_cv_enable_geocaches=$enableval],
215 [ac_cv_enable_geocaches=no])
216AC_CACHE_CHECK([whether to enable Geocaches Acquire],
217 [ac_cv_enable_geocaches], [ac_cv_enable_geocaches=yes])
218case $ac_cv_enable_geocaches in
219 yes)
220 AC_DEFINE(VIK_CONFIG_GEOCACHES, [], [GEOCACHES STUFF])
221 ;;
222esac
223AM_CONDITIONAL([GEOCACHES], [test x$ac_cv_enable_geocaches = xyes])
224
dd84b6d1
GB
225AC_ARG_ENABLE(spotmaps, AC_HELP_STRING([--enable-spotmaps],
226 [enable SPOTMaps map (default is enable).]),
227 [ac_cv_enable_spotmaps=$enableval],
228 [ac_cv_enable_spotmaps=yes])
229AC_CACHE_CHECK([whether to enable SPOTMaps map],
230 [ac_cv_enable_spotmaps], [ac_cv_enable_spotmaps=yes])
231case $ac_cv_enable_spotmaps in
232 yes)
233 AC_DEFINE(VIK_CONFIG_SPOTMAPS, [], [SPOTMAPS STUFF])
234 ;;
235esac
236AM_CONDITIONAL([SPOTMAPS], [test x$ac_cv_enable_spotmaps = xyes])
237
8c721f83
EB
238
239AC_ARG_ENABLE(dem24k, AC_HELP_STRING([--enable-dem24k],
240 [enable USGS 24k DEM (default is disable) download source. Requires dem24k.pl script in path.]),
241 [ac_cv_enable_dem24k=$enableval],
242 [ac_cv_enable_dem24k=no])
243AC_CACHE_CHECK([whether to enable USGS DEM 24k download source],
244 [ac_cv_enable_dem24k], [ac_cv_enable_dem24k=yes])
245case $ac_cv_enable_dem24k in
246 yes)
247 AC_DEFINE(VIK_CONFIG_DEM24K, [], [DEM24K STUFF])
248 ;;
249esac
250AM_CONDITIONAL([DEM24K], [test x$ac_cv_enable_dem24k = xyes])
251
001a86db
QT
252# Realtime GPS tracking
253AC_ARG_ENABLE(realtime-gps-tracking, AC_HELP_STRING([--enable-realtime-gps-tracking],
254 [enable realtime GPS tracking (default is enable)]),
255 [ac_cv_enable_realtimegpstracking=$enableval],
256 [ac_cv_enable_realtimegpstracking=yes])
257AC_CACHE_CHECK([whether to enable Realtime GPS Tracking stuff],
258 [ac_cv_enable_realtimegpstracking], [ac_cv_enable_realtimegpstracking=yes])
259case $ac_cv_enable_realtimegpstracking in
260 yes)
8956d2ef
QT
261 AC_CHECK_LIB(gps,gps_poll,,AC_MSG_ERROR([libgps is needed for Realtime GPS Tracking feature[,] but not found. The feature can be disable with --disable-realtime-gps-tracking]))
262 AC_DEFINE(VIK_CONFIG_REALTIME_GPS_TRACKING, [], [REALTIME GPS TRACKING STUFF])
001a86db
QT
263 ;;
264esac
265AM_CONDITIONAL([REALTIME_GPS_TRACKING], [test x$ac_cv_enable_realtimegpstracking = xyes])
bec818c4
GB
266# Viking supports two incompatibles versions of GPSd: 2.39 and 2.90
267# But GPSd does not provides easy way to test features.
268if test x$ac_cv_enable_realtimegpstracking = xyes
269then
270 AC_CHECK_FUNCS(gps_stream)
a263d172 271 AC_CHECK_FUNCS(gps_open_r)
bec818c4 272fi
001a86db 273
ba4a5e11
GB
274AC_ARG_WITH(search,
275 [AC_HELP_STRING([--with-search],
276 [specify google or geonames for searching (default is google)])],
277 [case "x$withval" in
278 "xgoogle")
279 VIK_CONFIG_SEARCH=VIK_CONFIG_SEARCH_GOOGLE
280 ;;
281 "xgeonames")
282 VIK_CONFIG_SEARCH=VIK_CONFIG_SEARCH_GEONAMES
283 ;;
284 *)
285 AC_MSG_ERROR([Please, set a value for search method])
286 esac],
287 [VIK_CONFIG_SEARCH=VIK_CONFIG_SEARCH_GOOGLE])
288AC_DEFINE_UNQUOTED(VIK_CONFIG_SEARCH_GOOGLE, 1,
289 [Id. for searching via GOOGLE])
290AC_DEFINE_UNQUOTED(VIK_CONFIG_SEARCH_GEONAMES, 2,
291 [Id. for searching via GEONAMES])
292AC_DEFINE_UNQUOTED(VIK_CONFIG_SEARCH, ${VIK_CONFIG_SEARCH},
293 [Method for the search])
294
295
1bc9b120
GB
296AC_ARG_WITH(mapcache,
297 [AC_HELP_STRING([--with-mapcache],
298 [specify the size of the map cache (default is 50331648)])],
299 [if test "x$withval" = "xno"; then
300 VIK_CONFIG_MAPCACHE_SIZE=0;
301 elif test "x$withval" = "xyes"; then
302 AC_MSG_ERROR([Please, set a value for size of the map cache])
303 else
304 VIK_CONFIG_MAPCACHE_SIZE=${withval}
305 fi],
306 [VIK_CONFIG_MAPCACHE_SIZE=50331648])
307AC_DEFINE_UNQUOTED(VIK_CONFIG_MAPCACHE_SIZE, ${VIK_CONFIG_MAPCACHE_SIZE},
308 [Size of the map cache])
309
5e108809
GB
310
311AC_ARG_WITH(tileage,
312 [AC_HELP_STRING([--with-tileage],
313 [specify the age of a tile before checking it (default is 30 s)])],
314 [if test "x$withval" = "xno"; then
315 VIK_CONFIG_DEFAULT_TILE_AGE=0;
316 elif test "x$withval" = "xyes"; then
317 AC_MSG_ERROR([Please, set a value for age of tiles])
318 else
319 VIK_CONFIG_DEFAULT_TILE_AGE=${withval}
320 fi],
321 [VIK_CONFIG_DEFAULT_TILE_AGE=30])
322AC_DEFINE_UNQUOTED(VIK_CONFIG_DEFAULT_TILE_AGE, ${VIK_CONFIG_DEFAULT_TILE_AGE},
323 [Age of tiles before cheking it (in seconds)])
324
e5140ce8
GB
325dnl man pages processing
326DB2MAN_XSL=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl
327AC_SUBST(DB2MAN_XSL)
328AC_PATH_PROG(XP,xsltproc)
eb6a42c9 329AM_CONDITIONAL([HAVE_XSLTPROC],[test "x$XP" != "x"])
e5140ce8
GB
330AM_CONDITIONAL([GEN_MANPAGES],[test "x$XP" != "x" && test -r "$DB2MAN_XSL"])
331
a5daec1c
GB
332dnl This will cause the automake generated makefiles to pass the
333dnl correct flags to aclocal.
334ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
335AC_SUBST(ACLOCAL_AMFLAGS)
336
734652bf 337# Configuration
9903c388 338AC_CONFIG_FILES([Makefile
0912fc7e 339 src/Makefile
dad55b79 340 src/icons/Makefile
a5daec1c 341 po/Makefile.in
9d3e06a4 342 test/Makefile
f8b8a0b5 343 help/Makefile
0912fc7e 344 doc/Makefile
e5c58469 345 doc/reference/Makefile
5c6dc9bf 346 doc/examples/Makefile
0912fc7e 347 doc/dev/Makefile])
af2740eb
QT
348AC_OUTPUT([
349 viking.spec
350 ])
001a86db
QT
351
352dnl Output the configuration summary
353echo ""
354echo "==========================================="
355echo "$PACKAGE $VERSION"
356echo "-------------------------------------------"
357echo "Alphabetized track & waypoints : $ac_cv_enable_alpha_trw"
9f58c4b4 358echo "Bing Maps : $ac_cv_enable_bing"
001a86db 359echo "Google Maps : $ac_cv_enable_google"
001a86db 360echo "Terraserver Maps : $ac_cv_enable_terraserver"
c21cf491 361echo "Expedia Maps : $ac_cv_enable_expedia"
001a86db 362echo "Open Street Map : $ac_cv_enable_openstreetmap"
f7d8a3c2 363echo "BlueMarble : $ac_cv_enable_bluemarble"
dd84b6d1 364echo "SPOTMaps : $ac_cv_enable_spotmaps"
da03b29d 365echo "Geonames : $ac_cv_enable_geonames"
001a86db
QT
366#echo "Geocaches Acquire : $ac_cv_enable_geocaches"
367echo "USGS 24k DEM : $ac_cv_enable_dem24k"
368echo "Realtime GPS Tracking : $ac_cv_enable_realtimegpstracking"
369echo "Size of map cache (in memory) : ${VIK_CONFIG_MAPCACHE_SIZE}"
5e108809 370echo "Age of tiles (in seconds) : ${VIK_CONFIG_DEFAULT_TILE_AGE}"
001a86db
QT
371echo "-------------------------------------------"
372echo ""
373echo "Configure finished, type 'make' to build."
374