]> git.street.me.uk Git - andy/viking.git/blob - configure.ac
Draw position marker on track elev/speed graphs at mouse click
[andy/viking.git] / configure.ac
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ(2.59)
5 AC_INIT(viking, 0.9.2)
6 AM_INIT_AUTOMAKE()
7 dnl AC_CONFIG_SRCDIR([src/main.c])
8 AC_CONFIG_HEADERS([src/config.h])
9
10 # Checks for programs.
11 AC_PROG_CC
12 AC_PROG_MAKE_SET
13
14 # Checks for header files.
15 AC_HEADER_STDC
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])
17
18 # Checks for typedefs, structures, and compiler characteristics.
19 AC_C_CONST
20 AC_TYPE_MODE_T
21
22 # Checks for library functions.
23 AC_FUNC_STAT
24 AC_FUNC_STRTOD
25 AC_CHECK_FUNCS([bzero floor gethostbyname memset mkdir mkdtemp pow realpath socket sqrt strcasecmp strchr strdup strncasecmp strtol strtoul])
26
27 # Expat
28 AM_WITH_EXPAT
29
30 # Curl
31 LIBCURL_CHECK_CONFIG([yes],[],[],[AC_MSG_ERROR([libcurl is needed but not found])])
32
33 # libgps
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])
36
37 AC_CHECK_PROG([GDK_PIXBUF_CSOURCE],gdk-pixbuf-csource,[yes])
38 if test $GDK_PIXBUF_CSOURCE != "yes"
39 then
40   AC_MSG_ERROR([gdk-pixbuf-csource is needed but not found])
41 fi
42
43 # Checks for libraries.
44 AM_PATH_GTK_2_0(2.2.0,,AC_MSG_ERROR(needs GTK+ 2.2.0),gthread)
45
46 # Options
47 AC_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])
51 AC_CACHE_CHECK([whether to enable alphabetized track & waypoint],
52                [ac_cv_enable_alpha_trw], [ac_cv_enable_alpha_trw=yes])
53 case $ac_cv_enable_alpha_trw in
54   yes)
55     AC_DEFINE(VIK_CONFIG_ALPHABETIZED_TRW, [], [NO ALPHABETIZED TRW])
56     ;;
57 esac
58
59 AC_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])
63 AC_CACHE_CHECK([whether to enable Google stuff],
64                [ac_cv_enable_google], [ac_cv_enable_google=yes])
65 case $ac_cv_enable_google in
66   yes)
67     AC_DEFINE(VIK_CONFIG_GOOGLE, [], [GOOGLE STUFF])
68     ;;
69 esac
70 AM_CONDITIONAL([GOOGLE], [test x$ac_cv_enable_google = xyes])
71
72 AC_ARG_ENABLE(oldgoogle, AC_HELP_STRING([--enable-old-google],
73               [enable old Google stuff (default is disable)]),
74               [ac_cv_enable_old_google=$enableval],
75               [ac_cv_enable_old_google=no])
76 AC_CACHE_CHECK([whether to enable Old Google stuff],
77                [ac_cv_enable_old_google], [ac_cv_enable_old_google=yes])
78 case $ac_cv_enable_google in
79   yes)
80     AC_DEFINE(VIK_CONFIG_OLD_GOOGLE, [], [OLD GOOGLE STUFF])
81     ;;
82 esac
83 AM_CONDITIONAL([OLDGOOGLE], [test x$ac_cv_enable_old_google = xyes])
84
85 AC_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])
89 AC_CACHE_CHECK([whether to enable Terraserver stuff],
90                [ac_cv_enable_terraserver], [ac_cv_enable_terraserver=yes])
91 case $ac_cv_enable_terraserver in
92   yes)
93     AC_DEFINE(VIK_CONFIG_TERRASERVER, [], [TERRASERVER STUFF])
94     ;;
95 esac
96 AM_CONDITIONAL([TERRASERVER], [test x$ac_cv_enable_terraserver = xyes])
97
98 AC_ARG_ENABLE(expedia, AC_HELP_STRING([--enable-expedia],
99               [enable Expedia stuff (default is disable)]),
100               [ac_cv_enable_expedia=$enableval],
101               [ac_cv_enable_expedia=no])
102 AC_CACHE_CHECK([whether to enable Expedia stuff],
103                [ac_cv_enable_expedia], [ac_cv_enable_expedia=yes])
104 case $ac_cv_enable_expedia in
105   yes)
106     AC_DEFINE(VIK_CONFIG_EXPEDIA, [], [EXPEDIA STUFF])
107     ;;
108 esac
109 AM_CONDITIONAL([EXPEDIA], [test x$ac_cv_enable_expedia = xyes])
110
111 # OpenStreetMap http://www.openstreetmap.org/
112 AC_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])
116 AC_CACHE_CHECK([whether to enable OpenStreetMap stuff],
117                [ac_cv_enable_openstreetmap], [ac_cv_enable_openstreetmap=yes])
118 case $ac_cv_enable_openstreetmap in
119   yes)
120     AC_DEFINE(VIK_CONFIG_OPENSTREETMAP, [], [OPENSTREETMAP STUFF])
121     ;;
122 esac
123 AM_CONDITIONAL([OPENSTREETMAP], [test x$ac_cv_enable_openstreetmap = xyes])
124
125 AC_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])
129 AC_CACHE_CHECK([whether to enable Geocaches Acquire],
130                [ac_cv_enable_geocaches], [ac_cv_enable_geocaches=yes])
131 case $ac_cv_enable_geocaches in
132   yes)
133     AC_DEFINE(VIK_CONFIG_GEOCACHES, [], [GEOCACHES STUFF])
134     ;;
135 esac
136 AM_CONDITIONAL([GEOCACHES], [test x$ac_cv_enable_geocaches = xyes])
137
138
139 AC_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])
143 AC_CACHE_CHECK([whether to enable USGS DEM 24k download source],
144                [ac_cv_enable_dem24k], [ac_cv_enable_dem24k=yes])
145 case $ac_cv_enable_dem24k in
146   yes)
147     AC_DEFINE(VIK_CONFIG_DEM24K, [], [DEM24K STUFF])
148     ;;
149 esac
150 AM_CONDITIONAL([DEM24K], [test x$ac_cv_enable_dem24k = xyes])
151
152 # Realtime GPS tracking
153 AC_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])
157 AC_CACHE_CHECK([whether to enable Realtime GPS Tracking stuff],
158                [ac_cv_enable_realtimegpstracking], [ac_cv_enable_realtimegpstracking=yes])
159 case $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     ;;
164 esac
165 AM_CONDITIONAL([REALTIME_GPS_TRACKING], [test x$ac_cv_enable_realtimegpstracking = xyes])
166
167 AC_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])
178 AC_DEFINE_UNQUOTED(VIK_CONFIG_MAPCACHE_SIZE, ${VIK_CONFIG_MAPCACHE_SIZE},
179                    [Size of the map cache])
180
181 # Configuration
182 AC_CONFIG_FILES([Makefile
183                  src/Makefile
184                  src/icons/Makefile
185                  test/Makefile
186                  doc/Makefile
187                  doc/dev/Makefile])
188 AC_OUTPUT([
189            viking.spec
190            ])
191
192 dnl Output the configuration summary
193 echo ""
194 echo "==========================================="
195 echo "$PACKAGE $VERSION"
196 echo "-------------------------------------------"
197 echo "Alphabetized track & waypoints   : $ac_cv_enable_alpha_trw"
198 echo "Google Maps                      : $ac_cv_enable_google"
199 #echo "Old Google Maps                  : $ac_cv_enable_old_google"
200 echo "Terraserver Maps                 : $ac_cv_enable_terraserver"
201 #echo "Expedia Maps                     : $ac_cv_enable_expedia"
202 echo "Open Street Map                  : $ac_cv_enable_openstreetmap"
203 #echo "Geocaches Acquire                : $ac_cv_enable_geocaches"
204 echo "USGS 24k DEM                     : $ac_cv_enable_dem24k"
205 echo "Realtime GPS Tracking            : $ac_cv_enable_realtimegpstracking"
206 echo "Size of map cache (in memory)    : ${VIK_CONFIG_MAPCACHE_SIZE}"
207 echo "-------------------------------------------"
208 echo ""
209 echo "Configure finished, type 'make' to build."
210