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