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.
15 GETTEXT_PACKAGE=viking
16 AC_SUBST(GETTEXT_PACKAGE)
17 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
19 AM_GLIB_DEFINE_LOCALEDIR(LOCALEDIR)
22 IT_PROG_INTLTOOL([0.35.0])
24 AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS'])
26 dnl This will cause the automake generated makefiles to pass the
27 dnl correct flags to aclocal.
28 ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
29 AC_SUBST(ACLOCAL_AMFLAGS)
31 # Checks for header files.
33 AC_CHECK_HEADERS([malloc.h netdb.h netinet/in.h stdlib.h string.h sys/param.h sys/socket.h unistd.h math.h])
35 # Checks for typedefs, structures, and compiler characteristics.
39 # Checks for library functions.
42 AC_CHECK_FUNCS([bzero floor gethostbyname memset mkdir mkdtemp pow realpath socket sqrt strcasecmp strchr strdup strncasecmp strtol strtoul])
48 LIBCURL_CHECK_CONFIG([yes],[],[],[AC_MSG_ERROR([libcurl is needed but not found])])
51 #AC_CHECK_LIB(gps,gps_poll,AC_DEFINE(HAVE_LIBGPS,[],[libgps to connect to gpsd]),)
52 #AM_CONDITIONAL([LIBGPS], [test x$ac_cv_lib_gps_gps_poll = xyes])
54 AC_CHECK_PROG([GDK_PIXBUF_CSOURCE],gdk-pixbuf-csource,[yes])
55 if test $GDK_PIXBUF_CSOURCE != "yes"
57 AC_MSG_ERROR([gdk-pixbuf-csource is needed but not found])
60 # Checks for libraries.
61 AM_PATH_GTK_2_0(2.2.0,,AC_MSG_ERROR(needs GTK+ 2.2.0),gthread)
64 AC_ARG_ENABLE(alphabetized-trw, AC_HELP_STRING([--enable-alphabetized-trw],
65 [enable alphabetized track & waypoints (default is enable)]),
66 [ac_cv_enable_alpha_trw=$enableval],
67 [ac_cv_enable_alpha_trw=yes])
68 AC_CACHE_CHECK([whether to enable alphabetized track & waypoint],
69 [ac_cv_enable_alpha_trw], [ac_cv_enable_alpha_trw=yes])
70 case $ac_cv_enable_alpha_trw in
72 AC_DEFINE(VIK_CONFIG_ALPHABETIZED_TRW, [], [NO ALPHABETIZED TRW])
76 AC_ARG_ENABLE(google, AC_HELP_STRING([--enable-google],
77 [enable Google stuff (default is enable)]),
78 [ac_cv_enable_google=$enableval],
79 [ac_cv_enable_google=yes])
80 AC_CACHE_CHECK([whether to enable Google stuff],
81 [ac_cv_enable_google], [ac_cv_enable_google=yes])
82 case $ac_cv_enable_google in
84 AC_DEFINE(VIK_CONFIG_GOOGLE, [], [GOOGLE STUFF])
87 AM_CONDITIONAL([GOOGLE], [test x$ac_cv_enable_google = xyes])
89 AC_ARG_ENABLE(oldgoogle, AC_HELP_STRING([--enable-old-google],
90 [enable old Google stuff (default is disable)]),
91 [ac_cv_enable_old_google=$enableval],
92 [ac_cv_enable_old_google=no])
93 AC_CACHE_CHECK([whether to enable Old Google stuff],
94 [ac_cv_enable_old_google], [ac_cv_enable_old_google=yes])
95 case $ac_cv_enable_old_google in
97 AC_DEFINE(VIK_CONFIG_OLD_GOOGLE, [], [OLD GOOGLE STUFF])
100 AM_CONDITIONAL([OLDGOOGLE], [test x$ac_cv_enable_old_google = xyes])
102 AC_ARG_ENABLE(terraserver, AC_HELP_STRING([--enable-terraserver],
103 [enable Terraserver stuff (default is enable)]),
104 [ac_cv_enable_terraserver=$enableval],
105 [ac_cv_enable_terraserver=yes])
106 AC_CACHE_CHECK([whether to enable Terraserver stuff],
107 [ac_cv_enable_terraserver], [ac_cv_enable_terraserver=yes])
108 case $ac_cv_enable_terraserver in
110 AC_DEFINE(VIK_CONFIG_TERRASERVER, [], [TERRASERVER STUFF])
113 AM_CONDITIONAL([TERRASERVER], [test x$ac_cv_enable_terraserver = xyes])
115 AC_ARG_ENABLE(expedia, AC_HELP_STRING([--enable-expedia],
116 [enable Expedia stuff (default is disable)]),
117 [ac_cv_enable_expedia=$enableval],
118 [ac_cv_enable_expedia=no])
119 AC_CACHE_CHECK([whether to enable Expedia stuff],
120 [ac_cv_enable_expedia], [ac_cv_enable_expedia=yes])
121 case $ac_cv_enable_expedia in
123 AC_DEFINE(VIK_CONFIG_EXPEDIA, [], [EXPEDIA STUFF])
126 AM_CONDITIONAL([EXPEDIA], [test x$ac_cv_enable_expedia = xyes])
128 # OpenStreetMap http://www.openstreetmap.org/
129 AC_ARG_ENABLE(openstreetmap, AC_HELP_STRING([--enable-openstreetmap],
130 [enable OpenStreetMap stuff (default is enable)]),
131 [ac_cv_enable_openstreetmap=$enableval],
132 [ac_cv_enable_openstreetmap=yes])
133 AC_CACHE_CHECK([whether to enable OpenStreetMap stuff],
134 [ac_cv_enable_openstreetmap], [ac_cv_enable_openstreetmap=yes])
135 case $ac_cv_enable_openstreetmap in
137 AC_DEFINE(VIK_CONFIG_OPENSTREETMAP, [], [OPENSTREETMAP STUFF])
140 AM_CONDITIONAL([OPENSTREETMAP], [test x$ac_cv_enable_openstreetmap = xyes])
142 AC_ARG_ENABLE(geocaches, AC_HELP_STRING([--enable-geocaches],
143 [enable Geocaches Acquire (default is disable). WARNING: Broken, do not enable]),
144 [ac_cv_enable_geocaches=$enableval],
145 [ac_cv_enable_geocaches=no])
146 AC_CACHE_CHECK([whether to enable Geocaches Acquire],
147 [ac_cv_enable_geocaches], [ac_cv_enable_geocaches=yes])
148 case $ac_cv_enable_geocaches in
150 AC_DEFINE(VIK_CONFIG_GEOCACHES, [], [GEOCACHES STUFF])
153 AM_CONDITIONAL([GEOCACHES], [test x$ac_cv_enable_geocaches = xyes])
156 AC_ARG_ENABLE(dem24k, AC_HELP_STRING([--enable-dem24k],
157 [enable USGS 24k DEM (default is disable) download source. Requires dem24k.pl script in path.]),
158 [ac_cv_enable_dem24k=$enableval],
159 [ac_cv_enable_dem24k=no])
160 AC_CACHE_CHECK([whether to enable USGS DEM 24k download source],
161 [ac_cv_enable_dem24k], [ac_cv_enable_dem24k=yes])
162 case $ac_cv_enable_dem24k in
164 AC_DEFINE(VIK_CONFIG_DEM24K, [], [DEM24K STUFF])
167 AM_CONDITIONAL([DEM24K], [test x$ac_cv_enable_dem24k = xyes])
169 # Realtime GPS tracking
170 AC_ARG_ENABLE(realtime-gps-tracking, AC_HELP_STRING([--enable-realtime-gps-tracking],
171 [enable realtime GPS tracking (default is enable)]),
172 [ac_cv_enable_realtimegpstracking=$enableval],
173 [ac_cv_enable_realtimegpstracking=yes])
174 AC_CACHE_CHECK([whether to enable Realtime GPS Tracking stuff],
175 [ac_cv_enable_realtimegpstracking], [ac_cv_enable_realtimegpstracking=yes])
176 case $ac_cv_enable_realtimegpstracking in
178 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]))
179 AC_DEFINE(VIK_CONFIG_REALTIME_GPS_TRACKING, [], [REALTIME GPS TRACKING STUFF])
182 AM_CONDITIONAL([REALTIME_GPS_TRACKING], [test x$ac_cv_enable_realtimegpstracking = xyes])
184 AC_ARG_WITH(mapcache,
185 [AC_HELP_STRING([--with-mapcache],
186 [specify the size of the map cache (default is 50331648)])],
187 [if test "x$withval" = "xno"; then
188 VIK_CONFIG_MAPCACHE_SIZE=0;
189 elif test "x$withval" = "xyes"; then
190 AC_MSG_ERROR([Please, set a value for size of the map cache])
192 VIK_CONFIG_MAPCACHE_SIZE=${withval}
194 [VIK_CONFIG_MAPCACHE_SIZE=50331648])
195 AC_DEFINE_UNQUOTED(VIK_CONFIG_MAPCACHE_SIZE, ${VIK_CONFIG_MAPCACHE_SIZE},
196 [Size of the map cache])
198 dnl This will cause the automake generated makefiles to pass the
199 dnl correct flags to aclocal.
200 ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
201 AC_SUBST(ACLOCAL_AMFLAGS)
204 AC_CONFIG_FILES([Makefile
215 dnl Output the configuration summary
217 echo "==========================================="
218 echo "$PACKAGE $VERSION"
219 echo "-------------------------------------------"
220 echo "Alphabetized track & waypoints : $ac_cv_enable_alpha_trw"
221 echo "Google Maps : $ac_cv_enable_google"
222 #echo "Old Google Maps : $ac_cv_enable_old_google"
223 echo "Terraserver Maps : $ac_cv_enable_terraserver"
224 #echo "Expedia Maps : $ac_cv_enable_expedia"
225 echo "Open Street Map : $ac_cv_enable_openstreetmap"
226 #echo "Geocaches Acquire : $ac_cv_enable_geocaches"
227 echo "USGS 24k DEM : $ac_cv_enable_dem24k"
228 echo "Realtime GPS Tracking : $ac_cv_enable_realtimegpstracking"
229 echo "Size of map cache (in memory) : ${VIK_CONFIG_MAPCACHE_SIZE}"
230 echo "-------------------------------------------"
232 echo "Configure finished, type 'make' to build."