4 AM_INIT_AUTOMAKE([foreign subdir-objects])
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)
30 m4_define([_LT_AC_TAGCONFIG], [])
31 m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])])
37 AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization],
38 [disable code optimization through compiler]), [
39 if (test "${enableval}" = "no"); then
46 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
47 [enable compiling with debugging information]), [
48 if (test "${enableval}" = "yes" &&
49 test "${ac_cv_prog_cc_g}" = "yes"); then
54 AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie],
55 [enable position independent executables flag]), [
56 if (test "${enableval}" = "yes" &&
57 test "${ac_cv_prog_cc_pie}" = "yes"); then
58 CFLAGS="$CFLAGS -fPIE"
59 LDFLAGS="$LDFLAGS -pie"
63 AC_ARG_ENABLE(threads,
64 AC_HELP_STRING([--enable-threads], [enable threading support]),
65 [enable_threads=${enableval}], [enable_threads="no"])
67 AC_ARG_ENABLE(ethernet,
68 AC_HELP_STRING([--enable-ethernet], [enable Ethernet support]),
69 [enable_ethernet=${enableval}], [enable_ethernet="no"])
70 AM_CONDITIONAL(ETHERNET, test "${enable_ethernet}" != "no")
71 AM_CONDITIONAL(ETHERNET_BUILTIN, test "${enable_ethernet}" = "builtin")
74 AC_HELP_STRING([--enable-wifi], [enable WiFi support]),
75 [enable_wifi=${enableval}], [enable_wifi="no"])
76 if (test "${enable_wifi}" != "no"); then
77 AC_PATH_PROG(WPASUPPLICANT, [wpa_supplicant], [],
78 $PATH:/sbin:/usr/sbin)
80 AM_CONDITIONAL(WIFI, test "${enable_wifi}" != "no")
81 AM_CONDITIONAL(WIFI_BUILTIN, test "${enable_wifi}" = "builtin")
83 AC_ARG_ENABLE(bluetooth,
84 AC_HELP_STRING([--enable-bluetooth], [enable Bluetooth support]),
85 [enable_bluetooth=${enableval}], [enable_bluetooth="no"])
86 AM_CONDITIONAL(BLUETOOTH, test "${enable_bluetooth}" != "no")
87 AM_CONDITIONAL(BLUETOOTH_BUILTIN, test "${enable_bluetooth}" = "builtin")
89 AC_ARG_ENABLE(hh2serial-gps,
90 AC_HELP_STRING([--enable-hh2serial-gps], [enable hh2serial GPS support]),
91 [enable_hh2serial_gps=${enableval}], [enable_hh2serial_gps="no"])
92 AM_CONDITIONAL(HH2SERIAL_GPS, test "${enable_hh2serial_gps}" != "no")
93 AM_CONDITIONAL(HH2SERIAL_GPS_BUILTIN, test "${enable_hh2serial_gps}" = "builtin")
96 AC_HELP_STRING([--enable-ofono], [enable oFono support]),
97 [enable_ofono=${enableval}], [enable_ofono="no"])
98 AM_CONDITIONAL(OFONO, test "${enable_ofono}" != "no")
99 AM_CONDITIONAL(OFONO_BUILTIN, test "${enable_ofono}" = "builtin")
101 AC_ARG_WITH(udhcpc, AC_HELP_STRING([--with-udhcpc=PROGRAM],
102 [specify location of udhcpc binary]), [path_udhcpc=${withval}])
105 AC_HELP_STRING([--enable-udhcp], [enable uDHCP support]),
106 [enable_udhcp=${enableval}], [enable_udhcp="no"])
107 if (test "${enable_udhcp}" != "no"); then
108 if (test -z "${path_udhcpc}"); then
109 AC_PATH_PROG(UDHCPC, [udhcpc], [], $PATH:/sbin:/usr/sbin)
111 UDHCPC="${path_udhcpc}"
115 AM_CONDITIONAL(UDHCP, test "${enable_udhcp}" != "no")
116 AM_CONDITIONAL(UDHCP_BUILTIN, test "${enable_udhcp}" = "builtin")
118 AC_ARG_WITH(dhclient, AC_HELP_STRING([--with-dhclient=PROGRAM],
119 [specify location of dhclient binary]), [path_dhclient=${withval}])
121 AC_ARG_ENABLE(dhclient,
122 AC_HELP_STRING([--enable-dhclient], [enable dhclient support]),
123 [enable_dhclient=${enableval}], [enable_dhclient="no"])
124 if (test "${enable_dhclient}" != "no"); then
125 if (test -z "${path_dhclient}"); then
126 AC_PATH_PROG(DHCLIENT, [dhclient], [], $PATH:/sbin:/usr/sbin)
128 DHCLIENT="${path_dhclient}"
131 AC_MSG_CHECKING(dhclient major version)
132 version_dhclient=`${DHCLIENT} --version 2>&1 | sed '/^isc-dhclient-*/!d; s///; s/\..*//;q'`
133 AC_MSG_RESULT(${version_dhclient})
134 if (test "${version_dhclient}" = "4"); then
135 AC_DEFINE(HAVE_DHCLIENT_HOSTNAME, 1, [Define to 1 if you have dhclient hostname support.])
138 AM_CONDITIONAL(DHCLIENT, test "${enable_dhclient}" != "no")
139 AM_CONDITIONAL(DHCLIENT_BUILTIN, test "${enable_dhclient}" = "builtin")
141 AC_ARG_WITH(resolvconf, AC_HELP_STRING([--with-resolvconf=PROGRAM],
142 [specify location of resolvconf binary]), [path_resolvconf=${withval}])
144 AC_ARG_ENABLE(resolvconf,
145 AC_HELP_STRING([--enable-resolvconf], [enable resolvconf support]),
146 [enable_resolvconf=${enableval}], [enable_resolvconf="no"])
147 if (test "${enable_resolvconf}" != "no"); then
148 if (test -z "${path_resolvconf}"); then
149 AC_PATH_PROG(RESOLVCONF, [resolvconf], [], $PATH:/sbin:/usr/sbin)
151 RESOLVCONF="${path_resolvconf}"
155 AM_CONDITIONAL(RESOLVCONF, test "${enable_resolvconf}" != "no")
156 AM_CONDITIONAL(RESOLVCONF_BUILTIN, test "${enable_resolvconf}" = "builtin")
158 AC_ARG_WITH(openconnect, AC_HELP_STRING([--with-openconnect=PROGRAM],
159 [specify location of openconnect binary]), [path_openconnect=${withval}])
161 AC_ARG_ENABLE(openconnect,
162 AC_HELP_STRING([--enable-openconnect], [enable openconnect support]),
163 [enable_openconnect=${enableval}], [enable_openconnect="no"])
164 if (test "${enable_openconnect}" != "no"); then
165 if (test -z "${path_openconnect}"); then
166 AC_PATH_PROG(OPENCONNECT, [openconnect], [], $PATH:/sbin:/usr/sbin)
168 OPENCONNECT="${path_openconnect}"
169 AC_SUBST(OPENCONNECT)
172 AM_CONDITIONAL(OPENCONNECT, test "${enable_openconnect}" != "no")
173 AM_CONDITIONAL(OPENCONNECT_BUILTIN, test "${enable_openconnect}" = "builtin")
175 AC_ARG_ENABLE(portal,
176 AC_HELP_STRING([--enable-portal], [enable portal detection support]),
177 [enable_portal=${enableval}], [enable_portal="no"])
178 AM_CONDITIONAL(PORTAL, test "${enable_portal}" != "no")
179 AM_CONDITIONAL(PORTAL_BUILTIN, test "${enable_portal}" = "builtin")
181 AC_ARG_ENABLE(loopback,
182 AC_HELP_STRING([--enable-loopback], [enable loopback support]),
183 [enable_loopback=${enableval}], [enable_loopback="no"])
184 if (test "${enable_loopback}" != "no"); then
185 AC_CHECK_HEADERS(sys/inotify.h, dummy=yes,
186 AC_MSG_ERROR(inotify header files are required))
188 AC_CHECK_LIB(c, inotify_init, dummy=yes,
189 AC_MSG_ERROR(inotify library support is required))
191 AM_CONDITIONAL(LOOPBACK, test "${enable_loopback}" != "no")
192 AM_CONDITIONAL(LOOPBACK_BUILTIN, test "${enable_loopback}" = "builtin")
194 AC_ARG_ENABLE(dnsproxy,
195 AC_HELP_STRING([--enable-dnsproxy], [enable DNS proxy support]),
196 [enable_dnsproxy=${enableval}], [enable_dnsproxy="no"])
197 if (test "${enable_dnsproxy}" != "no"); then
198 AC_CHECK_HEADERS(resolv.h, dummy=yes,
199 AC_MSG_ERROR(resolver header files are required))
200 AC_CHECK_LIB(resolv, ns_initparse, dummy=yes,
201 AC_MSG_ERROR(resolver library support is required))
203 AM_CONDITIONAL(DNSPROXY, test "${enable_dnsproxy}" != "no")
204 AM_CONDITIONAL(DNSPROXY_BUILTIN, test "${enable_dnsproxy}" = "builtin")
206 AC_ARG_ENABLE(google,
207 AC_HELP_STRING([--enable-google], [enable Google Public DNS support]),
208 [enable_google=${enableval}], [enable_google="no"])
209 AM_CONDITIONAL(GOOGLE, test "${enable_google}" != "no")
210 AM_CONDITIONAL(GOOGLE_BUILTIN, test "${enable_google}" = "builtin")
213 AC_HELP_STRING([--enable-meego], [enable MeeGo features support]),
214 [enable_meego=${enableval}], [enable_meego="no"])
215 AM_CONDITIONAL(MEEGO, test "${enable_meego}" != "no")
216 AM_CONDITIONAL(MEEGO_BUILTIN, test "${enable_meego}" = "builtin")
218 AC_CHECK_LIB(dl, dlopen, dummy=yes,
219 AC_MSG_ERROR(dynamic linking loader is required))
221 AC_ARG_WITH(iwmxsdk, AC_HELP_STRING([--with-iwmxsdk=PATH],
222 [path to Intel WiMAX SDK]),
223 [pkgconfig_iwmxsdk=${withval}/lib/pkgconfig])
225 AC_ARG_ENABLE(iwmx, AC_HELP_STRING([--enable-iwmx],
226 [enable Intel WiMAX support]), [enable_iwmx=${enableval}])
227 if (test "${enable_iwmx}" = "yes"); then
229 export PKG_CONFIG_PATH="${pkgconfig_iwmxsdk}"
230 PKG_CHECK_MODULES(IWMXSDK, libiWmxSdk-0, dummy=yes,
231 AC_MSG_ERROR(Intel WiMAX SDK is required))
233 AC_SUBST(IWMXSDK_CFLAGS)
234 AC_SUBST(IWMXSDK_LIBS)
236 # Fix API compat breakage from 1.4 to 1.5...
237 CPPFLAGS_save=$CPPFLAGS
238 CPPFLAGS="$IWMXSDK_CFLAGS $CPPFLAGS"
239 AH_TEMPLATE([HAVE_IWMXSDK_STATUS_IDLE],
240 [WIMAX_API_DEVICE_STATUS_Connection_Idle is present])
241 AC_CHECK_DECL(WIMAX_API_DEVICE_STATUS_Connection_Idle,
242 [AC_DEFINE([HAVE_IWMXSDK_STATUS_IDLE], [1], [])],
244 [[#include <WiMaxType.h>]])
246 AH_TEMPLATE([HAVE_WIMAX_API_DEVICE_ID],
247 [WIMAX_API_DEVICE_ID is present])
248 AC_CHECK_TYPE(WIMAX_API_DEVICE_ID,
249 [AC_DEFINE([HAVE_WIMAX_API_DEVICE_ID], [1], [])],
251 [[#include <WiMaxType.h>]])
253 AH_TEMPLATE([HAVE_WIMAX_API_HW_DEVICE_ID],
254 [WIMAX_API_HW_DEVICE_ID is present])
255 AC_CHECK_TYPE(WIMAX_API_HW_DEVICE_ID,
256 [AC_DEFINE([HAVE_WIMAX_API_HW_DEVICE_ID], [1], [])],
258 [[#include <WiMaxType.h>]])
260 AH_TEMPLATE([HAVE_WIMAX_API_NSP_INFO_EX],
261 [WIMAX_API_NSP_INFO_EX is present])
262 AC_CHECK_TYPE(WIMAX_API_NSP_INFO_EX,
263 [AC_DEFINE([HAVE_WIMAX_API_NSP_INFO_EX], [1], [])],
265 [[#include <WiMaxType.h>]
266 [#include <WiMaxTypesEx.h>]])
268 AH_TEMPLATE([HAVE_WIMAX_API_CONNECTED_NSP_INFO],
269 [WIMAX_API_CONNECTED_NSP_INFO is present])
270 AC_CHECK_TYPE(WIMAX_API_CONNECTED_NSP_INFO,
271 [AC_DEFINE([HAVE_WIMAX_API_CONNECTED_NSP_INFO], [1], [])],
273 [[#include <WiMaxType.h>]])
275 CPPFLAGS=$CPPFLAGS_save
277 AM_CONDITIONAL(IWMX, test "${enable_iwmx}" = "yes")
279 AC_ARG_ENABLE(iospm, AC_HELP_STRING([--enable-iospm],
280 [enable Intel OSPM support]), [enable_iospm=${enableval}])
281 AM_CONDITIONAL(IOSPM, test "${enable_iospm}" = "yes")
283 AC_ARG_WITH(ntpd, AC_HELP_STRING([--with-=PROGRAM],
284 [specify ntpd binary location]), [path_ntpd=${withval}])
287 AC_HELP_STRING([--enable-ntpd], [enable ntpd support]),
288 [enable_ntpd=${enableval}], [enable_ntpd="no"])
290 if (test "${enable_ntpd}" != "no"); then
291 if (test -z "${path_ntpd}"); then
292 AC_PATH_PROG(NTPD, [ntpd], [], $PATH:/sbin:/usr/sbin)
298 AM_CONDITIONAL(NTPD, test "${enable_ntpd}" != "no")
299 AM_CONDITIONAL(NTPD_BUILTIN, test "${enable_ntpd}" = "builtin")
301 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
302 AC_MSG_ERROR(GLib >= 2.16 is required))
303 AC_SUBST(GLIB_CFLAGS)
306 if (test "${enable_threads}" = "yes"); then
307 AC_DEFINE(NEED_THREADS, 1, [Define if threading support is required])
308 PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
309 AC_MSG_ERROR(GThread >= 2.16 is required))
310 GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
311 GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
314 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, dummy=yes,
315 AC_MSG_ERROR(D-Bus >= 1.0 is required))
316 AC_CHECK_LIB(dbus-1, dbus_watch_get_unix_fd, dummy=yes,
317 AC_DEFINE(NEED_DBUS_WATCH_GET_UNIX_FD, 1,
318 [Define to 1 if you need the dbus_watch_get_unix_fd() function.]))
319 AC_SUBST(DBUS_CFLAGS)
322 AC_ARG_WITH(dbusconf, AC_HELP_STRING([--with-dbusconf=PATH],
323 [path to D-Bus config directory]), [path_dbusconf=${withval}],
324 [path_dbusconf="`$PKG_CONFIG --variable=sysconfdir dbus-1`"])
325 if (test -z "${path_dbusconf}"); then
326 DBUS_DATADIR="${sysconfdir}/dbus-1/system.d"
328 DBUS_DATADIR="${path_dbusconf}/dbus-1/system.d"
330 AC_SUBST(DBUS_DATADIR)
332 AC_ARG_ENABLE(polkit,
333 AC_HELP_STRING([--enable-polkit], [enable PolicyKit support]),
334 [enable_polkit=${enableval}], [enable_polkit="no"])
335 if (test "${enable_polkit}" != "no"); then
336 PKG_CHECK_MODULES(POLKIT, polkit-dbus >= 0.7, dummy=yes,
337 AC_MSG_ERROR(PolicyKit >= 0.7 is required))
338 AC_SUBST(POLKIT_CFLAGS)
339 AC_SUBST(POLKIT_LIBS)
340 POLKIT_DATADIR="`$PKG_CONFIG --variable=policydir polkit`"
341 if (test -z "${POLKIT_DATADIR}"); then
342 POLKIT_DATADIR="${datadir}/PolicyKit/policy"
344 AC_SUBST(POLKIT_DATADIR)
346 AM_CONDITIONAL(POLKIT, test "${enable_polkit}" != "no")
347 AM_CONDITIONAL(POLKIT_BUILTIN, test "${enable_polkit}" = "builtin")
349 AC_ARG_ENABLE(client, AC_HELP_STRING([--enable-client],
350 [enable command line client]), [enable_client=${enableval}])
351 AM_CONDITIONAL(CLIENT, test "${enable_client}" = "yes")
353 AC_ARG_ENABLE(tools, AC_HELP_STRING([--enable-tools],
354 [enable testing tools]), [enable_tools=${enableval}])
355 if (test "${enable_tools}" = "yes"); then
356 PKG_CHECK_MODULES(NETLINK, libnl-1, dummy=yes,
357 AC_MSG_ERROR(Netlink library is required))
358 AC_SUBST(NETLINK_CFLAGS)
359 AC_SUBST(NETLINK_LIBS)
361 AM_CONDITIONAL(TOOLS, test "${enable_tools}" = "yes")
363 AC_ARG_ENABLE(test, AC_HELP_STRING([--enable-test],
364 [enable test/example scripts]), [enable_test=${enableval}])
365 AM_CONDITIONAL(TEST, test "${enable_test}" = "yes")
367 AC_ARG_ENABLE(fake, AC_HELP_STRING([--enable-fake],
368 [enable fake device support]), [enable_fake=${enableval}])
369 AM_CONDITIONAL(FAKE, test "${enable_fake}" = "yes")
371 AC_ARG_ENABLE(capng, AC_HELP_STRING([--enable-capng],
372 [enable capabilities support]), [enable_capng=${enableval}])
373 if (test "${enable_capng}" = "yes"); then
374 PKG_CHECK_MODULES(CAPNG, libcap-ng, dummy=yes,
375 AC_MSG_ERROR(Capabilities library is required))
376 AC_SUBST(CAPNG_CFLAGS)
378 AC_DEFINE(HAVE_CAPNG, 1, [Define to 1 if you have capabilities library.])
381 AC_ARG_ENABLE(udev, AC_HELP_STRING([--disable-udev],
382 [don't use udev support even if available]),
383 [enable_udev=${enableval}])
384 if (test "${enable_udev}" != "no"); then
385 PKG_CHECK_MODULES(UDEV, libudev >= 143,
386 [enable_udev="yes"], [enable_udev="no"])
388 if (test "${enable_udev}" = "yes"); then
389 UDEV_DATADIR="`$PKG_CONFIG --variable=udevdir udev`"
390 if (test -z "${UDEV_DATADIR}"); then
391 UDEV_DATADIR="${sysconfdir}/udev/rules.d"
393 UDEV_DATADIR="${UDEV_DATADIR}/rules.d"
395 AC_SUBST(UDEV_DATADIR)
397 AC_SUBST(UDEV_CFLAGS)
399 AM_CONDITIONAL(UDEV, test "${enable_udev}" = "yes")
401 AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles],
402 [don't install configuration and data files]),
403 [enable_datafiles=${enableval}])
404 AM_CONDITIONAL(DATAFILES, test "${enable_datafiles}" != "no")
406 AC_OUTPUT(Makefile include/version.h src/connman.service
407 scripts/connman doc/version.xml connman.pc)