4 AM_INIT_AUTOMAKE(connman, 0.5)
5 AM_CONFIG_HEADER(config.h)
9 AC_PREFIX_DEFAULT(/usr/local)
11 if (test "${CFLAGS}" = ""); then
12 CFLAGS="-Wall -O2 -D_FORTIFY_SOURCE=2"
21 m4_define([_LT_AC_TAGCONFIG], [])
22 m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])])
29 AC_PATH_PROG([XSLTPROC], [xsltproc])
31 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
32 [enable compiling with debugging information]), [
33 if (test "${enableval}" = "yes" &&
34 test "${ac_cv_prog_cc_g}" = "yes"); then
35 CFLAGS="$CFLAGS -g -O0 -Werror"
39 AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie],
40 [enable position independent executables flag]), [
41 if (test "${enableval}" = "yes" &&
42 test "${ac_cv_prog_cc_pie}" = "yes"); then
43 CFLAGS="$CFLAGS -fPIE"
44 LDFLAGS="$LDFLAGS -pie"
48 AC_PATH_PROG(UDHCPC, [udhcpc], ,$PATH:/sbin:/usr/sbin)
49 AC_PATH_PROG(DHCLIENT, [dhclient], ,$PATH:/sbin:/usr/sbin)
50 AC_PATH_PROG(RESOLVCONF, [resolvconf], ,$PATH:/sbin:/usr/sbin)
51 AC_PATH_PROG(WPASUPPLICANT, [wpa_supplicant], ,$PATH:/sbin:/usr/sbin)
53 AC_CHECK_LIB(dl, dlopen, dummy=yes,
54 AC_MSG_ERROR(dynamic linking loader is required))
56 PKG_CHECK_MODULES(GLIB, glib-2.0, dummy=yes,
57 AC_MSG_ERROR(glib is required))
61 AC_ARG_ENABLE(threads, AC_HELP_STRING([--enable-threads],
62 [enable threading support]), [
63 AC_DEFINE(NEED_THREADS, 1, [Define if threading support is required])
65 PKG_CHECK_MODULES(GTHREAD, gthread-2.0, dummy=yes,
66 AC_MSG_ERROR(gthread is required))
67 GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
68 GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
71 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, dummy=yes,
72 AC_MSG_ERROR(libdbus is required))
76 AC_SUBST([GDBUS_CFLAGS], ['$(DBUS_CFLAGS) -I$(top_srcdir)/gdbus'])
77 AC_SUBST([GDBUS_LIBS], ['$(top_builddir)/gdbus/libgdbus.la $(DBUS_LIBS)'])
79 PKG_CHECK_MODULES(UDEV, libudev >= 127, udev_found=yes, udev_found=no)
82 AM_CONDITIONAL(UDEV, test "${udev_found}" = "yes")
84 PKG_CHECK_MODULES(POLKIT, polkit-dbus >= 0.7, polkit_found=yes, polkit_found=no)
85 AC_SUBST(POLKIT_CFLAGS)
87 AM_CONDITIONAL(POLKIT, test "${polkit_found}" = "yes")
89 AC_ARG_ENABLE(client, AC_HELP_STRING([--enable-client],
90 [enable command line client]), [enable_client=${enableval}])
91 AM_CONDITIONAL(CLIENT, test "${enable_client}" = "yes")
93 AC_ARG_ENABLE(fake, AC_HELP_STRING([--enable-fake],
94 [enable fake plugin]), [enable_fake=${enableval}])
95 AM_CONDITIONAL(FAKE, test "${enable_fake}" = "yes")
97 AC_OUTPUT(Makefile gdbus/Makefile include/Makefile src/Makefile doc/Makefile
98 test/Makefile plugins/Makefile client/Makefile scripts/Makefile
99 scripts/connman src/connman.service doc/version.xml connman.pc)