2 # Process this file with autoconf to produce a configure script.
7 dnl AC_CONFIG_SRCDIR([src/main.c])
8 AC_CONFIG_HEADERS([src/config.h])
10 # Checks for programs.
14 AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
17 GETTEXT_PACKAGE=viking
18 AC_SUBST(GETTEXT_PACKAGE)
19 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
21 AM_GLIB_DEFINE_LOCALEDIR(LOCALEDIR)
24 IT_PROG_INTLTOOL([0.35.0])
26 AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS'])
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)
33 # Checks for header files.
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])
37 # Checks for typedefs, structures, and compiler characteristics.
41 # Checks for library functions.
44 AC_CHECK_FUNCS([floor gethostbyname memset mkdtemp pow realpath socket sqrt strcasecmp strchr strdup strncasecmp strtol strtoul])
50 LIBCURL_CHECK_CONFIG([yes],[],[],[AC_MSG_ERROR([libcurl is needed but not found])])
53 AC_CHECK_PROG([GDK_PIXBUF_CSOURCE],gdk-pixbuf-csource,[yes])
54 if test $GDK_PIXBUF_CSOURCE != "yes"
56 AC_MSG_ERROR([gdk-pixbuf-csource is needed but not found])
59 dnl ------------------
60 dnl | Pkgconfig checks |---------------------------------------
61 dnl ------------------
63 PKG_CHECK_MODULES(PACKAGE, [
69 AC_SUBST(PACKAGE_CFLAGS)
70 AC_SUBST(PACKAGE_LIBS)
75 AC_ARG_ENABLE(deprecations,
76 [AC_HELP_STRING([--enable-deprecations],
77 [warn about deprecated usages [default=no]])],,
78 [enable_deprecations=no])
80 if test "x$enable_deprecations" = "xyes"; then
81 DISABLE_DEPRECATED_CFLAGS="\
82 -DG_DISABLE_DEPRECATED \
83 -DGDK_DISABLE_DEPRECATED \
84 -DGTK_DISABLE_DEPRECATED \
85 -DGDK_PIXBUF_DISABLE_DEPRECATED"
86 AC_SUBST(DISABLE_DEPRECATED_CFLAGS)
90 AC_ARG_ENABLE(alphabetized-trw, AC_HELP_STRING([--enable-alphabetized-trw],
91 [enable alphabetized track & waypoints (default is enable)]),
92 [ac_cv_enable_alpha_trw=$enableval],
93 [ac_cv_enable_alpha_trw=yes])
94 AC_CACHE_CHECK([whether to enable alphabetized track & waypoint],
95 [ac_cv_enable_alpha_trw], [ac_cv_enable_alpha_trw=yes])
96 case $ac_cv_enable_alpha_trw in
98 AC_DEFINE(VIK_CONFIG_ALPHABETIZED_TRW, [], [NO ALPHABETIZED TRW])
102 AC_ARG_ENABLE(google, AC_HELP_STRING([--enable-google],
103 [enable Google stuff (default is enable)]),
104 [ac_cv_enable_google=$enableval],
105 [ac_cv_enable_google=yes])
106 AC_CACHE_CHECK([whether to enable Google stuff],
107 [ac_cv_enable_google], [ac_cv_enable_google=yes])
108 case $ac_cv_enable_google in
110 AC_DEFINE(VIK_CONFIG_GOOGLE, [], [GOOGLE STUFF])
113 AM_CONDITIONAL([GOOGLE], [test x$ac_cv_enable_google = xyes])
115 AC_ARG_ENABLE(terraserver, AC_HELP_STRING([--enable-terraserver],
116 [enable Terraserver stuff (default is enable)]),
117 [ac_cv_enable_terraserver=$enableval],
118 [ac_cv_enable_terraserver=yes])
119 AC_CACHE_CHECK([whether to enable Terraserver stuff],
120 [ac_cv_enable_terraserver], [ac_cv_enable_terraserver=yes])
121 case $ac_cv_enable_terraserver in
123 AC_DEFINE(VIK_CONFIG_TERRASERVER, [], [TERRASERVER STUFF])
126 AM_CONDITIONAL([TERRASERVER], [test x$ac_cv_enable_terraserver = xyes])
128 AC_ARG_ENABLE(expedia, AC_HELP_STRING([--enable-expedia],
129 [enable Expedia stuff (default is disable)]),
130 [ac_cv_enable_expedia=$enableval],
131 [ac_cv_enable_expedia=no])
132 AC_CACHE_CHECK([whether to enable Expedia stuff],
133 [ac_cv_enable_expedia], [ac_cv_enable_expedia=yes])
134 case $ac_cv_enable_expedia in
136 AC_DEFINE(VIK_CONFIG_EXPEDIA, [], [EXPEDIA STUFF])
139 AM_CONDITIONAL([EXPEDIA], [test x$ac_cv_enable_expedia = xyes])
141 # OpenStreetMap http://www.openstreetmap.org/
142 AC_ARG_ENABLE(openstreetmap, AC_HELP_STRING([--enable-openstreetmap],
143 [enable OpenStreetMap stuff (default is enable)]),
144 [ac_cv_enable_openstreetmap=$enableval],
145 [ac_cv_enable_openstreetmap=yes])
146 AC_CACHE_CHECK([whether to enable OpenStreetMap stuff],
147 [ac_cv_enable_openstreetmap], [ac_cv_enable_openstreetmap=yes])
148 case $ac_cv_enable_openstreetmap in
150 AC_DEFINE(VIK_CONFIG_OPENSTREETMAP, [], [OPENSTREETMAP STUFF])
153 AM_CONDITIONAL([OPENSTREETMAP], [test x$ac_cv_enable_openstreetmap = xyes])
156 AC_ARG_ENABLE(bluemarble, AC_HELP_STRING([--enable-bluemarble],
157 [enable BlueMarble stuff (default is enable)]),
158 [ac_cv_enable_bluemarble=$enableval],
159 [ac_cv_enable_bluemarble=yes])
160 AC_CACHE_CHECK([whether to enable BlueMarble stuff],
161 [ac_cv_enable_bluemarble], [ac_cv_enable_bluemarble=yes])
162 case $ac_cv_enable_bluemarble in
164 AC_DEFINE(VIK_CONFIG_BLUEMARBLE, [], [BLUEMARBLE STUFF])
167 AM_CONDITIONAL([BLUEMARBLE], [test x$ac_cv_enable_bluemarble = xyes])
170 AC_ARG_ENABLE(openaerial, AC_HELP_STRING([--enable-openaerial],
171 [enable OpenAerial stuff (default is enable)]),
172 [ac_cv_enable_openaerial=$enableval],
173 [ac_cv_enable_openaerial=yes])
174 AC_CACHE_CHECK([whether to enable OpenAerial stuff],
175 [ac_cv_enable_openaerial], [ac_cv_enable_openaerial=yes])
176 case $ac_cv_enable_openaerial in
178 AC_DEFINE(VIK_CONFIG_OPENAERIAL, [], [OPENAERIAL STUFF])
181 AM_CONDITIONAL([OPENAERIAL], [test x$ac_cv_enable_openaerial = xyes])
183 # GeoNames http://www.geonames.org/
184 AC_ARG_ENABLE(geonames, AC_HELP_STRING([--enable-geonames],
185 [enable Geonames stuff (default is enable)]),
186 [ac_cv_enable_geonames=$enableval],
187 [ac_cv_enable_geonames=yes])
188 AC_CACHE_CHECK([whether to enable Geonames stuff],
189 [ac_cv_enable_geonames], [ac_cv_enable_geonames=yes])
190 case $ac_cv_enable_geonames in
192 AC_DEFINE(VIK_CONFIG_GEONAMES, [], [GEONAMES STUFF])
195 AM_CONDITIONAL([GEONAMES], [test x$ac_cv_enable_geonames = xyes])
197 AC_ARG_ENABLE(geocaches, AC_HELP_STRING([--enable-geocaches],
198 [enable Geocaches Acquire (default is disable).]),
199 [ac_cv_enable_geocaches=$enableval],
200 [ac_cv_enable_geocaches=no])
201 AC_CACHE_CHECK([whether to enable Geocaches Acquire],
202 [ac_cv_enable_geocaches], [ac_cv_enable_geocaches=yes])
203 case $ac_cv_enable_geocaches in
205 AC_DEFINE(VIK_CONFIG_GEOCACHES, [], [GEOCACHES STUFF])
208 AM_CONDITIONAL([GEOCACHES], [test x$ac_cv_enable_geocaches = xyes])
211 AC_ARG_ENABLE(dem24k, AC_HELP_STRING([--enable-dem24k],
212 [enable USGS 24k DEM (default is disable) download source. Requires dem24k.pl script in path.]),
213 [ac_cv_enable_dem24k=$enableval],
214 [ac_cv_enable_dem24k=no])
215 AC_CACHE_CHECK([whether to enable USGS DEM 24k download source],
216 [ac_cv_enable_dem24k], [ac_cv_enable_dem24k=yes])
217 case $ac_cv_enable_dem24k in
219 AC_DEFINE(VIK_CONFIG_DEM24K, [], [DEM24K STUFF])
222 AM_CONDITIONAL([DEM24K], [test x$ac_cv_enable_dem24k = xyes])
224 # Realtime GPS tracking
225 AC_ARG_ENABLE(realtime-gps-tracking, AC_HELP_STRING([--enable-realtime-gps-tracking],
226 [enable realtime GPS tracking (default is enable)]),
227 [ac_cv_enable_realtimegpstracking=$enableval],
228 [ac_cv_enable_realtimegpstracking=yes])
229 AC_CACHE_CHECK([whether to enable Realtime GPS Tracking stuff],
230 [ac_cv_enable_realtimegpstracking], [ac_cv_enable_realtimegpstracking=yes])
231 case $ac_cv_enable_realtimegpstracking in
233 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]))
234 AC_DEFINE(VIK_CONFIG_REALTIME_GPS_TRACKING, [], [REALTIME GPS TRACKING STUFF])
237 AM_CONDITIONAL([REALTIME_GPS_TRACKING], [test x$ac_cv_enable_realtimegpstracking = xyes])
240 [AC_HELP_STRING([--with-search],
241 [specify google or geonames for searching (default is google)])],
244 VIK_CONFIG_SEARCH=VIK_CONFIG_SEARCH_GOOGLE
247 VIK_CONFIG_SEARCH=VIK_CONFIG_SEARCH_GEONAMES
250 AC_MSG_ERROR([Please, set a value for search method])
252 [VIK_CONFIG_SEARCH=VIK_CONFIG_SEARCH_GOOGLE])
253 AC_DEFINE_UNQUOTED(VIK_CONFIG_SEARCH_GOOGLE, 1,
254 [Id. for searching via GOOGLE])
255 AC_DEFINE_UNQUOTED(VIK_CONFIG_SEARCH_GEONAMES, 2,
256 [Id. for searching via GEONAMES])
257 AC_DEFINE_UNQUOTED(VIK_CONFIG_SEARCH, ${VIK_CONFIG_SEARCH},
258 [Method for the search])
261 AC_ARG_WITH(mapcache,
262 [AC_HELP_STRING([--with-mapcache],
263 [specify the size of the map cache (default is 50331648)])],
264 [if test "x$withval" = "xno"; then
265 VIK_CONFIG_MAPCACHE_SIZE=0;
266 elif test "x$withval" = "xyes"; then
267 AC_MSG_ERROR([Please, set a value for size of the map cache])
269 VIK_CONFIG_MAPCACHE_SIZE=${withval}
271 [VIK_CONFIG_MAPCACHE_SIZE=50331648])
272 AC_DEFINE_UNQUOTED(VIK_CONFIG_MAPCACHE_SIZE, ${VIK_CONFIG_MAPCACHE_SIZE},
273 [Size of the map cache])
275 dnl man pages processing
276 DB2MAN_XSL=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl
278 AC_PATH_PROG(XP,xsltproc)
279 AM_CONDITIONAL([GEN_MANPAGES],[test "x$XP" != "x" && test -r "$DB2MAN_XSL"])
281 dnl This will cause the automake generated makefiles to pass the
282 dnl correct flags to aclocal.
283 ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
284 AC_SUBST(ACLOCAL_AMFLAGS)
287 AC_CONFIG_FILES([Makefile
298 dnl Output the configuration summary
300 echo "==========================================="
301 echo "$PACKAGE $VERSION"
302 echo "-------------------------------------------"
303 echo "Alphabetized track & waypoints : $ac_cv_enable_alpha_trw"
304 echo "Google Maps : $ac_cv_enable_google"
305 echo "Terraserver Maps : $ac_cv_enable_terraserver"
306 #echo "Expedia Maps : $ac_cv_enable_expedia"
307 echo "Open Street Map : $ac_cv_enable_openstreetmap"
308 echo "OpenAerial : $ac_cv_enable_openaerial"
309 echo "BlueMarble : $ac_cv_enable_bluemarble"
310 echo "Geonames : $ac_cv_enable_geonames"
311 #echo "Geocaches Acquire : $ac_cv_enable_geocaches"
312 echo "USGS 24k DEM : $ac_cv_enable_dem24k"
313 echo "Realtime GPS Tracking : $ac_cv_enable_realtimegpstracking"
314 echo "Size of map cache (in memory) : ${VIK_CONFIG_MAPCACHE_SIZE}"
315 echo "-------------------------------------------"
317 echo "Configure finished, type 'make' to build."