]>
Commit | Line | Data |
---|---|---|
9903c388 EB |
1 | # -*- Autoconf -*- |
2 | # Process this file with autoconf to produce a configure script. | |
3 | ||
4 | AC_PREREQ(2.59) | |
13c9d849 | 5 | AC_INIT(viking, 0.9.2) |
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 | ||
9903c388 EB |
14 | # Checks for header files. |
15 | AC_HEADER_STDC | |
5868323c | 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]) |
9903c388 EB |
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 | |
eb93fa95 | 25 | AC_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 |
28 | AM_WITH_EXPAT |
29 | ||
3292ba8b | 30 | # Curl |
f901dcdf | 31 | LIBCURL_CHECK_CONFIG([yes],[],[],[AC_MSG_ERROR([libcurl is needed but not found])]) |
3292ba8b | 32 | |
c4e61875 QT |
33 | # libgps |
34 | AC_CHECK_LIB(gps,gps_poll,,AC_MSG_ERROR([libgps is needed but not found])) | |
35 | ||
fa1b5a5f GB |
36 | AC_CHECK_PROG([GDK_PIXBUF_CSOURCE],gdk-pixbuf-csource,[yes]) |
37 | if test $GDK_PIXBUF_CSOURCE != "yes" | |
38 | then | |
39 | AC_MSG_ERROR([gdk-pixbuf-csource is needed but not found]) | |
40 | fi | |
41 | ||
42 | # Checks for libraries. | |
43 | AM_PATH_GTK_2_0(2.2.0,,AC_MSG_ERROR(needs GTK+ 2.2.0),gthread) | |
dad55b79 | 44 | |
734652bf EB |
45 | # Options |
46 | AC_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]) | |
50 | AC_CACHE_CHECK([whether to enable alphabetized track & waypoint], | |
51 | [ac_cv_enable_alpha_trw], [ac_cv_enable_alpha_trw=yes]) | |
52 | case $ac_cv_enable_alpha_trw in | |
53 | yes) | |
54 | AC_DEFINE(VIK_CONFIG_ALPHABETIZED_TRW, [], [NO ALPHABETIZED TRW]) | |
55 | ;; | |
56 | esac | |
57 | ||
cdcaf41c QT |
58 | AC_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]) | |
62 | AC_CACHE_CHECK([whether to enable Google stuff], | |
63 | [ac_cv_enable_google], [ac_cv_enable_google=yes]) | |
64 | case $ac_cv_enable_google in | |
65 | yes) | |
66 | AC_DEFINE(VIK_CONFIG_GOOGLE, [], [GOOGLE STUFF]) | |
67 | ;; | |
68 | esac | |
69 | AM_CONDITIONAL([GOOGLE], [test x$ac_cv_enable_google = xyes]) | |
70 | ||
36c78d6d QT |
71 | AC_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]) | |
75 | AC_CACHE_CHECK([whether to enable Old Google stuff], | |
76 | [ac_cv_enable_old_google], [ac_cv_enable_old_google=yes]) | |
77 | case $ac_cv_enable_google in | |
78 | yes) | |
79 | AC_DEFINE(VIK_CONFIG_OLD_GOOGLE, [], [OLD GOOGLE STUFF]) | |
80 | ;; | |
81 | esac | |
82 | AM_CONDITIONAL([OLDGOOGLE], [test x$ac_cv_enable_old_google = xyes]) | |
83 | ||
cdcaf41c QT |
84 | AC_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]) | |
88 | AC_CACHE_CHECK([whether to enable Terraserver stuff], | |
89 | [ac_cv_enable_terraserver], [ac_cv_enable_terraserver=yes]) | |
90 | case $ac_cv_enable_terraserver in | |
91 | yes) | |
92 | AC_DEFINE(VIK_CONFIG_TERRASERVER, [], [TERRASERVER STUFF]) | |
93 | ;; | |
94 | esac | |
95 | AM_CONDITIONAL([TERRASERVER], [test x$ac_cv_enable_terraserver = xyes]) | |
96 | ||
97 | AC_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 |
101 | AC_CACHE_CHECK([whether to enable Expedia stuff], |
102 | [ac_cv_enable_expedia], [ac_cv_enable_expedia=yes]) | |
103 | case $ac_cv_enable_expedia in | |
104 | yes) | |
105 | AC_DEFINE(VIK_CONFIG_EXPEDIA, [], [EXPEDIA STUFF]) | |
106 | ;; | |
107 | esac | |
108 | AM_CONDITIONAL([EXPEDIA], [test x$ac_cv_enable_expedia = xyes]) | |
109 | ||
ca9eb04a GB |
110 | # OpenStreetMap http://www.openstreetmap.org/ |
111 | AC_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]) | |
115 | AC_CACHE_CHECK([whether to enable OpenStreetMap stuff], | |
116 | [ac_cv_enable_openstreetmap], [ac_cv_enable_openstreetmap=yes]) | |
117 | case $ac_cv_enable_openstreetmap in | |
118 | yes) | |
119 | AC_DEFINE(VIK_CONFIG_OPENSTREETMAP, [], [OPENSTREETMAP STUFF]) | |
120 | ;; | |
121 | esac | |
122 | AM_CONDITIONAL([OPENSTREETMAP], [test x$ac_cv_enable_openstreetmap = xyes]) | |
123 | ||
1ef9e637 QT |
124 | AC_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]) | |
128 | AC_CACHE_CHECK([whether to enable Geocaches Acquire], | |
129 | [ac_cv_enable_geocaches], [ac_cv_enable_geocaches=yes]) | |
130 | case $ac_cv_enable_geocaches in | |
131 | yes) | |
132 | AC_DEFINE(VIK_CONFIG_GEOCACHES, [], [GEOCACHES STUFF]) | |
133 | ;; | |
134 | esac | |
135 | AM_CONDITIONAL([GEOCACHES], [test x$ac_cv_enable_geocaches = xyes]) | |
136 | ||
8c721f83 EB |
137 | |
138 | AC_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]) | |
142 | AC_CACHE_CHECK([whether to enable USGS DEM 24k download source], | |
143 | [ac_cv_enable_dem24k], [ac_cv_enable_dem24k=yes]) | |
144 | case $ac_cv_enable_dem24k in | |
145 | yes) | |
146 | AC_DEFINE(VIK_CONFIG_DEM24K, [], [DEM24K STUFF]) | |
147 | ;; | |
148 | esac | |
149 | AM_CONDITIONAL([DEM24K], [test x$ac_cv_enable_dem24k = xyes]) | |
150 | ||
1bc9b120 GB |
151 | AC_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]) | |
162 | AC_DEFINE_UNQUOTED(VIK_CONFIG_MAPCACHE_SIZE, ${VIK_CONFIG_MAPCACHE_SIZE}, | |
163 | [Size of the map cache]) | |
164 | ||
734652bf | 165 | # Configuration |
9903c388 | 166 | AC_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 |
172 | AC_OUTPUT([ |
173 | viking.spec | |
174 | ]) |