adding missed tag
[profile/ivi/uxlaunch.git] / configure.ac
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ([2.68])
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])
10
11 # Checks for programs.
12 AC_PROG_CC
13 AC_PROG_INSTALL
14
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]))
24
25 # PkgConfig tests
26 PKG_CHECK_MODULES([DBUS], [dbus-1])
27
28 PKG_CHECK_MODULES([GLIB2], [glib-2.0])
29
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])
34 ])
35 AM_CONDITIONAL([WITH_CONSOLEKIT], [test "x$CONSOLEKIT_LIBS" != x])
36
37 # features
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]))
41
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]))
45
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"
50 fi
51
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)
58 fi
59 AM_CONDITIONAL(SYSTEMD, test -n "${path_systemdunit}")
60
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])
63
64 # Checks for typedefs, structures, and compiler characteristics.
65 AC_TYPE_UID_T
66 AC_TYPE_PID_T
67 AC_TYPE_SIZE_T
68 AC_TYPE_SSIZE_T
69 AC_TYPE_UINT64_T
70
71 # Checks for library functions.
72 AC_FUNC_CHOWN
73 AC_FUNC_FORK
74 AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
75 AC_FUNC_MALLOC
76 AC_CHECK_FUNCS([clock_gettime gettimeofday memset mkdir setenv strchr strdup strerror strrchr strstr uname])
77
78 AC_OUTPUT(uxlaunch.service)
79
80 echo
81 echo "Build configuration:"
82 echo
83 echo "Library support:"
84 echo -n " * ConsoleKit : "
85 test -n "$CONSOLEKIT_LIBS" && echo yes || echo no
86 echo -n " * Pam        : "
87 test -n "`echo $LIBS | grep lpam`" && echo yes || echo no
88 echo -n " * Xauth      : "
89 test -n "`echo $LIBS | grep lXau`" && echo yes || echo no
90 echo
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
100 echo