4 AM_INIT_AUTOMAKE(connman, 0.19)
5 AM_CONFIG_HEADER(config.h)
9 AC_PREFIX_DEFAULT(/usr/local)
20 m4_define([_LT_AC_TAGCONFIG], [])
21 m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])])
30 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
31 [enable compiling with debugging information]), [
32 if (test "${enableval}" = "yes" &&
33 test "${ac_cv_prog_cc_g}" = "yes"); then
34 CFLAGS="$CFLAGS -g -O0"
38 AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie],
39 [enable position independent executables flag]), [
40 if (test "${enableval}" = "yes" &&
41 test "${ac_cv_prog_cc_pie}" = "yes"); then
42 CFLAGS="$CFLAGS -fPIE"
43 LDFLAGS="$LDFLAGS -pie"
47 AC_ARG_ENABLE(threads,
48 AC_HELP_STRING([--enable-threads], [enable threading support]),
49 [enable_threads=${enableval}], [enable_threads="no"])
51 AC_ARG_ENABLE(loopback,
52 AC_HELP_STRING([--enable-loopback], [enable loopback support]),
53 [enable_loopback=${enableval}], [enable_loopback="no"])
54 AM_CONDITIONAL(LOOPBACK, test "${enable_loopback}" != "no")
55 AM_CONDITIONAL(LOOPBACK_BUILTIN, test "${enable_loopback}" = "builtin")
57 AC_ARG_ENABLE(ethernet,
58 AC_HELP_STRING([--enable-ethernet], [enable Ethernet support]),
59 [enable_ethernet=${enableval}], [enable_ethernet="no"])
60 AM_CONDITIONAL(ETHERNET, test "${enable_ethernet}" != "no")
61 AM_CONDITIONAL(ETHERNET_BUILTIN, test "${enable_ethernet}" = "builtin")
64 AC_HELP_STRING([--enable-wifi], [enable WiFi support]),
65 [enable_wifi=${enableval}], [enable_wifi="no"])
66 if (test "${enable_wifi}" != "no"); then
67 AC_PATH_PROG(WPASUPPLICANT, [wpa_supplicant], [],
68 $PATH:/sbin:/usr/sbin)
70 AM_CONDITIONAL(WIFI, test "${enable_wifi}" != "no")
71 AM_CONDITIONAL(WIFI_BUILTIN, test "${enable_wifi}" = "builtin")
73 AC_ARG_ENABLE(bluetooth,
74 AC_HELP_STRING([--enable-bluetooth], [enable Bluetooth support]),
75 [enable_bluetooth=${enableval}], [enable_bluetooth="no"])
76 AM_CONDITIONAL(BLUETOOTH, test "${enable_bluetooth}" != "no")
77 AM_CONDITIONAL(BLUETOOTH_BUILTIN, test "${enable_bluetooth}" = "builtin")
80 AC_HELP_STRING([--enable-ofono], [enable oFono support]),
81 [enable_ofono=${enableval}], [enable_ofono="no"])
82 AM_CONDITIONAL(OFONO, test "${enable_ofono}" != "no")
83 AM_CONDITIONAL(OFONO_BUILTIN, test "${enable_ofono}" = "builtin")
85 AC_ARG_ENABLE(modemmgr,
86 AC_HELP_STRING([--enable-modemmgr], [enable Modem Manager support]),
87 [enable_modemmgr=${enableval}], [enable_modemmgr="no"])
88 AM_CONDITIONAL(MODEMMGR, test "${enable_modemmgr}" = "yes")
90 AC_ARG_WITH(udhcpc, AC_HELP_STRING([--with-udhcpc=PROGRAM],
91 [specify location of udhcpc binary]), [path_udhcpc=${withval}])
94 AC_HELP_STRING([--enable-udhcp], [enable uDHCP support]),
95 [enable_udhcp=${enableval}], [enable_udhcp="no"])
96 if (test "${enable_udhcp}" != "no"); then
97 if (test -z "${path_udhcpc}"); then
98 AC_PATH_PROG(UDHCPC, [udhcpc], [], $PATH:/sbin:/usr/sbin)
100 UDHCPC="${path_udhcpc}"
104 AM_CONDITIONAL(UDHCP, test "${enable_udhcp}" != "no")
105 AM_CONDITIONAL(UDHCP_BUILTIN, test "${enable_udhcp}" = "builtin")
107 AC_ARG_WITH(dhclient, AC_HELP_STRING([--with-dhclient=PROGRAM],
108 [specify location of dhclient binary]), [path_dhclient=${withval}])
110 AC_ARG_ENABLE(dhclient,
111 AC_HELP_STRING([--enable-dhclient], [enable dhclient support]),
112 [enable_dhclient=${enableval}], [enable_dhclient="no"])
113 if (test "${enable_dhclient}" != "no"); then
114 if (test -z "${path_dhclient}"); then
115 AC_PATH_PROG(DHCLIENT, [dhclient], [], $PATH:/sbin:/usr/sbin)
117 DHCLIENT="${path_dhclient}"
121 AM_CONDITIONAL(DHCLIENT, test "${enable_dhclient}" != "no")
122 AM_CONDITIONAL(DHCLIENT_BUILTIN, test "${enable_dhclient}" = "builtin")
124 AC_ARG_WITH(resolvconf, AC_HELP_STRING([--with-resolvconf=PROGRAM],
125 [specify location of resolvconf binary]), [path_resolvconf=${withval}])
127 AC_ARG_ENABLE(resolvconf,
128 AC_HELP_STRING([--enable-resolvconf], [enable resolvconf support]),
129 [enable_resolvconf=${enableval}], [enable_resolvconf="no"])
130 if (test "${enable_resolvconf}" != "no"); then
131 if (test -z "${path_resolvconf}"); then
132 AC_PATH_PROG(RESOLVCONF, [resolvconf], [], $PATH:/sbin:/usr/sbin)
134 RESOLVCONF="${path_resolvconf}"
138 AM_CONDITIONAL(RESOLVCONF, test "${enable_resolvconf}" != "no")
139 AM_CONDITIONAL(RESOLVCONF_BUILTIN, test "${enable_resolvconf}" = "builtin")
141 AC_ARG_ENABLE(dnsproxy,
142 AC_HELP_STRING([--enable-dnsproxy], [enable DNS proxy support]),
143 [enable_dnsproxy=${enableval}], [enable_dnsproxy="no"])
144 AM_CONDITIONAL(DNSPROXY, test "${enable_dnsproxy}" != "no")
145 AM_CONDITIONAL(DNSPROXY_BUILTIN, test "${enable_dnsproxy}" = "builtin")
147 AC_ARG_ENABLE(novatel, AC_HELP_STRING([--enable-novatel],
148 [enable Novatel support]), [enable_novatel=${enableval}])
149 AM_CONDITIONAL(NOVATEL, test "${enable_novatel}" = "yes")
151 AC_ARG_ENABLE(huawei, AC_HELP_STRING([--enable-huawei],
152 [enable HUAWEI support]), [enable_huawei=${enableval}])
153 AM_CONDITIONAL(HUAWEI, test "${enable_huawei}" = "yes")
155 AC_ARG_ENABLE(hso, AC_HELP_STRING([--enable-hso],
156 [enable HSO support]), [enable_hso=${enableval}])
157 AM_CONDITIONAL(HSO, test "${enable_hso}" = "yes")
159 AC_ARG_WITH(pppd, AC_HELP_STRING([--with-pppd=PROGRAM],
160 [specify location of pppd binary]), [path_pppd=${withval}])
162 AC_ARG_ENABLE(ppp, AC_HELP_STRING([--enable-ppp],
163 [enable PPP support]), [enable_ppp=${enableval}])
164 if (test "${enable_ppp}" = "yes" || test "${enable_novatel}" = "yes" ||
165 test "${enable_huawei}" = "yes"); then
166 if (test -z "${path_pppd}"); then
167 AC_PATH_PROG(PPPD, [pppd], [], $PATH:/sbin:/usr/sbin)
172 AC_CHECK_HEADERS(pppd/pppd.h, enable_ppp=yes,
173 AC_MSG_ERROR(PPP development files are required))
175 AM_CONDITIONAL(PPPD, test "${enable_ppp}" = "yes")
177 AC_CHECK_HEADERS(sys/inotify.h, dummy=yes,
178 AC_MSG_ERROR(inotify header files are required))
180 AC_CHECK_LIB(c, inotify_init, dummy=yes,
181 AC_MSG_ERROR(inotify library support is required))
183 AC_CHECK_LIB(dl, dlopen, dummy=yes,
184 AC_MSG_ERROR(dynamic linking loader is required))
186 AC_ARG_ENABLE(udev, AC_HELP_STRING([--enable-udev],
187 [enable udev support]), [enable_udev=${enableval}])
188 if (test "${enable_udev}" = "yes"); then
189 AC_DEFINE(HAVE_UDEV, 1, [Define if udev support is available])
190 PKG_CHECK_MODULES(UDEV, libudev >= 129, enable_udev=yes,
191 AC_MSG_ERROR(udev >= 129 is required))
192 AC_CHECK_LIB(udev, udev_enumerate_add_match_property, dummy=yes,
193 AC_DEFINE(NEED_UDEV_ENUMERATE_ADD_MATCH_PROPERTY, 1,
194 [Define to 1 if you need the
195 udev_enumerate_add_match_property() function.]))
196 AC_CHECK_LIB(udev, udev_device_get_parent_with_subsystem_devtype, dummy=yes,
197 AC_DEFINE(NEED_UDEV_DEVICE_GET_PARENT_WITH_SUBSYSTEM_DEVTYPE, 1,
198 [Define to 1 if you need the
199 udev_device_get_parent_with_subsystem_devtype()
201 UDEV_DATADIR="`$PKG_CONFIG --variable=rulesdir libudev`"
202 if (test -z "${UDEV_DATADIR}"); then
203 UDEV_DATADIR="${sysconfdir}/udev/rules.d"
205 AC_SUBST(UDEV_DATADIR)
207 AC_SUBST(UDEV_CFLAGS)
209 AM_CONDITIONAL(UDEV, test "${enable_udev}" = "yes")
211 AC_ARG_ENABLE(iospm, AC_HELP_STRING([--enable-iospm],
212 [enable Intel OSPM support]), [enable_iospm=${enableval}])
213 AM_CONDITIONAL(IOSPM, test "${enable_iospm}" = "yes")
215 AC_ARG_ENABLE(iwmxsdk, AC_HELP_STRING([--enable-iwmxsdk],
216 [enable Intel WiMAX support]), [enable_iwmxsdk=${enableval}])
217 if (test "${enable_iwmxsdk}" = "yes"); then
219 PKG_CHECK_MODULES(IWMXSDK, libiWmxSdk-0, enable_iwmxsdk=yes,
220 AC_MSG_ERROR(Intel WiMAX SDK is required))
221 AC_SUBST(IWMXSDK_CFLAGS)
222 AC_SUBST(IWMXSDK_LIBS)
224 AM_CONDITIONAL(IWMXSDK, test "${enable_iwmxsdk}" = "yes")
226 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
227 AC_MSG_ERROR(GLib >= 2.16 is required))
228 AC_SUBST(GLIB_CFLAGS)
231 if (test "${enable_threads}" = "yes"); then
232 AC_DEFINE(NEED_THREADS, 1, [Define if threading support is required])
233 PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
234 AC_MSG_ERROR(GThread >= 2.16 is required))
235 GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
236 GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
239 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, dummy=yes,
240 AC_MSG_ERROR(D-Bus >= 1.0 is required))
241 AC_CHECK_LIB(dbus-1, dbus_watch_get_unix_fd, dummy=yes,
242 AC_DEFINE(NEED_DBUS_WATCH_GET_UNIX_FD, 1,
243 [Define to 1 if you need the dbus_watch_get_unix_fd() function.]))
244 AC_SUBST(DBUS_CFLAGS)
246 DBUS_DATADIR="`$PKG_CONFIG --variable=sysconfdir dbus-1`"
247 if (test -z "{DBUS_DATADIR}"); then
248 DBUS_DATADIR="${sysconfdir}/dbus-1/system.d"
250 DBUS_DATADIR="$DBUS_DATADIR/dbus-1/system.d"
252 AC_SUBST(DBUS_DATADIR)
254 AC_SUBST([GDBUS_CFLAGS], ['$(DBUS_CFLAGS) -I$(top_srcdir)/gdbus'])
255 AC_SUBST([GDBUS_LIBS], ['$(top_builddir)/gdbus/libgdbus.la $(DBUS_LIBS)'])
257 AC_SUBST([GATCHAT_CFLAGS], ['-I$(top_srcdir)/gatchat'])
258 AC_SUBST([GATCHAT_LIBS], ['$(top_builddir)/gatchat/libgatchat.la'])
260 AC_ARG_ENABLE(polkit, AC_HELP_STRING([--enable-polkit],
261 [enable PolicyKit support]), [enable_polkit=${enableval}])
262 if (test "${enable_polkit}" = "yes"); then
263 PKG_CHECK_MODULES(POLKIT, polkit-dbus >= 0.7, enable_polkit=yes,
264 AC_MSG_ERROR(PolicyKit >= 0.7 is required))
265 AC_SUBST(POLKIT_CFLAGS)
266 AC_SUBST(POLKIT_LIBS)
267 POLKIT_DATADIR="`$PKG_CONFIG --variable=policydir polkit`"
268 if (test -z "${POLKIT_DATADIR}"); then
269 POLKIT_DATADIR="${datadir}/PolicyKit/policy"
271 AC_SUBST(POLKIT_DATADIR)
273 AM_CONDITIONAL(POLKIT, test "${enable_polkit}" = "yes")
275 AC_ARG_ENABLE(client, AC_HELP_STRING([--enable-client],
276 [enable command line client]), [enable_client=${enableval}])
277 AM_CONDITIONAL(CLIENT, test "${enable_client}" = "yes")
279 AC_ARG_ENABLE(tools, AC_HELP_STRING([--enable-tools],
280 [enable testing tools]), [enable_tools=${enableval}])
281 if (test "${enable_tools}" = "yes"); then
282 PKG_CHECK_MODULES(NETLINK, libnl-1, enable_netlink=yes,
283 AC_MSG_ERROR(Netlink library is required))
284 AC_SUBST(NETLINK_CFLAGS)
285 AC_SUBST(NETLINK_LIBS)
287 AM_CONDITIONAL(TOOLS, test "${enable_tools}" = "yes")
289 AC_ARG_ENABLE(fake, AC_HELP_STRING([--enable-fake],
290 [enable fake device support]), [enable_fake=${enableval}])
291 AM_CONDITIONAL(FAKE, test "${enable_fake}" = "yes")
293 AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles],
294 [don't install configuration and data files]),
295 [enable_datafiles=${enableval}])
296 AM_CONDITIONAL(DATAFILES, test "${enable_datafiles}" != "no")
300 AC_OUTPUT(Makefile gdbus/Makefile gatchat/Makefile
301 include/Makefile include/version.h
302 src/Makefile src/connman.service
303 scripts/connman scripts/Makefile
304 plugins/Makefile client/Makefile
305 tools/Makefile test/Makefile
306 doc/Makefile doc/version.xml connman.pc)