4 AM_INIT_AUTOMAKE(connman, 0.15)
5 AM_CONFIG_HEADER(config.h)
9 AC_PREFIX_DEFAULT(/usr/local)
19 m4_define([_LT_AC_TAGCONFIG], [])
20 m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])])
29 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
30 [enable compiling with debugging information]), [
31 if (test "${enableval}" = "yes" &&
32 test "${ac_cv_prog_cc_g}" = "yes"); then
33 CFLAGS="$CFLAGS -g -O0"
37 AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie],
38 [enable position independent executables flag]), [
39 if (test "${enableval}" = "yes" &&
40 test "${ac_cv_prog_cc_pie}" = "yes"); then
41 CFLAGS="$CFLAGS -fPIE"
42 LDFLAGS="$LDFLAGS -pie"
46 AC_ARG_ENABLE(threads, AC_HELP_STRING([--enable-threads],
47 [enable threading support]), [enable_threads=${enableval}])
49 AC_ARG_ENABLE(loopback, AC_HELP_STRING([--enable-loopback],
50 [enable loopback support]), [enable_loopback=${enableval}])
51 AM_CONDITIONAL(LOOPBACK, test "${enable_loopback}" != "no")
52 AM_CONDITIONAL(LOOPBACK_BUILTIN, test "${enable_loopback}" = "builtin")
54 AC_ARG_ENABLE(ethernet, AC_HELP_STRING([--enable-ethernet],
55 [enable Ethernet support]), [enable_ethernet=${enableval}])
56 AM_CONDITIONAL(ETHERNET, test "${enable_ethernet}" != "no")
57 AM_CONDITIONAL(ETHERNET_BUILTIN, test "${enable_ethernet}" = "builtin")
59 AC_ARG_ENABLE(wifi, AC_HELP_STRING([--enable-wifi],
60 [enable WiFi support]), [enable_wifi=${enableval}])
61 if (test "${enable_wifi}" = "yes"); then
62 AC_PATH_PROG(WPASUPPLICANT, [wpa_supplicant], [],
63 $PATH:/sbin:/usr/sbin)
65 AM_CONDITIONAL(WIFI, test "${enable_wifi}" != "no")
66 AM_CONDITIONAL(WIFI_BUILTIN, test "${enable_wifi}" = "builtin")
68 AC_ARG_ENABLE(bluetooth, AC_HELP_STRING([--enable-bluetooth],
69 [enable Bluetooth support]), [enable_bluetooth=${enableval}])
70 AM_CONDITIONAL(BLUETOOTH, test "${enable_bluetooth}" != "no")
71 AM_CONDITIONAL(BLUETOOTH_BUILTIN, test "${enable_bluetooth}" = "builtin")
73 AC_ARG_ENABLE(modemmgr, AC_HELP_STRING([--enable-modemmgr],
74 [enable Modem Manager support]), [enable_modemmgr=${enableval}])
75 AM_CONDITIONAL(MODEMMGR, test "${enable_modemmgr}" = "yes")
77 AC_ARG_WITH(udhcpc, AC_HELP_STRING([--with-udhcpc=PROGRAM],
78 [specify location of udhcpc binary]), [path_udhcpc=${withval}])
80 AC_ARG_ENABLE(udhcp, AC_HELP_STRING([--enable-udhcp],
81 [enable uDHCP support]), [enable_udhcp=${enableval}])
82 if (test "${enable_udhcp}" = "yes"); then
83 if (test -z "${path_udhcpc}"); then
84 AC_PATH_PROG(UDHCPC, [udhcpc], [], $PATH:/sbin:/usr/sbin)
86 UDHCPC="${path_udhcpc}"
90 AM_CONDITIONAL(UDHCP, test "${enable_udhcp}" = "yes")
92 AC_ARG_WITH(dhclient, AC_HELP_STRING([--with-dhclient=PROGRAM],
93 [specify location of dhclient binary]), [path_dhclient=${withval}])
95 AC_ARG_ENABLE(dhclient, AC_HELP_STRING([--enable-dhclient],
96 [enable dhclient support]), [enable_dhclient=${enableval}])
97 if (test "${enable_dhclient}" = "yes"); then
98 if (test -z "${path_dhclient}"); then
99 AC_PATH_PROG(DHCLIENT, [dhclient], [], $PATH:/sbin:/usr/sbin)
101 DHCLIENT="${path_dhclient}"
105 AM_CONDITIONAL(DHCLIENT, test "${enable_dhclient}" = "yes")
107 AC_ARG_WITH(resolvconf, AC_HELP_STRING([--with-resolvconf=PROGRAM],
108 [specify location of resolvconf binary]), [path_resolvconf=${withval}])
110 AC_ARG_ENABLE(resolvconf, AC_HELP_STRING([--enable-resolvconf],
111 [enable resolvconf support]), [enable_resolvconf=${enableval}])
112 if (test "${enable_resolvconf}" = "yes"); then
113 if (test -z "${path_resolvconf}"); then
114 AC_PATH_PROG(RESOLVCONF, [resolvconf], [], $PATH:/sbin:/usr/sbin)
116 RESOLVCONF="${path_resolvconf}"
120 AM_CONDITIONAL(RESOLVCONF, test "${enable_resolvconf}" != "no")
121 AM_CONDITIONAL(RESOLVCONF_BUILTIN, test "${enable_resolvconf}" = "builtin")
123 AC_ARG_ENABLE(dnsproxy, AC_HELP_STRING([--enable-dnsproxy],
124 [enable DNS proxy support]), [enable_dnsproxy=${enableval}])
125 AM_CONDITIONAL(DNSPROXY, test "${enable_dnsproxy}" != "no")
126 AM_CONDITIONAL(DNSPROXY_BUILTIN, test "${enable_dnsproxy}" = "builtin")
128 AC_ARG_ENABLE(novatel, AC_HELP_STRING([--enable-novatel],
129 [enable Novatel support]), [enable_novatel=${enableval}])
130 AM_CONDITIONAL(NOVATEL, test "${enable_novatel}" = "yes")
132 AC_ARG_ENABLE(huawei, AC_HELP_STRING([--enable-huawei],
133 [enable HUAWEI support]), [enable_huawei=${enableval}])
134 AM_CONDITIONAL(HUAWEI, test "${enable_huawei}" = "yes")
136 AC_ARG_ENABLE(hso, AC_HELP_STRING([--enable-hso],
137 [enable HSO support]), [enable_hso=${enableval}])
138 AM_CONDITIONAL(HSO, test "${enable_hso}" = "yes")
140 AC_ARG_WITH(pppd, AC_HELP_STRING([--with-pppd=PROGRAM],
141 [specify location of pppd binary]), [path_pppd=${withval}])
143 AC_ARG_ENABLE(ppp, AC_HELP_STRING([--enable-ppp],
144 [enable PPP support]), [enable_ppp=${enableval}])
145 if (test "${enable_ppp}" = "yes" || test "${enable_novatel}" = "yes" ||
146 test "${enable_huawei}" = "yes"); then
147 if (test -z "${path_pppd}"); then
148 AC_PATH_PROG(PPPD, [pppd], [], $PATH:/sbin:/usr/sbin)
153 AC_CHECK_HEADERS(pppd/pppd.h, enable_ppp=yes,
154 AC_MSG_ERROR(PPP development files are required))
156 AM_CONDITIONAL(PPPD, test "${enable_ppp}" = "yes")
158 AC_CHECK_HEADERS(sys/inotify.h, dummy=yes,
159 AC_MSG_ERROR(inotify header files are required))
161 AC_CHECK_LIB(c, inotify_init, dummy=yes,
162 AC_MSG_ERROR(inotify library support is required))
164 AC_CHECK_LIB(dl, dlopen, dummy=yes,
165 AC_MSG_ERROR(dynamic linking loader is required))
167 AC_ARG_ENABLE(udev, AC_HELP_STRING([--enable-udev],
168 [enable udev support]), [enable_udev=${enableval}])
169 if (test "${enable_udev}" = "yes"); then
170 AC_DEFINE(HAVE_UDEV, 1, [Define if udev support is available])
171 PKG_CHECK_MODULES(UDEV, libudev >= 129, enable_udev=yes,
172 AC_MSG_ERROR(udev >= 129 is required))
173 AC_CHECK_LIB(udev, udev_enumerate_add_match_property, dummy=yes,
174 AC_DEFINE(NEED_UDEV_ENUMERATE_ADD_MATCH_PROPERTY, 1,
175 [Define to 1 if you need the
176 udev_enumerate_add_match_property() function.]))
177 AC_CHECK_LIB(udev, udev_device_get_parent_with_subsystem_devtype, dummy=yes,
178 AC_DEFINE(NEED_UDEV_DEVICE_GET_PARENT_WITH_SUBSYSTEM_DEVTYPE, 1,
179 [Define to 1 if you need the
180 udev_device_get_parent_with_subsystem_devtype()
182 UDEV_DATADIR="`$PKG_CONFIG --variable=rulesdir libudev`"
183 if (test -z "${UDEV_DATADIR}"); then
184 UDEV_DATADIR="${sysconfdir}/udev/rules.d"
186 AC_SUBST(UDEV_DATADIR)
188 AC_SUBST(UDEV_CFLAGS)
190 AM_CONDITIONAL(UDEV, test "${enable_udev}" = "yes")
192 AC_ARG_ENABLE(iospm, AC_HELP_STRING([--enable-iospm],
193 [enable Intel OSPM support]), [enable_iospm=${enableval}])
194 AM_CONDITIONAL(IOSPM, test "${enable_iospm}" = "yes")
196 AC_ARG_ENABLE(iwmxsdk, AC_HELP_STRING([--enable-iwmxsdk],
197 [enable Intel WiMAX support]), [enable_iwmxsdk=${enableval}])
198 if (test "${enable_iwmxsdk}" = "yes"); then
200 PKG_CHECK_MODULES(IWMXSDK, libiWmxSdk-0, enable_iwmxsdk=yes,
201 AC_MSG_ERROR(Intel WiMAX SDK is required))
202 AC_SUBST(IWMXSDK_CFLAGS)
203 AC_SUBST(IWMXSDK_LIBS)
205 AM_CONDITIONAL(IWMXSDK, test "${enable_iwmxsdk}" = "yes")
207 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
208 AC_MSG_ERROR(GLib >= 2.16 is required))
209 AC_SUBST(GLIB_CFLAGS)
212 if (test "${enable_threads}" = "yes"); then
213 AC_DEFINE(NEED_THREADS, 1, [Define if threading support is required])
214 PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
215 AC_MSG_ERROR(GThread >= 2.16 is required))
216 GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
217 GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
220 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, dummy=yes,
221 AC_MSG_ERROR(D-Bus >= 1.0 is required))
222 AC_CHECK_LIB(dbus-1, dbus_watch_get_unix_fd, dummy=yes,
223 AC_DEFINE(NEED_DBUS_WATCH_GET_UNIX_FD, 1,
224 [Define to 1 if you need the dbus_watch_get_unix_fd() function.]))
225 AC_SUBST(DBUS_CFLAGS)
227 DBUS_DATADIR="`$PKG_CONFIG --variable=sysconfdir dbus-1`"
228 if (test -z "{DBUS_DATADIR}"); then
229 DBUS_DATADIR="${sysconfdir}/dbus-1/system.d"
231 DBUS_DATADIR="$DBUS_DATADIR/dbus-1/system.d"
233 AC_SUBST(DBUS_DATADIR)
235 AC_SUBST([GDBUS_CFLAGS], ['$(DBUS_CFLAGS) -I$(top_srcdir)/gdbus'])
236 AC_SUBST([GDBUS_LIBS], ['$(top_builddir)/gdbus/libgdbus.la $(DBUS_LIBS)'])
238 AC_ARG_ENABLE(polkit, AC_HELP_STRING([--enable-polkit],
239 [enable PolicyKit support]), [enable_polkit=${enableval}])
240 if (test "${enable_polkit}" = "yes"); then
241 PKG_CHECK_MODULES(POLKIT, polkit-dbus >= 0.7, enable_polkit=yes,
242 AC_MSG_ERROR(PolicyKit >= 0.7 is required))
243 AC_SUBST(POLKIT_CFLAGS)
244 AC_SUBST(POLKIT_LIBS)
245 POLKIT_DATADIR="`$PKG_CONFIG --variable=policydir polkit`"
246 if (test -z "${POLKIT_DATADIR}"); then
247 POLKIT_DATADIR="${datadir}/PolicyKit/policy"
249 AC_SUBST(POLKIT_DATADIR)
251 AM_CONDITIONAL(POLKIT, test "${enable_polkit}" = "yes")
253 AC_ARG_ENABLE(client, AC_HELP_STRING([--enable-client],
254 [enable command line client]), [enable_client=${enableval}])
255 AM_CONDITIONAL(CLIENT, test "${enable_client}" = "yes")
257 AC_ARG_ENABLE(tools, AC_HELP_STRING([--enable-tools],
258 [enable testing tools]), [enable_tools=${enableval}])
259 if (test "${enable_tools}" = "yes"); then
260 PKG_CHECK_MODULES(NETLINK, libnl-1, enable_netlink=yes,
261 AC_MSG_ERROR(Netlink library is required))
262 AC_SUBST(NETLINK_CFLAGS)
263 AC_SUBST(NETLINK_LIBS)
265 AM_CONDITIONAL(TOOLS, test "${enable_tools}" = "yes")
267 AC_ARG_ENABLE(fake, AC_HELP_STRING([--enable-fake],
268 [enable fake device support]), [enable_fake=${enableval}])
269 AM_CONDITIONAL(FAKE, test "${enable_fake}" = "yes")
271 AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles],
272 [don't install configuration and data files]),
273 [enable_datafiles=${enableval}])
274 AM_CONDITIONAL(DATAFILES, test "${enable_datafiles}" != "no")
278 AC_OUTPUT(Makefile gdbus/Makefile include/Makefile include/version.h
279 src/Makefile src/connman.service
280 scripts/connman scripts/Makefile
281 plugins/Makefile client/Makefile
282 tools/Makefile test/Makefile
283 doc/Makefile doc/version.xml connman.pc)