4 AM_INIT_AUTOMAKE(connman, 0.23)
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)
27 m4_define([_LT_AC_TAGCONFIG], [])
28 m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])])
35 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
36 [enable compiling with debugging information]), [
37 if (test "${enableval}" = "yes" &&
38 test "${ac_cv_prog_cc_g}" = "yes"); then
39 CFLAGS="$CFLAGS -g -O0"
43 AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie],
44 [enable position independent executables flag]), [
45 if (test "${enableval}" = "yes" &&
46 test "${ac_cv_prog_cc_pie}" = "yes"); then
47 CFLAGS="$CFLAGS -fPIE"
48 LDFLAGS="$LDFLAGS -pie"
52 AC_ARG_ENABLE(threads,
53 AC_HELP_STRING([--enable-threads], [enable threading support]),
54 [enable_threads=${enableval}], [enable_threads="no"])
56 AC_ARG_ENABLE(loopback,
57 AC_HELP_STRING([--enable-loopback], [enable loopback support]),
58 [enable_loopback=${enableval}], [enable_loopback="no"])
59 AM_CONDITIONAL(LOOPBACK, test "${enable_loopback}" != "no")
60 AM_CONDITIONAL(LOOPBACK_BUILTIN, test "${enable_loopback}" = "builtin")
62 AC_ARG_ENABLE(ethernet,
63 AC_HELP_STRING([--enable-ethernet], [enable Ethernet support]),
64 [enable_ethernet=${enableval}], [enable_ethernet="no"])
65 AM_CONDITIONAL(ETHERNET, test "${enable_ethernet}" != "no")
66 AM_CONDITIONAL(ETHERNET_BUILTIN, test "${enable_ethernet}" = "builtin")
69 AC_HELP_STRING([--enable-wifi], [enable WiFi support]),
70 [enable_wifi=${enableval}], [enable_wifi="no"])
71 if (test "${enable_wifi}" != "no"); then
72 AC_PATH_PROG(WPASUPPLICANT, [wpa_supplicant], [],
73 $PATH:/sbin:/usr/sbin)
75 AM_CONDITIONAL(WIFI, test "${enable_wifi}" != "no")
76 AM_CONDITIONAL(WIFI_BUILTIN, test "${enable_wifi}" = "builtin")
78 AC_ARG_ENABLE(bluetooth,
79 AC_HELP_STRING([--enable-bluetooth], [enable Bluetooth support]),
80 [enable_bluetooth=${enableval}], [enable_bluetooth="no"])
81 AM_CONDITIONAL(BLUETOOTH, test "${enable_bluetooth}" != "no")
82 AM_CONDITIONAL(BLUETOOTH_BUILTIN, test "${enable_bluetooth}" = "builtin")
85 AC_HELP_STRING([--enable-ofono], [enable oFono support]),
86 [enable_ofono=${enableval}], [enable_ofono="no"])
87 AM_CONDITIONAL(OFONO, test "${enable_ofono}" != "no")
88 AM_CONDITIONAL(OFONO_BUILTIN, test "${enable_ofono}" = "builtin")
90 AC_ARG_ENABLE(modemmgr,
91 AC_HELP_STRING([--enable-modemmgr], [enable Modem Manager support]),
92 [enable_modemmgr=${enableval}], [enable_modemmgr="no"])
93 AM_CONDITIONAL(MODEMMGR, test "${enable_modemmgr}" != "no")
94 AM_CONDITIONAL(MODEMMGR_BUILTIN, test "${enable_modemmgr}" = "builtin")
96 AC_ARG_WITH(udhcpc, AC_HELP_STRING([--with-udhcpc=PROGRAM],
97 [specify location of udhcpc binary]), [path_udhcpc=${withval}])
100 AC_HELP_STRING([--enable-udhcp], [enable uDHCP support]),
101 [enable_udhcp=${enableval}], [enable_udhcp="no"])
102 if (test "${enable_udhcp}" != "no"); then
103 if (test -z "${path_udhcpc}"); then
104 AC_PATH_PROG(UDHCPC, [udhcpc], [], $PATH:/sbin:/usr/sbin)
106 UDHCPC="${path_udhcpc}"
110 AM_CONDITIONAL(UDHCP, test "${enable_udhcp}" != "no")
111 AM_CONDITIONAL(UDHCP_BUILTIN, test "${enable_udhcp}" = "builtin")
113 AC_ARG_WITH(dhclient, AC_HELP_STRING([--with-dhclient=PROGRAM],
114 [specify location of dhclient binary]), [path_dhclient=${withval}])
116 AC_ARG_ENABLE(dhclient,
117 AC_HELP_STRING([--enable-dhclient], [enable dhclient support]),
118 [enable_dhclient=${enableval}], [enable_dhclient="no"])
119 if (test "${enable_dhclient}" != "no"); then
120 if (test -z "${path_dhclient}"); then
121 AC_PATH_PROG(DHCLIENT, [dhclient], [], $PATH:/sbin:/usr/sbin)
123 DHCLIENT="${path_dhclient}"
127 AM_CONDITIONAL(DHCLIENT, test "${enable_dhclient}" != "no")
128 AM_CONDITIONAL(DHCLIENT_BUILTIN, test "${enable_dhclient}" = "builtin")
130 AC_ARG_WITH(resolvconf, AC_HELP_STRING([--with-resolvconf=PROGRAM],
131 [specify location of resolvconf binary]), [path_resolvconf=${withval}])
133 AC_ARG_ENABLE(resolvconf,
134 AC_HELP_STRING([--enable-resolvconf], [enable resolvconf support]),
135 [enable_resolvconf=${enableval}], [enable_resolvconf="no"])
136 if (test "${enable_resolvconf}" != "no"); then
137 if (test -z "${path_resolvconf}"); then
138 AC_PATH_PROG(RESOLVCONF, [resolvconf], [], $PATH:/sbin:/usr/sbin)
140 RESOLVCONF="${path_resolvconf}"
144 AM_CONDITIONAL(RESOLVCONF, test "${enable_resolvconf}" != "no")
145 AM_CONDITIONAL(RESOLVCONF_BUILTIN, test "${enable_resolvconf}" = "builtin")
147 AC_ARG_ENABLE(dnsproxy,
148 AC_HELP_STRING([--enable-dnsproxy], [enable DNS proxy support]),
149 [enable_dnsproxy=${enableval}], [enable_dnsproxy="no"])
150 AM_CONDITIONAL(DNSPROXY, test "${enable_dnsproxy}" != "no")
151 AM_CONDITIONAL(DNSPROXY_BUILTIN, test "${enable_dnsproxy}" = "builtin")
153 AC_ARG_ENABLE(novatel, AC_HELP_STRING([--enable-novatel],
154 [enable Novatel support]), [enable_novatel=${enableval}])
155 AM_CONDITIONAL(NOVATEL, test "${enable_novatel}" = "yes")
157 AC_ARG_ENABLE(huawei, AC_HELP_STRING([--enable-huawei],
158 [enable HUAWEI support]), [enable_huawei=${enableval}])
159 AM_CONDITIONAL(HUAWEI, test "${enable_huawei}" = "yes")
162 AC_HELP_STRING([--enable-hso], [enable HSO support]),
163 [enable_hso=${enableval}], [enable_hso="no"])
164 AM_CONDITIONAL(HSO, test "${enable_hso}" != "no")
165 AM_CONDITIONAL(HSO_BUILTIN, test "${enable_hso}" = "builtin")
168 AC_HELP_STRING([--enable-mbm], [enable MBM support]),
169 [enable_mbm=${enableval}], [enable_mbm="no"])
170 AM_CONDITIONAL(MBM, test "${enable_mbm}" != "no")
171 AM_CONDITIONAL(MBM_BUILTIN, test "${enable_mbm}" = "builtin")
173 AC_ARG_WITH(pppd, AC_HELP_STRING([--with-pppd=PROGRAM],
174 [specify location of pppd binary]), [path_pppd=${withval}])
176 AC_ARG_ENABLE(ppp, AC_HELP_STRING([--enable-ppp],
177 [enable PPP support]), [enable_ppp=${enableval}])
178 if (test "${enable_ppp}" = "yes" || test "${enable_novatel}" = "yes" ||
179 test "${enable_huawei}" = "yes"); then
180 if (test -z "${path_pppd}"); then
181 AC_PATH_PROG(PPPD, [pppd], [], $PATH:/sbin:/usr/sbin)
186 AC_CHECK_HEADERS(pppd/pppd.h, enable_ppp=yes,
187 AC_MSG_ERROR(PPP development files are required))
189 AM_CONDITIONAL(PPPD, test "${enable_ppp}" = "yes")
191 AC_CHECK_HEADERS(sys/inotify.h, dummy=yes,
192 AC_MSG_ERROR(inotify header files are required))
194 AC_CHECK_LIB(c, inotify_init, dummy=yes,
195 AC_MSG_ERROR(inotify library 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 AM_CONDITIONAL(IWMX, test "${enable_iwmx}" = "yes")
217 AC_ARG_ENABLE(iospm, AC_HELP_STRING([--enable-iospm],
218 [enable Intel OSPM support]), [enable_iospm=${enableval}])
219 AM_CONDITIONAL(IOSPM, test "${enable_iospm}" = "yes")
221 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
222 AC_MSG_ERROR(GLib >= 2.16 is required))
223 AC_SUBST(GLIB_CFLAGS)
226 if (test "${enable_threads}" = "yes"); then
227 AC_DEFINE(NEED_THREADS, 1, [Define if threading support is required])
228 PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
229 AC_MSG_ERROR(GThread >= 2.16 is required))
230 GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
231 GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
234 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, dummy=yes,
235 AC_MSG_ERROR(D-Bus >= 1.0 is required))
236 AC_CHECK_LIB(dbus-1, dbus_watch_get_unix_fd, dummy=yes,
237 AC_DEFINE(NEED_DBUS_WATCH_GET_UNIX_FD, 1,
238 [Define to 1 if you need the dbus_watch_get_unix_fd() function.]))
239 AC_SUBST(DBUS_CFLAGS)
241 DBUS_DATADIR="`$PKG_CONFIG --variable=sysconfdir dbus-1`"
242 if (test -z "{DBUS_DATADIR}"); then
243 DBUS_DATADIR="${sysconfdir}/dbus-1/system.d"
245 DBUS_DATADIR="$DBUS_DATADIR/dbus-1/system.d"
247 AC_SUBST(DBUS_DATADIR)
249 AC_SUBST([GDBUS_CFLAGS], ['$(DBUS_CFLAGS) -I$(top_srcdir)/gdbus'])
250 AC_SUBST([GDBUS_LIBS], ['$(top_builddir)/gdbus/libgdbus.la $(DBUS_LIBS)'])
252 AC_SUBST([GATCHAT_CFLAGS], ['-I$(top_srcdir)/gatchat'])
253 AC_SUBST([GATCHAT_LIBS], ['$(top_builddir)/gatchat/libgatchat.la'])
255 AC_ARG_ENABLE(polkit,
256 AC_HELP_STRING([--enable-polkit], [enable PolicyKit support]),
257 [enable_polkit=${enableval}], [enable_polkit="no"])
258 if (test "${enable_polkit}" != "no"); then
259 PKG_CHECK_MODULES(POLKIT, polkit-dbus >= 0.7, dummy=yes,
260 AC_MSG_ERROR(PolicyKit >= 0.7 is required))
261 AC_SUBST(POLKIT_CFLAGS)
262 AC_SUBST(POLKIT_LIBS)
263 POLKIT_DATADIR="`$PKG_CONFIG --variable=policydir polkit`"
264 if (test -z "${POLKIT_DATADIR}"); then
265 POLKIT_DATADIR="${datadir}/PolicyKit/policy"
267 AC_SUBST(POLKIT_DATADIR)
269 AM_CONDITIONAL(POLKIT, test "${enable_polkit}" != "no")
270 AM_CONDITIONAL(POLKIT_BUILTIN, test "${enable_polkit}" = "builtin")
272 AC_ARG_ENABLE(client, AC_HELP_STRING([--enable-client],
273 [enable command line client]), [enable_client=${enableval}])
274 AM_CONDITIONAL(CLIENT, test "${enable_client}" = "yes")
276 AC_ARG_ENABLE(tools, AC_HELP_STRING([--enable-tools],
277 [enable testing tools]), [enable_tools=${enableval}])
278 if (test "${enable_tools}" = "yes"); then
279 PKG_CHECK_MODULES(NETLINK, libnl-1, dummy=yes,
280 AC_MSG_ERROR(Netlink library is required))
281 AC_SUBST(NETLINK_CFLAGS)
282 AC_SUBST(NETLINK_LIBS)
284 AM_CONDITIONAL(TOOLS, test "${enable_tools}" = "yes")
286 AC_ARG_ENABLE(fake, AC_HELP_STRING([--enable-fake],
287 [enable fake device support]), [enable_fake=${enableval}])
288 AM_CONDITIONAL(FAKE, test "${enable_fake}" = "yes")
290 AC_ARG_ENABLE(udev, AC_HELP_STRING([--disable-udev],
291 [don't use udev support even if available]),
292 [enable_udev=${enableval}])
293 if (test "${enable_udev}" != "no"); then
294 PKG_CHECK_MODULES(UDEV, libudev >= 141,
295 [enable_udev="yes"], [enable_udev="no"])
297 if (test "${enable_udev}" = "yes"); then
298 AC_CHECK_LIB(udev, udev_monitor_filter_update, dummy=yes,
299 AC_DEFINE(NEED_UDEV_MONITOR_FILTER, 1,
300 [Define to 1 if you need the
301 udev_monitor_filter...() functions.]))
302 UDEV_DATADIR="`$PKG_CONFIG --variable=udevdir udev`"
303 if (test -z "${UDEV_DATADIR}"); then
304 UDEV_DATADIR="${sysconfdir}/udev/rules.d"
306 UDEV_DATADIR="${UDEV_DATADIR}/rules.d"
308 AC_SUBST(UDEV_DATADIR)
310 AC_SUBST(UDEV_CFLAGS)
312 AM_CONDITIONAL(UDEV, test "${enable_udev}" = "yes")
314 AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles],
315 [don't install configuration and data files]),
316 [enable_datafiles=${enableval}])
317 AM_CONDITIONAL(DATAFILES, test "${enable_datafiles}" != "no")
319 AC_OUTPUT(Makefile gdbus/Makefile gatchat/Makefile
320 include/Makefile include/version.h
321 src/Makefile src/connman.service
322 scripts/connman scripts/Makefile
323 plugins/Makefile client/Makefile
324 tools/Makefile test/Makefile
325 doc/Makefile doc/version.xml connman.pc)