4 AM_INIT_AUTOMAKE(connman, 0.9)
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([])])
27 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
28 [enable compiling with debugging information]), [
29 if (test "${enableval}" = "yes" &&
30 test "${ac_cv_prog_cc_g}" = "yes"); then
31 CFLAGS="$CFLAGS -g -O0"
35 AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie],
36 [enable position independent executables flag]), [
37 if (test "${enableval}" = "yes" &&
38 test "${ac_cv_prog_cc_pie}" = "yes"); then
39 CFLAGS="$CFLAGS -fPIE"
40 LDFLAGS="$LDFLAGS -pie"
44 AC_ARG_ENABLE(threads, AC_HELP_STRING([--enable-threads],
45 [enable threading support]), [enable_threads=${enableval}])
47 AC_ARG_ENABLE(loopback, AC_HELP_STRING([--enable-loopback],
48 [enable loopback support]), [enable_loopback=${enableval}])
49 AM_CONDITIONAL(LOOPBACK, test "${enable_loopback}" = "yes")
51 AC_ARG_ENABLE(ethernet, AC_HELP_STRING([--enable-ethernet],
52 [enable Ethernet support]), [enable_ethernet=${enableval}])
53 AM_CONDITIONAL(ETHERNET, test "${enable_ethernet}" = "yes")
55 AC_ARG_ENABLE(wifi, AC_HELP_STRING([--enable-wifi],
56 [enable WiFi support]), [enable_wifi=${enableval}])
57 if (test "${enable_wifi}" = "yes"); then
58 AC_PATH_PROG(WPASUPPLICANT, [wpa_supplicant], [],
59 $PATH:/sbin:/usr/sbin)
61 AM_CONDITIONAL(WIFI, test "${enable_wifi}" = "yes")
63 AC_ARG_ENABLE(wimax, AC_HELP_STRING([--enable-wimax],
64 [enable WiMAX support]), [enable_wimax=${enableval}])
65 AM_CONDITIONAL(WIMAX, test "${enable_wimax}" = "yes")
67 AC_ARG_ENABLE(bluetooth, AC_HELP_STRING([--enable-bluetooth],
68 [enable Bluetooth support]), [enable_bluetooth=${enableval}])
69 AM_CONDITIONAL(BLUETOOTH, test "${enable_bluetooth}" = "yes")
71 AC_ARG_WITH(udhcpc, AC_HELP_STRING([--with-udhcpc=PROGRAM],
72 [specify location of udhcpc binary]), [path_udhcpc=${withval}])
74 AC_ARG_ENABLE(udhcp, AC_HELP_STRING([--enable-udhcp],
75 [enable uDHCP support]), [enable_udhcp=${enableval}])
76 if (test "${enable_udhcp}" = "yes"); then
77 if (test -z "${path_udhcpc}"); then
78 AC_PATH_PROG(UDHCPC, [udhcpc], [], $PATH:/sbin:/usr/sbin)
80 UDHCPC="${path_udhcpc}"
84 AM_CONDITIONAL(UDHCP, test "${enable_udhcp}" = "yes")
86 AC_ARG_WITH(dhclient, AC_HELP_STRING([--with-dhclient=PROGRAM],
87 [specify location of dhclient binary]), [path_dhclient=${withval}])
89 AC_ARG_ENABLE(dhclient, AC_HELP_STRING([--enable-dhclient],
90 [enable dhclient support]), [enable_dhclient=${enableval}])
91 if (test "${enable_dhclient}" = "yes"); then
92 if (test -z "${path_dhclient}"); then
93 AC_PATH_PROG(DHCLIENT, [dhclient], [], $PATH:/sbin:/usr/sbin)
95 UDHCPC="${path_dhclient}"
99 AM_CONDITIONAL(DHCLIENT, test "${enable_dhclient}" = "yes")
101 AC_ARG_WITH(resolvconf, AC_HELP_STRING([--with-resolvconf=PROGRAM],
102 [specify location of resolvconf binary]), [path_resolvconf=${withval}])
104 AC_ARG_ENABLE(resolvconf, AC_HELP_STRING([--enable-resolvconf],
105 [enable resolvconf support]), [enable_resolvconf=${enableval}])
106 if (test "${enable_resolvconf}" = "yes"); then
107 if (test -z "${path_resolvconf}"); then
108 AC_PATH_PROG(RESOLVCONF, [resolvconf], [], $PATH:/sbin:/usr/sbin)
110 UDHCPC="${path_resolvconf}"
114 AM_CONDITIONAL(RESOLVCONF, test "${enable_resolvconf}" = "yes")
116 AC_ARG_ENABLE(dnsproxy, AC_HELP_STRING([--enable-dnsproxy],
117 [enable DNS proxy support]), [enable_dnsproxy=${enableval}])
118 AM_CONDITIONAL(DNSPROXY, test "${enable_dnsproxy}" = "yes")
120 AC_ARG_ENABLE(novatel, AC_HELP_STRING([--enable-novatel],
121 [enable Novatel support]), [enable_novatel=${enableval}])
122 AM_CONDITIONAL(NOVATEL, test "${enable_novatel}" = "yes")
124 AC_ARG_ENABLE(huawei, AC_HELP_STRING([--enable-huawei],
125 [enable HUAWEI support]), [enable_huawei=${enableval}])
126 AM_CONDITIONAL(HUAWEI, test "${enable_huawei}" = "yes")
128 AC_ARG_ENABLE(hso, AC_HELP_STRING([--enable-hso],
129 [enable HSO support]), [enable_hso=${enableval}])
130 AM_CONDITIONAL(HSO, test "${enable_hso}" = "yes")
132 AC_ARG_WITH(pppd, AC_HELP_STRING([--with-pppd=PROGRAM],
133 [specify location of pppd binary]), [path_pppd=${withval}])
135 AC_ARG_ENABLE(ppp, AC_HELP_STRING([--enable-ppp],
136 [enable PPP support]), [enable_ppp=${enableval}])
137 if (test "${enable_ppp}" = "yes" || test "${enable_novatel}" = "yes" ||
138 test "${enable_huawei}" = "yes"); then
139 if (test -z "${path_pppd}"); then
140 AC_PATH_PROG(PPPD, [pppd], [], $PATH:/sbin:/usr/sbin)
145 AC_CHECK_HEADERS(pppd/pppd.h, enable_ppp=yes,
146 AC_MSG_ERROR(PPP development files are required))
148 AM_CONDITIONAL(PPPD, test "${enable_ppp}" = "yes")
150 AC_CHECK_LIB(dl, dlopen, dummy=yes,
151 AC_MSG_ERROR(dynamic linking loader is required))
153 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
154 AC_MSG_ERROR(GLib >= 2.16 is required))
155 AC_SUBST(GLIB_CFLAGS)
158 if (test "${enable_threads}" = "yes"); then
159 AC_DEFINE(NEED_THREADS, 1, [Define if threading support is required])
160 PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
161 AC_MSG_ERROR(GThread >= 2.16 is required))
162 GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
163 GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
166 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, dummy=yes,
167 AC_MSG_ERROR(D-Bus >= 1.0 is required))
168 AC_SUBST(DBUS_CFLAGS)
170 DBUS_DATADIR="`$PKG_CONFIG --variable=sysconfdir dbus-1`"
171 if (test -z "{DBUS_DATADIR}"); then
172 DBUS_DATADIR="${sysconfdir}/dbus-1/system.d"
174 DBUS_DATADIR="$DBUS_DATADIR/dbus-1/system.d"
176 AC_SUBST(DBUS_DATADIR)
178 AC_SUBST([GDBUS_CFLAGS], ['$(DBUS_CFLAGS) -I$(top_srcdir)/gdbus'])
179 AC_SUBST([GDBUS_LIBS], ['$(top_builddir)/gdbus/libgdbus.la $(DBUS_LIBS)'])
181 AC_ARG_ENABLE(udev, AC_HELP_STRING([--enable-udev],
182 [enable udev support]), [enable_udev=${enableval}])
183 if (test "${enable_udev}" = "yes"); then
184 AC_DEFINE(HAVE_UDEV, 1, [Define if udev support is available])
185 PKG_CHECK_MODULES(UDEV, libudev >= 129, enable_udev=yes,
186 AC_MSG_ERROR(udev >= 129 is required))
187 AC_CHECK_LIB(udev, udev_enumerate_add_match_property, dummy=yes,
188 AC_DEFINE(NEED_UDEV_ENUMERATE_ADD_MATCH_PROPERTY, 1,
189 [Define to 1 if you need the
190 udev_enumerate_add_match_property() function.]))
191 AC_CHECK_LIB(udev, udev_device_get_parent_with_subsystem_devtype, dummy=yes,
192 AC_DEFINE(NEED_UDEV_DEVICE_GET_PARENT_WITH_SUBSYSTEM_DEVTYPE, 1,
193 [Define to 1 if you need the
194 udev_device_get_parent_with_subsystem_devtype()
196 UDEV_DATADIR="`$PKG_CONFIG --variable=rulesdir libudev`"
197 if (test -z "${UDEV_DATADIR}"); then
198 UDEV_DATADIR="${sysconfdir}/udev/rules.d"
200 AC_SUBST(UDEV_DATADIR)
202 AC_SUBST(UDEV_CFLAGS)
204 AM_CONDITIONAL(UDEV, test "${enable_udev}" = "yes")
206 AC_ARG_ENABLE(polkit, AC_HELP_STRING([--enable-polkit],
207 [enable PolicyKit support]), [enable_polkit=${enableval}])
208 if (test "${enable_polkit}" = "yes"); then
209 PKG_CHECK_MODULES(POLKIT, polkit-dbus >= 0.7, enable_polkit=yes,
210 AC_MSG_ERROR(PolicyKit >= 0.7 is required))
211 AC_SUBST(POLKIT_CFLAGS)
212 AC_SUBST(POLKIT_LIBS)
213 POLKIT_DATADIR="`$PKG_CONFIG --variable=policydir polkit`"
214 if (test -z "${POLKIT_DATADIR}"); then
215 POLKIT_DATADIR="${datadir}/PolicyKit/policy"
217 AC_SUBST(POLKIT_DATADIR)
219 AM_CONDITIONAL(POLKIT, test "${enable_polkit}" = "yes")
221 AC_ARG_ENABLE(client, AC_HELP_STRING([--enable-client],
222 [enable command line client]), [enable_client=${enableval}])
223 AM_CONDITIONAL(CLIENT, test "${enable_client}" = "yes")
225 AC_ARG_ENABLE(fake, AC_HELP_STRING([--enable-fake],
226 [enable fake device support]), [enable_fake=${enableval}])
227 AM_CONDITIONAL(FAKE, test "${enable_fake}" = "yes")
229 AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles],
230 [don't install configuration and data files]),
231 [enable_datafiles=${enableval}])
232 AM_CONDITIONAL(DATAFILES, test "${enable_datafiles}" != "no")
234 AC_OUTPUT(Makefile gdbus/Makefile include/Makefile include/version.h
235 src/Makefile src/connman.service scripts/connman
236 scripts/Makefile plugins/Makefile client/Makefile
237 test/Makefile doc/Makefile doc/version.xml connman.pc)