-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigure.ac
283 lines (236 loc) · 7.6 KB
/
configure.ac
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
AC_PREREQ(2.59)
AC_INIT(geoclue, 0.12.0, http://geoclue.freedesktop.org)
AC_CONFIG_SRCDIR(geoclue/gc-iface-geoclue.c)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([1.9 foreign])
GEOCLUE_VERSION=0.12.0
# Enable silent build when available (Automake 1.11)
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
AC_PROG_CC
AC_ISC_POSIX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_GCC_TRADITIONAL
AM_PROG_LIBTOOL
GLIB_GSETTINGS
GTK_DOC_CHECK(1.0)
AC_CHECK_PROGS(XSLT, xsltproc)
AC_ARG_ENABLE(system-bus,
[AC_HELP_STRING([--enable-system-bus],
[Use the system bus instead of session bus])],
enable_system_bus="$enableval",
enable_system_bus=no)
AM_CONDITIONAL(USE_SYSTEM_BUS, test x$enable_system_bus = xyes)
if test x$enable_system_bus = xyes; then
AC_DEFINE(GEOCLUE_DBUS_BUS, DBUS_BUS_SYSTEM, Use the system bus)
else
AC_DEFINE(GEOCLUE_DBUS_BUS, DBUS_BUS_SESSION, Use the session bus)
fi
PKG_CHECK_MODULES(GEOCLUE, [
glib-2.0
gobject-2.0
dbus-glib-1 >= 0.86
libxml-2.0
])
AC_SUBST(GEOCLUE_LIBS)
AC_SUBST(GEOCLUE_CFLAGS)
PKG_CHECK_MODULES(MASTER, [
gio-2.0 >= 2.25.7
glib-2.0
])
AC_SUBST(MASTER_LIBS)
AC_SUBST(MASTER_CFLAGS)
AC_PATH_PROG(DBUS_BINDING_TOOL, dbus-binding-tool)
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
DBUS_SERVICES_DIR="${datadir}/dbus-1/services"
AC_SUBST(DBUS_SERVICES_DIR)
AC_DEFINE_UNQUOTED(DBUS_SERVICES_DIR, "$DBUS_SERVICES_DIR", [Where services dir for D-Bus is])
CFLAGS="$CFLAGS -g -Wall -Wno-format"
# -----------------------------------------------------------
# gtk+
# -----------------------------------------------------------
AC_ARG_ENABLE(gtk,
AS_HELP_STRING([--enable-gtk=@<:@no/yes/auto@:>@],
[build with gtk support]), ,
enable_gtk=auto)
if test "x$enable_gtk" != "xno"; then
PKG_CHECK_MODULES(GTK,
[
gtk+-2.0
], have_gtk="yes", have_gtk="no")
if test "x$have_gtk" = "xyes"; then
AC_DEFINE(HAVE_GTK, 1, [Define if you have gtk+])
fi
else
have_gtk=no
fi
if test "x$enable_gtk" = "xyes" -a "x$have_gtk" != "xyes"; then
AC_MSG_ERROR([Couldn't find gtk dependencies.])
fi
AM_CONDITIONAL(HAVE_GTK, test "x$have_gtk" = "xyes")
AC_SUBST(GTK_LIBS)
AC_SUBST(GTK_CFLAGS)
# -----------------------------------------------------------
# connectivity
# -----------------------------------------------------------
CONNECTIVITY="None"
AC_ARG_ENABLE(conic,
AS_HELP_STRING([--enable-conic=@<:@no/yes/auto@:>@],
[build with conic support]), ,
enable_conic=auto)
if test "x$enable_conic" != "xno"; then
PKG_CHECK_MODULES(CONIC,
[
conic
], have_conic="yes", have_conic="no")
if test "x$have_conic" = "xyes"; then
CONNECTIVITY="Maemo LibConIC"
CONNECTIVITY_LIBS=${CONIC_LIBS}
CONNECTIVITY_CFLAGS=${CONIC_CFLAGS}
AC_DEFINE(HAVE_CONIC, 1, [define if libconic is installed])
fi
else
have_conic=no
fi
if test "x$enable_conic" = "xyes" -a "x$have_conic" != "xyes"; then
AC_MSG_ERROR([Couldn't find conic dependencies.])
fi
AC_ARG_ENABLE(connman,
AS_HELP_STRING([--enable-connman=@<:@no/yes/auto@:>@],
[build with connman support]), ,
enable_connman=auto)
if test "x$enable_connman" != "xno"; then
CONNECTIVITY="ConnMan"
AC_DEFINE(HAVE_CONNMAN, 1, [define if libconmann is installed])
else
have_connman=no
fi
AC_ARG_ENABLE(networkmanager,
AS_HELP_STRING([--enable-networkmanager=@<:@no/yes/auto@:>@],
[build with NetworkManager support]), ,
enable_networkmanager=auto)
if test "x$enable_networkmanager" != "xno"; then
PKG_CHECK_MODULES(NETWORK_MANAGER,
[
NetworkManager libnm-glib libnm-util
], have_networkmanager="yes", have_networkmanager="no")
if test "x$have_networkmanager" = "xyes"; then
CONNECTIVITY="Network Manager"
CONNECTIVITY_LIBS=${NETWORK_MANAGER_LIBS}
CONNECTIVITY_CFLAGS=${NETWORK_MANAGER_CFLAGS}
AC_DEFINE(HAVE_NETWORK_MANAGER, 1, [define if Network Manager is installed])
fi
else
have_networkmanager=no
fi
if test "x$enable_networkmanager" = "xyes" -a "x$have_networkmanager" != "xyes"; then
AC_MSG_ERROR([Couldn't find Network Manager dependencies.])
fi
AC_SUBST(CONNECTIVITY_LIBS)
AC_SUBST(CONNECTIVITY_CFLAGS)
PROVIDER_SUBDIRS="example hostip geonames nominatim manual plazes localnet yahoo gsmloc"
# -----------------------------------------------------------
# gypsy / gpsd / skyhook
# -----------------------------------------------------------
GYPSY_REQUIRED=0.7.1
AC_ARG_ENABLE(gypsy,
AS_HELP_STRING([--enable-gypsy=@<:@no/yes/auto@:>@],
[build with gypsy support]), ,
enable_gypsy=auto)
if test "x$enable_gypsy" != "xno"; then
PKG_CHECK_MODULES(GYPSY,
[
gypsy >= $GYPSY_REQUIRED
], have_gypsy="yes", have_gypsy="no")
if test "x$have_gypsy" = "xyes"; then
PROVIDER_SUBDIRS="$PROVIDER_SUBDIRS gypsy"
else
NO_BUILD_PROVIDERS="$NO_BUILD_PROVIDERS gypsy"
fi
else
have_gypsy=no
fi
if test "x$enable_gypsy" = "xyes" -a "x$have_gypsy" != "xyes"; then
AC_MSG_ERROR([Couldn't find gypsy dependencies.])
fi
AC_SUBST(GYPSY_LIBS)
AC_SUBST(GYPSY_CFLAGS)
AC_ARG_ENABLE(gpsd,
AS_HELP_STRING([--enable-gpsd=@<:@no/yes/auto@:>@],
[build with gpsd support]), ,
enable_gpsd=auto)
if test "x$enable_gpsd" != "xno"; then
PKG_CHECK_MODULES(GPSD, [libgps >= 2.91], have_gpsd="yes", have_gpsd="no")
if test "x$have_gpsd" = "xyes"; then
PROVIDER_SUBDIRS="$PROVIDER_SUBDIRS gpsd"
else
NO_BUILD_PROVIDERS="$NO_BUILD_PROVIDERS gpsd"
fi
else
have_gpsd=no
fi
if test "x$enable_gpsd" = "xyes" -a "x$have_gpsd" != "xyes"; then
AC_MSG_ERROR([Couldn't find gpsd dependencies - libgps >= 2.90.])
fi
AC_SUBST(GPSD_LIBS)
AC_SUBST(GPSD_CFLAGS)
AC_ARG_ENABLE(skyhook,
AS_HELP_STRING([--enable-skyhook=@<:@no/yes/auto@:>@],
[build with skyhook support]), ,
enable_skyhook=auto)
if test "x$enable_skyhook" != "xno"; then
PKG_CHECK_MODULES(SKYHOOK, [
libsoup-gnome-2.4
], have_skyhook=yes, have_skyhook=no)
if test "x$have_skyhook" = "xyes"; then
PROVIDER_SUBDIRS="$PROVIDER_SUBDIRS skyhook"
GPSD_LIBS="-lgps"
else
NO_BUILD_PROVIDERS="$NO_BUILD_PROVIDERS skyhook"
fi
else
have_skyhook=no
fi
if test "x$enable_skyhook" = "xyes" -a "x$have_skyhook" != "xyes"; then
AC_MSG_ERROR([Couldn't find gpsd dependencies.])
fi
AC_SUBST(SKYHOOK_LIBS)
AC_SUBST(SKYHOOK_CFLAGS)
AC_SUBST(PROVIDER_SUBDIRS)
AC_SUBST(NO_BUILD_PROVIDERS)
AC_CONFIG_FILES([
geoclue.pc
Makefile
docs/Makefile
docs/reference/Makefile
docs/tools/Makefile
interfaces/Makefile
geoclue/Makefile
example/Makefile
test/Makefile
providers/Makefile
providers/example/Makefile
providers/gypsy/Makefile
providers/gpsd/Makefile
providers/hostip/Makefile
providers/geonames/Makefile
providers/manual/Makefile
providers/nominatim/Makefile
providers/plazes/Makefile
providers/localnet/Makefile
providers/yahoo/Makefile
providers/gsmloc/Makefile
providers/skyhook/Makefile
src/Makefile
])
AC_OUTPUT
echo ""
echo "Geoclue ${VERSION} has been configured as follows: "
echo "---------------------------------------------------"
echo "Source code location: ${srcdir}"
echo "Compiler: ${CC}"
echo "Network connectivity: ${CONNECTIVITY}"
echo "Providers: ${PROVIDER_SUBDIRS}"
echo "Excluded providers: ${NO_BUILD_PROVIDERS}"
echo ""