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_PATH_PROG(UDHCPC, [udhcpc], ,$PATH:/sbin:/usr/sbin)
47 AC_PATH_PROG(DHCLIENT, [dhclient], ,$PATH:/sbin:/usr/sbin)
48 AC_PATH_PROG(RESOLVCONF, [resolvconf], ,$PATH:/sbin:/usr/sbin)
49 AC_PATH_PROG(WPASUPPLICANT, [wpa_supplicant], ,$PATH:/sbin:/usr/sbin)
50 AC_PATH_PROG(PPPD, [pppd], ,$PATH:/sbin:/usr/sbin)
52 AC_CHECK_HEADERS(pppd/pppd.h, pppd_found=no, pppd_found=yes)
53 AM_CONDITIONAL(PPPD, test "${pppd_found}" = "yes")
55 AC_CHECK_LIB(dl, dlopen, dummy=yes,
56 AC_MSG_ERROR(dynamic linking loader is required))
58 PKG_CHECK_MODULES(GLIB, glib-2.0, dummy=yes,
59 AC_MSG_ERROR(glib is required))
63 AC_ARG_ENABLE(threads, AC_HELP_STRING([--enable-threads],
64 [enable threading support]), [
65 AC_DEFINE(NEED_THREADS, 1, [Define if threading support is required])
67 PKG_CHECK_MODULES(GTHREAD, gthread-2.0, dummy=yes,
68 AC_MSG_ERROR(gthread is required))
69 GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
70 GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
73 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, dummy=yes,
74 AC_MSG_ERROR(libdbus is required))
78 AC_SUBST([GDBUS_CFLAGS], ['$(DBUS_CFLAGS) -I$(top_srcdir)/gdbus'])
79 AC_SUBST([GDBUS_LIBS], ['$(top_builddir)/gdbus/libgdbus.la $(DBUS_LIBS)'])
81 PKG_CHECK_MODULES(UDEV, libudev >= 127, udev_found=yes, udev_found=no)
84 AM_CONDITIONAL(UDEV, test "${udev_found}" = "yes")
86 PKG_CHECK_MODULES(POLKIT, polkit-dbus >= 0.7, polkit_found=yes, polkit_found=no)
87 AC_SUBST(POLKIT_CFLAGS)
89 AM_CONDITIONAL(POLKIT, test "${polkit_found}" = "yes")
91 AC_ARG_ENABLE(client, AC_HELP_STRING([--enable-client],
92 [enable command line client]), [enable_client=${enableval}])
93 AM_CONDITIONAL(CLIENT, test "${enable_client}" = "yes")
95 AC_ARG_ENABLE(fake, AC_HELP_STRING([--enable-fake],
96 [enable fake plugin]), [enable_fake=${enableval}])
97 AM_CONDITIONAL(FAKE, test "${enable_fake}" = "yes")
99 AC_OUTPUT(Makefile gdbus/Makefile include/Makefile src/Makefile doc/Makefile
100 test/Makefile plugins/Makefile client/Makefile scripts/Makefile
101 scripts/connman src/connman.service doc/version.xml connman.pc)