]> git.street.me.uk Git - andy/viking.git/blame - configure.ac
Set 'OK' default for autogenerated dialogs.
[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)
05593e97 5AC_INIT(viking, 1.0)
9903c388
EB
6AM_INIT_AUTOMAKE()
7dnl AC_CONFIG_SRCDIR([src/main.c])
8fe95819 8AC_CONFIG_HEADERS([src/config.h])
9903c388
EB
9
10# Checks for programs.
972d7785 11AC_PROG_CC
9903c388 12AC_PROG_MAKE_SET
b6e6dfbd 13AC_PROG_RANLIB
8f661d80 14AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
9903c388 15
a5daec1c
GB
16# I18N
17GETTEXT_PACKAGE=viking
18AC_SUBST(GETTEXT_PACKAGE)
19AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
20
21AM_GLIB_DEFINE_LOCALEDIR(LOCALEDIR)
22
23AM_GLIB_GNU_GETTEXT
d44b1562 24IT_PROG_INTLTOOL([0.35.0])
a5daec1c
GB
25
26AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS'])
27
28dnl This will cause the automake generated makefiles to pass the
29dnl correct flags to aclocal.
30ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
31AC_SUBST(ACLOCAL_AMFLAGS)
32
9903c388
EB
33# Checks for header files.
34AC_HEADER_STDC
7de36baf 35AC_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
36
37# Checks for typedefs, structures, and compiler characteristics.
38AC_C_CONST
39AC_TYPE_MODE_T
40
41# Checks for library functions.
42AC_FUNC_STAT
43AC_FUNC_STRTOD
c44594ee 44AC_CHECK_FUNCS([floor gethostbyname memset mkdtemp pow realpath socket sqrt strcasecmp strchr strdup strncasecmp strtol strtoul])
fabfa349
JB
45AC_CHECK_LIB(m, tan)
46AC_CHECK_LIB(z, inflate)
9903c388 47
dad55b79 48# Expat
fa1b5a5f
GB
49AM_WITH_EXPAT
50
3292ba8b 51# Curl
f901dcdf 52LIBCURL_CHECK_CONFIG([yes],[],[],[AC_MSG_ERROR([libcurl is needed but not found])])
3292ba8b 53
bf0922c7 54# gdk-pixbuf-csource
fa1b5a5f
GB
55AC_CHECK_PROG([GDK_PIXBUF_CSOURCE],gdk-pixbuf-csource,[yes])
56if test $GDK_PIXBUF_CSOURCE != "yes"
57then
58 AC_MSG_ERROR([gdk-pixbuf-csource is needed but not found])
59fi
60
bf0922c7
GB
61dnl ------------------
62dnl | Pkgconfig checks |---------------------------------------
63dnl ------------------
64
65PKG_CHECK_MODULES(PACKAGE, [
66 glib-2.0 >= 2.12
67 gthread-2.0 >= 2.2
274e14bd 68 gtk+-2.0 >= 2.12
314084b8 69 gio-2.0 >= 2.12
bf0922c7
GB
70])
71
72AC_SUBST(PACKAGE_CFLAGS)
73AC_SUBST(PACKAGE_LIBS)
74
f8b8a0b5
GB
75dnl -------------
76dnl | User Manual |---------------------------------------
77dnl -------------
78GNOME_DOC_INIT
dad55b79 79
bca29d33
GB
80dnl ---------------------------------------------------------------------------
81dnl - Use deprecated options (default enabled for devs, disabled in releases)
82dnl ---------------------------------------------------------------------------
83
79452f0e
GB
84AC_ARG_ENABLE(deprecations,
85 [AC_HELP_STRING([--enable-deprecations],
bca29d33
GB
86 [warn about deprecated usages [default=no]])],
87 [ac_cv_enable_deprecations=$enableval],
88 [ac_cv_enable_deprecations=no])
89AC_CACHE_CHECK([whether to enable deprecated features],
90 [ac_cv_enable_deprecations], [ac_cv_enable_deprecations=no])
79452f0e 91
bca29d33 92if test "x$ac_cv_enable_deprecations" = "xyes"; then
79452f0e 93 DISABLE_DEPRECATED_CFLAGS="\
bca29d33
GB
94-DG_DISABLE_SINGLE_INCLUDES \
95-DGSEAL_ENABLE \
79452f0e
GB
96-DG_DISABLE_DEPRECATED \
97-DGDK_DISABLE_DEPRECATED \
bca29d33
GB
98-DGDK_PIXBUF_DISABLE_DEPRECATED \
99-DGTK_DISABLE_SINGLE_INCLUDES \
100-DGTK_DISABLE_DEPRECATED"
101 CPPFLAGS="$CPPFLAGS $DISABLE_DEPRECATED_CFLAGS"
79452f0e 102fi
dad55b79 103
734652bf
EB
104# Options
105AC_ARG_ENABLE(alphabetized-trw, AC_HELP_STRING([--enable-alphabetized-trw],
106 [enable alphabetized track & waypoints (default is enable)]),
107 [ac_cv_enable_alpha_trw=$enableval],
108 [ac_cv_enable_alpha_trw=yes])
109AC_CACHE_CHECK([whether to enable alphabetized track & waypoint],
110 [ac_cv_enable_alpha_trw], [ac_cv_enable_alpha_trw=yes])
111case $ac_cv_enable_alpha_trw in
112 yes)
113 AC_DEFINE(VIK_CONFIG_ALPHABETIZED_TRW, [], [NO ALPHABETIZED TRW])
114 ;;
115esac
116
cdcaf41c
QT
117AC_ARG_ENABLE(google, AC_HELP_STRING([--enable-google],
118 [enable Google stuff (default is enable)]),
119 [ac_cv_enable_google=$enableval],
120 [ac_cv_enable_google=yes])
121AC_CACHE_CHECK([whether to enable Google stuff],
122 [ac_cv_enable_google], [ac_cv_enable_google=yes])
123case $ac_cv_enable_google in
124 yes)
125 AC_DEFINE(VIK_CONFIG_GOOGLE, [], [GOOGLE STUFF])
126 ;;
127esac
128AM_CONDITIONAL([GOOGLE], [test x$ac_cv_enable_google = xyes])
129
130AC_ARG_ENABLE(terraserver, AC_HELP_STRING([--enable-terraserver],
131 [enable Terraserver stuff (default is enable)]),
132 [ac_cv_enable_terraserver=$enableval],
133 [ac_cv_enable_terraserver=yes])
134AC_CACHE_CHECK([whether to enable Terraserver stuff],
135 [ac_cv_enable_terraserver], [ac_cv_enable_terraserver=yes])
136case $ac_cv_enable_terraserver in
137 yes)
138 AC_DEFINE(VIK_CONFIG_TERRASERVER, [], [TERRASERVER STUFF])
139 ;;
140esac
141AM_CONDITIONAL([TERRASERVER], [test x$ac_cv_enable_terraserver = xyes])
142
143AC_ARG_ENABLE(expedia, AC_HELP_STRING([--enable-expedia],
06f31fd5 144 [enable Expedia stuff (default is disable)]),
cdcaf41c 145 [ac_cv_enable_expedia=$enableval],
06f31fd5 146 [ac_cv_enable_expedia=no])
cdcaf41c
QT
147AC_CACHE_CHECK([whether to enable Expedia stuff],
148 [ac_cv_enable_expedia], [ac_cv_enable_expedia=yes])
149case $ac_cv_enable_expedia in
150 yes)
151 AC_DEFINE(VIK_CONFIG_EXPEDIA, [], [EXPEDIA STUFF])
152 ;;
153esac
154AM_CONDITIONAL([EXPEDIA], [test x$ac_cv_enable_expedia = xyes])
155
ca9eb04a
GB
156# OpenStreetMap http://www.openstreetmap.org/
157AC_ARG_ENABLE(openstreetmap, AC_HELP_STRING([--enable-openstreetmap],
158 [enable OpenStreetMap stuff (default is enable)]),
159 [ac_cv_enable_openstreetmap=$enableval],
160 [ac_cv_enable_openstreetmap=yes])
161AC_CACHE_CHECK([whether to enable OpenStreetMap stuff],
162 [ac_cv_enable_openstreetmap], [ac_cv_enable_openstreetmap=yes])
163case $ac_cv_enable_openstreetmap in
164 yes)
165 AC_DEFINE(VIK_CONFIG_OPENSTREETMAP, [], [OPENSTREETMAP STUFF])
166 ;;
167esac
168AM_CONDITIONAL([OPENSTREETMAP], [test x$ac_cv_enable_openstreetmap = xyes])
169
96c3f0d5
GB
170# BlueMarble
171AC_ARG_ENABLE(bluemarble, AC_HELP_STRING([--enable-bluemarble],
172 [enable BlueMarble stuff (default is enable)]),
173 [ac_cv_enable_bluemarble=$enableval],
174 [ac_cv_enable_bluemarble=yes])
175AC_CACHE_CHECK([whether to enable BlueMarble stuff],
176 [ac_cv_enable_bluemarble], [ac_cv_enable_bluemarble=yes])
177case $ac_cv_enable_bluemarble in
178 yes)
179 AC_DEFINE(VIK_CONFIG_BLUEMARBLE, [], [BLUEMARBLE STUFF])
180 ;;
181esac
182AM_CONDITIONAL([BLUEMARBLE], [test x$ac_cv_enable_bluemarble = xyes])
183
da03b29d
GB
184# GeoNames http://www.geonames.org/
185AC_ARG_ENABLE(geonames, AC_HELP_STRING([--enable-geonames],
186 [enable Geonames stuff (default is enable)]),
187 [ac_cv_enable_geonames=$enableval],
188 [ac_cv_enable_geonames=yes])
189AC_CACHE_CHECK([whether to enable Geonames stuff],
190 [ac_cv_enable_geonames], [ac_cv_enable_geonames=yes])
191case $ac_cv_enable_geonames in
192 yes)
193 AC_DEFINE(VIK_CONFIG_GEONAMES, [], [GEONAMES STUFF])
194 ;;
195esac
196AM_CONDITIONAL([GEONAMES], [test x$ac_cv_enable_geonames = xyes])
197
1ef9e637 198AC_ARG_ENABLE(geocaches, AC_HELP_STRING([--enable-geocaches],
a0d39f7e 199 [enable Geocaches Acquire (default is disable).]),
1ef9e637
QT
200 [ac_cv_enable_geocaches=$enableval],
201 [ac_cv_enable_geocaches=no])
202AC_CACHE_CHECK([whether to enable Geocaches Acquire],
203 [ac_cv_enable_geocaches], [ac_cv_enable_geocaches=yes])
204case $ac_cv_enable_geocaches in
205 yes)
206 AC_DEFINE(VIK_CONFIG_GEOCACHES, [], [GEOCACHES STUFF])
207 ;;
208esac
209AM_CONDITIONAL([GEOCACHES], [test x$ac_cv_enable_geocaches = xyes])
210
8c721f83
EB
211
212AC_ARG_ENABLE(dem24k, AC_HELP_STRING([--enable-dem24k],
213 [enable USGS 24k DEM (default is disable) download source. Requires dem24k.pl script in path.]),
214 [ac_cv_enable_dem24k=$enableval],
215 [ac_cv_enable_dem24k=no])
216AC_CACHE_CHECK([whether to enable USGS DEM 24k download source],
217 [ac_cv_enable_dem24k], [ac_cv_enable_dem24k=yes])
218case $ac_cv_enable_dem24k in
219 yes)
220 AC_DEFINE(VIK_CONFIG_DEM24K, [], [DEM24K STUFF])
221 ;;
222esac
223AM_CONDITIONAL([DEM24K], [test x$ac_cv_enable_dem24k = xyes])
224
001a86db
QT
225# Realtime GPS tracking
226AC_ARG_ENABLE(realtime-gps-tracking, AC_HELP_STRING([--enable-realtime-gps-tracking],
227 [enable realtime GPS tracking (default is enable)]),
228 [ac_cv_enable_realtimegpstracking=$enableval],
229 [ac_cv_enable_realtimegpstracking=yes])
230AC_CACHE_CHECK([whether to enable Realtime GPS Tracking stuff],
231 [ac_cv_enable_realtimegpstracking], [ac_cv_enable_realtimegpstracking=yes])
232case $ac_cv_enable_realtimegpstracking in
233 yes)
8956d2ef
QT
234 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]))
235 AC_DEFINE(VIK_CONFIG_REALTIME_GPS_TRACKING, [], [REALTIME GPS TRACKING STUFF])
001a86db
QT
236 ;;
237esac
238AM_CONDITIONAL([REALTIME_GPS_TRACKING], [test x$ac_cv_enable_realtimegpstracking = xyes])
bec818c4
GB
239# Viking supports two incompatibles versions of GPSd: 2.39 and 2.90
240# But GPSd does not provides easy way to test features.
241if test x$ac_cv_enable_realtimegpstracking = xyes
242then
243 AC_CHECK_FUNCS(gps_stream)
a263d172 244 AC_CHECK_FUNCS(gps_open_r)
bec818c4 245fi
001a86db 246
ba4a5e11
GB
247AC_ARG_WITH(search,
248 [AC_HELP_STRING([--with-search],
249 [specify google or geonames for searching (default is google)])],
250 [case "x$withval" in
251 "xgoogle")
252 VIK_CONFIG_SEARCH=VIK_CONFIG_SEARCH_GOOGLE
253 ;;
254 "xgeonames")
255 VIK_CONFIG_SEARCH=VIK_CONFIG_SEARCH_GEONAMES
256 ;;
257 *)
258 AC_MSG_ERROR([Please, set a value for search method])
259 esac],
260 [VIK_CONFIG_SEARCH=VIK_CONFIG_SEARCH_GOOGLE])
261AC_DEFINE_UNQUOTED(VIK_CONFIG_SEARCH_GOOGLE, 1,
262 [Id. for searching via GOOGLE])
263AC_DEFINE_UNQUOTED(VIK_CONFIG_SEARCH_GEONAMES, 2,
264 [Id. for searching via GEONAMES])
265AC_DEFINE_UNQUOTED(VIK_CONFIG_SEARCH, ${VIK_CONFIG_SEARCH},
266 [Method for the search])
267
268
1bc9b120
GB
269AC_ARG_WITH(mapcache,
270 [AC_HELP_STRING([--with-mapcache],
271 [specify the size of the map cache (default is 50331648)])],
272 [if test "x$withval" = "xno"; then
273 VIK_CONFIG_MAPCACHE_SIZE=0;
274 elif test "x$withval" = "xyes"; then
275 AC_MSG_ERROR([Please, set a value for size of the map cache])
276 else
277 VIK_CONFIG_MAPCACHE_SIZE=${withval}
278 fi],
279 [VIK_CONFIG_MAPCACHE_SIZE=50331648])
280AC_DEFINE_UNQUOTED(VIK_CONFIG_MAPCACHE_SIZE, ${VIK_CONFIG_MAPCACHE_SIZE},
281 [Size of the map cache])
282
5e108809
GB
283
284AC_ARG_WITH(tileage,
285 [AC_HELP_STRING([--with-tileage],
286 [specify the age of a tile before checking it (default is 30 s)])],
287 [if test "x$withval" = "xno"; then
288 VIK_CONFIG_DEFAULT_TILE_AGE=0;
289 elif test "x$withval" = "xyes"; then
290 AC_MSG_ERROR([Please, set a value for age of tiles])
291 else
292 VIK_CONFIG_DEFAULT_TILE_AGE=${withval}
293 fi],
294 [VIK_CONFIG_DEFAULT_TILE_AGE=30])
295AC_DEFINE_UNQUOTED(VIK_CONFIG_DEFAULT_TILE_AGE, ${VIK_CONFIG_DEFAULT_TILE_AGE},
296 [Age of tiles before cheking it (in seconds)])
297
e5140ce8
GB
298dnl man pages processing
299DB2MAN_XSL=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl
300AC_SUBST(DB2MAN_XSL)
301AC_PATH_PROG(XP,xsltproc)
eb6a42c9 302AM_CONDITIONAL([HAVE_XSLTPROC],[test "x$XP" != "x"])
e5140ce8
GB
303AM_CONDITIONAL([GEN_MANPAGES],[test "x$XP" != "x" && test -r "$DB2MAN_XSL"])
304
a5daec1c
GB
305dnl This will cause the automake generated makefiles to pass the
306dnl correct flags to aclocal.
307ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
308AC_SUBST(ACLOCAL_AMFLAGS)
309
734652bf 310# Configuration
9903c388 311AC_CONFIG_FILES([Makefile
0912fc7e 312 src/Makefile
dad55b79 313 src/icons/Makefile
a5daec1c 314 po/Makefile.in
9d3e06a4 315 test/Makefile
f8b8a0b5 316 help/Makefile
0912fc7e 317 doc/Makefile
5c6dc9bf 318 doc/examples/Makefile
0912fc7e 319 doc/dev/Makefile])
af2740eb
QT
320AC_OUTPUT([
321 viking.spec
322 ])
001a86db
QT
323
324dnl Output the configuration summary
325echo ""
326echo "==========================================="
327echo "$PACKAGE $VERSION"
328echo "-------------------------------------------"
329echo "Alphabetized track & waypoints : $ac_cv_enable_alpha_trw"
330echo "Google Maps : $ac_cv_enable_google"
001a86db 331echo "Terraserver Maps : $ac_cv_enable_terraserver"
c21cf491 332echo "Expedia Maps : $ac_cv_enable_expedia"
001a86db 333echo "Open Street Map : $ac_cv_enable_openstreetmap"
f7d8a3c2 334echo "BlueMarble : $ac_cv_enable_bluemarble"
da03b29d 335echo "Geonames : $ac_cv_enable_geonames"
001a86db
QT
336#echo "Geocaches Acquire : $ac_cv_enable_geocaches"
337echo "USGS 24k DEM : $ac_cv_enable_dem24k"
338echo "Realtime GPS Tracking : $ac_cv_enable_realtimegpstracking"
339echo "Size of map cache (in memory) : ${VIK_CONFIG_MAPCACHE_SIZE}"
5e108809 340echo "Age of tiles (in seconds) : ${VIK_CONFIG_DEFAULT_TILE_AGE}"
001a86db
QT
341echo "-------------------------------------------"
342echo ""
343echo "Configure finished, type 'make' to build."
344