2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([uxlaunch],[0.64],[auke-jan.h.kok@intel.com])
6 AM_INIT_AUTOMAKE([-Wall -Werror foreign])
7 AC_CONFIG_FILES([Makefile src/Makefile])
8 AC_CONFIG_SRCDIR([src/uxlaunch.c])
9 AC_CONFIG_HEADERS([config.h])
11 # Checks for programs.
15 # Checks for libraries.
16 # FIXME: Replace `main' with a function in `-lXau':
17 AC_CHECK_LIB([Xau], [main], , AC_MSG_ERROR([libXau is required but was not found]))
18 # FIXME: Replace `main' with a function in `-lpam':
19 AC_CHECK_LIB([pam], [main], , AC_MSG_ERROR([libpam is required but was not found]))
20 # FIXME: Replace `main' with a function in `-lpthread':
21 AC_CHECK_LIB([pthread], [main], , AC_MSG_ERROR([libpthread is required but was not found]))
22 # FIXME: Replace `main' with a function in `-lrt':
23 AC_CHECK_LIB([rt], [main], , AC_MSG_ERROR([librt is required but was not found]))
26 PKG_CHECK_MODULES([DBUS], [dbus-1])
28 PKG_CHECK_MODULES([GLIB2], [glib-2.0])
30 AC_ARG_WITH([ck-connector], AS_HELP_STRING([--with-ck-connector], [Build with ConsoleKit connector support (default: autodetect)]))
31 AS_IF([test "x$with_ck_connector" != xno], [
32 PKG_CHECK_MODULES([CONSOLEKIT], [ck-connector >= 0.4])
33 AC_DEFINE([WITH_CONSOLEKIT], [1], [Enable ConsoleKit support])
35 AM_CONDITIONAL([WITH_CONSOLEKIT], [test "x$CONSOLEKIT_LIBS" != x])
38 AC_ARG_ENABLE([chooser], AS_HELP_STRING([--disable-chooser], [Build with chooser support (default: enabled)]))
39 AM_CONDITIONAL([ENABLE_CHOOSER], [test "x$enable_chooser" != xno])
40 AS_IF([test "x$enable_chooser" != xno], AC_DEFINE([ENABLE_CHOOSER], [1], [Enable Chooser and Chooser IPC]))
42 AC_ARG_ENABLE([ecryptfs], AS_HELP_STRING([--disable-ecryptfs], [Build with ecryptfs support (default: enabled)]))
43 AM_CONDITIONAL([ENABLE_ECRYPTFS], [test "x$enable_ecryptfs" != xno])
44 AS_IF([test "x$enable_ecryptfs" != xno], AC_DEFINE([ENABLE_ECRYPTFS], [1], [Enable ECryptFS support]))
46 AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [enable debug data generation (default: disabled)]))
47 if test x"$enable_debug" == x"yes"; then
48 AC_DEFINE([DEBUG],[1],[Debug Mode])
49 AM_CFLAGS="$AM_CFLAGS -g -Wall -Werror -Wno-uninitialized -O0"
52 AC_ARG_WITH([systemdunitdir], AC_HELP_STRING([--with-systemdunitdir=DIR],
53 [path to systemd service directory]), [path_systemdunit=${withval}],
54 [path_systemdunit="`$PKG_CONFIG --variable=systemdsystemunitdir systemd`"])
55 if (test -n "${path_systemdunit}"); then
56 SYSTEMD_UNITDIR="${path_systemdunit}"
57 AC_SUBST(SYSTEMD_UNITDIR)
59 AM_CONDITIONAL(SYSTEMD, test -n "${path_systemdunit}")
61 # Checks for header files.
62 AC_CHECK_HEADERS([fcntl.h limits.h stdint.h stdlib.h string.h sys/ioctl.h sys/time.h syslog.h unistd.h])
64 # Checks for typedefs, structures, and compiler characteristics.
71 # Checks for library functions.
74 AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
76 AC_CHECK_FUNCS([clock_gettime gettimeofday memset mkdir setenv strchr strdup strerror strrchr strstr uname])
78 AC_OUTPUT(uxlaunch.service)
81 echo "Build configuration:"
83 echo "Library support:"
84 echo -n " * ConsoleKit : "
85 test -n "$CONSOLEKIT_LIBS" && echo yes || echo no
87 test -n "`echo $LIBS | grep lpam`" && echo yes || echo no
89 test -n "`echo $LIBS | grep lXau`" && echo yes || echo no
91 echo "Feature support:"
92 echo -n " * chooser : "
93 test "x$enable_chooser" != xno && echo yes || echo no
94 echo -n " * ecryptfs : "
95 test "x$enable_ecryptfs" != xno && echo yes || echo no
96 echo -n " * debugging : "
97 test "x$enable_debug" == xyes && echo yes || echo no
98 echo -n " * systemd : "
99 test "x$path_systemdunit" == x && echo no || echo yes