Provide x-display-manager.
[debian/lxdm.git] / configure.ac
CommitLineData
eea1c851
AL
1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ([2.63])
faee902e 5AC_INIT([lxdm], [0.2.0], [http://lxde.org/])
eea1c851
AL
6AM_INIT_AUTOMAKE([-Wall -Werror foreign])
7
8AC_CONFIG_SRCDIR([src/lxdm.c])
9AC_CONFIG_HEADERS([config.h])
10
11# Checks for programs.
12AC_PROG_CC
13AC_PROG_INSTALL
14AM_PROG_CC_C_O
15
16# Checks for libraries.
eea1c851 17AC_CHECK_LIB([crypt], [crypt])
faee902e
AL
18
19AC_ARG_WITH(pam,AC_HELP_STRING([--without-pam],[build without pam]),
20[],[AC_CHECK_LIB([pam], [pam_open_session])])
21
eea1c851
AL
22AC_CHECK_LIB([ck-connector],[ck_connector_open_session])
23
24# Checks for header files.
25AC_PATH_X
26AC_CHECK_HEADERS([shadow.h stdlib.h string.h unistd.h])
27
28# Checks for typedefs, structures, and compiler characteristics.
29AC_TYPE_PID_T
30
31# Checks for library functions.
32AC_FUNC_FORK
33AC_CHECK_FUNCS([atexit endpwent getspnam getusershell memset putenv strstr])
34
35PKG_CONFIG=pkg-config # FIXME: is this OK?
36# Check for ISO Codes, this is taken from gdm
37AC_MSG_CHECKING([whether iso-codes has iso-639 domain])
38if $PKG_CONFIG --variable=domains iso-codes | grep 639 >/dev/null ; then
39 AC_MSG_RESULT([yes])
40else
41 AC_MSG_RESULT([no])
42fi
43AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX],["`$PKG_CONFIG --variable=prefix iso-codes`"],[ISO codes prefix])
44ISO_CODES=iso-codes
45
46IT_PROG_INTLTOOL([0.40.0])
47
faee902e
AL
48PKG_CHECK_MODULES(XLIB,x11)
49AC_SUBST(XLIB_CFLAGS)
50AC_SUBST(XLIB_LIBS)
51
eea1c851
AL
52pkg_modules="gtk+-2.0 >= 2.12.0"
53PKG_CHECK_MODULES(GTK, [$pkg_modules])
54AC_SUBST(GTK_CFLAGS)
55AC_SUBST(GTK_LIBS)
56
faee902e
AL
57PKG_CHECK_MODULES(CONSOLEKIT, "ck-connector",[
58 AC_SUBST(CONSOLEKIT_CFLAGS)
59 AC_SUBST(CONSOLEKIT_LIBS)],[
60 echo "ConsoleKit devel package not found"
61 ])
62
63AC_ARG_ENABLE(password,
64[ --enable-password enable to load autologin password store at config file ],
65[case "${enableval}" in
66 yes) enable_password=yes ;;
67 no) enable_password=no ;;
68 *) AC_MSG_ERROR([bad value "${enableval}" for --enable-password, use "yes" (default) or "no".]) ;;
69esac],[])
70
71if test "x$enable_password" = "xyes" ; then
72 CFLAGS="$CFLAGS -DENABLE_PASSWORD"
73fi
74
75AC_ARG_ENABLE(xauth,
76 AC_HELP_STRING([--disable-xauth],[disable the xauth support ]),
77 [enable_xauth=$enablevar],
78 [enable_xauth=yes]
79)
80
81if test "x$enable_xauth" = "x$no" ; then
82 CFLAGS="$CFLAGS -DDISABLE_XAUTH"
83else
84 AC_CHECK_LIB([Xau],[XauWriteAuth])
85fi
eea1c851
AL
86
87GETTEXT_PACKAGE=lxdm
88AC_SUBST(GETTEXT_PACKAGE)
89AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
90
91AC_CONFIG_FILES([
92 Makefile
93 lxdm.spec
94 src/Makefile
95 po/Makefile.in
96 pam/Makefile
97 data/Makefile
faee902e
AL
98 data/PostLogin
99 data/PostLogout
100 data/PreLogin
101 data/PreReboot
102 data/PreShutdown
103 data/LoginReady
eea1c851 104])
faee902e 105AC_CONFIG_FILES([data/lxdm], [chmod +x data/lxdm])
eea1c851 106AC_OUTPUT
faee902e
AL
107
108dnl sanity checks
109if test "$sysconfdir" != "/etc"; then
110 AC_MSG_WARN(sysconfdir is not /etc.)
111 AC_MSG_WARN(Please consider passing --sysconfdir=/etc to configure.)
112fi