5
[https://bugs.freedesktop.org/enter_bug.cgi?product=ConsoleKit],
8
AC_CONFIG_SRCDIR([src/ck-manager.c])
10
AM_INIT_AUTOMAKE([1.9 no-dist-gzip dist-bzip2])
11
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
14
# for O_NOFOLLOW support
27
# Save flags to aclocal
28
ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
30
GETTEXT_PACKAGE=ConsoleKit
31
AC_SUBST(GETTEXT_PACKAGE)
32
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of default gettext domain])
38
DBUS_REQUIRED_VERSION=0.82
39
GLIB_REQUIRED_VERSION=2.14
40
X11_REQUIRED_VERSION=1.0.0
41
POLKIT_REQUIRED_VERSION=0.92
43
AC_CHECK_HEADERS(unistd.h)
44
AC_CHECK_HEADERS(paths.h)
45
AC_CHECK_HEADERS(sys/vt.h)
46
AC_CHECK_HEADERS(sys/consio.h)
48
AC_CHECK_FUNCS(getpeerucred getpeereid)
52
PKG_CHECK_MODULES(CONSOLE_KIT,
53
dbus-glib-1 >= $DBUS_REQUIRED_VERSION
54
gobject-2.0 >= $GLIB_REQUIRED_VERSION
55
gthread-2.0 >= $GLIB_REQUIRED_VERSION
58
PKG_CHECK_MODULES(POLKIT,
59
polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION,
62
if test "x$have_polkit" = "xyes" ; then
63
AC_DEFINE(HAVE_POLKIT, [], [Define if we have polkit])
65
AM_CONDITIONAL(HAVE_POLKIT, test x$have_polkit = xyes)
68
PKG_CHECK_MODULES(LIBDBUS,
69
dbus-1 >= $DBUS_REQUIRED_VERSION
71
PKG_CHECK_MODULES(TOOLS,
72
x11 >= $X11_REQUIRED_VERSION
73
glib-2.0 >= $GLIB_REQUIRED_VERSION
76
PKG_CHECK_MODULES(HISTORY,
77
glib-2.0 >= $GLIB_REQUIRED_VERSION
80
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
82
EXTRA_COMPILE_WARNINGS(yes)
84
# Solaris requires libresolv for daemon()
87
AC_CHECK_LIB(resolv, daemon, [CONSOLE_KIT_LIBS="$CONSOLE_KIT_LIBS -lresolv"])
91
# Find out the version of DBUS we're using
93
dbus_version=`pkg-config --modversion dbus-1`
94
DBUS_VERSION_MAJOR=`echo $dbus_version | awk -F. '{print $1}'`
95
DBUS_VERSION_MINOR=`echo $dbus_version | awk -F. '{print $2}'`
96
DBUS_VERSION_MICRO=`echo $dbus_version | awk -F. '{print $3}'`
97
if test "z$DBUS_VERSION_MAJOR" = "z"; then
98
DBUS_VERSION_MAJOR="0"
100
if test "z$DBUS_VERSION_MINOR" = "z"; then
101
DBUS_VERSION_MINOR="0"
103
if test "z$DBUS_VERSION_MICRO" = "z"; then
104
DBUS_VERSION_MICRO="0"
107
if test "z$DBUS_VERSION_MAJOR" = "z0" -a "z$DBUS_VERSION_MINOR" = "z0" -a "z$DBUS_VERSION_MICRO" = "z0"; then echo "Error: Couldn't determine the version of your DBUS package."
108
echo " This is probably an error in this script, please report it"
109
echo " along with the following information:"
110
echo " Base DBUS version ='$dbus_version'"
111
echo " DBUS_VERSION_MAJOR='$DBUS_VERSION_MAJOR'"
112
echo " DBUS_VERSION_MINOR='$DBUS_VERSION_MINOR'"
113
echo " DBUS_VERSION_MICRO='$DBUS_VERSION_MICRO'"
117
echo "Your dbus version is $DBUS_VERSION_MAJOR,$DBUS_VERSION_MINOR,$DBUS_VERSION_MICRO."
118
DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MAJOR=$DBUS_VERSION_MAJOR"
119
DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MINOR=$DBUS_VERSION_MINOR"
120
DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MICRO=$DBUS_VERSION_MICRO"
122
AC_SUBST(DBUS_CFLAGS)
125
dnl ---------------------------------------------------------------------------
126
dnl - Are we specifying a different dbus root ?
127
dnl ---------------------------------------------------------------------------
129
AC_ARG_WITH(dbus-sys,
130
[AC_HELP_STRING([--with-dbus-sys=<dir>],
131
[where D-BUS system.d directory is])])
132
AC_ARG_WITH(dbus-services,
133
[AC_HELP_STRING([--with-dbus-services=<dir>],
134
[where D-BUS services directory is])])
135
if ! test -z "$with_dbus_sys" ; then
136
DBUS_SYS_DIR="$with_dbus_sys"
138
DBUS_SYS_DIR="$sysconfdir/dbus-1/system.d"
140
AC_SUBST(DBUS_SYS_DIR)
143
dnl ---------------------------------------------------------------------------
145
dnl ---------------------------------------------------------------------------
148
AC_CHECK_LIB(z, compress,
149
[AC_CHECK_HEADER(zlib.h, [have_libz=yes], [])], [])
150
if test "x$have_libz" != "xyes"; then
151
AC_MSG_ERROR([Unable to find libz])
153
Z_LIBS="${Z_LIBS} -lz"
156
dnl ---------------------------------------------------------------------------
158
dnl ---------------------------------------------------------------------------
160
AC_ARG_WITH(pid-file,
161
[AC_HELP_STRING([--with-pid-file=<file>],
162
[pid file location])])
164
if ! test -z "$with_pid_file"; then
165
CONSOLE_KIT_PID_FILE=$with_pid_file
167
CONSOLE_KIT_PID_FILE=${localstatedir}/run/ConsoleKit/pid
170
AC_SUBST(CONSOLE_KIT_PID_FILE)
172
dnl ---------------------------------------------------------------------------
173
dnl Figure out what tools backend to build
174
dnl ---------------------------------------------------------------------------
179
*-*-freebsd* | *-*-kfreebsd*-gnu)
181
AC_CHECK_LIB(kvm, kvm_openfiles, have_kvm=yes,
182
AC_MSG_ERROR([Unable to find libkvm which is needed on FreeBSD]))
183
if test "x$have_kvm" = "xyes"; then
194
AC_MSG_ERROR([No sysdeps back-end implemented for host $host])
200
AM_CONDITIONAL(CK_COMPILE_LINUX, test x$CK_BACKEND = xlinux, [Compiling for Linux])
201
AM_CONDITIONAL(CK_COMPILE_FREEBSD, test x$CK_BACKEND = xfreebsd, [Compiling for FreeBSD])
202
AM_CONDITIONAL(CK_COMPILE_SOLARIS, test x$CK_BACKEND = xsolaris, [Compiling for Solaris])
205
dnl ---------------------------------------------------------------------------
207
dnl ---------------------------------------------------------------------------
210
AC_CHECK_LIB(pam, pam_getenv, have_pam=yes)
211
AM_CONDITIONAL(HAVE_PAM, test x$have_pam = xyes)
212
if test "x$have_pam" = "xyes"; then
213
PAM_LIBS="${PAM_LIBS} -lpam"
218
AC_CHECK_HEADERS([security/pam_modutil.h security/pam_ext.h])
219
AC_CHECK_LIB(pam, pam_syslog, [AC_DEFINE(HAVE_PAM_SYSLOG, [], [Define to 1 if you have the pam_syslog function])])
221
# Check if we should build the PAM module
223
AC_ARG_ENABLE(pam-module,
224
[AC_HELP_STRING([--enable-pam-module],
225
[build PAM module])],
226
, enable_pam_module=no)
227
if test "x$enable_pam_module" = "xyes"; then
228
if test "x$have_pam" = "xno"; then
229
AC_MSG_ERROR([--enable-pam-module requires PAM but PAM was not found])
231
AC_DEFINE(ENABLE_PAM_MODULE, [], [Set if we build PAM module])
234
AM_CONDITIONAL(ENABLE_PAM_MODULE, test "x$enable_pam_module" = "xyes")
236
dnl ---------------------------------------------------------------------------
237
dnl - Install directory for PAM security module
238
dnl ---------------------------------------------------------------------------
240
AC_ARG_WITH(pam-module-dir,
241
[AC_HELP_STRING([--with-pam-module-dir=<dir>],
242
[directory to install PAM security module])])
243
if ! test -z "$with_pam_module_dir"; then
244
PAM_MODULE_DIR="$with_pam_module_dir"
246
PAM_MODULE_DIR="/lib/security"
248
AC_SUBST(PAM_MODULE_DIR)
250
dnl ---------------------------------------------------------------------------
251
dnl - DocBook Documentation
252
dnl ---------------------------------------------------------------------------
254
AC_ARG_ENABLE(docbook-docs,
255
[AC_HELP_STRING([--enable-docbook-docs],
256
[build documentation (requires xmlto)])],
257
enable_docbook_docs=$enableval,enable_docbook_docs=no)
258
AC_PATH_PROG(XMLTO, xmlto, no)
259
AC_MSG_CHECKING([whether to build DocBook documentation])
260
if test x$XMLTO = xno ; then
265
if test x$enable_docbook_docs = xauto ; then
266
if test x$have_docbook = xno ; then
267
enable_docbook_docs=no
269
enable_docbook_docs=yes
272
if test x$enable_docbook_docs = xyes; then
273
if test x$have_docbook = xno; then
274
AC_MSG_ERROR([Building DocBook docs explicitly required, but DocBook not found])
277
AM_CONDITIONAL(DOCBOOK_DOCS_ENABLED, test x$enable_docbook_docs = xyes)
280
AC_ARG_VAR([XMLTO],[Define/override the `xmlto' location.])
281
AC_ARG_VAR([XMLTO_FLAGS],[Define/override `xmlto' options, like `--skip-validation'.])
283
dnl ---------------------------------------------------------------------------
284
dnl Check for xsltproc
285
dnl ---------------------------------------------------------------------------
286
AC_PATH_PROG([XSLTPROC], [xsltproc])
288
dnl ---------------------------------------------------------------------------
289
dnl check for inotify
290
dnl ---------------------------------------------------------------------------
293
AC_CHECK_FUNC(inotify_init,
294
[AC_CHECK_HEADER([sys/inotify.h],
295
[enable_inotify=yes],
299
AM_CONDITIONAL(ENABLE_INOTIFY, test "x$enable_inotify" = "xyes")
301
if test "x$enable_inotify" = "xyes" ; then
302
AC_DEFINE(ENABLE_INOTIFY, [], [Define if we have inotify])
305
dnl ---------------------------------------------------------------------------
307
dnl ---------------------------------------------------------------------------
310
AC_ARG_ENABLE(rbac-shutdown,
311
[AC_HELP_STRING([--enable-rbac-shutdown=<key>],
312
[Build with RBAC support specifying shutdown/reboot RBAC authentication key])],
313
enable_rbac_shutdown=$enableval,enable_rbac_shutdown=no)
314
if test "x$enable_rbac_shutdown" != "xno"; then
315
RBAC_LIBS="-lsecdb -lsocket -lnsl"
316
AC_DEFINE(ENABLE_RBAC_SHUTDOWN, [], [Set if we build with RBAC support])
317
AC_DEFINE_UNQUOTED(RBAC_SHUTDOWN_KEY, "$enable_rbac_shutdown", [Set if we build with RBAC support])
318
msg_rbac_shutdown="yes, using key $enable_rbac_shutdown"
322
dnl ---------------------------------------------------------------------------
324
dnl ---------------------------------------------------------------------------
326
# Turn on the additional warnings last, so -Werror doesn't affect other tests.
328
AC_ARG_ENABLE(more-warnings,
329
[AC_HELP_STRING([--enable-more-warnings],
330
[Maximum compiler warnings])],
331
set_more_warnings="$enableval",[
332
if test -d $srcdir/.git; then
333
set_more_warnings=yes
338
AC_MSG_CHECKING(for more warnings)
339
if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
343
-Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
344
-Wnested-externs -Wpointer-arith \
345
-Wcast-align -Wsign-compare -Wp,-D_FORTIFY_SOURCE=2 \
348
for option in -Wno-strict-aliasing -Wno-sign-compare; do
349
SAVE_CFLAGS="$CFLAGS"
350
CFLAGS="$CFLAGS $option"
351
AC_MSG_CHECKING([whether gcc understands $option])
352
AC_TRY_COMPILE([], [],
355
if test $has_option = no; then
356
CFLAGS="$SAVE_CFLAGS"
358
AC_MSG_RESULT($has_option)
371
[AC_HELP_STRING([--enable-debug],
372
[turn on debugging])],
374
if test "$enable_debug" = "yes"; then
375
DEBUG_CFLAGS="-DG_ENABLE_DEBUG"
377
if test "x$enable_debug" = "xno"; then
378
DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
383
AC_SUBST(DEBUG_CFLAGS)
387
AC_SUBST(CONSOLE_KIT_CFLAGS)
388
AC_SUBST(CONSOLE_KIT_LIBS)
396
AC_ARG_WITH([systemdsystemunitdir],
397
AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
399
[with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
400
AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
401
AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir"])
410
tools/freebsd/Makefile
411
tools/solaris/Makefile
414
doc/dbus/ConsoleKit.xml
416
libck-connector/Makefile
417
libck-connector/ck-connector.pc
418
pam-ck-connector/Makefile
421
AC_CONFIG_HEADERS([config.h])
427
========================
430
exec_prefix: ${exec_prefix}
434
sysconfdir: ${sysconfdir}
435
localstatedir: ${localstatedir}
437
source code location: ${srcdir}
440
Base libs: ${CONSOLE_KIT_LIBS}
441
Tools libs: ${TOOLS_LIBS}
442
Maintainer mode: ${USE_MAINTAINER_MODE}
444
dbus-1 system.d dir: ${DBUS_SYS_DIR}
445
Build backend: ${CK_BACKEND}
446
PAM module dir: ${PAM_MODULE_DIR}
447
Build PAM module: ${msg_pam_module}
448
Build docs: ${enable_docbook_docs}
450
PolicyKit support ${have_polkit}
451
RBAC (Solaris) support: ${msg_rbac_shutdown}
453
if test x${have_polkit} = xno -a x${msg_rbac_shutdown} = xno; then
454
echo "WARNING: PolicyKit and RBAC are disabled. You need to manually edit the ConsoleKit.conf"
455
echo " file to lock down the service. Failure to do so may be"
456
echo " a huge SECURITY HOLE. I repeat: YOU NEED TO EDIT THE FILE"
457
echo " ConsoleKit.conf to match your distro/site to avoid NASTY SECURITY HOLES."