4 AM_INIT_AUTOMAKE(connman, 0.0)
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_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(DHCLIENT, [dhclient])
47 AC_PATH_PROG(WPASUPPLICANT, [wpa_supplicant])
49 PKG_CHECK_MODULES(GLIB, glib-2.0, dummy=yes,
50 AC_MSG_ERROR(glib is required))
54 PKG_CHECK_MODULES(GTHREAD, gthread-2.0, dummy=yes,
55 AC_MSG_ERROR(gthread is required))
56 AC_SUBST(GTHREAD_CFLAGS)
57 AC_SUBST(GTHREAD_LIBS)
59 PKG_CHECK_MODULES(GMODULE, gmodule-2.0, dummy=yes,
60 AC_MSG_ERROR(gmodule is required))
61 AC_SUBST(GMODULE_CFLAGS)
62 AC_SUBST(GMODULE_LIBS)
64 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, dummy=yes,
65 AC_MSG_ERROR(libdbus is required))
69 AC_SUBST([GDBUS_CFLAGS], ['$(DBUS_CFLAGS) -I$(top_srcdir)/gdbus'])
70 AC_SUBST([GDBUS_LIBS], ['$(top_builddir)/gdbus/libgdbus.la $(DBUS_LIBS)'])
72 PKG_CHECK_MODULES(HAL, hal >= 0.5.8, hal_found=yes, hal_found=no)
75 AM_CONDITIONAL(HAL, test "${hal_found}" = "yes")
77 PKG_CHECK_MODULES(POLKIT, polkit-dbus >= 0.7, polkit_found=yes, polkit_found=no)
78 AC_SUBST(POLKIT_CFLAGS)
80 AM_CONDITIONAL(POLKIT, test "${polkit_found}" = "yes")
82 PKG_CHECK_MODULES(SQLITE, sqlite3, sqlite_found=yes, sqlite_found=no)
83 AC_SUBST(SQLITE_CFLAGS)
86 AC_OUTPUT(Makefile gdbus/Makefile include/Makefile src/Makefile doc/Makefile
87 test/Makefile plugins/Makefile scripts/Makefile scripts/connman
88 src/connman.service doc/version.xml connman.pc)