]> git.street.me.uk Git - andy/viking.git/blame - configure.ac
Preview adding a trackpoint by drawing a line when moving mouse
[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
QT
33# libgps
34AC_CHECK_LIB(gps,gps_poll,,AC_MSG_ERROR([libgps is needed but not found]))
35
fa1b5a5f
GB
36AC_CHECK_PROG([GDK_PIXBUF_CSOURCE],gdk-pixbuf-csource,[yes])
37if test $GDK_PIXBUF_CSOURCE != "yes"
38then
39 AC_MSG_ERROR([gdk-pixbuf-csource is needed but not found])
40fi
41
42# Checks for libraries.
43AM_PATH_GTK_2_0(2.2.0,,AC_MSG_ERROR(needs GTK+ 2.2.0),gthread)
dad55b79 44
734652bf
EB
45# Options
46AC_ARG_ENABLE(alphabetized-trw, AC_HELP_STRING([--enable-alphabetized-trw],
47 [enable alphabetized track & waypoints (default is enable)]),
48 [ac_cv_enable_alpha_trw=$enableval],
49 [ac_cv_enable_alpha_trw=yes])
50AC_CACHE_CHECK([whether to enable alphabetized track & waypoint],
51 [ac_cv_enable_alpha_trw], [ac_cv_enable_alpha_trw=yes])
52case $ac_cv_enable_alpha_trw in
53 yes)
54 AC_DEFINE(VIK_CONFIG_ALPHABETIZED_TRW, [], [NO ALPHABETIZED TRW])
55 ;;
56esac
57
cdcaf41c
QT
58AC_ARG_ENABLE(google, AC_HELP_STRING([--enable-google],
59 [enable Google stuff (default is enable)]),
60 [ac_cv_enable_google=$enableval],
61 [ac_cv_enable_google=yes])
62AC_CACHE_CHECK([whether to enable Google stuff],
63 [ac_cv_enable_google], [ac_cv_enable_google=yes])
64case $ac_cv_enable_google in
65 yes)
66 AC_DEFINE(VIK_CONFIG_GOOGLE, [], [GOOGLE STUFF])
67 ;;
68esac
69AM_CONDITIONAL([GOOGLE], [test x$ac_cv_enable_google = xyes])
70
36c78d6d
QT
71AC_ARG_ENABLE(oldgoogle, AC_HELP_STRING([--enable-old-google],
72 [enable old Google stuff (default is disable)]),
73 [ac_cv_enable_google=$enableval],
74 [ac_cv_enable_google=no])
75AC_CACHE_CHECK([whether to enable Old Google stuff],
76 [ac_cv_enable_old_google], [ac_cv_enable_old_google=yes])
77case $ac_cv_enable_google in
78 yes)
79 AC_DEFINE(VIK_CONFIG_OLD_GOOGLE, [], [OLD GOOGLE STUFF])
80 ;;
81esac
82AM_CONDITIONAL([OLDGOOGLE], [test x$ac_cv_enable_old_google = xyes])
83
cdcaf41c
QT
84AC_ARG_ENABLE(terraserver, AC_HELP_STRING([--enable-terraserver],
85 [enable Terraserver stuff (default is enable)]),
86 [ac_cv_enable_terraserver=$enableval],
87 [ac_cv_enable_terraserver=yes])
88AC_CACHE_CHECK([whether to enable Terraserver stuff],
89 [ac_cv_enable_terraserver], [ac_cv_enable_terraserver=yes])
90case $ac_cv_enable_terraserver in
91 yes)
92 AC_DEFINE(VIK_CONFIG_TERRASERVER, [], [TERRASERVER STUFF])
93 ;;
94esac
95AM_CONDITIONAL([TERRASERVER], [test x$ac_cv_enable_terraserver = xyes])
96
97AC_ARG_ENABLE(expedia, AC_HELP_STRING([--enable-expedia],
06f31fd5 98 [enable Expedia stuff (default is disable)]),
cdcaf41c 99 [ac_cv_enable_expedia=$enableval],
06f31fd5 100 [ac_cv_enable_expedia=no])
cdcaf41c
QT
101AC_CACHE_CHECK([whether to enable Expedia stuff],
102 [ac_cv_enable_expedia], [ac_cv_enable_expedia=yes])
103case $ac_cv_enable_expedia in
104 yes)
105 AC_DEFINE(VIK_CONFIG_EXPEDIA, [], [EXPEDIA STUFF])
106 ;;
107esac
108AM_CONDITIONAL([EXPEDIA], [test x$ac_cv_enable_expedia = xyes])
109
ca9eb04a
GB
110# OpenStreetMap http://www.openstreetmap.org/
111AC_ARG_ENABLE(openstreetmap, AC_HELP_STRING([--enable-openstreetmap],
112 [enable OpenStreetMap stuff (default is enable)]),
113 [ac_cv_enable_openstreetmap=$enableval],
114 [ac_cv_enable_openstreetmap=yes])
115AC_CACHE_CHECK([whether to enable OpenStreetMap stuff],
116 [ac_cv_enable_openstreetmap], [ac_cv_enable_openstreetmap=yes])
117case $ac_cv_enable_openstreetmap in
118 yes)
119 AC_DEFINE(VIK_CONFIG_OPENSTREETMAP, [], [OPENSTREETMAP STUFF])
120 ;;
121esac
122AM_CONDITIONAL([OPENSTREETMAP], [test x$ac_cv_enable_openstreetmap = xyes])
123
1ef9e637
QT
124AC_ARG_ENABLE(geocaches, AC_HELP_STRING([--enable-geocaches],
125 [enable Geocaches Acquire (default is disable). WARNING: Broken, do not enable]),
126 [ac_cv_enable_geocaches=$enableval],
127 [ac_cv_enable_geocaches=no])
128AC_CACHE_CHECK([whether to enable Geocaches Acquire],
129 [ac_cv_enable_geocaches], [ac_cv_enable_geocaches=yes])
130case $ac_cv_enable_geocaches in
131 yes)
132 AC_DEFINE(VIK_CONFIG_GEOCACHES, [], [GEOCACHES STUFF])
133 ;;
134esac
135AM_CONDITIONAL([GEOCACHES], [test x$ac_cv_enable_geocaches = xyes])
136
8c721f83
EB
137
138AC_ARG_ENABLE(dem24k, AC_HELP_STRING([--enable-dem24k],
139 [enable USGS 24k DEM (default is disable) download source. Requires dem24k.pl script in path.]),
140 [ac_cv_enable_dem24k=$enableval],
141 [ac_cv_enable_dem24k=no])
142AC_CACHE_CHECK([whether to enable USGS DEM 24k download source],
143 [ac_cv_enable_dem24k], [ac_cv_enable_dem24k=yes])
144case $ac_cv_enable_dem24k in
145 yes)
146 AC_DEFINE(VIK_CONFIG_DEM24K, [], [DEM24K STUFF])
147 ;;
148esac
149AM_CONDITIONAL([DEM24K], [test x$ac_cv_enable_dem24k = xyes])
150
1bc9b120
GB
151AC_ARG_WITH(mapcache,
152 [AC_HELP_STRING([--with-mapcache],
153 [specify the size of the map cache (default is 50331648)])],
154 [if test "x$withval" = "xno"; then
155 VIK_CONFIG_MAPCACHE_SIZE=0;
156 elif test "x$withval" = "xyes"; then
157 AC_MSG_ERROR([Please, set a value for size of the map cache])
158 else
159 VIK_CONFIG_MAPCACHE_SIZE=${withval}
160 fi],
161 [VIK_CONFIG_MAPCACHE_SIZE=50331648])
162AC_DEFINE_UNQUOTED(VIK_CONFIG_MAPCACHE_SIZE, ${VIK_CONFIG_MAPCACHE_SIZE},
163 [Size of the map cache])
164
734652bf 165# Configuration
9903c388 166AC_CONFIG_FILES([Makefile
0912fc7e 167 src/Makefile
dad55b79 168 src/icons/Makefile
9d3e06a4 169 test/Makefile
0912fc7e
EB
170 doc/Makefile
171 doc/dev/Makefile])
af2740eb
QT
172AC_OUTPUT([
173 viking.spec
174 ])