]>
Commit | Line | Data |
---|---|---|
9903c388 EB |
1 | # -*- Autoconf -*- |
2 | # Process this file with autoconf to produce a configure script. | |
3 | ||
4 | AC_PREREQ(2.59) | |
5b46f77e | 5 | AC_INIT(viking, 0.9.4) |
9903c388 EB |
6 | AM_INIT_AUTOMAKE() |
7 | dnl AC_CONFIG_SRCDIR([src/main.c]) | |
8fe95819 | 8 | AC_CONFIG_HEADERS([src/config.h]) |
9903c388 EB |
9 | |
10 | # Checks for programs. | |
11 | AC_PROG_CC | |
12 | AC_PROG_MAKE_SET | |
13 | ||
a5daec1c GB |
14 | # I18N |
15 | GETTEXT_PACKAGE=viking | |
16 | AC_SUBST(GETTEXT_PACKAGE) | |
17 | AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name]) | |
18 | ||
19 | AM_GLIB_DEFINE_LOCALEDIR(LOCALEDIR) | |
20 | ||
21 | AM_GLIB_GNU_GETTEXT | |
d44b1562 | 22 | IT_PROG_INTLTOOL([0.35.0]) |
a5daec1c GB |
23 | |
24 | AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS']) | |
25 | ||
26 | dnl This will cause the automake generated makefiles to pass the | |
27 | dnl correct flags to aclocal. | |
28 | ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}" | |
29 | AC_SUBST(ACLOCAL_AMFLAGS) | |
30 | ||
9903c388 EB |
31 | # Checks for header files. |
32 | AC_HEADER_STDC | |
5868323c | 33 | AC_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. | |
36 | AC_C_CONST | |
37 | AC_TYPE_MODE_T | |
38 | ||
39 | # Checks for library functions. | |
40 | AC_FUNC_STAT | |
41 | AC_FUNC_STRTOD | |
eb93fa95 | 42 | AC_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 |
45 | AM_WITH_EXPAT |
46 | ||
3292ba8b | 47 | # Curl |
f901dcdf | 48 | LIBCURL_CHECK_CONFIG([yes],[],[],[AC_MSG_ERROR([libcurl is needed but not found])]) |
3292ba8b | 49 | |
fa1b5a5f GB |
50 | AC_CHECK_PROG([GDK_PIXBUF_CSOURCE],gdk-pixbuf-csource,[yes]) |
51 | if test $GDK_PIXBUF_CSOURCE != "yes" | |
52 | then | |
53 | AC_MSG_ERROR([gdk-pixbuf-csource is needed but not found]) | |
54 | fi | |
55 | ||
56 | # Checks for libraries. | |
57 | AM_PATH_GTK_2_0(2.2.0,,AC_MSG_ERROR(needs GTK+ 2.2.0),gthread) | |
dad55b79 | 58 | |
734652bf EB |
59 | # Options |
60 | AC_ARG_ENABLE(alphabetized-trw, AC_HELP_STRING([--enable-alphabetized-trw], | |
61 | [enable alphabetized track & waypoints (default is enable)]), | |
62 | [ac_cv_enable_alpha_trw=$enableval], | |
63 | [ac_cv_enable_alpha_trw=yes]) | |
64 | AC_CACHE_CHECK([whether to enable alphabetized track & waypoint], | |
65 | [ac_cv_enable_alpha_trw], [ac_cv_enable_alpha_trw=yes]) | |
66 | case $ac_cv_enable_alpha_trw in | |
67 | yes) | |
68 | AC_DEFINE(VIK_CONFIG_ALPHABETIZED_TRW, [], [NO ALPHABETIZED TRW]) | |
69 | ;; | |
70 | esac | |
71 | ||
cdcaf41c QT |
72 | AC_ARG_ENABLE(google, AC_HELP_STRING([--enable-google], |
73 | [enable Google stuff (default is enable)]), | |
74 | [ac_cv_enable_google=$enableval], | |
75 | [ac_cv_enable_google=yes]) | |
76 | AC_CACHE_CHECK([whether to enable Google stuff], | |
77 | [ac_cv_enable_google], [ac_cv_enable_google=yes]) | |
78 | case $ac_cv_enable_google in | |
79 | yes) | |
80 | AC_DEFINE(VIK_CONFIG_GOOGLE, [], [GOOGLE STUFF]) | |
81 | ;; | |
82 | esac | |
83 | AM_CONDITIONAL([GOOGLE], [test x$ac_cv_enable_google = xyes]) | |
84 | ||
36c78d6d QT |
85 | AC_ARG_ENABLE(oldgoogle, AC_HELP_STRING([--enable-old-google], |
86 | [enable old Google stuff (default is disable)]), | |
001a86db QT |
87 | [ac_cv_enable_old_google=$enableval], |
88 | [ac_cv_enable_old_google=no]) | |
36c78d6d QT |
89 | AC_CACHE_CHECK([whether to enable Old Google stuff], |
90 | [ac_cv_enable_old_google], [ac_cv_enable_old_google=yes]) | |
24ca37ba | 91 | case $ac_cv_enable_old_google in |
36c78d6d QT |
92 | yes) |
93 | AC_DEFINE(VIK_CONFIG_OLD_GOOGLE, [], [OLD GOOGLE STUFF]) | |
94 | ;; | |
95 | esac | |
96 | AM_CONDITIONAL([OLDGOOGLE], [test x$ac_cv_enable_old_google = xyes]) | |
97 | ||
cdcaf41c QT |
98 | AC_ARG_ENABLE(terraserver, AC_HELP_STRING([--enable-terraserver], |
99 | [enable Terraserver stuff (default is enable)]), | |
100 | [ac_cv_enable_terraserver=$enableval], | |
101 | [ac_cv_enable_terraserver=yes]) | |
102 | AC_CACHE_CHECK([whether to enable Terraserver stuff], | |
103 | [ac_cv_enable_terraserver], [ac_cv_enable_terraserver=yes]) | |
104 | case $ac_cv_enable_terraserver in | |
105 | yes) | |
106 | AC_DEFINE(VIK_CONFIG_TERRASERVER, [], [TERRASERVER STUFF]) | |
107 | ;; | |
108 | esac | |
109 | AM_CONDITIONAL([TERRASERVER], [test x$ac_cv_enable_terraserver = xyes]) | |
110 | ||
111 | AC_ARG_ENABLE(expedia, AC_HELP_STRING([--enable-expedia], | |
06f31fd5 | 112 | [enable Expedia stuff (default is disable)]), |
cdcaf41c | 113 | [ac_cv_enable_expedia=$enableval], |
06f31fd5 | 114 | [ac_cv_enable_expedia=no]) |
cdcaf41c QT |
115 | AC_CACHE_CHECK([whether to enable Expedia stuff], |
116 | [ac_cv_enable_expedia], [ac_cv_enable_expedia=yes]) | |
117 | case $ac_cv_enable_expedia in | |
118 | yes) | |
119 | AC_DEFINE(VIK_CONFIG_EXPEDIA, [], [EXPEDIA STUFF]) | |
120 | ;; | |
121 | esac | |
122 | AM_CONDITIONAL([EXPEDIA], [test x$ac_cv_enable_expedia = xyes]) | |
123 | ||
ca9eb04a GB |
124 | # OpenStreetMap http://www.openstreetmap.org/ |
125 | AC_ARG_ENABLE(openstreetmap, AC_HELP_STRING([--enable-openstreetmap], | |
126 | [enable OpenStreetMap stuff (default is enable)]), | |
127 | [ac_cv_enable_openstreetmap=$enableval], | |
128 | [ac_cv_enable_openstreetmap=yes]) | |
129 | AC_CACHE_CHECK([whether to enable OpenStreetMap stuff], | |
130 | [ac_cv_enable_openstreetmap], [ac_cv_enable_openstreetmap=yes]) | |
131 | case $ac_cv_enable_openstreetmap in | |
132 | yes) | |
133 | AC_DEFINE(VIK_CONFIG_OPENSTREETMAP, [], [OPENSTREETMAP STUFF]) | |
134 | ;; | |
135 | esac | |
136 | AM_CONDITIONAL([OPENSTREETMAP], [test x$ac_cv_enable_openstreetmap = xyes]) | |
137 | ||
1ef9e637 | 138 | AC_ARG_ENABLE(geocaches, AC_HELP_STRING([--enable-geocaches], |
a0d39f7e | 139 | [enable Geocaches Acquire (default is disable).]), |
1ef9e637 QT |
140 | [ac_cv_enable_geocaches=$enableval], |
141 | [ac_cv_enable_geocaches=no]) | |
142 | AC_CACHE_CHECK([whether to enable Geocaches Acquire], | |
143 | [ac_cv_enable_geocaches], [ac_cv_enable_geocaches=yes]) | |
144 | case $ac_cv_enable_geocaches in | |
145 | yes) | |
146 | AC_DEFINE(VIK_CONFIG_GEOCACHES, [], [GEOCACHES STUFF]) | |
147 | ;; | |
148 | esac | |
149 | AM_CONDITIONAL([GEOCACHES], [test x$ac_cv_enable_geocaches = xyes]) | |
150 | ||
8c721f83 EB |
151 | |
152 | AC_ARG_ENABLE(dem24k, AC_HELP_STRING([--enable-dem24k], | |
153 | [enable USGS 24k DEM (default is disable) download source. Requires dem24k.pl script in path.]), | |
154 | [ac_cv_enable_dem24k=$enableval], | |
155 | [ac_cv_enable_dem24k=no]) | |
156 | AC_CACHE_CHECK([whether to enable USGS DEM 24k download source], | |
157 | [ac_cv_enable_dem24k], [ac_cv_enable_dem24k=yes]) | |
158 | case $ac_cv_enable_dem24k in | |
159 | yes) | |
160 | AC_DEFINE(VIK_CONFIG_DEM24K, [], [DEM24K STUFF]) | |
161 | ;; | |
162 | esac | |
163 | AM_CONDITIONAL([DEM24K], [test x$ac_cv_enable_dem24k = xyes]) | |
164 | ||
001a86db QT |
165 | # Realtime GPS tracking |
166 | AC_ARG_ENABLE(realtime-gps-tracking, AC_HELP_STRING([--enable-realtime-gps-tracking], | |
167 | [enable realtime GPS tracking (default is enable)]), | |
168 | [ac_cv_enable_realtimegpstracking=$enableval], | |
169 | [ac_cv_enable_realtimegpstracking=yes]) | |
170 | AC_CACHE_CHECK([whether to enable Realtime GPS Tracking stuff], | |
171 | [ac_cv_enable_realtimegpstracking], [ac_cv_enable_realtimegpstracking=yes]) | |
172 | case $ac_cv_enable_realtimegpstracking in | |
173 | yes) | |
8956d2ef QT |
174 | 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])) |
175 | AC_DEFINE(VIK_CONFIG_REALTIME_GPS_TRACKING, [], [REALTIME GPS TRACKING STUFF]) | |
001a86db QT |
176 | ;; |
177 | esac | |
178 | AM_CONDITIONAL([REALTIME_GPS_TRACKING], [test x$ac_cv_enable_realtimegpstracking = xyes]) | |
179 | ||
1bc9b120 GB |
180 | AC_ARG_WITH(mapcache, |
181 | [AC_HELP_STRING([--with-mapcache], | |
182 | [specify the size of the map cache (default is 50331648)])], | |
183 | [if test "x$withval" = "xno"; then | |
184 | VIK_CONFIG_MAPCACHE_SIZE=0; | |
185 | elif test "x$withval" = "xyes"; then | |
186 | AC_MSG_ERROR([Please, set a value for size of the map cache]) | |
187 | else | |
188 | VIK_CONFIG_MAPCACHE_SIZE=${withval} | |
189 | fi], | |
190 | [VIK_CONFIG_MAPCACHE_SIZE=50331648]) | |
191 | AC_DEFINE_UNQUOTED(VIK_CONFIG_MAPCACHE_SIZE, ${VIK_CONFIG_MAPCACHE_SIZE}, | |
192 | [Size of the map cache]) | |
193 | ||
a5daec1c GB |
194 | dnl This will cause the automake generated makefiles to pass the |
195 | dnl correct flags to aclocal. | |
196 | ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}" | |
197 | AC_SUBST(ACLOCAL_AMFLAGS) | |
198 | ||
734652bf | 199 | # Configuration |
9903c388 | 200 | AC_CONFIG_FILES([Makefile |
0912fc7e | 201 | src/Makefile |
dad55b79 | 202 | src/icons/Makefile |
a5daec1c | 203 | po/Makefile.in |
9d3e06a4 | 204 | test/Makefile |
0912fc7e EB |
205 | doc/Makefile |
206 | doc/dev/Makefile]) | |
af2740eb QT |
207 | AC_OUTPUT([ |
208 | viking.spec | |
209 | ]) | |
001a86db QT |
210 | |
211 | dnl Output the configuration summary | |
212 | echo "" | |
213 | echo "===========================================" | |
214 | echo "$PACKAGE $VERSION" | |
215 | echo "-------------------------------------------" | |
216 | echo "Alphabetized track & waypoints : $ac_cv_enable_alpha_trw" | |
217 | echo "Google Maps : $ac_cv_enable_google" | |
218 | #echo "Old Google Maps : $ac_cv_enable_old_google" | |
219 | echo "Terraserver Maps : $ac_cv_enable_terraserver" | |
220 | #echo "Expedia Maps : $ac_cv_enable_expedia" | |
221 | echo "Open Street Map : $ac_cv_enable_openstreetmap" | |
222 | #echo "Geocaches Acquire : $ac_cv_enable_geocaches" | |
223 | echo "USGS 24k DEM : $ac_cv_enable_dem24k" | |
224 | echo "Realtime GPS Tracking : $ac_cv_enable_realtimegpstracking" | |
225 | echo "Size of map cache (in memory) : ${VIK_CONFIG_MAPCACHE_SIZE}" | |
226 | echo "-------------------------------------------" | |
227 | echo "" | |
228 | echo "Configure finished, type 'make' to build." | |
229 |