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}" = "yes")
53 AC_ARG_ENABLE(ethernet, AC_HELP_STRING([--enable-ethernet],
54 [enable Ethernet support]), [enable_ethernet=${enableval}])
55 AM_CONDITIONAL(ETHERNET, test "${enable_ethernet}" = "yes")
57 AC_ARG_ENABLE(wifi, AC_HELP_STRING([--enable-wifi],
58 [enable WiFi support]), [enable_wifi=${enableval}])
59 if (test "${enable_wifi}" = "yes"); then
60 AC_PATH_PROG(WPASUPPLICANT, [wpa_supplicant], [],
61 $PATH:/sbin:/usr/sbin)
63 AM_CONDITIONAL(WIFI, test "${enable_wifi}" = "yes")
65 AC_ARG_ENABLE(bluetooth, AC_HELP_STRING([--enable-bluetooth],
66 [enable Bluetooth support]), [enable_bluetooth=${enableval}])
67 AM_CONDITIONAL(BLUETOOTH, test "${enable_bluetooth}" = "yes")
69 AC_ARG_ENABLE(modemmgr, AC_HELP_STRING([--enable-modemmgr],
70 [enable Modem Manager support]), [enable_modemmgr=${enableval}])
71 AM_CONDITIONAL(MODEMMGR, test "${enable_modemmgr}" = "yes")
73 AC_ARG_WITH(udhcpc, AC_HELP_STRING([--with-udhcpc=PROGRAM],
74 [specify location of udhcpc binary]), [path_udhcpc=${withval}])
76 AC_ARG_ENABLE(udhcp, AC_HELP_STRING([--enable-udhcp],
77 [enable uDHCP support]), [enable_udhcp=${enableval}])
78 if (test "${enable_udhcp}" = "yes"); then
79 if (test -z "${path_udhcpc}"); then
80 AC_PATH_PROG(UDHCPC, [udhcpc], [], $PATH:/sbin:/usr/sbin)
82 UDHCPC="${path_udhcpc}"
86 AM_CONDITIONAL(UDHCP, test "${enable_udhcp}" = "yes")
88 AC_ARG_WITH(dhclient, AC_HELP_STRING([--with-dhclient=PROGRAM],
89 [specify location of dhclient binary]), [path_dhclient=${withval}])
91 AC_ARG_ENABLE(dhclient, AC_HELP_STRING([--enable-dhclient],
92 [enable dhclient support]), [enable_dhclient=${enableval}])
93 if (test "${enable_dhclient}" = "yes"); then
94 if (test -z "${path_dhclient}"); then
95 AC_PATH_PROG(DHCLIENT, [dhclient], [], $PATH:/sbin:/usr/sbin)
97 DHCLIENT="${path_dhclient}"
101 AM_CONDITIONAL(DHCLIENT, test "${enable_dhclient}" = "yes")
103 AC_ARG_WITH(resolvconf, AC_HELP_STRING([--with-resolvconf=PROGRAM],
104 [specify location of resolvconf binary]), [path_resolvconf=${withval}])
106 AC_ARG_ENABLE(resolvconf, AC_HELP_STRING([--enable-resolvconf],
107 [enable resolvconf support]), [enable_resolvconf=${enableval}])
108 if (test "${enable_resolvconf}" = "yes"); then
109 if (test -z "${path_resolvconf}"); then
110 AC_PATH_PROG(RESOLVCONF, [resolvconf], [], $PATH:/sbin:/usr/sbin)
112 RESOLVCONF="${path_resolvconf}"
116 AM_CONDITIONAL(RESOLVCONF, test "${enable_resolvconf}" = "yes")
118 AC_ARG_ENABLE(dnsproxy, AC_HELP_STRING([--enable-dnsproxy],
119 [enable DNS proxy support]), [enable_dnsproxy=${enableval}])
120 AM_CONDITIONAL(DNSPROXY, test "${enable_dnsproxy}" = "yes")
122 AC_ARG_ENABLE(novatel, AC_HELP_STRING([--enable-novatel],
123 [enable Novatel support]), [enable_novatel=${enableval}])
124 AM_CONDITIONAL(NOVATEL, test "${enable_novatel}" = "yes")
126 AC_ARG_ENABLE(huawei, AC_HELP_STRING([--enable-huawei],
127 [enable HUAWEI support]), [enable_huawei=${enableval}])
128 AM_CONDITIONAL(HUAWEI, test "${enable_huawei}" = "yes")
130 AC_ARG_ENABLE(hso, AC_HELP_STRING([--enable-hso],
131 [enable HSO support]), [enable_hso=${enableval}])
132 AM_CONDITIONAL(HSO, test "${enable_hso}" = "yes")
134 AC_ARG_WITH(pppd, AC_HELP_STRING([--with-pppd=PROGRAM],
135 [specify location of pppd binary]), [path_pppd=${withval}])
137 AC_ARG_ENABLE(ppp, AC_HELP_STRING([--enable-ppp],
138 [enable PPP support]), [enable_ppp=${enableval}])
139 if (test "${enable_ppp}" = "yes" || test "${enable_novatel}" = "yes" ||
140 test "${enable_huawei}" = "yes"); then
141 if (test -z "${path_pppd}"); then
142 AC_PATH_PROG(PPPD, [pppd], [], $PATH:/sbin:/usr/sbin)
147 AC_CHECK_HEADERS(pppd/pppd.h, enable_ppp=yes,
148 AC_MSG_ERROR(PPP development files are required))
150 AM_CONDITIONAL(PPPD, test "${enable_ppp}" = "yes")
152 AC_CHECK_HEADERS(sys/inotify.h, dummy=yes,
153 AC_MSG_ERROR(inotify header files are required))
155 AC_CHECK_LIB(c, inotify_init, dummy=yes,
156 AC_MSG_ERROR(inotify library support is required))
158 AC_CHECK_LIB(dl, dlopen, dummy=yes,
159 AC_MSG_ERROR(dynamic linking loader is required))
161 AC_ARG_ENABLE(udev, AC_HELP_STRING([--enable-udev],
162 [enable udev support]), [enable_udev=${enableval}])
163 if (test "${enable_udev}" = "yes"); then
164 AC_DEFINE(HAVE_UDEV, 1, [Define if udev support is available])
165 PKG_CHECK_MODULES(UDEV, libudev >= 129, enable_udev=yes,
166 AC_MSG_ERROR(udev >= 129 is required))
167 AC_CHECK_LIB(udev, udev_enumerate_add_match_property, dummy=yes,
168 AC_DEFINE(NEED_UDEV_ENUMERATE_ADD_MATCH_PROPERTY, 1,
169 [Define to 1 if you need the
170 udev_enumerate_add_match_property() function.]))
171 AC_CHECK_LIB(udev, udev_device_get_parent_with_subsystem_devtype, dummy=yes,
172 AC_DEFINE(NEED_UDEV_DEVICE_GET_PARENT_WITH_SUBSYSTEM_DEVTYPE, 1,
173 [Define to 1 if you need the
174 udev_device_get_parent_with_subsystem_devtype()
176 UDEV_DATADIR="`$PKG_CONFIG --variable=rulesdir libudev`"
177 if (test -z "${UDEV_DATADIR}"); then
178 UDEV_DATADIR="${sysconfdir}/udev/rules.d"
180 AC_SUBST(UDEV_DATADIR)
182 AC_SUBST(UDEV_CFLAGS)
184 AM_CONDITIONAL(UDEV, test "${enable_udev}" = "yes")
186 AC_ARG_ENABLE(iospm, AC_HELP_STRING([--enable-iospm],
187 [enable Intel OSPM support]), [enable_iospm=${enableval}])
188 AM_CONDITIONAL(IOSPM, test "${enable_iospm}" = "yes")
190 AC_ARG_ENABLE(iwmxsdk, AC_HELP_STRING([--enable-iwmxsdk],
191 [enable Intel WiMAX support]), [enable_iwmxsdk=${enableval}])
192 if (test "${enable_iwmxsdk}" = "yes"); then
194 PKG_CHECK_MODULES(IWMXSDK, libiWmxSdk-0, enable_iwmxsdk=yes,
195 AC_MSG_ERROR(Intel WiMAX SDK is required))
196 AC_SUBST(IWMXSDK_CFLAGS)
197 AC_SUBST(IWMXSDK_LIBS)
199 AM_CONDITIONAL(IWMXSDK, test "${enable_iwmxsdk}" = "yes")
201 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
202 AC_MSG_ERROR(GLib >= 2.16 is required))
203 AC_SUBST(GLIB_CFLAGS)
206 if (test "${enable_threads}" = "yes"); then
207 AC_DEFINE(NEED_THREADS, 1, [Define if threading support is required])
208 PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
209 AC_MSG_ERROR(GThread >= 2.16 is required))
210 GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
211 GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
214 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, dummy=yes,
215 AC_MSG_ERROR(D-Bus >= 1.0 is required))
216 AC_CHECK_LIB(dbus-1, dbus_watch_get_unix_fd, dummy=yes,
217 AC_DEFINE(NEED_DBUS_WATCH_GET_UNIX_FD, 1,
218 [Define to 1 if you need the dbus_watch_get_unix_fd() function.]))
219 AC_SUBST(DBUS_CFLAGS)
221 DBUS_DATADIR="`$PKG_CONFIG --variable=sysconfdir dbus-1`"
222 if (test -z "{DBUS_DATADIR}"); then
223 DBUS_DATADIR="${sysconfdir}/dbus-1/system.d"
225 DBUS_DATADIR="$DBUS_DATADIR/dbus-1/system.d"
227 AC_SUBST(DBUS_DATADIR)
229 AC_SUBST([GDBUS_CFLAGS], ['$(DBUS_CFLAGS) -I$(top_srcdir)/gdbus'])
230 AC_SUBST([GDBUS_LIBS], ['$(top_builddir)/gdbus/libgdbus.la $(DBUS_LIBS)'])
232 AC_ARG_ENABLE(polkit, AC_HELP_STRING([--enable-polkit],
233 [enable PolicyKit support]), [enable_polkit=${enableval}])
234 if (test "${enable_polkit}" = "yes"); then
235 PKG_CHECK_MODULES(POLKIT, polkit-dbus >= 0.7, enable_polkit=yes,
236 AC_MSG_ERROR(PolicyKit >= 0.7 is required))
237 AC_SUBST(POLKIT_CFLAGS)
238 AC_SUBST(POLKIT_LIBS)
239 POLKIT_DATADIR="`$PKG_CONFIG --variable=policydir polkit`"
240 if (test -z "${POLKIT_DATADIR}"); then
241 POLKIT_DATADIR="${datadir}/PolicyKit/policy"
243 AC_SUBST(POLKIT_DATADIR)
245 AM_CONDITIONAL(POLKIT, test "${enable_polkit}" = "yes")
247 AC_ARG_ENABLE(client, AC_HELP_STRING([--enable-client],
248 [enable command line client]), [enable_client=${enableval}])
249 AM_CONDITIONAL(CLIENT, test "${enable_client}" = "yes")
251 AC_ARG_ENABLE(tools, AC_HELP_STRING([--enable-tools],
252 [enable testing tools]), [enable_tools=${enableval}])
253 if (test "${enable_tools}" = "yes"); then
254 PKG_CHECK_MODULES(NETLINK, libnl-1, enable_netlink=yes,
255 AC_MSG_ERROR(Netlink library is required))
256 AC_SUBST(NETLINK_CFLAGS)
257 AC_SUBST(NETLINK_LIBS)
259 AM_CONDITIONAL(TOOLS, test "${enable_tools}" = "yes")
261 AC_ARG_ENABLE(fake, AC_HELP_STRING([--enable-fake],
262 [enable fake device support]), [enable_fake=${enableval}])
263 AM_CONDITIONAL(FAKE, test "${enable_fake}" = "yes")
265 AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles],
266 [don't install configuration and data files]),
267 [enable_datafiles=${enableval}])
268 AM_CONDITIONAL(DATAFILES, test "${enable_datafiles}" != "no")
272 AC_OUTPUT(Makefile gdbus/Makefile include/Makefile include/version.h
273 src/Makefile src/connman.service
274 scripts/connman scripts/Makefile
275 plugins/Makefile client/Makefile
276 tools/Makefile test/Makefile
277 doc/Makefile doc/version.xml connman.pc)