]> git.street.me.uk Git - andy/viking.git/blame - configure.ac
Draw position marker on track elev/speed graphs at mouse click
[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)
13c9d849 5AC_INIT(viking, 0.9.2)
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
9903c388
EB
14# Checks for header files.
15AC_HEADER_STDC
5868323c 16AC_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
17
18# Checks for typedefs, structures, and compiler characteristics.
19AC_C_CONST
20AC_TYPE_MODE_T
21
22# Checks for library functions.
23AC_FUNC_STAT
24AC_FUNC_STRTOD
eb93fa95 25AC_CHECK_FUNCS([bzero floor gethostbyname memset mkdir mkdtemp pow realpath socket sqrt strcasecmp strchr strdup strncasecmp strtol strtoul])
9903c388 26
dad55b79 27# Expat
fa1b5a5f
GB
28AM_WITH_EXPAT
29
3292ba8b 30# Curl
f901dcdf 31LIBCURL_CHECK_CONFIG([yes],[],[],[AC_MSG_ERROR([libcurl is needed but not found])])
3292ba8b 32
c4e61875 33# libgps
001a86db
QT
34#AC_CHECK_LIB(gps,gps_poll,AC_DEFINE(HAVE_LIBGPS,[],[libgps to connect to gpsd]),)
35#AM_CONDITIONAL([LIBGPS], [test x$ac_cv_lib_gps_gps_poll = xyes])
c4e61875 36
fa1b5a5f
GB
37AC_CHECK_PROG([GDK_PIXBUF_CSOURCE],gdk-pixbuf-csource,[yes])
38if test $GDK_PIXBUF_CSOURCE != "yes"
39then
40 AC_MSG_ERROR([gdk-pixbuf-csource is needed but not found])
41fi
42
43# Checks for libraries.
44AM_PATH_GTK_2_0(2.2.0,,AC_MSG_ERROR(needs GTK+ 2.2.0),gthread)
dad55b79 45
734652bf
EB
46# Options
47AC_ARG_ENABLE(alphabetized-trw, AC_HELP_STRING([--enable-alphabetized-trw],
48 [enable alphabetized track & waypoints (default is enable)]),
49 [ac_cv_enable_alpha_trw=$enableval],
50 [ac_cv_enable_alpha_trw=yes])
51AC_CACHE_CHECK([whether to enable alphabetized track & waypoint],
52 [ac_cv_enable_alpha_trw], [ac_cv_enable_alpha_trw=yes])
53case $ac_cv_enable_alpha_trw in
54 yes)
55 AC_DEFINE(VIK_CONFIG_ALPHABETIZED_TRW, [], [NO ALPHABETIZED TRW])
56 ;;
57esac
58
cdcaf41c
QT
59AC_ARG_ENABLE(google, AC_HELP_STRING([--enable-google],
60 [enable Google stuff (default is enable)]),
61 [ac_cv_enable_google=$enableval],
62 [ac_cv_enable_google=yes])
63AC_CACHE_CHECK([whether to enable Google stuff],
64 [ac_cv_enable_google], [ac_cv_enable_google=yes])
65case $ac_cv_enable_google in
66 yes)
67 AC_DEFINE(VIK_CONFIG_GOOGLE, [], [GOOGLE STUFF])
68 ;;
69esac
70AM_CONDITIONAL([GOOGLE], [test x$ac_cv_enable_google = xyes])
71
36c78d6d
QT
72AC_ARG_ENABLE(oldgoogle, AC_HELP_STRING([--enable-old-google],
73 [enable old Google stuff (default is disable)]),
001a86db
QT
74 [ac_cv_enable_old_google=$enableval],
75 [ac_cv_enable_old_google=no])
36c78d6d
QT
76AC_CACHE_CHECK([whether to enable Old Google stuff],
77 [ac_cv_enable_old_google], [ac_cv_enable_old_google=yes])
78case $ac_cv_enable_google in
79 yes)
80 AC_DEFINE(VIK_CONFIG_OLD_GOOGLE, [], [OLD GOOGLE STUFF])
81 ;;
82esac
83AM_CONDITIONAL([OLDGOOGLE], [test x$ac_cv_enable_old_google = xyes])
84
cdcaf41c
QT
85AC_ARG_ENABLE(terraserver, AC_HELP_STRING([--enable-terraserver],
86 [enable Terraserver stuff (default is enable)]),
87 [ac_cv_enable_terraserver=$enableval],
88 [ac_cv_enable_terraserver=yes])
89AC_CACHE_CHECK([whether to enable Terraserver stuff],
90 [ac_cv_enable_terraserver], [ac_cv_enable_terraserver=yes])
91case $ac_cv_enable_terraserver in
92 yes)
93 AC_DEFINE(VIK_CONFIG_TERRASERVER, [], [TERRASERVER STUFF])
94 ;;
95esac
96AM_CONDITIONAL([TERRASERVER], [test x$ac_cv_enable_terraserver = xyes])
97
98AC_ARG_ENABLE(expedia, AC_HELP_STRING([--enable-expedia],
06f31fd5 99 [enable Expedia stuff (default is disable)]),
cdcaf41c 100 [ac_cv_enable_expedia=$enableval],
06f31fd5 101 [ac_cv_enable_expedia=no])
cdcaf41c
QT
102AC_CACHE_CHECK([whether to enable Expedia stuff],
103 [ac_cv_enable_expedia], [ac_cv_enable_expedia=yes])
104case $ac_cv_enable_expedia in
105 yes)
106 AC_DEFINE(VIK_CONFIG_EXPEDIA, [], [EXPEDIA STUFF])
107 ;;
108esac
109AM_CONDITIONAL([EXPEDIA], [test x$ac_cv_enable_expedia = xyes])
110
ca9eb04a
GB
111# OpenStreetMap http://www.openstreetmap.org/
112AC_ARG_ENABLE(openstreetmap, AC_HELP_STRING([--enable-openstreetmap],
113 [enable OpenStreetMap stuff (default is enable)]),
114 [ac_cv_enable_openstreetmap=$enableval],
115 [ac_cv_enable_openstreetmap=yes])
116AC_CACHE_CHECK([whether to enable OpenStreetMap stuff],
117 [ac_cv_enable_openstreetmap], [ac_cv_enable_openstreetmap=yes])
118case $ac_cv_enable_openstreetmap in
119 yes)
120 AC_DEFINE(VIK_CONFIG_OPENSTREETMAP, [], [OPENSTREETMAP STUFF])
121 ;;
122esac
123AM_CONDITIONAL([OPENSTREETMAP], [test x$ac_cv_enable_openstreetmap = xyes])
124
1ef9e637
QT
125AC_ARG_ENABLE(geocaches, AC_HELP_STRING([--enable-geocaches],
126 [enable Geocaches Acquire (default is disable). WARNING: Broken, do not enable]),
127 [ac_cv_enable_geocaches=$enableval],
128 [ac_cv_enable_geocaches=no])
129AC_CACHE_CHECK([whether to enable Geocaches Acquire],
130 [ac_cv_enable_geocaches], [ac_cv_enable_geocaches=yes])
131case $ac_cv_enable_geocaches in
132 yes)
133 AC_DEFINE(VIK_CONFIG_GEOCACHES, [], [GEOCACHES STUFF])
134 ;;
135esac
136AM_CONDITIONAL([GEOCACHES], [test x$ac_cv_enable_geocaches = xyes])
137
8c721f83
EB
138
139AC_ARG_ENABLE(dem24k, AC_HELP_STRING([--enable-dem24k],
140 [enable USGS 24k DEM (default is disable) download source. Requires dem24k.pl script in path.]),
141 [ac_cv_enable_dem24k=$enableval],
142 [ac_cv_enable_dem24k=no])
143AC_CACHE_CHECK([whether to enable USGS DEM 24k download source],
144 [ac_cv_enable_dem24k], [ac_cv_enable_dem24k=yes])
145case $ac_cv_enable_dem24k in
146 yes)
147 AC_DEFINE(VIK_CONFIG_DEM24K, [], [DEM24K STUFF])
148 ;;
149esac
150AM_CONDITIONAL([DEM24K], [test x$ac_cv_enable_dem24k = xyes])
151
001a86db
QT
152# Realtime GPS tracking
153AC_ARG_ENABLE(realtime-gps-tracking, AC_HELP_STRING([--enable-realtime-gps-tracking],
154 [enable realtime GPS tracking (default is enable)]),
155 [ac_cv_enable_realtimegpstracking=$enableval],
156 [ac_cv_enable_realtimegpstracking=yes])
157AC_CACHE_CHECK([whether to enable Realtime GPS Tracking stuff],
158 [ac_cv_enable_realtimegpstracking], [ac_cv_enable_realtimegpstracking=yes])
159case $ac_cv_enable_realtimegpstracking in
160 yes)
161 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]))
162 AC_DEFINE(VIK_CONFIG_REALTIME_GPS_TRACKING, [], [REALTIME GPS TRACKING STUFF])
163 ;;
164esac
165AM_CONDITIONAL([REALTIME_GPS_TRACKING], [test x$ac_cv_enable_realtimegpstracking = xyes])
166
1bc9b120
GB
167AC_ARG_WITH(mapcache,
168 [AC_HELP_STRING([--with-mapcache],
169 [specify the size of the map cache (default is 50331648)])],
170 [if test "x$withval" = "xno"; then
171 VIK_CONFIG_MAPCACHE_SIZE=0;
172 elif test "x$withval" = "xyes"; then
173 AC_MSG_ERROR([Please, set a value for size of the map cache])
174 else
175 VIK_CONFIG_MAPCACHE_SIZE=${withval}
176 fi],
177 [VIK_CONFIG_MAPCACHE_SIZE=50331648])
178AC_DEFINE_UNQUOTED(VIK_CONFIG_MAPCACHE_SIZE, ${VIK_CONFIG_MAPCACHE_SIZE},
179 [Size of the map cache])
180
734652bf 181# Configuration
9903c388 182AC_CONFIG_FILES([Makefile
0912fc7e 183 src/Makefile
dad55b79 184 src/icons/Makefile
9d3e06a4 185 test/Makefile
0912fc7e
EB
186 doc/Makefile
187 doc/dev/Makefile])
af2740eb
QT
188AC_OUTPUT([
189 viking.spec
190 ])
001a86db
QT
191
192dnl Output the configuration summary
193echo ""
194echo "==========================================="
195echo "$PACKAGE $VERSION"
196echo "-------------------------------------------"
197echo "Alphabetized track & waypoints : $ac_cv_enable_alpha_trw"
198echo "Google Maps : $ac_cv_enable_google"
199#echo "Old Google Maps : $ac_cv_enable_old_google"
200echo "Terraserver Maps : $ac_cv_enable_terraserver"
201#echo "Expedia Maps : $ac_cv_enable_expedia"
202echo "Open Street Map : $ac_cv_enable_openstreetmap"
203#echo "Geocaches Acquire : $ac_cv_enable_geocaches"
204echo "USGS 24k DEM : $ac_cv_enable_dem24k"
205echo "Realtime GPS Tracking : $ac_cv_enable_realtimegpstracking"
206echo "Size of map cache (in memory) : ${VIK_CONFIG_MAPCACHE_SIZE}"
207echo "-------------------------------------------"
208echo ""
209echo "Configure finished, type 'make' to build."
210