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 # Checks for header files.
16 AC_CHECK_HEADERS([malloc.h netdb.h netinet/in.h stdlib.h string.h sys/param.h sys/socket.h unistd.h math.h])
18 # Checks for typedefs, structures, and compiler characteristics.
22 # Checks for library functions.
25 AC_CHECK_FUNCS([bzero floor gethostbyname memset mkdir mkdtemp pow realpath socket sqrt strcasecmp strchr strdup strncasecmp strtol strtoul])
31 LIBCURL_CHECK_CONFIG([yes],[],[],[AC_MSG_ERROR([libcurl is needed but not found])])
34 AC_CHECK_LIB(gps,gps_poll,,AC_MSG_ERROR([libgps is needed but not found]))
36 AC_CHECK_PROG([GDK_PIXBUF_CSOURCE],gdk-pixbuf-csource,[yes])
37 if test $GDK_PIXBUF_CSOURCE != "yes"
39 AC_MSG_ERROR([gdk-pixbuf-csource is needed but not found])
42 # Checks for libraries.
43 AM_PATH_GTK_2_0(2.2.0,,AC_MSG_ERROR(needs GTK+ 2.2.0),gthread)
46 AC_ARG_ENABLE(alphabetized-trw, AC_HELP_STRING([--enable-alphabetized-trw],
47 [enable alphabetized track & waypoints (default is enable)]),
48 [ac_cv_enable_alpha_trw=$enableval],
49 [ac_cv_enable_alpha_trw=yes])
50 AC_CACHE_CHECK([whether to enable alphabetized track & waypoint],
51 [ac_cv_enable_alpha_trw], [ac_cv_enable_alpha_trw=yes])
52 case $ac_cv_enable_alpha_trw in
54 AC_DEFINE(VIK_CONFIG_ALPHABETIZED_TRW, [], [NO ALPHABETIZED TRW])
58 AC_ARG_ENABLE(google, AC_HELP_STRING([--enable-google],
59 [enable Google stuff (default is enable)]),
60 [ac_cv_enable_google=$enableval],
61 [ac_cv_enable_google=yes])
62 AC_CACHE_CHECK([whether to enable Google stuff],
63 [ac_cv_enable_google], [ac_cv_enable_google=yes])
64 case $ac_cv_enable_google in
66 AC_DEFINE(VIK_CONFIG_GOOGLE, [], [GOOGLE STUFF])
69 AM_CONDITIONAL([GOOGLE], [test x$ac_cv_enable_google = xyes])
71 AC_ARG_ENABLE(oldgoogle, AC_HELP_STRING([--enable-old-google],
72 [enable old Google stuff (default is disable)]),
73 [ac_cv_enable_google=$enableval],
74 [ac_cv_enable_google=no])
75 AC_CACHE_CHECK([whether to enable Old Google stuff],
76 [ac_cv_enable_old_google], [ac_cv_enable_old_google=yes])
77 case $ac_cv_enable_google in
79 AC_DEFINE(VIK_CONFIG_OLD_GOOGLE, [], [OLD GOOGLE STUFF])
82 AM_CONDITIONAL([OLDGOOGLE], [test x$ac_cv_enable_old_google = xyes])
84 AC_ARG_ENABLE(terraserver, AC_HELP_STRING([--enable-terraserver],
85 [enable Terraserver stuff (default is enable)]),
86 [ac_cv_enable_terraserver=$enableval],
87 [ac_cv_enable_terraserver=yes])
88 AC_CACHE_CHECK([whether to enable Terraserver stuff],
89 [ac_cv_enable_terraserver], [ac_cv_enable_terraserver=yes])
90 case $ac_cv_enable_terraserver in
92 AC_DEFINE(VIK_CONFIG_TERRASERVER, [], [TERRASERVER STUFF])
95 AM_CONDITIONAL([TERRASERVER], [test x$ac_cv_enable_terraserver = xyes])
97 AC_ARG_ENABLE(expedia, AC_HELP_STRING([--enable-expedia],
98 [enable Expedia stuff (default is disable)]),
99 [ac_cv_enable_expedia=$enableval],
100 [ac_cv_enable_expedia=no])
101 AC_CACHE_CHECK([whether to enable Expedia stuff],
102 [ac_cv_enable_expedia], [ac_cv_enable_expedia=yes])
103 case $ac_cv_enable_expedia in
105 AC_DEFINE(VIK_CONFIG_EXPEDIA, [], [EXPEDIA STUFF])
108 AM_CONDITIONAL([EXPEDIA], [test x$ac_cv_enable_expedia = xyes])
110 # OpenStreetMap http://www.openstreetmap.org/
111 AC_ARG_ENABLE(openstreetmap, AC_HELP_STRING([--enable-openstreetmap],
112 [enable OpenStreetMap stuff (default is enable)]),
113 [ac_cv_enable_openstreetmap=$enableval],
114 [ac_cv_enable_openstreetmap=yes])
115 AC_CACHE_CHECK([whether to enable OpenStreetMap stuff],
116 [ac_cv_enable_openstreetmap], [ac_cv_enable_openstreetmap=yes])
117 case $ac_cv_enable_openstreetmap in
119 AC_DEFINE(VIK_CONFIG_OPENSTREETMAP, [], [OPENSTREETMAP STUFF])
122 AM_CONDITIONAL([OPENSTREETMAP], [test x$ac_cv_enable_openstreetmap = xyes])
124 AC_ARG_ENABLE(geocaches, AC_HELP_STRING([--enable-geocaches],
125 [enable Geocaches Acquire (default is disable). WARNING: Broken, do not enable]),
126 [ac_cv_enable_geocaches=$enableval],
127 [ac_cv_enable_geocaches=no])
128 AC_CACHE_CHECK([whether to enable Geocaches Acquire],
129 [ac_cv_enable_geocaches], [ac_cv_enable_geocaches=yes])
130 case $ac_cv_enable_geocaches in
132 AC_DEFINE(VIK_CONFIG_GEOCACHES, [], [GEOCACHES STUFF])
135 AM_CONDITIONAL([GEOCACHES], [test x$ac_cv_enable_geocaches = xyes])
138 AC_ARG_ENABLE(dem24k, AC_HELP_STRING([--enable-dem24k],
139 [enable USGS 24k DEM (default is disable) download source. Requires dem24k.pl script in path.]),
140 [ac_cv_enable_dem24k=$enableval],
141 [ac_cv_enable_dem24k=no])
142 AC_CACHE_CHECK([whether to enable USGS DEM 24k download source],
143 [ac_cv_enable_dem24k], [ac_cv_enable_dem24k=yes])
144 case $ac_cv_enable_dem24k in
146 AC_DEFINE(VIK_CONFIG_DEM24K, [], [DEM24K STUFF])
149 AM_CONDITIONAL([DEM24K], [test x$ac_cv_enable_dem24k = xyes])
151 AC_ARG_WITH(mapcache,
152 [AC_HELP_STRING([--with-mapcache],
153 [specify the size of the map cache (default is 50331648)])],
154 [if test "x$withval" = "xno"; then
155 VIK_CONFIG_MAPCACHE_SIZE=0;
156 elif test "x$withval" = "xyes"; then
157 AC_MSG_ERROR([Please, set a value for size of the map cache])
159 VIK_CONFIG_MAPCACHE_SIZE=${withval}
161 [VIK_CONFIG_MAPCACHE_SIZE=50331648])
162 AC_DEFINE_UNQUOTED(VIK_CONFIG_MAPCACHE_SIZE, ${VIK_CONFIG_MAPCACHE_SIZE},
163 [Size of the map cache])
166 AC_CONFIG_FILES([Makefile