]> git.street.me.uk Git - andy/viking.git/blame - configure.ac
Use a list of possible browsers.
[andy/viking.git] / configure.ac
CommitLineData
9903c388
EB
1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.59)
1530c21f 5AC_INIT(viking, 0.9.3)
9903c388
EB
6AM_INIT_AUTOMAKE()
7dnl AC_CONFIG_SRCDIR([src/main.c])
8fe95819 8AC_CONFIG_HEADERS([src/config.h])
9903c388
EB
9
10# Checks for programs.
11AC_PROG_CC
12AC_PROG_MAKE_SET
13
a5daec1c
GB
14# I18N
15GETTEXT_PACKAGE=viking
16AC_SUBST(GETTEXT_PACKAGE)
17AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
18
19AM_GLIB_DEFINE_LOCALEDIR(LOCALEDIR)
20
21AM_GLIB_GNU_GETTEXT
22AC_PROG_INTLTOOL([0.35.0])
23
24AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS'])
25
26dnl This will cause the automake generated makefiles to pass the
27dnl correct flags to aclocal.
28ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
29AC_SUBST(ACLOCAL_AMFLAGS)
30
9903c388
EB
31# Checks for header files.
32AC_HEADER_STDC
5868323c 33AC_CHECK_HEADERS([malloc.h netdb.h netinet/in.h stdlib.h string.h sys/param.h sys/socket.h unistd.h math.h])
9903c388
EB
34
35# Checks for typedefs, structures, and compiler characteristics.
36AC_C_CONST
37AC_TYPE_MODE_T
38
39# Checks for library functions.
40AC_FUNC_STAT
41AC_FUNC_STRTOD
eb93fa95 42AC_CHECK_FUNCS([bzero floor gethostbyname memset mkdir mkdtemp pow realpath socket sqrt strcasecmp strchr strdup strncasecmp strtol strtoul])
9903c388 43
dad55b79 44# Expat
fa1b5a5f
GB
45AM_WITH_EXPAT
46
3292ba8b 47# Curl
f901dcdf 48LIBCURL_CHECK_CONFIG([yes],[],[],[AC_MSG_ERROR([libcurl is needed but not found])])
3292ba8b 49
c4e61875 50# libgps
001a86db
QT
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])
c4e61875 53
fa1b5a5f
GB
54AC_CHECK_PROG([GDK_PIXBUF_CSOURCE],gdk-pixbuf-csource,[yes])
55if test $GDK_PIXBUF_CSOURCE != "yes"
56then
57 AC_MSG_ERROR([gdk-pixbuf-csource is needed but not found])
58fi
59
60# Checks for libraries.
61AM_PATH_GTK_2_0(2.2.0,,AC_MSG_ERROR(needs GTK+ 2.2.0),gthread)
dad55b79 62
734652bf
EB
63# Options
64AC_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])
68AC_CACHE_CHECK([whether to enable alphabetized track & waypoint],
69 [ac_cv_enable_alpha_trw], [ac_cv_enable_alpha_trw=yes])
70case $ac_cv_enable_alpha_trw in
71 yes)
72 AC_DEFINE(VIK_CONFIG_ALPHABETIZED_TRW, [], [NO ALPHABETIZED TRW])
73 ;;
74esac
75
cdcaf41c
QT
76AC_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])
80AC_CACHE_CHECK([whether to enable Google stuff],
81 [ac_cv_enable_google], [ac_cv_enable_google=yes])
82case $ac_cv_enable_google in
83 yes)
84 AC_DEFINE(VIK_CONFIG_GOOGLE, [], [GOOGLE STUFF])
85 ;;
86esac
87AM_CONDITIONAL([GOOGLE], [test x$ac_cv_enable_google = xyes])
88
36c78d6d
QT
89AC_ARG_ENABLE(oldgoogle, AC_HELP_STRING([--enable-old-google],
90 [enable old Google stuff (default is disable)]),
001a86db
QT
91 [ac_cv_enable_old_google=$enableval],
92 [ac_cv_enable_old_google=no])
36c78d6d
QT
93AC_CACHE_CHECK([whether to enable Old Google stuff],
94 [ac_cv_enable_old_google], [ac_cv_enable_old_google=yes])
24ca37ba 95case $ac_cv_enable_old_google in
36c78d6d
QT
96 yes)
97 AC_DEFINE(VIK_CONFIG_OLD_GOOGLE, [], [OLD GOOGLE STUFF])
98 ;;
99esac
100AM_CONDITIONAL([OLDGOOGLE], [test x$ac_cv_enable_old_google = xyes])
101
cdcaf41c
QT
102AC_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])
106AC_CACHE_CHECK([whether to enable Terraserver stuff],
107 [ac_cv_enable_terraserver], [ac_cv_enable_terraserver=yes])
108case $ac_cv_enable_terraserver in
109 yes)
110 AC_DEFINE(VIK_CONFIG_TERRASERVER, [], [TERRASERVER STUFF])
111 ;;
112esac
113AM_CONDITIONAL([TERRASERVER], [test x$ac_cv_enable_terraserver = xyes])
114
115AC_ARG_ENABLE(expedia, AC_HELP_STRING([--enable-expedia],
06f31fd5 116 [enable Expedia stuff (default is disable)]),
cdcaf41c 117 [ac_cv_enable_expedia=$enableval],
06f31fd5 118 [ac_cv_enable_expedia=no])
cdcaf41c
QT
119AC_CACHE_CHECK([whether to enable Expedia stuff],
120 [ac_cv_enable_expedia], [ac_cv_enable_expedia=yes])
121case $ac_cv_enable_expedia in
122 yes)
123 AC_DEFINE(VIK_CONFIG_EXPEDIA, [], [EXPEDIA STUFF])
124 ;;
125esac
126AM_CONDITIONAL([EXPEDIA], [test x$ac_cv_enable_expedia = xyes])
127
ca9eb04a
GB
128# OpenStreetMap http://www.openstreetmap.org/
129AC_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])
133AC_CACHE_CHECK([whether to enable OpenStreetMap stuff],
134 [ac_cv_enable_openstreetmap], [ac_cv_enable_openstreetmap=yes])
135case $ac_cv_enable_openstreetmap in
136 yes)
137 AC_DEFINE(VIK_CONFIG_OPENSTREETMAP, [], [OPENSTREETMAP STUFF])
138 ;;
139esac
140AM_CONDITIONAL([OPENSTREETMAP], [test x$ac_cv_enable_openstreetmap = xyes])
141
1ef9e637
QT
142AC_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])
146AC_CACHE_CHECK([whether to enable Geocaches Acquire],
147 [ac_cv_enable_geocaches], [ac_cv_enable_geocaches=yes])
148case $ac_cv_enable_geocaches in
149 yes)
150 AC_DEFINE(VIK_CONFIG_GEOCACHES, [], [GEOCACHES STUFF])
151 ;;
152esac
153AM_CONDITIONAL([GEOCACHES], [test x$ac_cv_enable_geocaches = xyes])
154
8c721f83
EB
155
156AC_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])
160AC_CACHE_CHECK([whether to enable USGS DEM 24k download source],
161 [ac_cv_enable_dem24k], [ac_cv_enable_dem24k=yes])
162case $ac_cv_enable_dem24k in
163 yes)
164 AC_DEFINE(VIK_CONFIG_DEM24K, [], [DEM24K STUFF])
165 ;;
166esac
167AM_CONDITIONAL([DEM24K], [test x$ac_cv_enable_dem24k = xyes])
168
001a86db
QT
169# Realtime GPS tracking
170AC_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])
174AC_CACHE_CHECK([whether to enable Realtime GPS Tracking stuff],
175 [ac_cv_enable_realtimegpstracking], [ac_cv_enable_realtimegpstracking=yes])
176case $ac_cv_enable_realtimegpstracking in
177 yes)
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])
180 ;;
181esac
182AM_CONDITIONAL([REALTIME_GPS_TRACKING], [test x$ac_cv_enable_realtimegpstracking = xyes])
183
1bc9b120
GB
184AC_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])
191 else
192 VIK_CONFIG_MAPCACHE_SIZE=${withval}
193 fi],
194 [VIK_CONFIG_MAPCACHE_SIZE=50331648])
195AC_DEFINE_UNQUOTED(VIK_CONFIG_MAPCACHE_SIZE, ${VIK_CONFIG_MAPCACHE_SIZE},
196 [Size of the map cache])
197
a5daec1c
GB
198dnl This will cause the automake generated makefiles to pass the
199dnl correct flags to aclocal.
200ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
201AC_SUBST(ACLOCAL_AMFLAGS)
202
734652bf 203# Configuration
9903c388 204AC_CONFIG_FILES([Makefile
0912fc7e 205 src/Makefile
dad55b79 206 src/icons/Makefile
a5daec1c 207 po/Makefile.in
9d3e06a4 208 test/Makefile
0912fc7e
EB
209 doc/Makefile
210 doc/dev/Makefile])
af2740eb
QT
211AC_OUTPUT([
212 viking.spec
213 ])
001a86db
QT
214
215dnl Output the configuration summary
216echo ""
217echo "==========================================="
218echo "$PACKAGE $VERSION"
219echo "-------------------------------------------"
220echo "Alphabetized track & waypoints : $ac_cv_enable_alpha_trw"
221echo "Google Maps : $ac_cv_enable_google"
222#echo "Old Google Maps : $ac_cv_enable_old_google"
223echo "Terraserver Maps : $ac_cv_enable_terraserver"
224#echo "Expedia Maps : $ac_cv_enable_expedia"
225echo "Open Street Map : $ac_cv_enable_openstreetmap"
226#echo "Geocaches Acquire : $ac_cv_enable_geocaches"
227echo "USGS 24k DEM : $ac_cv_enable_dem24k"
228echo "Realtime GPS Tracking : $ac_cv_enable_realtimegpstracking"
229echo "Size of map cache (in memory) : ${VIK_CONFIG_MAPCACHE_SIZE}"
230echo "-------------------------------------------"
231echo ""
232echo "Configure finished, type 'make' to build."
233