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
|
From 5be732fcd92de66614f434ebeb1bd8ec5905544d Mon Sep 17 00:00:00 2001
From: Mikel Olasagasti Uranga <mikel@olasagasti.info>
Date: Mon, 22 Jun 2009 17:24:22 +0200
Subject: [PATCH] Remove automagic deps and add switches to enable/disable them
---
configure.ac | 176 +++++++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 139 insertions(+), 37 deletions(-)
diff --git a/configure.ac b/configure.ac
index 3109048..8e5e67c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,35 +55,90 @@ AC_DEFINE_UNQUOTED(DBUS_SERVICES_DIR, "$DBUS_SERVICES_DIR", [Where services dir
CFLAGS="$CFLAGS -g -Wall -Werror -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")
-PKG_CHECK_MODULES(GTK, [
- gtk+-2.0
-], HAVE_GTK=yes, HAVE_GTK=no)
-AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
+ 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"
-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])
+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
-PKG_CHECK_MODULES(NETWORK_MANAGER, [
- NetworkManager
-], HAVE_NETWORK_MANAGER=yes, HAVE_NETWORK_MANAGER=no)
-if test "x$HAVE_NETWORK_MANAGER" = "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])
+
+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(NETWORKMANAGER,
+ [
+ NetworkManager
+ ], 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)
@@ -92,35 +147,82 @@ AC_SUBST(CONNECTIVITY_CFLAGS)
PROVIDER_SUBDIRS="example hostip geonames manual plazes localnet yahoo"
-PKG_CHECK_MODULES(GSMLOC, [
- gammu >= 1.12
-], HAVE_GSMLOC=yes, HAVE_GSMLOC=no)
-if test "x$HAVE_GSMLOC" = "xyes"; then
- PROVIDER_SUBDIRS="$PROVIDER_SUBDIRS gsmloc"
+# -----------------------------------------------------------
+# gsmloc / gypsy / gpsd
+# -----------------------------------------------------------
+
+AC_ARG_ENABLE(gsmloc,
+ AS_HELP_STRING([--enable-gsmloc=@<:@no/yes/auto@:>@],
+ [build with gsmloc support]), ,
+ enable_gsmloc=auto)
+
+if test "x$enable_gsmloc" != "xno"; then
+ PKG_CHECK_MODULES(GSMLOC,
+ [
+ gammu >= 1.12
+ ], have_gsmloc="yes", have_gsmloc="no")
+
+ if test "x$have_gsmloc" = "xyes"; then
+ PROVIDER_SUBDIRS="$PROVIDER_SUBDIRS gsmloc"
+ else
+ NO_BUILD_PROVIDERS="$NO_BUILD_PROVIDERS gsmloc"
+ fi
else
- NO_BUILD_PROVIDERS="$NO_BUILD_PROVIDERS gsmloc"
+ have_gsmloc=no
+fi
+
+if test "x$enable_gsmloc" = "xyes" -a "x$have_gsmloc" != "xyes"; then
+ AC_MSG_ERROR([Couldn't find gsmloc dependencies.])
fi
AC_SUBST(GSMLOC_LIBS)
AC_SUBST(GSMLOC_CFLAGS)
-PKG_CHECK_MODULES(GYPSY, [
- gypsy
-], HAVE_GYPSY=yes,HAVE_GYPSY=no)
-if test "x$HAVE_GYPSY" = "xyes"; then
- PROVIDER_SUBDIRS="$PROVIDER_SUBDIRS gypsy"
+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
+ ], 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
- NO_BUILD_PROVIDERS="$NO_BUILD_PROVIDERS gypsy"
+ 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_CHECK_LIB(gps, gps_open,[libgps=yes] )
-if test "x$libgps" = xyes; then
- PROVIDER_SUBDIRS="$PROVIDER_SUBDIRS gpsd"
- GPSD_LIBS="-lgps"
+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
+ AC_CHECK_LIB(gps, gps_open,[libgps=yes] )
+ if test "x$have_gpsd" = "xyes"; then
+ PROVIDER_SUBDIRS="$PROVIDER_SUBDIRS gpsd"
+ GPSD_LIBS="-lgps"
+ else
+ NO_BUILD_PROVIDERS="$NO_BUILD_PROVIDERS gpsd"
+ fi
else
- NO_BUILD_PROVIDERS="$NO_BUILD_PROVIDERS gpsd"
+ have_gpsd=no
+fi
+
+if test "x$enable_gpsd" = "xyes" -a "x$have_gpsd" != "xyes"; then
+ AC_MSG_ERROR([Couldn't find gpsd dependencies.])
fi
AC_SUBST(GPSD_LIBS)
AC_SUBST(GPSD_CFLAGS)
--
1.6.3.1
|