]> git.street.me.uk Git - andy/viking.git/blame - configure.ac
Document previous import
[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)
05bba7a6 5AC_INIT(viking, 0.9.9)
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])
9903c388 45
dad55b79 46# Expat
fa1b5a5f
GB
47AM_WITH_EXPAT
48
3292ba8b 49# Curl
f901dcdf 50LIBCURL_CHECK_CONFIG([yes],[],[],[AC_MSG_ERROR([libcurl is needed but not found])])
3292ba8b 51
bf0922c7 52# gdk-pixbuf-csource
fa1b5a5f
GB
53AC_CHECK_PROG([GDK_PIXBUF_CSOURCE],gdk-pixbuf-csource,[yes])
54if test $GDK_PIXBUF_CSOURCE != "yes"
55then
56 AC_MSG_ERROR([gdk-pixbuf-csource is needed but not found])
57fi
58
bf0922c7
GB
59dnl ------------------
60dnl | Pkgconfig checks |---------------------------------------
61dnl ------------------
62
63PKG_CHECK_MODULES(PACKAGE, [
64 glib-2.0 >= 2.12
65 gthread-2.0 >= 2.2
274e14bd 66 gtk+-2.0 >= 2.12
314084b8 67 gio-2.0 >= 2.12
bf0922c7
GB
68])
69
70AC_SUBST(PACKAGE_CFLAGS)
71AC_SUBST(PACKAGE_LIBS)
72
79452f0e
GB
73###############
74# Depecations #
75###############
76AC_ARG_ENABLE(deprecations,
77 [AC_HELP_STRING([--enable-deprecations],
78 [warn about deprecated usages [default=no]])],,
79 [enable_deprecations=no])
80
81if test "x$enable_deprecations" = "xyes"; then
82 DISABLE_DEPRECATED_CFLAGS="\
83-DG_DISABLE_DEPRECATED \
84-DGDK_DISABLE_DEPRECATED \
85-DGTK_DISABLE_DEPRECATED \
86-DGDK_PIXBUF_DISABLE_DEPRECATED"
87 AC_SUBST(DISABLE_DEPRECATED_CFLAGS)
88fi
dad55b79 89
734652bf
EB
90# Options
91AC_ARG_ENABLE(alphabetized-trw, AC_HELP_STRING([--enable-alphabetized-trw],
92 [enable alphabetized track & waypoints (default is enable)]),
93 [ac_cv_enable_alpha_trw=$enableval],
94 [ac_cv_enable_alpha_trw=yes])
95AC_CACHE_CHECK([whether to enable alphabetized track & waypoint],
96 [ac_cv_enable_alpha_trw], [ac_cv_enable_alpha_trw=yes])
97case $ac_cv_enable_alpha_trw in
98 yes)
99 AC_DEFINE(VIK_CONFIG_ALPHABETIZED_TRW, [], [NO ALPHABETIZED TRW])
100 ;;
101esac
102
cdcaf41c
QT
103AC_ARG_ENABLE(google, AC_HELP_STRING([--enable-google],
104 [enable Google stuff (default is enable)]),
105 [ac_cv_enable_google=$enableval],
106 [ac_cv_enable_google=yes])
107AC_CACHE_CHECK([whether to enable Google stuff],
108 [ac_cv_enable_google], [ac_cv_enable_google=yes])
109case $ac_cv_enable_google in
110 yes)
111 AC_DEFINE(VIK_CONFIG_GOOGLE, [], [GOOGLE STUFF])
112 ;;
113esac
114AM_CONDITIONAL([GOOGLE], [test x$ac_cv_enable_google = xyes])
115
116AC_ARG_ENABLE(terraserver, AC_HELP_STRING([--enable-terraserver],
117 [enable Terraserver stuff (default is enable)]),
118 [ac_cv_enable_terraserver=$enableval],
119 [ac_cv_enable_terraserver=yes])
120AC_CACHE_CHECK([whether to enable Terraserver stuff],
121 [ac_cv_enable_terraserver], [ac_cv_enable_terraserver=yes])
122case $ac_cv_enable_terraserver in
123 yes)
124 AC_DEFINE(VIK_CONFIG_TERRASERVER, [], [TERRASERVER STUFF])
125 ;;
126esac
127AM_CONDITIONAL([TERRASERVER], [test x$ac_cv_enable_terraserver = xyes])
128
129AC_ARG_ENABLE(expedia, AC_HELP_STRING([--enable-expedia],
06f31fd5 130 [enable Expedia stuff (default is disable)]),
cdcaf41c 131 [ac_cv_enable_expedia=$enableval],
06f31fd5 132 [ac_cv_enable_expedia=no])
cdcaf41c
QT
133AC_CACHE_CHECK([whether to enable Expedia stuff],
134 [ac_cv_enable_expedia], [ac_cv_enable_expedia=yes])
135case $ac_cv_enable_expedia in
136 yes)
137 AC_DEFINE(VIK_CONFIG_EXPEDIA, [], [EXPEDIA STUFF])
138 ;;
139esac
140AM_CONDITIONAL([EXPEDIA], [test x$ac_cv_enable_expedia = xyes])
141
ca9eb04a
GB
142# OpenStreetMap http://www.openstreetmap.org/
143AC_ARG_ENABLE(openstreetmap, AC_HELP_STRING([--enable-openstreetmap],
144 [enable OpenStreetMap stuff (default is enable)]),
145 [ac_cv_enable_openstreetmap=$enableval],
146 [ac_cv_enable_openstreetmap=yes])
147AC_CACHE_CHECK([whether to enable OpenStreetMap stuff],
148 [ac_cv_enable_openstreetmap], [ac_cv_enable_openstreetmap=yes])
149case $ac_cv_enable_openstreetmap in
150 yes)
151 AC_DEFINE(VIK_CONFIG_OPENSTREETMAP, [], [OPENSTREETMAP STUFF])
152 ;;
153esac
154AM_CONDITIONAL([OPENSTREETMAP], [test x$ac_cv_enable_openstreetmap = xyes])
155
96c3f0d5
GB
156# BlueMarble
157AC_ARG_ENABLE(bluemarble, AC_HELP_STRING([--enable-bluemarble],
158 [enable BlueMarble stuff (default is enable)]),
159 [ac_cv_enable_bluemarble=$enableval],
160 [ac_cv_enable_bluemarble=yes])
161AC_CACHE_CHECK([whether to enable BlueMarble stuff],
162 [ac_cv_enable_bluemarble], [ac_cv_enable_bluemarble=yes])
163case $ac_cv_enable_bluemarble in
164 yes)
165 AC_DEFINE(VIK_CONFIG_BLUEMARBLE, [], [BLUEMARBLE STUFF])
166 ;;
167esac
168AM_CONDITIONAL([BLUEMARBLE], [test x$ac_cv_enable_bluemarble = xyes])
169
170# OpenAerial
171AC_ARG_ENABLE(openaerial, AC_HELP_STRING([--enable-openaerial],
172 [enable OpenAerial stuff (default is enable)]),
173 [ac_cv_enable_openaerial=$enableval],
174 [ac_cv_enable_openaerial=yes])
175AC_CACHE_CHECK([whether to enable OpenAerial stuff],
176 [ac_cv_enable_openaerial], [ac_cv_enable_openaerial=yes])
177case $ac_cv_enable_openaerial in
178 yes)
179 AC_DEFINE(VIK_CONFIG_OPENAERIAL, [], [OPENAERIAL STUFF])
180 ;;
181esac
182AM_CONDITIONAL([OPENAERIAL], [test x$ac_cv_enable_openaerial = 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)
302AM_CONDITIONAL([GEN_MANPAGES],[test "x$XP" != "x" && test -r "$DB2MAN_XSL"])
303
a5daec1c
GB
304dnl This will cause the automake generated makefiles to pass the
305dnl correct flags to aclocal.
306ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
307AC_SUBST(ACLOCAL_AMFLAGS)
308
734652bf 309# Configuration
9903c388 310AC_CONFIG_FILES([Makefile
0912fc7e 311 src/Makefile
dad55b79 312 src/icons/Makefile
a5daec1c 313 po/Makefile.in
9d3e06a4 314 test/Makefile
0912fc7e 315 doc/Makefile
5c6dc9bf 316 doc/examples/Makefile
0912fc7e 317 doc/dev/Makefile])
af2740eb
QT
318AC_OUTPUT([
319 viking.spec
320 ])
001a86db
QT
321
322dnl Output the configuration summary
323echo ""
324echo "==========================================="
325echo "$PACKAGE $VERSION"
326echo "-------------------------------------------"
327echo "Alphabetized track & waypoints : $ac_cv_enable_alpha_trw"
328echo "Google Maps : $ac_cv_enable_google"
001a86db
QT
329echo "Terraserver Maps : $ac_cv_enable_terraserver"
330#echo "Expedia Maps : $ac_cv_enable_expedia"
331echo "Open Street Map : $ac_cv_enable_openstreetmap"
f7d8a3c2 332echo "OpenAerial : $ac_cv_enable_openaerial"
333echo "BlueMarble : $ac_cv_enable_bluemarble"
da03b29d 334echo "Geonames : $ac_cv_enable_geonames"
001a86db
QT
335#echo "Geocaches Acquire : $ac_cv_enable_geocaches"
336echo "USGS 24k DEM : $ac_cv_enable_dem24k"
337echo "Realtime GPS Tracking : $ac_cv_enable_realtimegpstracking"
338echo "Size of map cache (in memory) : ${VIK_CONFIG_MAPCACHE_SIZE}"
5e108809 339echo "Age of tiles (in seconds) : ${VIK_CONFIG_DEFAULT_TILE_AGE}"
001a86db
QT
340echo "-------------------------------------------"
341echo ""
342echo "Configure finished, type 'make' to build."
343