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