4 AM_INIT_AUTOMAKE([foreign subdir-objects color-tests])
5 AM_CONFIG_HEADER(config.h)
7 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
11 AC_PREFIX_DEFAULT(/usr/local)
17 AC_SUBST(abs_top_srcdir)
18 AC_SUBST(abs_top_builddir)
28 m4_define([_LT_AC_TAGCONFIG], [])
29 m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])])
34 AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization],
35 [disable code optimization through compiler]), [
36 if (test "${enableval}" = "no"); then
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
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"
60 AC_ARG_ENABLE(threads,
61 AC_HELP_STRING([--enable-threads], [enable threading support]),
62 [enable_threads=${enableval}], [enable_threads="no"])
64 AC_ARG_ENABLE(ethernet,
65 AC_HELP_STRING([--enable-ethernet], [enable Ethernet support]),
66 [enable_ethernet=${enableval}], [enable_ethernet="no"])
67 AM_CONDITIONAL(ETHERNET, test "${enable_ethernet}" != "no")
68 AM_CONDITIONAL(ETHERNET_BUILTIN, test "${enable_ethernet}" = "builtin")
71 AC_HELP_STRING([--enable-wifi], [enable WiFi support]),
72 [enable_wifi=${enableval}], [enable_wifi="no"])
73 if (test "${enable_wifi}" != "no"); then
74 AC_PATH_PROG(WPASUPPLICANT, [wpa_supplicant], [],
75 $PATH:/sbin:/usr/sbin)
77 AM_CONDITIONAL(WIFI, test "${enable_wifi}" != "no")
78 AM_CONDITIONAL(WIFI_BUILTIN, test "${enable_wifi}" = "builtin")
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")
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")
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")
98 AC_ARG_WITH(openconnect, AC_HELP_STRING([--with-openconnect=PROGRAM],
99 [specify location of openconnect binary]), [path_openconnect=${withval}])
101 AC_ARG_ENABLE(openconnect,
102 AC_HELP_STRING([--enable-openconnect], [enable openconnect support]),
103 [enable_openconnect=${enableval}], [enable_openconnect="no"])
104 if (test "${enable_openconnect}" != "no"); then
105 if (test -z "${path_openconnect}"); then
106 AC_PATH_PROG(OPENCONNECT, [openconnect], [], $PATH:/sbin:/usr/sbin)
108 OPENCONNECT="${path_openconnect}"
109 AC_SUBST(OPENCONNECT)
112 AM_CONDITIONAL(OPENCONNECT, test "${enable_openconnect}" != "no")
113 AM_CONDITIONAL(OPENCONNECT_BUILTIN, test "${enable_openconnect}" = "builtin")
115 AC_ARG_ENABLE(portal,
116 AC_HELP_STRING([--enable-portal], [enable portal detection support]),
117 [enable_portal=${enableval}], [enable_portal="no"])
118 AM_CONDITIONAL(PORTAL, test "${enable_portal}" != "no")
119 AM_CONDITIONAL(PORTAL_BUILTIN, test "${enable_portal}" = "builtin")
121 AC_ARG_WITH(openvpn, AC_HELP_STRING([--with-openvpn=PROGRAM],
122 [specify location of openvpn binary]), [path_openvpn=${withval}])
124 AC_ARG_ENABLE(openvpn,
125 AC_HELP_STRING([--enable-openvpn], [enable openvpn support]),
126 [enable_openvpn=${enableval}], [enable_openvpn="no"])
127 if (test "${enable_openvpn}" != "no"); then
128 if (test -z "${path_openvpn}"); then
129 AC_PATH_PROG(OPENVPN, [openvpn], [], $PATH:/sbin:/usr/sbin)
131 OPENVPN="${path_openvpn}"
135 AM_CONDITIONAL(OPENVPN, test "${enable_openvpn}" != "no")
136 AM_CONDITIONAL(OPENVPN_BUILTIN, test "${enable_openvpn}" = "builtin")
138 AC_ARG_WITH(vpnc, AC_HELP_STRING([--with-vpnc=PROGRAM],
139 [specify location of vpnc binary]), [path_vpnc=${withval}])
142 AC_HELP_STRING([--enable-vpnc], [enable vpnc support]),
143 [enable_vpnc=${enableval}], [enable_vpnc="no"])
144 if (test "${enable_vpnc}" != "no"); then
145 if (test -z "${path_vpnc}"); then
146 AC_PATH_PROG(VPNC, [vpnc], [], $PATH:/sbin:/usr/sbin)
152 AM_CONDITIONAL(VPNC, test "${enable_vpnc}" != "no")
153 AM_CONDITIONAL(VPNC_BUILTIN, test "${enable_vpnc}" = "builtin")
155 AC_ARG_ENABLE(loopback,
156 AC_HELP_STRING([--enable-loopback], [enable loopback support]),
157 [enable_loopback=${enableval}], [enable_loopback="no"])
158 if (test "${enable_loopback}" != "no"); then
159 AC_CHECK_HEADERS(sys/inotify.h, dummy=yes,
160 AC_MSG_ERROR(inotify header files are required))
162 AC_CHECK_LIB(c, inotify_init, dummy=yes,
163 AC_MSG_ERROR(inotify library support is required))
165 AM_CONDITIONAL(LOOPBACK, test "${enable_loopback}" != "no")
166 AM_CONDITIONAL(LOOPBACK_BUILTIN, test "${enable_loopback}" = "builtin")
168 AC_ARG_ENABLE(pacrunner,
169 AC_HELP_STRING([--enable-pacrunner], [enable PAC runner support]),
170 [enable_pacrunner=${enableval}], [enable_pacrunner="no"])
172 AM_CONDITIONAL(PACRUNNER, test "${enable_pacrunner}" != "no")
173 AM_CONDITIONAL(PACRUNNER_BUILTIN, test "${enable_pacrunner}" = "builtin")
175 AC_ARG_ENABLE(google,
176 AC_HELP_STRING([--enable-google], [enable Google Public DNS support]),
177 [enable_google=${enableval}], [enable_google="no"])
178 AM_CONDITIONAL(GOOGLE, test "${enable_google}" != "no")
179 AM_CONDITIONAL(GOOGLE_BUILTIN, test "${enable_google}" = "builtin")
182 AC_HELP_STRING([--enable-meego], [enable MeeGo features support]),
183 [enable_meego=${enableval}], [enable_meego="no"])
184 AM_CONDITIONAL(MEEGO, test "${enable_meego}" != "no")
185 AM_CONDITIONAL(MEEGO_BUILTIN, test "${enable_meego}" = "builtin")
187 AC_CHECK_HEADERS(resolv.h, dummy=yes,
188 AC_MSG_ERROR(resolver header files are required))
189 AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [
190 AC_CHECK_LIB(resolv, __ns_initparse, dummy=yes,
191 AC_MSG_ERROR(resolver library support is required))
194 AC_CHECK_FUNC(signalfd, dummy=yes,
195 AC_MSG_ERROR(signalfd support is required))
197 AC_CHECK_LIB(dl, dlopen, dummy=yes,
198 AC_MSG_ERROR(dynamic linking loader is required))
200 AC_ARG_WITH(iwmxsdk, AC_HELP_STRING([--with-iwmxsdk=PATH],
201 [path to Intel WiMAX SDK]),
202 [pkgconfig_iwmxsdk=${withval}/lib/pkgconfig])
204 AC_ARG_ENABLE(iwmx, AC_HELP_STRING([--enable-iwmx],
205 [enable Intel WiMAX support]), [enable_iwmx=${enableval}])
206 if (test "${enable_iwmx}" = "yes"); then
208 export PKG_CONFIG_PATH="${pkgconfig_iwmxsdk}"
209 PKG_CHECK_MODULES(IWMXSDK, libiWmxSdk-0, dummy=yes,
210 AC_MSG_ERROR(Intel WiMAX SDK is required))
212 AC_SUBST(IWMXSDK_CFLAGS)
213 AC_SUBST(IWMXSDK_LIBS)
215 # Fix API compat breakage from 1.4 to 1.5...
216 CPPFLAGS_save=$CPPFLAGS
217 CPPFLAGS="$IWMXSDK_CFLAGS $CPPFLAGS"
218 AH_TEMPLATE([HAVE_IWMXSDK_STATUS_IDLE],
219 [WIMAX_API_DEVICE_STATUS_Connection_Idle is present])
220 AC_CHECK_DECL(WIMAX_API_DEVICE_STATUS_Connection_Idle,
221 [AC_DEFINE([HAVE_IWMXSDK_STATUS_IDLE], [1], [])],
223 [[#include <WiMaxType.h>]])
225 AH_TEMPLATE([HAVE_WIMAX_API_DEVICE_ID],
226 [WIMAX_API_DEVICE_ID is present])
227 AC_CHECK_TYPE(WIMAX_API_DEVICE_ID,
228 [AC_DEFINE([HAVE_WIMAX_API_DEVICE_ID], [1], [])],
230 [[#include <WiMaxType.h>]])
232 AH_TEMPLATE([HAVE_WIMAX_API_HW_DEVICE_ID],
233 [WIMAX_API_HW_DEVICE_ID is present])
234 AC_CHECK_TYPE(WIMAX_API_HW_DEVICE_ID,
235 [AC_DEFINE([HAVE_WIMAX_API_HW_DEVICE_ID], [1], [])],
237 [[#include <WiMaxType.h>]])
239 AH_TEMPLATE([HAVE_WIMAX_API_NSP_INFO_EX],
240 [WIMAX_API_NSP_INFO_EX is present])
241 AC_CHECK_TYPE(WIMAX_API_NSP_INFO_EX,
242 [AC_DEFINE([HAVE_WIMAX_API_NSP_INFO_EX], [1], [])],
244 [[#include <WiMaxType.h>]
245 [#include <WiMaxTypesEx.h>]])
247 AH_TEMPLATE([HAVE_WIMAX_API_CONNECTED_NSP_INFO],
248 [WIMAX_API_CONNECTED_NSP_INFO is present])
249 AC_CHECK_TYPE(WIMAX_API_CONNECTED_NSP_INFO,
250 [AC_DEFINE([HAVE_WIMAX_API_CONNECTED_NSP_INFO], [1], [])],
252 [[#include <WiMaxType.h>]])
254 CPPFLAGS=$CPPFLAGS_save
256 AM_CONDITIONAL(IWMX, test "${enable_iwmx}" = "yes")
258 AC_ARG_ENABLE(iospm, AC_HELP_STRING([--enable-iospm],
259 [enable Intel OSPM support]), [enable_iospm=${enableval}])
260 AM_CONDITIONAL(IOSPM, test "${enable_iospm}" = "yes")
262 AC_ARG_WITH(ntpd, AC_HELP_STRING([--with-ntpd=PROGRAM],
263 [specify ntpd binary location]), [path_ntpd=${withval}])
266 AC_HELP_STRING([--enable-ntpd], [enable ntpd support]),
267 [enable_ntpd=${enableval}], [enable_ntpd="no"])
269 if (test "${enable_ntpd}" != "no"); then
270 if (test -z "${path_ntpd}"); then
271 AC_PATH_PROG(NTPD, [ntpd], [], $PATH:/sbin:/usr/sbin)
277 AM_CONDITIONAL(NTPD, test "${enable_ntpd}" != "no")
278 AM_CONDITIONAL(NTPD_BUILTIN, test "${enable_ntpd}" = "builtin")
280 AC_ARG_ENABLE(nmcompat,
281 AC_HELP_STRING([--enable-nmcompat], [enable nmcompat support]),
282 [enable_nmcompat=${enableval}], [enable_nmcompat="no"])
283 AM_CONDITIONAL(NMCOMPAT, test "${enable_nmcompat}" != "no")
284 AM_CONDITIONAL(NMCOMPAT_BUILTIN, test "${enable_nmcompat}" = "builtin")
287 AC_HELP_STRING([--enable-tist], [enable TI Shared Transport support]),
288 [enable_tist=${enableval}], [enable_tist="no"])
289 AM_CONDITIONAL(TIST, test "${enable_tist}" != "no")
290 AM_CONDITIONAL(TIST_BUILTIN, test "${enable_tist}" = "builtin")
292 AC_ARG_WITH(stats-max-file-size, AC_HELP_STRING([--with-stats-max-file-size=SIZE],
293 [Maximal size of a statistics round robin file]),
294 [stats_max_file_size=${withval}])
296 if (test -z "${stats_max_file_size}"); then
297 # default size is 16 kByte
298 stats_max_file_size="16 * 8 * 128"
301 AC_DEFINE_UNQUOTED([STATS_MAX_FILE_SIZE], (${stats_max_file_size}), [Maximal size of a statistics round robin file])
303 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.22, dummy=yes,
304 AC_MSG_ERROR(GLib >= 2.22 is required))
305 AC_SUBST(GLIB_CFLAGS)
308 if (test "${enable_threads}" = "yes"); then
309 AC_DEFINE(NEED_THREADS, 1, [Define if threading support is required])
310 PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
311 AC_MSG_ERROR(GThread >= 2.16 is required))
312 GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
313 GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
316 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, dummy=yes,
317 AC_MSG_ERROR(D-Bus >= 1.0 is required))
318 saved_CFLAGS="$CFLAGS"
320 CFLAGS="$CFLAGS $DBUS_CFLAGS"
321 LIBS="$LIBS $DBUS_LIBS"
322 AC_CHECK_LIB(dbus-1, dbus_watch_get_unix_fd, dummy=yes,
323 AC_DEFINE(NEED_DBUS_WATCH_GET_UNIX_FD, 1,
324 [Define to 1 if you need the dbus_watch_get_unix_fd() function.]))
325 AC_CHECK_LIB(dbus-1, dbus_connection_can_send_type, dummy=yes,
326 AC_DEFINE(NEED_DBUS_CONNECTION_CAN_SEND_TYPE, 1,
327 [Define to 1 if you need the dbus_connection_can_send_type() function.]
329 CFLAGS="$saved_CFLAGS"
331 AC_SUBST(DBUS_CFLAGS)
334 AC_ARG_WITH(dbusconfdir, AC_HELP_STRING([--with-dbusconfdir=PATH],
335 [path to D-Bus config directory]), [path_dbusconf=${withval}],
336 [path_dbusconf="`$PKG_CONFIG --variable=sysconfdir dbus-1`"])
337 if (test -z "${path_dbusconf}"); then
338 DBUS_CONFDIR="${sysconfdir}/dbus-1/system.d"
340 DBUS_CONFDIR="${path_dbusconf}/dbus-1/system.d"
342 AC_SUBST(DBUS_CONFDIR)
344 AC_ARG_WITH(dbusdatadir, AC_HELP_STRING([--with-dbusdatadir=PATH],
345 [path to D-Bus data directory]), [path_dbusdata=${withval}],
346 [path_dbusdata="`$PKG_CONFIG --variable=datadir dbus-1`"])
347 if (test -z "${path_dbusdata}"); then
348 DBUS_DATADIR="${datadir}/dbus-1/system-services"
350 DBUS_DATADIR="${path_dbusdata}/dbus-1/system-services"
352 AC_SUBST(DBUS_DATADIR)
354 AC_ARG_WITH([systemdunitdir], AC_HELP_STRING([--with-systemdunitdir=DIR],
355 [path to systemd service directory]), [path_systemdunit=${withval}],
356 [path_systemdunit="`$PKG_CONFIG --variable=systemdsystemunitdir systemd`"])
357 if (test -n "${path_systemdunit}"); then
358 SYSTEMD_UNITDIR="${path_systemdunit}"
359 AC_SUBST(SYSTEMD_UNITDIR)
361 AM_CONDITIONAL(SYSTEMD, test -n "${path_systemdunit}")
363 PKG_CHECK_MODULES(XTABLES, xtables, dummy=yes,
364 AC_MSG_ERROR(Xtables library is required))
365 AC_SUBST(XTABLES_CFLAGS)
366 AC_SUBST(XTABLES_LIBS)
368 AC_ARG_ENABLE(polkit,
369 AC_HELP_STRING([--enable-polkit], [enable PolicyKit support]),
370 [enable_polkit=${enableval}], [enable_polkit="no"])
371 if (test "${enable_polkit}" != "no"); then
372 POLKIT_DATADIR="`$PKG_CONFIG --variable=actiondir polkit`"
374 if (test -z "${POLKIT_DATADIR}"); then
375 POLKIT_DATADIR="${datadir}/polkit-1/actions"
377 AC_SUBST(POLKIT_DATADIR)
379 AM_CONDITIONAL(POLKIT, test "${enable_polkit}" != "no")
380 AM_CONDITIONAL(POLKIT_BUILTIN, test "${enable_polkit}" = "builtin")
382 AC_ARG_ENABLE(client, AC_HELP_STRING([--enable-client],
383 [enable command line client]), [enable_client=${enableval}])
384 AM_CONDITIONAL(CLIENT, test "${enable_client}" = "yes")
386 AC_ARG_ENABLE(tools, AC_HELP_STRING([--enable-tools],
387 [enable testing tools]), [enable_tools=${enableval}])
388 if (test "${enable_tools}" = "yes"); then
389 PKG_CHECK_MODULES(GNUTLS, gnutls, dummy=yes,
390 AC_MSG_ERROR(GnuTLS library is required))
391 AC_SUBST(GNUTLS_CFLAGS)
392 AC_SUBST(GNUTLS_LIBS)
394 AC_CHECK_HEADERS(linux/if_alg.h, dummy=yes,
395 AC_MSG_ERROR(User-space algorithm header files are required))
397 AM_CONDITIONAL(TOOLS, test "${enable_tools}" = "yes")
399 AC_ARG_ENABLE(test, AC_HELP_STRING([--enable-test],
400 [enable test/example scripts]), [enable_test=${enableval}])
401 AM_CONDITIONAL(TEST, test "${enable_test}" = "yes")
403 AC_ARG_ENABLE(fake, AC_HELP_STRING([--enable-fake],
404 [enable fake device support]), [enable_fake=${enableval}])
405 AM_CONDITIONAL(FAKE, test "${enable_fake}" = "yes")
407 AC_ARG_ENABLE(capng, AC_HELP_STRING([--enable-capng],
408 [enable capabilities support]), [enable_capng=${enableval}])
409 if (test "${enable_capng}" = "yes"); then
410 PKG_CHECK_MODULES(CAPNG, libcap-ng, dummy=yes,
411 AC_MSG_ERROR(Capabilities library is required))
412 AC_SUBST(CAPNG_CFLAGS)
414 AC_DEFINE(HAVE_CAPNG, 1, [Define to 1 if you have capabilities library.])
417 AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles],
418 [don't install configuration and data files]),
419 [enable_datafiles=${enableval}])
420 AM_CONDITIONAL(DATAFILES, test "${enable_datafiles}" != "no")
422 AC_OUTPUT(Makefile include/version.h src/connman.service
423 scripts/connman doc/version.xml connman.pc)