Adding connman-test subpackage
[framework/connectivity/connman.git] / configure.ac
1 AC_PREREQ(2.60)
2 AC_INIT(connman, 0.78.4)
3
4 AM_INIT_AUTOMAKE([foreign subdir-objects color-tests])
5 AM_CONFIG_HEADER(config.h)
6
7 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
8
9 AM_MAINTAINER_MODE
10
11 AC_PREFIX_DEFAULT(/usr/local)
12
13 PKG_PROG_PKG_CONFIG
14
15 COMPILER_FLAGS
16
17 AC_SUBST(abs_top_srcdir)
18 AC_SUBST(abs_top_builddir)
19
20 AC_LANG_C
21
22 AC_PROG_CC
23 AM_PROG_CC_C_O
24 AC_PROG_CC_PIE
25 AC_PROG_INSTALL
26 AM_PROG_MKDIR_P
27
28 m4_define([_LT_AC_TAGCONFIG], [])
29 m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])])
30
31 AC_DISABLE_STATIC
32 AC_PROG_LIBTOOL
33
34 AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization],
35                         [disable code optimization through compiler]), [
36         if (test "${enableval}" = "no"); then
37                 CFLAGS="$CFLAGS -O0"
38         fi
39 ])
40
41 GTK_DOC_CHECK
42
43 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
44                         [enable compiling with debugging information]), [
45         if (test "${enableval}" = "yes" &&
46                                 test "${ac_cv_prog_cc_g}" = "yes"); then
47                 CFLAGS="$CFLAGS -g"
48         fi
49 ])
50
51 AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie],
52                         [enable position independent executables flag]), [
53         if (test "${enableval}" = "yes" &&
54                                 test "${ac_cv_prog_cc_pie}" = "yes"); then
55                 CFLAGS="$CFLAGS -fPIE"
56                 LDFLAGS="$LDFLAGS -pie"
57         fi
58 ])
59
60 AC_ARG_ENABLE(threads,
61         AC_HELP_STRING([--enable-threads], [enable threading support]),
62                         [enable_threads=${enableval}], [enable_threads="yes"])
63
64 AC_ARG_ENABLE(ethernet,
65         AC_HELP_STRING([--enable-ethernet], [enable Ethernet support]),
66                         [enable_ethernet=${enableval}], [enable_ethernet="yes"])
67 AM_CONDITIONAL(ETHERNET, test "${enable_ethernet}" != "no")
68 AM_CONDITIONAL(ETHERNET_BUILTIN, test "${enable_ethernet}" = "builtin")
69
70 AC_ARG_ENABLE(wifi,
71         AC_HELP_STRING([--enable-wifi], [enable WiFi support]),
72                         [enable_wifi=${enableval}], [enable_wifi="yes"])
73 if (test "${enable_wifi}" != "no"); then
74         AC_PATH_PROG(WPASUPPLICANT, [wpa_supplicant], [],
75                                                 $PATH:/sbin:/usr/sbin)
76 fi
77 AM_CONDITIONAL(WIFI, test "${enable_wifi}" != "no")
78 AM_CONDITIONAL(WIFI_BUILTIN, test "${enable_wifi}" = "builtin")
79
80 AC_ARG_ENABLE(bluetooth,
81         AC_HELP_STRING([--enable-bluetooth], [enable Bluetooth support]),
82                         [enable_bluetooth=${enableval}], [enable_bluetooth="no"])
83 AM_CONDITIONAL(BLUETOOTH, test "${enable_bluetooth}" != "no")
84 AM_CONDITIONAL(BLUETOOTH_BUILTIN, test "${enable_bluetooth}" = "builtin")
85
86 AC_ARG_ENABLE(hh2serial-gps,
87         AC_HELP_STRING([--enable-hh2serial-gps], [enable hh2serial GPS support]),
88                         [enable_hh2serial_gps=${enableval}], [enable_hh2serial_gps="no"])
89 AM_CONDITIONAL(HH2SERIAL_GPS, test "${enable_hh2serial_gps}" != "no")
90 AM_CONDITIONAL(HH2SERIAL_GPS_BUILTIN, test "${enable_hh2serial_gps}" = "builtin")
91
92 AC_ARG_ENABLE(ofono,
93         AC_HELP_STRING([--enable-ofono], [enable oFono support]),
94                         [enable_ofono=${enableval}], [enable_ofono="no"])
95 AM_CONDITIONAL(OFONO, test "${enable_ofono}" != "no")
96 AM_CONDITIONAL(OFONO_BUILTIN, test "${enable_ofono}" = "builtin")
97
98 AC_ARG_ENABLE(telephony,
99         AC_HELP_STRING([--enable-telephony], [enable Telephony support]),
100                         [enable_telephony=${enableval}], [enable_telephony="yes"])
101 AM_CONDITIONAL(TELEPHONY, test "${enable_telephony}" != "no")
102 AM_CONDITIONAL(TELEPHONY_BUILTIN, test "${enable_telephony}" = "builtin")
103
104 AC_ARG_ENABLE(tizen-ext, AC_HELP_STRING([--enable-tizen-ext],
105                         [enable TIZEN extensions]), [
106         if (test "${enableval}" = "yes"); then
107                 CFLAGS="$CFLAGS -DTIZEN_EXT"
108                 PKG_CHECK_MODULES(IPTC, libiptc, dummy=yes,
109                         AC_MSG_ERROR(libiptc is required for tizen-ext))
110                 IPTC_LIBS="$IPTC_LIBS -lip4tc"
111                 AC_SUBST(IPTC_CFLAGS)
112                 AC_SUBST(IPTC_LIBS)
113         fi
114 ])
115
116 AC_ARG_WITH(openconnect, AC_HELP_STRING([--with-openconnect=PROGRAM],
117         [specify location of openconnect binary]), [path_openconnect=${withval}])
118
119 AC_ARG_ENABLE(openconnect,
120         AC_HELP_STRING([--enable-openconnect], [enable openconnect support]),
121                         [enable_openconnect=${enableval}], [enable_openconnect="no"])
122 if (test "${enable_openconnect}" != "no"); then
123         if (test -z "${path_openconnect}"); then
124                 AC_PATH_PROG(OPENCONNECT, [openconnect], [], $PATH:/sbin:/usr/sbin)
125                 if (test -z "${OPENCONNECT}"); then
126                         AC_MSG_ERROR(openconnect binary not found)
127                 fi
128         else
129                 OPENCONNECT="${path_openconnect}"
130                 AC_SUBST(OPENCONNECT)
131         fi
132 fi
133 AM_CONDITIONAL(OPENCONNECT, test "${enable_openconnect}" != "no")
134 AM_CONDITIONAL(OPENCONNECT_BUILTIN, test "${enable_openconnect}" = "builtin")
135
136 AC_ARG_WITH(openvpn, AC_HELP_STRING([--with-openvpn=PROGRAM],
137         [specify location of openvpn binary]), [path_openvpn=${withval}])
138
139 AC_ARG_ENABLE(openvpn,
140         AC_HELP_STRING([--enable-openvpn], [enable openvpn support]),
141                         [enable_openvpn=${enableval}], [enable_openvpn="no"])
142 if (test "${enable_openvpn}" != "no"); then
143         if (test -z "${path_openvpn}"); then
144                 AC_PATH_PROG(OPENVPN, [openvpn], [], $PATH:/sbin:/usr/sbin)
145                 if (test -z "${OPENVPN}"); then
146                         AC_MSG_ERROR(openvpn binary not found)
147                 fi
148         else
149                 OPENVPN="${path_openvpn}"
150                 AC_SUBST(OPENVPN)
151         fi
152 fi
153 AM_CONDITIONAL(OPENVPN, test "${enable_openvpn}" != "no")
154 AM_CONDITIONAL(OPENVPN_BUILTIN, test "${enable_openvpn}" = "builtin")
155
156 AC_ARG_WITH(vpnc, AC_HELP_STRING([--with-vpnc=PROGRAM],
157         [specify location of vpnc binary]), [path_vpnc=${withval}])
158
159 AC_ARG_ENABLE(vpnc,
160         AC_HELP_STRING([--enable-vpnc], [enable vpnc support]),
161                 [enable_vpnc=${enableval}], [enable_vpnc="no"])
162 if (test "${enable_vpnc}" != "no"); then
163         if (test -z "${path_vpnc}"); then
164                 AC_PATH_PROG(VPNC, [vpnc], [], $PATH:/sbin:/usr/sbin)
165                 if (test -z "${VPNC}"); then
166                         AC_MSG_ERROR(vpnc binary not found)
167                 fi
168         else
169                 VPNC="${path_vpnc}"
170                 AC_SUBST(VPNC)
171         fi
172 fi
173 AM_CONDITIONAL(VPNC, test "${enable_vpnc}" != "no")
174 AM_CONDITIONAL(VPNC_BUILTIN, test "${enable_vpnc}" = "builtin")
175
176 AC_ARG_ENABLE(l2tp,
177         AC_HELP_STRING([--enable-l2tp], [enable l2tp support]),
178                         [enable_l2tp=${enableval}], [enable_l2tp="no"])
179 if (test "${enable_l2tp}" != "no"); then
180         if (test -z "${path_pppd}"); then
181                 AC_PATH_PROG(PPPD, [pppd], [/usr/sbin/pppd], $PATH:/sbin:/usr/sbin)
182         else
183                 PPPD="${path_pppd}"
184                 AC_SUBST(PPPD)
185         fi
186         AC_CHECK_HEADERS(pppd/pppd.h, dummy=yes,
187                         AC_MSG_ERROR(ppp header files are required))
188         if (test -z "${path_l2tp}"); then
189                 AC_PATH_PROG(L2TP, [xl2tpd], [/usr/sbin/xl2tpd], $PATH:/sbin:/usr/sbin)
190         else
191                 L2TP="${path_l2tp}"
192                 AC_SUBST(L2TP)
193         fi
194 fi
195 AM_CONDITIONAL(L2TP, test "${enable_l2tp}" != "no")
196 AM_CONDITIONAL(L2TP_BUILTIN, test "${enable_l2tp}" = "builtin")
197
198 AC_ARG_ENABLE(pptp,
199         AC_HELP_STRING([--enable-pptp], [enable pptp support]),
200                         [enable_pptp=${enableval}], [enable_pptp="no"])
201 if (test "${enable_pptp}" != "no"); then
202         if (test -z "${path_pppd}"); then
203                 AC_PATH_PROG(PPPD, [pppd], [/usr/sbin/pppd], $PATH:/sbin:/usr/sbin)
204         else
205                 PPPD="${path_pppd}"
206                 AC_SUBST(PPPD)
207         fi
208         AC_CHECK_HEADERS(pppd/pppd.h, dummy=yes,
209                         AC_MSG_ERROR(ppp header files are required))
210         if (test -z "${path_pptp}"); then
211                 AC_PATH_PROG(PPTP, [pptp], [/usr/sbin/pptp], $PATH:/sbin:/usr/sbin)
212         else
213                 PPTP="${path_pptp}"
214                 AC_SUBST(PPTP)
215         fi
216 fi
217 AM_CONDITIONAL(PPTP, test "${enable_pptp}" != "no")
218 AM_CONDITIONAL(PPTP_BUILTIN, test "${enable_pptp}" = "builtin")
219
220 AC_ARG_ENABLE(loopback,
221         AC_HELP_STRING([--enable-loopback], [enable loopback support]),
222                         [enable_loopback=${enableval}], [enable_loopback="yes"])
223 if (test "${enable_loopback}" != "no"); then
224         AC_CHECK_HEADERS(sys/inotify.h, dummy=yes,
225                         AC_MSG_ERROR(inotify header files are required))
226
227         AC_CHECK_LIB(c, inotify_init, dummy=yes,
228                         AC_MSG_ERROR(inotify library support is required))
229 fi
230 AM_CONDITIONAL(LOOPBACK, test "${enable_loopback}" != "no")
231 AM_CONDITIONAL(LOOPBACK_BUILTIN, test "${enable_loopback}" = "builtin")
232
233 AC_ARG_ENABLE(pacrunner,
234         AC_HELP_STRING([--enable-pacrunner], [enable PAC runner support]),
235                         [enable_pacrunner=${enableval}], [enable_pacrunner="no"])
236
237 AM_CONDITIONAL(PACRUNNER, test "${enable_pacrunner}" != "no")
238 AM_CONDITIONAL(PACRUNNER_BUILTIN, test "${enable_pacrunner}" = "builtin")
239
240 AC_ARG_ENABLE(google,
241         AC_HELP_STRING([--enable-google], [enable Google Public DNS support]),
242                         [enable_google=${enableval}], [enable_google="no"])
243 AM_CONDITIONAL(GOOGLE, test "${enable_google}" != "no")
244 AM_CONDITIONAL(GOOGLE_BUILTIN, test "${enable_google}" = "builtin")
245
246 AC_ARG_ENABLE(meego,
247         AC_HELP_STRING([--enable-meego], [enable MeeGo features support]),
248                         [enable_meego=${enableval}], [enable_meego="no"])
249 AM_CONDITIONAL(MEEGO, test "${enable_meego}" != "no")
250 AM_CONDITIONAL(MEEGO_BUILTIN, test "${enable_meego}" = "builtin")
251
252 AC_CHECK_HEADERS(resolv.h, dummy=yes,
253         AC_MSG_ERROR(resolver header files are required))
254 AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [
255         AC_CHECK_LIB(resolv, __ns_initparse, dummy=yes,
256                 AC_MSG_ERROR(resolver library support is required))
257 ])
258
259 AC_CHECK_FUNC(signalfd, dummy=yes,
260                         AC_MSG_ERROR(signalfd support is required))
261
262 AC_CHECK_LIB(dl, dlopen, dummy=yes,
263                         AC_MSG_ERROR(dynamic linking loader is required))
264
265 AC_ARG_WITH(iwmxsdk, AC_HELP_STRING([--with-iwmxsdk=PATH],
266                                                 [path to Intel WiMAX SDK]),
267                                 [pkgconfig_iwmxsdk=${withval}/lib/pkgconfig])
268
269 AC_ARG_ENABLE(iwmx, AC_HELP_STRING([--enable-iwmx],
270                 [enable Intel WiMAX support]), [enable_iwmx=${enableval}])
271 if (test "${enable_iwmx}" = "yes"); then
272         enable_threads="yes"
273         export PKG_CONFIG_PATH="${pkgconfig_iwmxsdk}"
274         PKG_CHECK_MODULES(IWMXSDK, libiWmxSdk-0, dummy=yes,
275                                 AC_MSG_ERROR(Intel WiMAX SDK is required))
276         PKG_CONFIG_PATH=""
277         AC_SUBST(IWMXSDK_CFLAGS)
278         AC_SUBST(IWMXSDK_LIBS)
279
280         # Fix API compat breakage from 1.4 to 1.5...
281         CPPFLAGS_save=$CPPFLAGS
282         CPPFLAGS="$IWMXSDK_CFLAGS $CPPFLAGS"
283         AH_TEMPLATE([HAVE_IWMXSDK_STATUS_IDLE],
284                     [WIMAX_API_DEVICE_STATUS_Connection_Idle is present])
285         AC_CHECK_DECL(WIMAX_API_DEVICE_STATUS_Connection_Idle,
286                       [AC_DEFINE([HAVE_IWMXSDK_STATUS_IDLE], [1], [])],
287                       [],
288                       [[#include <WiMaxType.h>]])
289
290         AH_TEMPLATE([HAVE_WIMAX_API_DEVICE_ID],
291                     [WIMAX_API_DEVICE_ID is present])
292         AC_CHECK_TYPE(WIMAX_API_DEVICE_ID,
293                       [AC_DEFINE([HAVE_WIMAX_API_DEVICE_ID], [1], [])],
294                       [],
295                       [[#include <WiMaxType.h>]])
296
297         AH_TEMPLATE([HAVE_WIMAX_API_HW_DEVICE_ID],
298                     [WIMAX_API_HW_DEVICE_ID is present])
299         AC_CHECK_TYPE(WIMAX_API_HW_DEVICE_ID,
300                       [AC_DEFINE([HAVE_WIMAX_API_HW_DEVICE_ID], [1], [])],
301                       [],
302                       [[#include <WiMaxType.h>]])
303
304         AH_TEMPLATE([HAVE_WIMAX_API_NSP_INFO_EX],
305                     [WIMAX_API_NSP_INFO_EX is present])
306         AC_CHECK_TYPE(WIMAX_API_NSP_INFO_EX,
307                       [AC_DEFINE([HAVE_WIMAX_API_NSP_INFO_EX], [1], [])],
308                       [],
309                       [[#include <WiMaxType.h>] 
310                        [#include <WiMaxTypesEx.h>]])
311
312         AH_TEMPLATE([HAVE_WIMAX_API_CONNECTED_NSP_INFO],
313                     [WIMAX_API_CONNECTED_NSP_INFO is present])
314         AC_CHECK_TYPE(WIMAX_API_CONNECTED_NSP_INFO,
315                       [AC_DEFINE([HAVE_WIMAX_API_CONNECTED_NSP_INFO], [1], [])],
316                       [],
317                       [[#include <WiMaxType.h>]])
318
319         CPPFLAGS=$CPPFLAGS_save
320 fi
321 AM_CONDITIONAL(IWMX, test "${enable_iwmx}" = "yes")
322
323 AC_ARG_ENABLE(iospm, AC_HELP_STRING([--enable-iospm],
324                 [enable Intel OSPM support]), [enable_iospm=${enableval}])
325 AM_CONDITIONAL(IOSPM, test "${enable_iospm}" = "yes")
326
327 AC_ARG_WITH(ntpd, AC_HELP_STRING([--with-ntpd=PROGRAM],
328         [specify ntpd binary location]), [path_ntpd=${withval}])
329
330 AC_ARG_ENABLE(ntpd,
331         AC_HELP_STRING([--enable-ntpd], [enable ntpd support]),
332                         [enable_ntpd=${enableval}], [enable_ntpd="no"])
333
334 if (test "${enable_ntpd}" != "no"); then
335         if (test -z "${path_ntpd}"); then
336                 AC_PATH_PROG(NTPD, [ntpd], [], $PATH:/sbin:/usr/sbin)
337         else
338                 NTPD="${path_ntpd}"
339                 AC_SUBST(NTPD)
340         fi
341 fi
342 AM_CONDITIONAL(NTPD, test "${enable_ntpd}" != "no")
343 AM_CONDITIONAL(NTPD_BUILTIN, test "${enable_ntpd}" = "builtin")
344
345 AC_ARG_ENABLE(nmcompat,
346         AC_HELP_STRING([--enable-nmcompat], [enable nmcompat support]),
347                         [enable_nmcompat=${enableval}], [enable_nmcompat="no"])
348 AM_CONDITIONAL(NMCOMPAT, test "${enable_nmcompat}" != "no")
349 AM_CONDITIONAL(NMCOMPAT_BUILTIN, test "${enable_nmcompat}" = "builtin")
350
351 AC_ARG_ENABLE(tist,
352         AC_HELP_STRING([--enable-tist], [enable TI Shared Transport support]),
353                         [enable_tist=${enableval}], [enable_tist="no"])
354 AM_CONDITIONAL(TIST, test "${enable_tist}" != "no")
355 AM_CONDITIONAL(TIST_BUILTIN, test "${enable_tist}" = "builtin")
356
357 AC_ARG_WITH(stats-max-file-size, AC_HELP_STRING([--with-stats-max-file-size=SIZE],
358                         [Maximal size of a statistics round robin file]),
359                         [stats_max_file_size=${withval}])
360
361 if (test -z "${stats_max_file_size}"); then
362    # default size is 16 kByte
363    stats_max_file_size="16 * 8 * 128"
364 fi
365
366 AC_DEFINE_UNQUOTED([STATS_MAX_FILE_SIZE], (${stats_max_file_size}), [Maximal size of a statistics round robin file])
367
368 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.22, dummy=yes,
369                                 AC_MSG_ERROR(GLib >= 2.22 is required))
370 AC_SUBST(GLIB_CFLAGS)
371 AC_SUBST(GLIB_LIBS)
372
373 if (test "${enable_threads}" = "yes"); then
374         AC_DEFINE(NEED_THREADS, 1, [Define if threading support is required])
375         PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
376                                 AC_MSG_ERROR(GThread >= 2.16 is required))
377         GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
378         GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
379 fi
380
381 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, dummy=yes,
382                                 AC_MSG_ERROR(D-Bus >= 1.0 is required))
383 saved_CFLAGS="$CFLAGS"
384 saved_LIBS="$LIBS"
385 CFLAGS="$CFLAGS $DBUS_CFLAGS"
386 LIBS="$LIBS $DBUS_LIBS"
387 AC_CHECK_LIB(dbus-1, dbus_watch_get_unix_fd, dummy=yes,
388         AC_DEFINE(NEED_DBUS_WATCH_GET_UNIX_FD, 1,
389                 [Define to 1 if you need the dbus_watch_get_unix_fd() function.]))
390 AC_CHECK_LIB(dbus-1, dbus_connection_can_send_type, dummy=yes,
391         AC_DEFINE(NEED_DBUS_CONNECTION_CAN_SEND_TYPE, 1,
392                 [Define to 1 if you need the dbus_connection_can_send_type() function.]
393 ))
394 CFLAGS="$saved_CFLAGS"
395 LIBS="$saved_LIBS"
396 AC_SUBST(DBUS_CFLAGS)
397 AC_SUBST(DBUS_LIBS)
398
399 AC_ARG_WITH(dbusconfdir, AC_HELP_STRING([--with-dbusconfdir=PATH],
400         [path to D-Bus config directory]), [path_dbusconf=${withval}],
401                 [path_dbusconf="`$PKG_CONFIG --variable=sysconfdir dbus-1`"])
402 if (test -z "${path_dbusconf}"); then
403         DBUS_CONFDIR="${sysconfdir}/dbus-1/system.d"
404 else
405         DBUS_CONFDIR="${path_dbusconf}/dbus-1/system.d"
406 fi
407 AC_SUBST(DBUS_CONFDIR)
408
409 AC_ARG_WITH(dbusdatadir, AC_HELP_STRING([--with-dbusdatadir=PATH],
410         [path to D-Bus data directory]), [path_dbusdata=${withval}],
411                 [path_dbusdata="`$PKG_CONFIG --variable=datadir dbus-1`"])
412 if (test -z "${path_dbusdata}"); then
413         DBUS_DATADIR="${datadir}/dbus-1/system-services"
414 else
415         DBUS_DATADIR="${path_dbusdata}/dbus-1/system-services"
416 fi
417 AC_SUBST(DBUS_DATADIR)
418
419 AC_ARG_WITH([systemdunitdir], AC_HELP_STRING([--with-systemdunitdir=DIR],
420         [path to systemd service directory]), [path_systemdunit=${withval}],
421                 [path_systemdunit="`$PKG_CONFIG --variable=systemdsystemunitdir systemd`"])
422 if (test -n "${path_systemdunit}"); then
423         SYSTEMD_UNITDIR="${path_systemdunit}"
424         AC_SUBST(SYSTEMD_UNITDIR)
425 fi
426 AM_CONDITIONAL(SYSTEMD, test -n "${path_systemdunit}")
427
428 PKG_CHECK_MODULES(XTABLES, xtables, dummy=yes,
429                                 AC_MSG_ERROR(Xtables library is required))
430 AC_SUBST(XTABLES_CFLAGS)
431 AC_SUBST(XTABLES_LIBS)
432
433 AC_ARG_ENABLE(polkit,
434         AC_HELP_STRING([--enable-polkit], [enable PolicyKit support]),
435                         [enable_polkit=${enableval}], [enable_polkit="no"])
436 if (test "${enable_polkit}" != "no"); then
437         POLKIT_DATADIR="`$PKG_CONFIG --variable=actiondir polkit`"
438         POLKIT_DATADIR=""
439         if (test -z "${POLKIT_DATADIR}"); then
440                 POLKIT_DATADIR="${datadir}/polkit-1/actions"
441         fi
442         AC_SUBST(POLKIT_DATADIR)
443 fi
444 AM_CONDITIONAL(POLKIT, test "${enable_polkit}" != "no")
445 AM_CONDITIONAL(POLKIT_BUILTIN, test "${enable_polkit}" = "builtin")
446
447 AC_ARG_ENABLE(client, AC_HELP_STRING([--enable-client],
448                 [enable command line client]), [enable_client=${enableval}])
449 AM_CONDITIONAL(CLIENT, test "${enable_client}" = "yes")
450
451 AC_ARG_ENABLE(tools, AC_HELP_STRING([--enable-tools],
452                 [enable testing tools]), [enable_tools=${enableval}])
453 if (test "${enable_tools}" = "yes"); then
454         PKG_CHECK_MODULES(GNUTLS, gnutls, dummy=yes,
455                                 AC_MSG_ERROR(GnuTLS library is required))
456         AC_SUBST(GNUTLS_CFLAGS)
457         AC_SUBST(GNUTLS_LIBS)
458
459         AC_CHECK_HEADERS(linux/if_alg.h, dummy=yes,
460                 AC_MSG_ERROR(User-space algorithm header files are required))
461 fi
462 AM_CONDITIONAL(TOOLS, test "${enable_tools}" = "yes")
463
464 AC_ARG_ENABLE(test, AC_HELP_STRING([--enable-test],
465                 [enable test/example scripts]), [enable_test=${enableval}])
466 AM_CONDITIONAL(TEST, test "${enable_test}" = "yes")
467
468 AC_ARG_ENABLE(fake, AC_HELP_STRING([--enable-fake],
469                 [enable fake device support]), [enable_fake=${enableval}])
470 AM_CONDITIONAL(FAKE, test "${enable_fake}" = "yes")
471
472 AC_ARG_ENABLE(capng, AC_HELP_STRING([--enable-capng],
473                 [enable capabilities support]), [enable_capng=${enableval}])
474 if (test "${enable_capng}" = "yes"); then
475         PKG_CHECK_MODULES(CAPNG, libcap-ng, dummy=yes,
476                                 AC_MSG_ERROR(Capabilities library is required))
477         AC_SUBST(CAPNG_CFLAGS)
478         AC_SUBST(CAPNG_LIBS)
479         AC_DEFINE(HAVE_CAPNG, 1, [Define to 1 if you have capabilities library.])
480 fi
481
482 AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles],
483                         [don't install configuration and data files]),
484                                         [enable_datafiles=${enableval}])
485 AM_CONDITIONAL(DATAFILES, test "${enable_datafiles}" != "no")
486
487 AC_OUTPUT(Makefile include/version.h src/connman.service
488                                 scripts/connman doc/version.xml connman.pc)