Add support for XML attribute based lat/lon values
[viking/guyou.git] / configure.ac
blob6b86f9985d81c51371aa2cf5b330166ccf520e54
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 AC_PREREQ(2.59)
5 AC_INIT(viking, 0.9.9)
6 AM_INIT_AUTOMAKE()
7 dnl AC_CONFIG_SRCDIR([src/main.c])
8 AC_CONFIG_HEADERS([src/config.h])
10 # Checks for programs.
11 AC_PROG_CC
12 AC_PROG_MAKE_SET
13 AC_PROG_RANLIB
14 AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
16 # I18N
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)
23 AM_GLIB_GNU_GETTEXT
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.
34 AC_HEADER_STDC
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.
38 AC_C_CONST
39 AC_TYPE_MODE_T
41 # Checks for library functions.
42 AC_FUNC_STAT
43 AC_FUNC_STRTOD
44 AC_CHECK_FUNCS([floor gethostbyname memset mkdtemp pow realpath socket sqrt strcasecmp strchr strdup strncasecmp strtol strtoul])
46 # Expat
47 AM_WITH_EXPAT
49 # Curl
50 LIBCURL_CHECK_CONFIG([yes],[],[],[AC_MSG_ERROR([libcurl is needed but not found])])
52 # gdk-pixbuf-csource
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])
59 dnl  ------------------
60 dnl | Pkgconfig checks |---------------------------------------
61 dnl  ------------------
63 PKG_CHECK_MODULES(PACKAGE, [
64         glib-2.0          >= 2.12
65         gthread-2.0       >= 2.2
66         gtk+-2.0          >= 2.12
69 AC_SUBST(PACKAGE_CFLAGS)
70 AC_SUBST(PACKAGE_LIBS)
72 ###############
73 # Depecations #
74 ###############
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)
89 # Options
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
97   yes)
98     AC_DEFINE(VIK_CONFIG_ALPHABETIZED_TRW, [], [NO ALPHABETIZED TRW])
99     ;;
100 esac
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
109   yes)
110     AC_DEFINE(VIK_CONFIG_GOOGLE, [], [GOOGLE STUFF])
111     ;;
112 esac
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
122   yes)
123     AC_DEFINE(VIK_CONFIG_TERRASERVER, [], [TERRASERVER STUFF])
124     ;;
125 esac
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
135   yes)
136     AC_DEFINE(VIK_CONFIG_EXPEDIA, [], [EXPEDIA STUFF])
137     ;;
138 esac
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
149   yes)
150     AC_DEFINE(VIK_CONFIG_OPENSTREETMAP, [], [OPENSTREETMAP STUFF])
151     ;;
152 esac
153 AM_CONDITIONAL([OPENSTREETMAP], [test x$ac_cv_enable_openstreetmap = xyes])
155 # BlueMarble
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
163   yes)
164     AC_DEFINE(VIK_CONFIG_BLUEMARBLE, [], [BLUEMARBLE STUFF])
165     ;;
166 esac
167 AM_CONDITIONAL([BLUEMARBLE], [test x$ac_cv_enable_bluemarble = xyes])
169 # OpenAerial
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
177   yes)
178     AC_DEFINE(VIK_CONFIG_OPENAERIAL, [], [OPENAERIAL STUFF])
179     ;;
180 esac
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
191   yes)
192     AC_DEFINE(VIK_CONFIG_GEONAMES, [], [GEONAMES STUFF])
193     ;;
194 esac
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
204   yes)
205     AC_DEFINE(VIK_CONFIG_GEOCACHES, [], [GEOCACHES STUFF])
206     ;;
207 esac
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
218   yes)
219     AC_DEFINE(VIK_CONFIG_DEM24K, [], [DEM24K STUFF])
220     ;;
221 esac
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
232   yes)
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])
235     ;;
236 esac
237 AM_CONDITIONAL([REALTIME_GPS_TRACKING], [test x$ac_cv_enable_realtimegpstracking = xyes])
239 AC_ARG_WITH(search,
240             [AC_HELP_STRING([--with-search],
241                             [specify google or geonames for searching (default is google)])],
242             [case "x$withval" in
243                "xgoogle")
244                  VIK_CONFIG_SEARCH=VIK_CONFIG_SEARCH_GOOGLE
245                  ;;
246                "xgeonames")
247                  VIK_CONFIG_SEARCH=VIK_CONFIG_SEARCH_GEONAMES
248                  ;;
249                *)
250                 AC_MSG_ERROR([Please, set a value for search method])
251              esac],
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])
268              else
269                 VIK_CONFIG_MAPCACHE_SIZE=${withval}
270              fi],
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
277 AC_SUBST(DB2MAN_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)
286 # Configuration
287 AC_CONFIG_FILES([Makefile
288                  src/Makefile
289                  src/icons/Makefile
290                  po/Makefile.in
291                  test/Makefile
292                  doc/Makefile
293                  doc/dev/Makefile])
294 AC_OUTPUT([
295            viking.spec
296            ])
298 dnl Output the configuration summary
299 echo ""
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 "-------------------------------------------"
316 echo ""
317 echo "Configure finished, type 'make' to build."