portland.vik example
[viking/gosmore.git] / configure.ac
blob82872708f7ceed0f3f2417034e2206ff896f95e9
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 AC_PREREQ(2.59)
5 AC_INIT(viking, 0.9.2)
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
14 # Checks for header files.
15 AC_HEADER_STDC
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])
18 # Checks for typedefs, structures, and compiler characteristics.
19 AC_C_CONST
20 AC_TYPE_MODE_T
22 # Checks for library functions.
23 AC_FUNC_STAT
24 AC_FUNC_STRTOD
25 AC_CHECK_FUNCS([bzero floor gethostbyname memset mkdir mkdtemp pow realpath socket sqrt strcasecmp strchr strdup strncasecmp strtol strtoul])
27 # Expat
28 AM_WITH_EXPAT
30 # Curl
31 LIBCURL_CHECK_CONFIG([yes],[],[],[AC_MSG_ERROR([libcurl is needed but not found])])
33 # libgps
34 AC_CHECK_LIB(gps,gps_poll,AC_DEFINE(HAVE_LIBGPS,[],[libgps to connect to gpsd]),)
35 AM_CONDITIONAL([LIBGPS], [test x$ac_cv_lib_gps_gps_poll = xyes])
37 AC_CHECK_PROG([GDK_PIXBUF_CSOURCE],gdk-pixbuf-csource,[yes])
38 if test $GDK_PIXBUF_CSOURCE != "yes"
39 then
40   AC_MSG_ERROR([gdk-pixbuf-csource is needed but not found])
43 # Checks for libraries.
44 AM_PATH_GTK_2_0(2.2.0,,AC_MSG_ERROR(needs GTK+ 2.2.0),gthread)
46 # Options
47 AC_ARG_ENABLE(alphabetized-trw, AC_HELP_STRING([--enable-alphabetized-trw],
48               [enable alphabetized track & waypoints (default is enable)]),
49               [ac_cv_enable_alpha_trw=$enableval],
50               [ac_cv_enable_alpha_trw=yes])
51 AC_CACHE_CHECK([whether to enable alphabetized track & waypoint],
52                [ac_cv_enable_alpha_trw], [ac_cv_enable_alpha_trw=yes])
53 case $ac_cv_enable_alpha_trw in
54   yes)
55     AC_DEFINE(VIK_CONFIG_ALPHABETIZED_TRW, [], [NO ALPHABETIZED TRW])
56     ;;
57 esac
59 AC_ARG_ENABLE(google, AC_HELP_STRING([--enable-google],
60               [enable Google stuff (default is enable)]),
61               [ac_cv_enable_google=$enableval],
62               [ac_cv_enable_google=yes])
63 AC_CACHE_CHECK([whether to enable Google stuff],
64                [ac_cv_enable_google], [ac_cv_enable_google=yes])
65 case $ac_cv_enable_google in
66   yes)
67     AC_DEFINE(VIK_CONFIG_GOOGLE, [], [GOOGLE STUFF])
68     ;;
69 esac
70 AM_CONDITIONAL([GOOGLE], [test x$ac_cv_enable_google = xyes])
72 AC_ARG_ENABLE(oldgoogle, AC_HELP_STRING([--enable-old-google],
73               [enable old Google stuff (default is disable)]),
74               [ac_cv_enable_google=$enableval],
75               [ac_cv_enable_google=no])
76 AC_CACHE_CHECK([whether to enable Old Google stuff],
77                [ac_cv_enable_old_google], [ac_cv_enable_old_google=yes])
78 case $ac_cv_enable_google in
79   yes)
80     AC_DEFINE(VIK_CONFIG_OLD_GOOGLE, [], [OLD GOOGLE STUFF])
81     ;;
82 esac
83 AM_CONDITIONAL([OLDGOOGLE], [test x$ac_cv_enable_old_google = xyes])
85 AC_ARG_ENABLE(terraserver, AC_HELP_STRING([--enable-terraserver],
86               [enable Terraserver stuff (default is enable)]),
87               [ac_cv_enable_terraserver=$enableval],
88               [ac_cv_enable_terraserver=yes])
89 AC_CACHE_CHECK([whether to enable Terraserver stuff],
90                [ac_cv_enable_terraserver], [ac_cv_enable_terraserver=yes])
91 case $ac_cv_enable_terraserver in
92   yes)
93     AC_DEFINE(VIK_CONFIG_TERRASERVER, [], [TERRASERVER STUFF])
94     ;;
95 esac
96 AM_CONDITIONAL([TERRASERVER], [test x$ac_cv_enable_terraserver = xyes])
98 AC_ARG_ENABLE(expedia, AC_HELP_STRING([--enable-expedia],
99               [enable Expedia stuff (default is disable)]),
100               [ac_cv_enable_expedia=$enableval],
101               [ac_cv_enable_expedia=no])
102 AC_CACHE_CHECK([whether to enable Expedia stuff],
103                [ac_cv_enable_expedia], [ac_cv_enable_expedia=yes])
104 case $ac_cv_enable_expedia in
105   yes)
106     AC_DEFINE(VIK_CONFIG_EXPEDIA, [], [EXPEDIA STUFF])
107     ;;
108 esac
109 AM_CONDITIONAL([EXPEDIA], [test x$ac_cv_enable_expedia = xyes])
111 # OpenStreetMap http://www.openstreetmap.org/
112 AC_ARG_ENABLE(openstreetmap, AC_HELP_STRING([--enable-openstreetmap],
113               [enable OpenStreetMap stuff (default is enable)]),
114               [ac_cv_enable_openstreetmap=$enableval],
115               [ac_cv_enable_openstreetmap=yes])
116 AC_CACHE_CHECK([whether to enable OpenStreetMap stuff],
117                [ac_cv_enable_openstreetmap], [ac_cv_enable_openstreetmap=yes])
118 case $ac_cv_enable_openstreetmap in
119   yes)
120     AC_DEFINE(VIK_CONFIG_OPENSTREETMAP, [], [OPENSTREETMAP STUFF])
121     ;;
122 esac
123 AM_CONDITIONAL([OPENSTREETMAP], [test x$ac_cv_enable_openstreetmap = xyes])
125 AC_ARG_ENABLE(geocaches, AC_HELP_STRING([--enable-geocaches],
126               [enable Geocaches Acquire (default is disable). WARNING: Broken, do not enable]),
127               [ac_cv_enable_geocaches=$enableval],
128               [ac_cv_enable_geocaches=no])
129 AC_CACHE_CHECK([whether to enable Geocaches Acquire],
130                [ac_cv_enable_geocaches], [ac_cv_enable_geocaches=yes])
131 case $ac_cv_enable_geocaches in
132   yes)
133     AC_DEFINE(VIK_CONFIG_GEOCACHES, [], [GEOCACHES STUFF])
134     ;;
135 esac
136 AM_CONDITIONAL([GEOCACHES], [test x$ac_cv_enable_geocaches = xyes])
139 AC_ARG_ENABLE(dem24k, AC_HELP_STRING([--enable-dem24k],
140               [enable USGS 24k DEM (default is disable) download source. Requires dem24k.pl script in path.]),
141               [ac_cv_enable_dem24k=$enableval],
142               [ac_cv_enable_dem24k=no])
143 AC_CACHE_CHECK([whether to enable USGS DEM 24k download source],
144                [ac_cv_enable_dem24k], [ac_cv_enable_dem24k=yes])
145 case $ac_cv_enable_dem24k in
146   yes)
147     AC_DEFINE(VIK_CONFIG_DEM24K, [], [DEM24K STUFF])
148     ;;
149 esac
150 AM_CONDITIONAL([DEM24K], [test x$ac_cv_enable_dem24k = xyes])
152 AC_ARG_WITH(mapcache,
153             [AC_HELP_STRING([--with-mapcache],
154                             [specify the size of the map cache (default is 50331648)])],
155             [if test "x$withval" = "xno"; then
156                 VIK_CONFIG_MAPCACHE_SIZE=0;
157              elif test "x$withval" = "xyes"; then
158                 AC_MSG_ERROR([Please, set a value for size of the map cache])
159              else
160                 VIK_CONFIG_MAPCACHE_SIZE=${withval}
161              fi],
162              [VIK_CONFIG_MAPCACHE_SIZE=50331648])
163 AC_DEFINE_UNQUOTED(VIK_CONFIG_MAPCACHE_SIZE, ${VIK_CONFIG_MAPCACHE_SIZE},
164                    [Size of the map cache])
166 # Configuration
167 AC_CONFIG_FILES([Makefile
168                  src/Makefile
169                  src/icons/Makefile
170                  test/Makefile
171                  doc/Makefile
172                  doc/dev/Makefile])
173 AC_OUTPUT([
174            viking.spec
175            ])