2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([tlm], [0.0.3], [])
6 AC_CONFIG_SRCDIR([src/daemon/tlm-main.c])
7 AC_CONFIG_HEADERS([config.h])
8 AC_CONFIG_MACRO_DIR([m4])
10 AM_INIT_AUTOMAKE([1.11 silent-rules subdir-objects tar-pax -Wno-portability])
14 LT_INIT([disable-static])
17 GTK_DOC_CHECK([1.18],[--flavour no-tmpl])
19 # Checks for programs.
21 AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums, [$PATH])
23 # Checks for libraries.
24 PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.30])
28 PKG_CHECK_MODULES([GIO], gio-2.0 gio-unix-2.0)
32 PKG_CHECK_MODULES([GMODULE], [gmodule-2.0])
33 AC_SUBST(GMODULE_CFLAGS)
34 AC_SUBST(GMODULE_LIBS)
36 # Check for libtlm-nfc
37 PKG_CHECK_MODULES([LIBTLM_NFC], [libtlm-nfc], [have_libtlm_nfc=yes], [have_libtlm_nfc=no])
38 AC_SUBST(LIBTLM_NFC_CFLAGS)
39 AC_SUBST(LIBTLM_NFC_LIBS)
40 AM_CONDITIONAL(HAVE_LIBTLM_NFC, [test x$have_libtlm_nfc = xyes])
42 AC_CHECK_HEADERS([security/pam_appl.h],,[AC_MSG_ERROR("pam-devel is required")])
44 TLM_CFLAGS="$GLIB_CFLAGS $GIO_CFLAGS $GMODULE_CFLAGS -D_POSIX_C_SOURCE=\"200809L\" -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE -Wall -Werror"
45 TLM_LIBS="$GLIB_LIBS $GIO_LIBS $GMODULE_LIBS"
50 AC_ARG_ENABLE(debug, [ --enable-debug enable debug features],
51 [enable_debug=$enable_debug], [enable_debug="no"])
52 if test "x$enable_debug" = "xyes" ; then
53 AC_DEFINE(ENABLE_DEBUG, [1], [Enable debug features])
54 AC_ARG_ENABLE(tests, [ --enable-tests build unit tests],
55 [enable_tests=$enable_tests], [enable_tests="no"])
56 if test "x$enable_tests" = "xyes" ; then
57 AC_DEFINE(ENABLE_TESTS, [1], [Build unit tests], [enable_tests=yes])
58 PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
61 AC_MSG_WARN("Tests can't be enabled without debug features")
64 AC_SUBST(CHECK_CFLAGS)
66 AM_CONDITIONAL(ENABLE_TESTS, [test "x$enable_tests" = "xyes"])
69 AC_ARG_ENABLE(examples, [ --enable-examples enable examples],
70 [enable_examples=$enable_examples], [enable_examples="no"])
71 AM_CONDITIONAL(ENABLE_EXAMPLES, [test x$enable_examples = xyes])
73 if test "x$enable_examples" = "xyes" ; then
74 PKG_CHECK_MODULES([ELEMENTARY], [elementary])
75 AC_SUBST(ELEMENTARY_CFLAGS)
76 AC_SUBST(ELEMENTARY_LIBS)
80 AC_ARG_ENABLE(sockets-path,
81 [ --enable-sockets-path=path enable dbus sockets path at location'
82 "path" instead of default "/var/run/tlm"],
83 [enable_sockets_path=$enableval],
84 [enable_sockets_path="/var/run/tlm"])
85 AC_DEFINE_UNQUOTED(TLM_DBUS_SOCKET_PATH, ["$enable_sockets_path"],
86 [Path for dbus sockets])
87 AC_DEFINE_UNQUOTED(TLM_DBUS_ROOT_SOCKET_ADDRESS,
88 ["unix:path=$enable_sockets_path/dbus-sock"], [Address for dbus socket
89 accessed by root only])
92 PKG_CHECK_MODULES([LIBGUM], [libgum], [have_libgum=yes], [have_libgum=no])
93 AC_ARG_ENABLE(gum, [ --enable-gum build for gumd plugin], ,
94 [enable_gum=$have_libgum])
95 if test "x$enable_gum" = "xyes" && test "x$have_libgum" = "xno" ; then
96 AC_MSG_ERROR("libgum is required.")
98 AC_SUBST(LIBGUM_CFLAGS)
100 AM_CONDITIONAL(HAVE_LIBGUM, [test x$have_libgum = xyes])
102 if test "x$enable_gum" = "xyes" ; then
103 AC_SUBST(ACCOUNT_PLUGIN_NAME, [gumd])
105 AC_SUBST(ACCOUNT_PLUGIN_NAME, [default])
113 src/common/dbus/Makefile
115 src/daemon/dbus/Makefile
117 src/sessiond/Makefile
120 src/plugins/default/Makefile
121 src/plugins/gumd/Makefile
122 src/plugins/nfc/Makefile
126 tests/config/Makefile
127 tests/daemon/Makefile
135 echo "Enabled debug features : "$enable_debug
136 echo "Building tests : "$enable_tests
137 echo "Enabled Gumd : "$enable_gum $have_libgum
138 echo "Enabled NFC : "$have_libtlm_nfc
139 echo "Enabled examples : "$enable_examples