Contents of /trunk/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 302 - (show annotations)
Tue Aug 31 18:58:25 2010 UTC (13 years, 7 months ago) by harbaum
File size: 7443 byte(s)
Added missing icon
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 # GPXView autoconf script
5 #
6 # Copyright (C) 2008 Till Harbaum <till@harbaum.org>
7 #
8 # This file is part of GPXView.
9 #
10 # GPXView is free software: you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation, either version 3 of the License, or
13 # (at your option) any later version.
14 #
15 # GPXView is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
19 #
20 # You should have received a copy of the GNU General Public License
21 # along with GPXView. If not, see <http://www.gnu.org/licenses/>.
22
23 AC_PREREQ(2.61)
24 AC_INIT([GPXView],[0.9.7],[till@harbaum.org])
25 AC_CONFIG_SRCDIR([src/main.c])
26 # AC_CONFIG_HEADER([src/config.h])
27
28 PACKAGE="gpxview"
29 AC_SUBST(PACKAGE)
30
31 # Checks for programs.
32 AC_PROG_CC
33 AC_PROG_INSTALL
34 AC_PROG_LN_S
35 AC_PROG_MAKE_SET
36
37 # Checks for libraries.
38
39 # Checks for header files.
40 #AC_HEADER_STDC
41 #AC_CHECK_HEADERS([libintl.h locale.h stdlib.h string.h sys/time.h unistd.h])
42
43 # Checks for typedefs, structures, and compiler characteristics.
44 #AC_C_CONST
45 #AC_C_INLINE
46 #AC_TYPE_SIZE_T
47 #AC_HEADER_TIME
48 #AC_STRUCT_TM
49 #AC_HEADER_STDBOOL
50
51 # Checks for library functions.
52 #AC_FUNC_MALLOC
53 #AC_FUNC_MKTIME
54 #AC_FUNC_STRFTIME
55 #AC_FUNC_STRTOD
56 #AC_CHECK_FUNCS([gettimeofday localtime_r memset pow setlocale sqrt strcasecmp strchr strcspn strdup strerror strrchr strstr strtoul tzset])
57
58 # check for gnome-vfs-module-2.0
59 PKG_CHECK_MODULES([gnome_vfs_module], [gnome-vfs-module-2.0], [], [AC_MSG_ERROR([gnome-vfs-module-2.0 missing])])
60 CFLAGS="$CFLAGS $gnome_vfs_module_CFLAGS"
61 LIBS="$LIBS $gnome_vfs_module_LIBS"
62
63 # check for libxml-2.0
64 PKG_CHECK_MODULES([libxml2], [libxml-2.0], [], [AC_MSG_ERROR([libxml-2.0 missing])])
65 CFLAGS="$CFLAGS $libxml2_CFLAGS"
66 LIBS="$LIBS $libxml2_LIBS"
67
68 # check for libcurl
69 PKG_CHECK_MODULES([libcurl], [libcurl], [], [AC_MSG_ERROR([libcurl missing])])
70 CFLAGS="$CFLAGS $libcurl_CFLAGS"
71 LIBS="$LIBS $libcurl_LIBS"
72
73 # check for libsoup
74 PKG_CHECK_MODULES([libsoup24], [libsoup-2.4], [
75 EXTRA_OBJS="$EXTRA_OBJS converter.o osm-gps-map.o map-tool.o osm-gps-map-osd-classic.o"
76 CFLAGS="$CFLAGS $libsoup24_CFLAGS -DENABLE_OSM_GPS_MAP"
77 LIBS="$LIBS $libsoup24_LIBS"
78 ], [
79 PKG_CHECK_MODULES([libsoup22], [libsoup-2.2], [
80 EXTRA_OBJS="$EXTRA_OBJS converter.o osm-gps-map.o map-tool.o osm-gps-map-osd-classic.o"
81 CFLAGS="$CFLAGS $libsoup22_CFLAGS -DUSE_LIBSOUP22 -DENABLE_OSM_GPS_MAP"
82 LIBS="$LIBS $libsoup22_LIBS"
83 ], [
84 AC_MSG_NOTICE([WARNING: libsoup-2.4/2.2 missing, disabling internal map])
85 ])
86 ])
87
88 # check for gtkhtml-3.14
89 PKG_CHECK_MODULES([libgtkhtml3_14], [libgtkhtml-3.14], [
90 CFLAGS="$CFLAGS $libgtkhtml3_14_CFLAGS"
91 LIBS="$LIBS $libgtkhtml3_14_LIBS"
92 ], [
93 # ok, we can also live with 3.8
94 PKG_CHECK_MODULES([libgtkhtml3_8], [libgtkhtml-3.8], [
95 CFLAGS="$CFLAGS $libgtkhtml3_8_CFLAGS"
96 LIBS="$LIBS $libgtkhtml3_8_LIBS"
97 ], [AC_MSG_ERROR([libgtkhtml-3 missing])])
98 ])
99
100 # check for maemo
101 AC_MSG_CHECKING([for Maemo])
102 PKG_CHECK_EXISTS(maemo-version, [
103 MAEMO="yes"
104 AC_MSG_RESULT(yes)
105
106 PKG_CHECK_MODULES([hildon], [hildon-1], [], [AC_MSG_ERROR([hildon-1 missing])])
107 CFLAGS="$CFLAGS -DUSE_MAEMO $hildon_CFLAGS"
108 LIBS="$LIBS $hildon_LIBS"
109
110 PKG_CHECK_MODULES([osso], [libosso], [], [AC_MSG_ERROR([libosso missing])])
111 CFLAGS="$CFLAGS $osso_CFLAGS"
112 LIBS="$LIBS $osso_LIBS"
113
114 PKG_CHECK_MODULES([hildon_fm_2], [hildon-fm-2], [], [AC_MSG_ERROR([hildon-fm-2 missing])])
115 CFLAGS="$CFLAGS $hildon_fm_2_CFLAGS"
116 LIBS="$LIBS $hildon_fm_2_LIBS"
117
118 # check for sqlite3 for maemo mapper interface
119 PKG_CHECK_MODULES([sqlite3], [sqlite3], [], [AC_MSG_ERROR([sqlite3 missing])])
120 CFLAGS="$CFLAGS $sqlite3_CFLAGS"
121 LIBS="$LIBS $sqlite3_LIBS"
122
123 # check for hildon-help
124 PKG_CHECK_MODULES([hildon_help], [hildon-help], [
125 CFLAGS="-DHILDON_HELP $CFLAGS $hildon_help_CFLAGS"
126 LIBS="$LIBS $hildon_help_LIBS"
127 ], [
128 AC_MSG_NOTICE([WARNING: hildon-help missing])
129 ])
130
131 # prefer gpsbt over liblocation as we got complaints regarding liblocation
132 # stability
133 PKG_CHECK_EXISTS(gpsbt, [
134 PKG_CHECK_MODULES([gpsbt], [gpsbt], [], [])
135 CFLAGS="$CFLAGS -DENABLE_GPSBT $gpsbt_CFLAGS"
136 LIBS="$LIBS $gpsbt_LIBS"
137 ], [
138 AC_MSG_NOTICE([gpsbt not found, trying liblocation])
139
140 PKG_CHECK_EXISTS(liblocation, [
141 PKG_CHECK_MODULES([liblocation], [liblocation], [], [])
142 CFLAGS="$CFLAGS -DENABLE_LIBLOCATION $liblocation_CFLAGS"
143 LIBS="$LIBS $liblocation_LIBS"
144 ], [
145 AC_MSG_NOTICE([WARNING: No liblocation nor gpsbt found, disabling gps auto start!])
146 ])
147 ])
148
149 PKG_CHECK_EXISTS(tablet-browser-interface, [
150 CFLAGS="$CFLAGS -DENABLE_BROWSER_INTERFACE"
151 ], [AC_MSG_NOTICE([WARNING: No tablet-browser-interface found, disabling microb interface!])])
152
153 PKG_CHECK_EXISTS(maemo-version, [
154 VERSION=`pkg-config --modversion maemo-version`
155 AC_MSG_NOTICE([Configuring for Maemo $VERSION])
156 CFLAGS="$CFLAGS -DMAEMO_VERSION=\\\"$VERSION\\\""
157 MAJOR=`echo $VERSION | cut -b1 -`
158 CFLAGS="$CFLAGS -DMAEMO_VERSION_MAJOR=$MAJOR"
159
160 MAEMO_VERSION_MAJOR=$MAJOR
161 AC_SUBST(MAEMO_VERSION_MAJOR)
162 ], [
163 AC_MSG_ERROR([maemo-version not found])
164 ])
165
166 INSTALL_PLATTFORM="install-maemo"
167
168 # fremantle uses icons of 48x48 pixels for the app installer,
169 # older versions used 26x26
170 if [[ "$MAJOR" == "5" ]]; then
171 ICONNAME=48x48/gpxview.png
172 datarootdir=/opt
173
174 # check for libespeak (broken in diablo, hence doing it here)
175 AC_CHECK_HEADERS(espeak/speak_lib.h, [
176 CFLAGS="$CFLAGS -DESPEAK"
177 LIBS="$LIBS -lespeak"
178 ])
179 else
180 ICONNAME=26x26/gpxview.png
181 AC_MSG_NOTICE([Enabling Maemo Mapper support])
182 fi
183
184 CFLAGS="$CFLAGS -DENABLE_MAEMO_MAPPER"
185 EXTRA_OBJS="$EXTRA_OBJS mm_poi.o"
186
187 # maemo uses dbus for ipc with maemo mapper
188 EXTRA_OBJS="$EXTRA_OBJS dbus.o"
189
190 AC_MSG_NOTICE([Using application installer icon "$ICONNAME"])
191
192 # add icon entry to debian/control
193 ICON=" Maemo icon $ICONNAME
194 XB-Maemo-Icon-26:
195 "
196
197 # generate base64 icon, remove first and last line
198 # and add a space before each line
199 ICON="$ICON`uuencode -m data/icons/$ICONNAME $ICONNAME | sed '1d;$d;s/^/ /' -`"
200
201 ], [
202 AC_MSG_RESULT(no)
203
204 EXTRA_OBJS="$EXTRA_OBJS bct.o"
205 CFLAGS="$CFLAGS -DBCT"
206
207 # check for gtk+-2.0
208 PKG_CHECK_MODULES([gtk], [gtk+-2.0], [], [AC_MSG_ERROR([gtk+-2.0 missing!])])
209 CFLAGS="$CFLAGS $gtk_CFLAGS"
210 LIBS="$LIBS $gtk_LIBS"
211
212 # non-maemo device use gnome to call the web browser
213 PKG_CHECK_MODULES([gnome2], [libgnome-2.0], [], [AC_MSG_ERROR([libgnome-2.0 missing])])
214 CFLAGS="$CFLAGS $gnome2_CFLAGS -DENABLE_BROWSER_INTERFACE"
215 LIBS="$LIBS $gnome2_LIBS"
216
217 # check for libespeak
218 AC_CHECK_HEADERS(espeak/speak_lib.h, [
219 CFLAGS="$CFLAGS -DESPEAK"
220 LIBS="$LIBS -lespeak"
221 ])
222
223 # check for libgps
224 PKG_CHECK_MODULES([gps], [libgps], [
225 CFLAGS="$CFLAGS $gps_CFLAGS -DUSE_LIBGPS"
226 LIBS="$LIBS $gps_LIBS"
227 ], [AC_MSG_NOTICE([No libgps found, using direct GPSD])])
228
229 INSTALL_PLATTFORM="install-debian"
230
231 ICON=" No icon"
232 ])
233
234 AC_SUBST(EXTRA_OBJS)
235 AC_SUBST(ICON)
236 AC_SUBST(INSTALL_PLATTFORM)
237 AC_CONFIG_FILES([Makefile src/Makefile data/Makefile debian/control])
238
239 AC_OUTPUT