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