4 AM_INIT_AUTOMAKE(connman, 0.4)
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"
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(DHCLIENT, [dhclient], ,$PATH:/sbin:/usr/sbin)
49 AC_PATH_PROG(WPASUPPLICANT, [wpa_supplicant], ,$PATH:/sbin:/usr/sbin)
51 AC_CHECK_LIB(dl, dlopen, dummy=yes,
52 AC_MSG_ERROR(dynamic linking loader is required))
54 PKG_CHECK_MODULES(GLIB, glib-2.0, dummy=yes,
55 AC_MSG_ERROR(glib is required))
59 AC_ARG_ENABLE(threads, AC_HELP_STRING([--enable-threads],
60 [enable threading support]), [
61 AC_DEFINE(NEED_THREADS, 1, [Define if threading support is required])
63 PKG_CHECK_MODULES(GTHREAD, gthread-2.0, dummy=yes,
64 AC_MSG_ERROR(gthread is required))
65 GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
66 GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
69 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, dummy=yes,
70 AC_MSG_ERROR(libdbus is required))
74 AC_SUBST([GDBUS_CFLAGS], ['$(DBUS_CFLAGS) -I$(top_srcdir)/gdbus'])
75 AC_SUBST([GDBUS_LIBS], ['$(top_builddir)/gdbus/libgdbus.la $(DBUS_LIBS)'])
77 PKG_CHECK_MODULES(UDEV, libudev >= 127, udev_found=yes, udev_found=no)
80 AM_CONDITIONAL(UDEV, test "${udev_found}" = "yes")
82 PKG_CHECK_MODULES(POLKIT, polkit-dbus >= 0.7, polkit_found=yes, polkit_found=no)
83 AC_SUBST(POLKIT_CFLAGS)
85 AM_CONDITIONAL(POLKIT, test "${polkit_found}" = "yes")
87 AC_ARG_ENABLE(fake, AC_HELP_STRING([--enable-fake],
88 [enable fake plugin]), [enable_fake=${enableval}])
89 AM_CONDITIONAL(FAKE, test "${enable_fake}" = "yes")
91 AC_OUTPUT(Makefile gdbus/Makefile include/Makefile src/Makefile doc/Makefile
92 test/Makefile plugins/Makefile client/Makefile scripts/Makefile
93 scripts/connman src/connman.service doc/version.xml connman.pc)