4 AM_INIT_AUTOMAKE(connman, 0.5)
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(wifi, AC_HELP_STRING([--enable-wifi],
52 [enable WiFi support]), [enable_wifi=${enableval}])
53 if (test "${enable_wifi}" = "yes"); then
54 AC_PATH_PROG(WPASUPPLICANT, [wpa_supplicant], [],
55 $PATH:/sbin:/usr/sbin)
57 AM_CONDITIONAL(WIFI, test "${enable_wifi}" = "yes")
59 AC_ARG_WITH(udhcpc, AC_HELP_STRING([--with-udhcpc=PROGRAM],
60 [specific location of udhcpc binary]), [path_udhcpc=${withval}])
62 AC_ARG_ENABLE(UDHCP, AC_HELP_STRING([--enable-udhcp],
63 [enable uDHCP support]), [enable_udhcp=${enableval}])
64 if (test "${enable_udhcp}" = "yes"); then
65 if (test -z "${path_udhcpc}"); then
66 AC_PATH_PROG(UDHCPC, [udhcpc], [], $PATH:/sbin:/usr/sbin)
68 UDHCPC="${path_udhcpc}"
72 AM_CONDITIONAL(UDHCP, test "${enable_udhcp}" = "yes")
74 AC_ARG_WITH(dhclient, AC_HELP_STRING([--with-dhclient=PROGRAM],
75 [specific location of dhclient binary]), [path_dhclient=${withval}])
77 AC_ARG_ENABLE(DHCLIENT, AC_HELP_STRING([--enable-dhclient],
78 [enable dhclient support]), [enable_dhclient=${enableval}])
79 if (test "${enable_dhclient}" = "yes"); then
80 if (test -z "${path_dhclient}"); then
81 AC_PATH_PROG(DHCLIENT, [dhclient], [], $PATH:/sbin:/usr/sbin)
83 UDHCPC="${path_dhclient}"
87 AM_CONDITIONAL(DHCLIENT, test "${enable_dhclient}" = "yes")
89 AC_ARG_WITH(resolvconf, AC_HELP_STRING([--with-resolvconf=PROGRAM],
90 [specific location of resolvconf binary]), [path_resolvconf=${withval}])
92 AC_ARG_ENABLE(RESOLVCONF, AC_HELP_STRING([--enable-resolvconf],
93 [enable resolvconf support]), [enable_resolvconf=${enableval}])
94 if (test "${enable_resolvconf}" = "yes"); then
95 if (test -z "${path_resolvconf}"); then
96 AC_PATH_PROG(RESOLVCONF, [resolvconf], [], $PATH:/sbin:/usr/sbin)
98 UDHCPC="${path_resolvconf}"
102 AM_CONDITIONAL(RESOLVCONF, test "${enable_resolvconf}" = "yes")
104 AC_ARG_ENABLE(novatel, AC_HELP_STRING([--enable-novatel],
105 [enable Novatel support]), [enable_novatel=${enableval}])
106 AM_CONDITIONAL(NOVATEL, test "${enable_novatel}" = "yes")
108 AC_ARG_ENABLE(huawei, AC_HELP_STRING([--enable-huawei],
109 [enable HUAWEI support]), [enable_huawei=${enableval}])
110 AM_CONDITIONAL(HUAWEI, test "${enable_huawei}" = "yes")
112 AC_ARG_ENABLE(hso, AC_HELP_STRING([--enable-hso],
113 [enable HSO support]), [enable_hso=${enableval}])
114 AM_CONDITIONAL(HSO, test "${enable_hso}" = "yes")
116 AC_ARG_WITH(pppd, AC_HELP_STRING([--with-pppd=PROGRAM],
117 [specific location of pppd binary]), [path_pppd=${withval}])
119 AC_ARG_ENABLE(ppp, AC_HELP_STRING([--enable-ppp],
120 [enable PPP support]), [enable_ppp=${enableval}])
121 if (test "${enable_ppp}" = "yes" || test "${enable_novatel}" = "yes" ||
122 test "${enable_huawei}" = "yes"); then
123 if (test -z "${path_pppd}"); then
124 AC_PATH_PROG(PPPD, [pppd], [], $PATH:/sbin:/usr/sbin)
129 AC_CHECK_HEADERS(pppd/pppd.h, enable_ppp=yes,
130 AC_MSG_ERROR(PPP development files are required))
132 AM_CONDITIONAL(PPPD, test "${enable_ppp}" = "yes")
134 AC_CHECK_LIB(dl, dlopen, dummy=yes,
135 AC_MSG_ERROR(dynamic linking loader is required))
137 PKG_CHECK_MODULES(GLIB, glib-2.0, dummy=yes,
138 AC_MSG_ERROR(glib is required))
139 AC_SUBST(GLIB_CFLAGS)
142 if (test "${enable_threads}" = "yes"); then
143 AC_DEFINE(NEED_THREADS, 1, [Define if threading support is required])
144 PKG_CHECK_MODULES(GTHREAD, gthread-2.0, dummy=yes,
145 AC_MSG_ERROR(gthread is required))
146 GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
147 GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
150 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, dummy=yes,
151 AC_MSG_ERROR(libdbus is required))
152 AC_SUBST(DBUS_CFLAGS)
155 AC_SUBST([GDBUS_CFLAGS], ['$(DBUS_CFLAGS) -I$(top_srcdir)/gdbus'])
156 AC_SUBST([GDBUS_LIBS], ['$(top_builddir)/gdbus/libgdbus.la $(DBUS_LIBS)'])
158 AC_ARG_ENABLE(udev, AC_HELP_STRING([--enable-udev],
159 [enable udev support]), [enable_udev=${enableval}])
160 if (test "${enable_udev}" = "yes"); then
161 AC_DEFINE(HAVE_UDEV, 1, [Define if udev support is available])
162 PKG_CHECK_MODULES(UDEV, libudev >= 129, enable_udev=yes,
163 AC_MSG_ERROR(udev >= 129 is required))
164 AC_CHECK_LIB(udev, udev_enumerate_add_match_property, dummy=yes,
165 AC_DEFINE(NEED_UDEV_ENUMERATE_ADD_MATCH_PROPERTY, 1,
166 [Define to 1 if you need the
167 udev_enumerate_add_match_property() function.]))
168 AC_CHECK_LIB(udev, udev_device_get_parent_with_subsystem_devtype, dummy=yes,
169 AC_DEFINE(NEED_UDEV_DEVICE_GET_PARENT_WITH_SUBSYSTEM_DEVTYPE, 1,
170 [Define to 1 if you need the
171 udev_device_get_parent_with_subsystem_devtype()
174 AC_SUBST(UDEV_CFLAGS)
176 AM_CONDITIONAL(UDEV, test "${enable_udev}" = "yes")
178 AC_ARG_ENABLE(polkit, AC_HELP_STRING([--enable-polkit],
179 [enable PolicyKit support]), [enable_polkit=${enableval}])
180 if (test "${enable_polkit}" = "yes"); then
181 PKG_CHECK_MODULES(POLKIT, polkit-dbus >= 0.7, enable_polkit=yes,
182 AC_MSG_ERROR(PolicyKit >= 0.7 is required))
183 AC_SUBST(POLKIT_CFLAGS)
184 AC_SUBST(POLKIT_LIBS)
186 AM_CONDITIONAL(POLKIT, test "${enable_polkit}" = "yes")
188 AC_ARG_ENABLE(client, AC_HELP_STRING([--enable-client],
189 [enable command line client]), [enable_client=${enableval}])
190 AM_CONDITIONAL(CLIENT, test "${enable_client}" = "yes")
192 AC_ARG_ENABLE(fake, AC_HELP_STRING([--enable-fake],
193 [enable fake device support]), [enable_fake=${enableval}])
194 AM_CONDITIONAL(FAKE, test "${enable_fake}" = "yes")
196 AC_OUTPUT(Makefile gdbus/Makefile include/Makefile src/Makefile doc/Makefile
197 test/Makefile plugins/Makefile client/Makefile scripts/Makefile
198 scripts/connman src/connman.service doc/version.xml connman.pc)