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_PATH_PROG([XSLTPROC], [xsltproc])
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(wifi, AC_HELP_STRING([--enable-wifi],
54 [enable WiFi support]), [enable_wifi=${enableval}])
55 if (test "${enable_wifi}" = "yes"); then
56 AC_PATH_PROG(WPASUPPLICANT, [wpa_supplicant], [],
57 $PATH:/sbin:/usr/sbin)
59 AM_CONDITIONAL(WIFI, test "${enable_wifi}" = "yes")
61 AC_ARG_ENABLE(UDHCP, AC_HELP_STRING([--enable-udhcp],
62 [enable uDHCP support]), [enable_udhcp=${enableval}])
63 if (test "${enable_udhcp}" = "yes"); then
64 AC_PATH_PROG(UDHCPC, [udhcpc], [], $PATH:/sbin:/usr/sbin)
66 AM_CONDITIONAL(UDHCP, test "${enable_udhcp}" = "yes")
68 AC_ARG_ENABLE(DHCLIENT, AC_HELP_STRING([--enable-dhclient],
69 [enable dhclient support]), [enable_dhclient=${enableval}])
70 if (test "${enable_dhclient}" = "yes"); then
71 AC_PATH_PROG(DHCLIENT, [dhclient], [], $PATH:/sbin:/usr/sbin)
73 AM_CONDITIONAL(DHCLIENT, test "${enable_dhclient}" = "yes")
75 AC_PATH_PROG(RESOLVCONF, [resolvconf], [], $PATH:/sbin:/usr/sbin)
77 AC_ARG_ENABLE(novatel, AC_HELP_STRING([--enable-novatel],
78 [enable Novatel support]), [enable_novatel=${enableval}])
79 AM_CONDITIONAL(NOVATEL, test "${enable_novatel}" = "yes")
81 AC_ARG_ENABLE(huawei, AC_HELP_STRING([--enable-huawei],
82 [enable HUAWEI support]), [enable_huawei=${enableval}])
83 AM_CONDITIONAL(HUAWEI, test "${enable_huawei}" = "yes")
85 AC_ARG_ENABLE(hso, AC_HELP_STRING([--enable-hso],
86 [enable HSO support]), [enable_hso=${enableval}])
87 AM_CONDITIONAL(HSO, test "${enable_hso}" = "yes")
89 AC_ARG_ENABLE(ppp, AC_HELP_STRING([--enable-ppp],
90 [enable PPP support]), [enable_ppp=${enableval}])
91 if (test "${enable_ppp}" = "yes" || test "${enable_novatel}" = "yes" ||
92 test "${enable_huawei}" = "yes"); then
93 AC_PATH_PROG(PPPD, [pppd], [], $PATH:/sbin:/usr/sbin)
94 AC_CHECK_HEADERS(pppd/pppd.h, enable_ppp=yes,
95 AC_MSG_ERROR(PPP development files are required))
97 AM_CONDITIONAL(PPPD, test "${enable_ppp}" = "yes")
99 AC_CHECK_LIB(dl, dlopen, dummy=yes,
100 AC_MSG_ERROR(dynamic linking loader is required))
102 PKG_CHECK_MODULES(GLIB, glib-2.0, dummy=yes,
103 AC_MSG_ERROR(glib is required))
104 AC_SUBST(GLIB_CFLAGS)
107 if (test "${enable_threads}" = "yes"); then
108 AC_DEFINE(NEED_THREADS, 1, [Define if threading support is required])
109 PKG_CHECK_MODULES(GTHREAD, gthread-2.0, dummy=yes,
110 AC_MSG_ERROR(gthread is required))
111 GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
112 GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
115 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, dummy=yes,
116 AC_MSG_ERROR(libdbus is required))
117 AC_SUBST(DBUS_CFLAGS)
120 AC_SUBST([GDBUS_CFLAGS], ['$(DBUS_CFLAGS) -I$(top_srcdir)/gdbus'])
121 AC_SUBST([GDBUS_LIBS], ['$(top_builddir)/gdbus/libgdbus.la $(DBUS_LIBS)'])
123 AC_ARG_ENABLE(udev, AC_HELP_STRING([--enable-udev],
124 [enable udev support]), [enable_udev=${enableval}])
125 if (test "${enable_udev}" = "yes"); then
126 AC_DEFINE(HAVE_UDEV, 1, [Define if udev support is available])
127 PKG_CHECK_MODULES(UDEV, libudev >= 129, enable_udev=yes,
128 AC_MSG_ERROR(udev >= 129 is required))
129 AC_CHECK_LIB(udev, udev_device_get_parent_with_devtype, dummy=yes,
130 AC_DEFINE(NEED_UDEV_DEVICE_GET_PARENT_WITH_DEVTYPE, 1,
131 [Define to 1 if you need the
132 udev_device_get_parent_with_devtype() function.]))
133 AC_CHECK_LIB(udev, udev_enumerate_add_match_property, dummy=yes,
134 AC_DEFINE(NEED_UDEV_ENUMERATE_ADD_MATCH_PROPERTY, 1,
135 [Define to 1 if you need the
136 udev_enumerate_add_match_property() function.]))
138 AC_SUBST(UDEV_CFLAGS)
140 AM_CONDITIONAL(UDEV, test "${enable_udev}" = "yes")
142 AC_ARG_ENABLE(polkit, AC_HELP_STRING([--enable-polkit],
143 [enable PolicyKit support]), [enable_polkit=${enableval}])
144 if (test "${enable_polkit}" = "yes"); then
145 PKG_CHECK_MODULES(POLKIT, polkit-dbus >= 0.7, enable_polkit=yes,
146 AC_MSG_ERROR(PolicyKit >= 0.7 is required))
147 AC_SUBST(POLKIT_CFLAGS)
148 AC_SUBST(POLKIT_LIBS)
150 AM_CONDITIONAL(POLKIT, test "${enable_polkit}" = "yes")
152 AC_ARG_ENABLE(client, AC_HELP_STRING([--enable-client],
153 [enable command line client]), [enable_client=${enableval}])
154 AM_CONDITIONAL(CLIENT, test "${enable_client}" = "yes")
156 AC_ARG_ENABLE(fake, AC_HELP_STRING([--enable-fake],
157 [enable fake device support]), [enable_fake=${enableval}])
158 AM_CONDITIONAL(FAKE, test "${enable_fake}" = "yes")
160 AC_OUTPUT(Makefile gdbus/Makefile include/Makefile src/Makefile doc/Makefile
161 test/Makefile plugins/Makefile client/Makefile scripts/Makefile
162 scripts/connman src/connman.service doc/version.xml connman.pc)