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}"
132 AM_CONDITIONAL(DHCLIENT, test "${enable_dhclient}" != "no")
133 AM_CONDITIONAL(DHCLIENT_BUILTIN, test "${enable_dhclient}" = "builtin")
135 AC_ARG_WITH(openconnect, AC_HELP_STRING([--with-openconnect=PROGRAM],
136 [specify location of openconnect binary]), [path_openconnect=${withval}])
138 AC_ARG_ENABLE(openconnect,
139 AC_HELP_STRING([--enable-openconnect], [enable openconnect support]),
140 [enable_openconnect=${enableval}], [enable_openconnect="no"])
141 if (test "${enable_openconnect}" != "no"); then
142 if (test -z "${path_openconnect}"); then
143 AC_PATH_PROG(OPENCONNECT, [openconnect], [], $PATH:/sbin:/usr/sbin)
145 OPENCONNECT="${path_openconnect}"
146 AC_SUBST(OPENCONNECT)
149 AM_CONDITIONAL(OPENCONNECT, test "${enable_openconnect}" != "no")
150 AM_CONDITIONAL(OPENCONNECT_BUILTIN, test "${enable_openconnect}" = "builtin")
152 AC_ARG_ENABLE(portal,
153 AC_HELP_STRING([--enable-portal], [enable portal detection support]),
154 [enable_portal=${enableval}], [enable_portal="no"])
155 AM_CONDITIONAL(PORTAL, test "${enable_portal}" != "no")
156 AM_CONDITIONAL(PORTAL_BUILTIN, test "${enable_portal}" = "builtin")
158 AC_ARG_ENABLE(loopback,
159 AC_HELP_STRING([--enable-loopback], [enable loopback support]),
160 [enable_loopback=${enableval}], [enable_loopback="no"])
161 if (test "${enable_loopback}" != "no"); then
162 AC_CHECK_HEADERS(sys/inotify.h, dummy=yes,
163 AC_MSG_ERROR(inotify header files are required))
165 AC_CHECK_LIB(c, inotify_init, dummy=yes,
166 AC_MSG_ERROR(inotify library support is required))
168 AM_CONDITIONAL(LOOPBACK, test "${enable_loopback}" != "no")
169 AM_CONDITIONAL(LOOPBACK_BUILTIN, test "${enable_loopback}" = "builtin")
171 AC_ARG_ENABLE(dnsproxy,
172 AC_HELP_STRING([--enable-dnsproxy], [enable DNS proxy support]),
173 [enable_dnsproxy=${enableval}], [enable_dnsproxy="no"])
174 if (test "${enable_dnsproxy}" != "no"); then
175 AC_CHECK_HEADERS(resolv.h, dummy=yes,
176 AC_MSG_ERROR(resolver header files are required))
177 AC_CHECK_LIB(resolv, ns_initparse, dummy=yes,
178 AC_MSG_ERROR(resolver library support is required))
180 AM_CONDITIONAL(DNSPROXY, test "${enable_dnsproxy}" != "no")
181 AM_CONDITIONAL(DNSPROXY_BUILTIN, test "${enable_dnsproxy}" = "builtin")
183 AC_ARG_ENABLE(google,
184 AC_HELP_STRING([--enable-google], [enable Google Public DNS support]),
185 [enable_google=${enableval}], [enable_google="no"])
186 AM_CONDITIONAL(GOOGLE, test "${enable_google}" != "no")
187 AM_CONDITIONAL(GOOGLE_BUILTIN, test "${enable_google}" = "builtin")
190 AC_HELP_STRING([--enable-meego], [enable MeeGo features support]),
191 [enable_meego=${enableval}], [enable_meego="no"])
192 AM_CONDITIONAL(MEEGO, test "${enable_meego}" != "no")
193 AM_CONDITIONAL(MEEGO_BUILTIN, test "${enable_meego}" = "builtin")
195 AC_CHECK_LIB(dl, dlopen, dummy=yes,
196 AC_MSG_ERROR(dynamic linking loader is required))
198 AC_ARG_WITH(iwmxsdk, AC_HELP_STRING([--with-iwmxsdk=PATH],
199 [path to Intel WiMAX SDK]),
200 [pkgconfig_iwmxsdk=${withval}/lib/pkgconfig])
202 AC_ARG_ENABLE(iwmx, AC_HELP_STRING([--enable-iwmx],
203 [enable Intel WiMAX support]), [enable_iwmx=${enableval}])
204 if (test "${enable_iwmx}" = "yes"); then
206 export PKG_CONFIG_PATH="${pkgconfig_iwmxsdk}"
207 PKG_CHECK_MODULES(IWMXSDK, libiWmxSdk-0, dummy=yes,
208 AC_MSG_ERROR(Intel WiMAX SDK is required))
210 AC_SUBST(IWMXSDK_CFLAGS)
211 AC_SUBST(IWMXSDK_LIBS)
213 # Fix API compat breakage from 1.4 to 1.5...
214 CPPFLAGS_save=$CPPFLAGS
215 CPPFLAGS="$IWMXSDK_CFLAGS $CPPFLAGS"
216 AH_TEMPLATE([HAVE_IWMXSDK_STATUS_IDLE],
217 [WIMAX_API_DEVICE_STATUS_Connection_Idle is present])
218 AC_CHECK_DECL(WIMAX_API_DEVICE_STATUS_Connection_Idle,
219 [AC_DEFINE([HAVE_IWMXSDK_STATUS_IDLE], [1], [])],
221 [[#include <WiMaxType.h>]])
223 AH_TEMPLATE([HAVE_WIMAX_API_DEVICE_ID],
224 [WIMAX_API_DEVICE_ID is present])
225 AC_CHECK_TYPE(WIMAX_API_DEVICE_ID,
226 [AC_DEFINE([HAVE_WIMAX_API_DEVICE_ID], [1], [])],
228 [[#include <WiMaxType.h>]])
230 AH_TEMPLATE([HAVE_WIMAX_API_HW_DEVICE_ID],
231 [WIMAX_API_HW_DEVICE_ID is present])
232 AC_CHECK_TYPE(WIMAX_API_HW_DEVICE_ID,
233 [AC_DEFINE([HAVE_WIMAX_API_HW_DEVICE_ID], [1], [])],
235 [[#include <WiMaxType.h>]])
237 AH_TEMPLATE([HAVE_WIMAX_API_NSP_INFO_EX],
238 [WIMAX_API_NSP_INFO_EX is present])
239 AC_CHECK_TYPE(WIMAX_API_NSP_INFO_EX,
240 [AC_DEFINE([HAVE_WIMAX_API_NSP_INFO_EX], [1], [])],
242 [[#include <WiMaxType.h>]
243 [#include <WiMaxTypesEx.h>]])
245 AH_TEMPLATE([HAVE_WIMAX_API_CONNECTED_NSP_INFO],
246 [WIMAX_API_CONNECTED_NSP_INFO is present])
247 AC_CHECK_TYPE(WIMAX_API_CONNECTED_NSP_INFO,
248 [AC_DEFINE([HAVE_WIMAX_API_CONNECTED_NSP_INFO], [1], [])],
250 [[#include <WiMaxType.h>]])
252 CPPFLAGS=$CPPFLAGS_save
254 AM_CONDITIONAL(IWMX, test "${enable_iwmx}" = "yes")
256 AC_ARG_ENABLE(iospm, AC_HELP_STRING([--enable-iospm],
257 [enable Intel OSPM support]), [enable_iospm=${enableval}])
258 AM_CONDITIONAL(IOSPM, test "${enable_iospm}" = "yes")
260 AC_ARG_WITH(ntpd, AC_HELP_STRING([--with-=PROGRAM],
261 [specify ntpd binary location]), [path_ntpd=${withval}])
264 AC_HELP_STRING([--enable-ntpd], [enable ntpd support]),
265 [enable_ntpd=${enableval}], [enable_ntpd="no"])
267 if (test "${enable_ntpd}" != "no"); then
268 if (test -z "${path_ntpd}"); then
269 AC_PATH_PROG(NTPD, [ntpd], [], $PATH:/sbin:/usr/sbin)
275 AM_CONDITIONAL(NTPD, test "${enable_ntpd}" != "no")
276 AM_CONDITIONAL(NTPD_BUILTIN, test "${enable_ntpd}" = "builtin")
278 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
279 AC_MSG_ERROR(GLib >= 2.16 is required))
280 AC_SUBST(GLIB_CFLAGS)
283 if (test "${enable_threads}" = "yes"); then
284 AC_DEFINE(NEED_THREADS, 1, [Define if threading support is required])
285 PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
286 AC_MSG_ERROR(GThread >= 2.16 is required))
287 GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
288 GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
291 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, dummy=yes,
292 AC_MSG_ERROR(D-Bus >= 1.0 is required))
293 AC_CHECK_LIB(dbus-1, dbus_watch_get_unix_fd, dummy=yes,
294 AC_DEFINE(NEED_DBUS_WATCH_GET_UNIX_FD, 1,
295 [Define to 1 if you need the dbus_watch_get_unix_fd() function.]))
296 AC_SUBST(DBUS_CFLAGS)
299 AC_ARG_WITH(dbusconf, AC_HELP_STRING([--with-dbusconf=PATH],
300 [path to D-Bus config directory]), [path_dbusconf=${withval}],
301 [path_dbusconf="`$PKG_CONFIG --variable=sysconfdir dbus-1`"])
302 if (test -z "${path_dbusconf}"); then
303 DBUS_DATADIR="${sysconfdir}/dbus-1/system.d"
305 DBUS_DATADIR="${path_dbusconf}/dbus-1/system.d"
307 AC_SUBST(DBUS_DATADIR)
309 AC_ARG_ENABLE(polkit,
310 AC_HELP_STRING([--enable-polkit], [enable PolicyKit support]),
311 [enable_polkit=${enableval}], [enable_polkit="no"])
312 if (test "${enable_polkit}" != "no"); then
313 PKG_CHECK_MODULES(POLKIT, polkit-dbus >= 0.7, dummy=yes,
314 AC_MSG_ERROR(PolicyKit >= 0.7 is required))
315 AC_SUBST(POLKIT_CFLAGS)
316 AC_SUBST(POLKIT_LIBS)
317 POLKIT_DATADIR="`$PKG_CONFIG --variable=policydir polkit`"
318 if (test -z "${POLKIT_DATADIR}"); then
319 POLKIT_DATADIR="${datadir}/PolicyKit/policy"
321 AC_SUBST(POLKIT_DATADIR)
323 AM_CONDITIONAL(POLKIT, test "${enable_polkit}" != "no")
324 AM_CONDITIONAL(POLKIT_BUILTIN, test "${enable_polkit}" = "builtin")
326 AC_ARG_ENABLE(client, AC_HELP_STRING([--enable-client],
327 [enable command line client]), [enable_client=${enableval}])
328 AM_CONDITIONAL(CLIENT, test "${enable_client}" = "yes")
330 AC_ARG_ENABLE(tools, AC_HELP_STRING([--enable-tools],
331 [enable testing tools]), [enable_tools=${enableval}])
332 if (test "${enable_tools}" = "yes"); then
333 PKG_CHECK_MODULES(IPTC, libiptc, dummy=yes,
334 AC_MSG_ERROR(iptables library is required))
335 AC_SUBST(IPTC_CFLAGS)
338 PKG_CHECK_MODULES(NETLINK, libnl-1, dummy=yes,
339 AC_MSG_ERROR(Netlink library is required))
340 AC_SUBST(NETLINK_CFLAGS)
341 AC_SUBST(NETLINK_LIBS)
343 AM_CONDITIONAL(TOOLS, test "${enable_tools}" = "yes")
345 AC_ARG_ENABLE(test, AC_HELP_STRING([--enable-test],
346 [enable test/example scripts]), [enable_test=${enableval}])
347 AM_CONDITIONAL(TEST, test "${enable_test}" = "yes")
349 AC_ARG_ENABLE(fake, AC_HELP_STRING([--enable-fake],
350 [enable fake device support]), [enable_fake=${enableval}])
351 AM_CONDITIONAL(FAKE, test "${enable_fake}" = "yes")
353 AC_ARG_ENABLE(capng, AC_HELP_STRING([--enable-capng],
354 [enable capabilities support]), [enable_capng=${enableval}])
355 if (test "${enable_capng}" = "yes"); then
356 PKG_CHECK_MODULES(CAPNG, libcap-ng, dummy=yes,
357 AC_MSG_ERROR(Capabilities library is required))
358 AC_SUBST(CAPNG_CFLAGS)
360 AC_DEFINE(HAVE_CAPNG, 1, [Define to 1 if you have capabilities library.])
363 AC_ARG_ENABLE(udev, AC_HELP_STRING([--disable-udev],
364 [don't use udev support even if available]),
365 [enable_udev=${enableval}])
366 if (test "${enable_udev}" != "no"); then
367 PKG_CHECK_MODULES(UDEV, libudev >= 143,
368 [enable_udev="yes"], [enable_udev="no"])
370 if (test "${enable_udev}" = "yes"); then
371 UDEV_DATADIR="`$PKG_CONFIG --variable=udevdir udev`"
372 if (test -z "${UDEV_DATADIR}"); then
373 UDEV_DATADIR="${sysconfdir}/udev/rules.d"
375 UDEV_DATADIR="${UDEV_DATADIR}/rules.d"
377 AC_SUBST(UDEV_DATADIR)
379 AC_SUBST(UDEV_CFLAGS)
381 AM_CONDITIONAL(UDEV, test "${enable_udev}" = "yes")
383 AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles],
384 [don't install configuration and data files]),
385 [enable_datafiles=${enableval}])
386 AM_CONDITIONAL(DATAFILES, test "${enable_datafiles}" != "no")
388 AC_OUTPUT(Makefile include/version.h src/connman.service
389 scripts/connman doc/version.xml connman.pc)