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