]> git.street.me.uk Git - andy/viking.git/blame - configure.ac
Initial VikMapType class
[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)
7a31304a 5AC_INIT(viking, 0.9.6)
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.
972d7785 11AC_PROG_CC
9903c388 12AC_PROG_MAKE_SET
b6e6dfbd 13AC_PROG_RANLIB
9903c388 14
a5daec1c
GB
15# I18N
16GETTEXT_PACKAGE=viking
17AC_SUBST(GETTEXT_PACKAGE)
18AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
19
20AM_GLIB_DEFINE_LOCALEDIR(LOCALEDIR)
21
22AM_GLIB_GNU_GETTEXT
d44b1562 23IT_PROG_INTLTOOL([0.35.0])
a5daec1c
GB
24
25AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS'])
26
27dnl This will cause the automake generated makefiles to pass the
28dnl correct flags to aclocal.
29ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
30AC_SUBST(ACLOCAL_AMFLAGS)
31
9903c388
EB
32# Checks for header files.
33AC_HEADER_STDC
e81e41fb 34AC_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])
9903c388
EB
35
36# Checks for typedefs, structures, and compiler characteristics.
37AC_C_CONST
38AC_TYPE_MODE_T
39
40# Checks for library functions.
41AC_FUNC_STAT
42AC_FUNC_STRTOD
c44594ee 43AC_CHECK_FUNCS([floor gethostbyname memset mkdtemp pow realpath socket sqrt strcasecmp strchr strdup strncasecmp strtol strtoul])
9903c388 44
dad55b79 45# Expat
fa1b5a5f
GB
46AM_WITH_EXPAT
47
3292ba8b 48# Curl
f901dcdf 49LIBCURL_CHECK_CONFIG([yes],[],[],[AC_MSG_ERROR([libcurl is needed but not found])])
3292ba8b 50
fa1b5a5f
GB
51AC_CHECK_PROG([GDK_PIXBUF_CSOURCE],gdk-pixbuf-csource,[yes])
52if test $GDK_PIXBUF_CSOURCE != "yes"
53then
54 AC_MSG_ERROR([gdk-pixbuf-csource is needed but not found])
55fi
56
57# Checks for libraries.
58AM_PATH_GTK_2_0(2.2.0,,AC_MSG_ERROR(needs GTK+ 2.2.0),gthread)
dad55b79 59
734652bf
EB
60# Options
61AC_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])
65AC_CACHE_CHECK([whether to enable alphabetized track & waypoint],
66 [ac_cv_enable_alpha_trw], [ac_cv_enable_alpha_trw=yes])
67case $ac_cv_enable_alpha_trw in
68 yes)
69 AC_DEFINE(VIK_CONFIG_ALPHABETIZED_TRW, [], [NO ALPHABETIZED TRW])
70 ;;
71esac
72
cdcaf41c
QT
73AC_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])
77AC_CACHE_CHECK([whether to enable Google stuff],
78 [ac_cv_enable_google], [ac_cv_enable_google=yes])
79case $ac_cv_enable_google in
80 yes)
81 AC_DEFINE(VIK_CONFIG_GOOGLE, [], [GOOGLE STUFF])
82 ;;
83esac
84AM_CONDITIONAL([GOOGLE], [test x$ac_cv_enable_google = xyes])
85
36c78d6d
QT
86AC_ARG_ENABLE(oldgoogle, AC_HELP_STRING([--enable-old-google],
87 [enable old Google stuff (default is disable)]),
001a86db
QT
88 [ac_cv_enable_old_google=$enableval],
89 [ac_cv_enable_old_google=no])
36c78d6d
QT
90AC_CACHE_CHECK([whether to enable Old Google stuff],
91 [ac_cv_enable_old_google], [ac_cv_enable_old_google=yes])
24ca37ba 92case $ac_cv_enable_old_google in
36c78d6d
QT
93 yes)
94 AC_DEFINE(VIK_CONFIG_OLD_GOOGLE, [], [OLD GOOGLE STUFF])
95 ;;
96esac
97AM_CONDITIONAL([OLDGOOGLE], [test x$ac_cv_enable_old_google = xyes])
98
cdcaf41c
QT
99AC_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])
103AC_CACHE_CHECK([whether to enable Terraserver stuff],
104 [ac_cv_enable_terraserver], [ac_cv_enable_terraserver=yes])
105case $ac_cv_enable_terraserver in
106 yes)
107 AC_DEFINE(VIK_CONFIG_TERRASERVER, [], [TERRASERVER STUFF])
108 ;;
109esac
110AM_CONDITIONAL([TERRASERVER], [test x$ac_cv_enable_terraserver = xyes])
111
112AC_ARG_ENABLE(expedia, AC_HELP_STRING([--enable-expedia],
06f31fd5 113 [enable Expedia stuff (default is disable)]),
cdcaf41c 114 [ac_cv_enable_expedia=$enableval],
06f31fd5 115 [ac_cv_enable_expedia=no])
cdcaf41c
QT
116AC_CACHE_CHECK([whether to enable Expedia stuff],
117 [ac_cv_enable_expedia], [ac_cv_enable_expedia=yes])
118case $ac_cv_enable_expedia in
119 yes)
120 AC_DEFINE(VIK_CONFIG_EXPEDIA, [], [EXPEDIA STUFF])
121 ;;
122esac
123AM_CONDITIONAL([EXPEDIA], [test x$ac_cv_enable_expedia = xyes])
124
ca9eb04a
GB
125# OpenStreetMap http://www.openstreetmap.org/
126AC_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])
130AC_CACHE_CHECK([whether to enable OpenStreetMap stuff],
131 [ac_cv_enable_openstreetmap], [ac_cv_enable_openstreetmap=yes])
132case $ac_cv_enable_openstreetmap in
133 yes)
134 AC_DEFINE(VIK_CONFIG_OPENSTREETMAP, [], [OPENSTREETMAP STUFF])
135 ;;
136esac
137AM_CONDITIONAL([OPENSTREETMAP], [test x$ac_cv_enable_openstreetmap = xyes])
138
1ef9e637 139AC_ARG_ENABLE(geocaches, AC_HELP_STRING([--enable-geocaches],
a0d39f7e 140 [enable Geocaches Acquire (default is disable).]),
1ef9e637
QT
141 [ac_cv_enable_geocaches=$enableval],
142 [ac_cv_enable_geocaches=no])
143AC_CACHE_CHECK([whether to enable Geocaches Acquire],
144 [ac_cv_enable_geocaches], [ac_cv_enable_geocaches=yes])
145case $ac_cv_enable_geocaches in
146 yes)
147 AC_DEFINE(VIK_CONFIG_GEOCACHES, [], [GEOCACHES STUFF])
148 ;;
149esac
150AM_CONDITIONAL([GEOCACHES], [test x$ac_cv_enable_geocaches = xyes])
151
8c721f83
EB
152
153AC_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])
157AC_CACHE_CHECK([whether to enable USGS DEM 24k download source],
158 [ac_cv_enable_dem24k], [ac_cv_enable_dem24k=yes])
159case $ac_cv_enable_dem24k in
160 yes)
161 AC_DEFINE(VIK_CONFIG_DEM24K, [], [DEM24K STUFF])
162 ;;
163esac
164AM_CONDITIONAL([DEM24K], [test x$ac_cv_enable_dem24k = xyes])
165
001a86db
QT
166# Realtime GPS tracking
167AC_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])
171AC_CACHE_CHECK([whether to enable Realtime GPS Tracking stuff],
172 [ac_cv_enable_realtimegpstracking], [ac_cv_enable_realtimegpstracking=yes])
173case $ac_cv_enable_realtimegpstracking in
174 yes)
8956d2ef
QT
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])
001a86db
QT
177 ;;
178esac
179AM_CONDITIONAL([REALTIME_GPS_TRACKING], [test x$ac_cv_enable_realtimegpstracking = xyes])
180
1bc9b120
GB
181AC_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])
192AC_DEFINE_UNQUOTED(VIK_CONFIG_MAPCACHE_SIZE, ${VIK_CONFIG_MAPCACHE_SIZE},
193 [Size of the map cache])
194
e5140ce8
GB
195dnl man pages processing
196DB2MAN_XSL=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl
197AC_SUBST(DB2MAN_XSL)
198AC_PATH_PROG(XP,xsltproc)
199AM_CONDITIONAL([GEN_MANPAGES],[test "x$XP" != "x" && test -r "$DB2MAN_XSL"])
200
a5daec1c
GB
201dnl This will cause the automake generated makefiles to pass the
202dnl correct flags to aclocal.
203ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
204AC_SUBST(ACLOCAL_AMFLAGS)
205
734652bf 206# Configuration
9903c388 207AC_CONFIG_FILES([Makefile
0912fc7e 208 src/Makefile
dad55b79 209 src/icons/Makefile
a5daec1c 210 po/Makefile.in
9d3e06a4 211 test/Makefile
0912fc7e
EB
212 doc/Makefile
213 doc/dev/Makefile])
af2740eb
QT
214AC_OUTPUT([
215 viking.spec
216 ])
001a86db
QT
217
218dnl Output the configuration summary
219echo ""
220echo "==========================================="
221echo "$PACKAGE $VERSION"
222echo "-------------------------------------------"
223echo "Alphabetized track & waypoints : $ac_cv_enable_alpha_trw"
224echo "Google Maps : $ac_cv_enable_google"
225#echo "Old Google Maps : $ac_cv_enable_old_google"
226echo "Terraserver Maps : $ac_cv_enable_terraserver"
227#echo "Expedia Maps : $ac_cv_enable_expedia"
228echo "Open Street Map : $ac_cv_enable_openstreetmap"
229#echo "Geocaches Acquire : $ac_cv_enable_geocaches"
230echo "USGS 24k DEM : $ac_cv_enable_dem24k"
231echo "Realtime GPS Tracking : $ac_cv_enable_realtimegpstracking"
232echo "Size of map cache (in memory) : ${VIK_CONFIG_MAPCACHE_SIZE}"
233echo "-------------------------------------------"
234echo ""
235echo "Configure finished, type 'make' to build."
236