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