2 # This file is part of elogind.
4 # Copyright 2010-2012 Lennart Poettering
5 # Copyright 2010-2012 Kay Sievers
7 # elogind is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU Lesser General Public License as published by
9 # the Free Software Foundation; either version 2.1 of the License, or
10 # (at your option) any later version.
12 # elogind is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public License
18 # along with systemd; If not, see <http://www.gnu.org/licenses/>.
24 [https://github.com/elogind/elogind/issues],
26 [https://github.com/elogind/elogind])
28 AC_CONFIG_SRCDIR([src/login/logind.c])
29 AC_CONFIG_MACRO_DIR([m4])
30 AC_CONFIG_HEADERS([config.h])
31 AC_CONFIG_AUX_DIR([build-aux])
33 AC_USE_SYSTEM_EXTENSIONS
35 AC_PREFIX_DEFAULT([/usr])
36 AM_MAINTAINER_MODE([enable])
37 AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects parallel-tests])
38 AM_SILENT_RULES([yes])
40 AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [Canonical host string.])
45 AS_IF([test "x$ax_cv_c_compiler_vendor" = "xgnu"], [
46 AC_CHECK_TOOLS([AR], [gcc-ar ar], [:])
47 AC_CHECK_TOOLS([NM], [gcc-nm nm], [:])
48 AC_CHECK_TOOLS([RANLIB], [gcc-ranlib ranlib], [:])
52 LT_INIT([disable-static])
54 AS_IF([test "x$enable_static" = "xyes"], [AC_MSG_ERROR([--enable-static is not supported by elogind])])
55 AS_IF([test "x$enable_largefile" = "xno"], [AC_MSG_ERROR([--disable-largefile is not supported by elogind])])
57 SET_ARCH(X86_64, x86_64*)
60 SET_ARCH(AARCH64, aarch64*)
62 # i18n stuff for the PolicyKit policy files, heck whether intltool can be found, disable NLS otherwise
63 AC_CHECK_PROG(intltool_found, [intltool-merge], [yes], [no])
64 AS_IF([test x"$intltool_found" != xyes],
65 [AS_IF([test x"$enable_nls" = xyes],
66 [AC_MSG_ERROR([--enable-nls requested but intltool not found])],
67 [AS_IF([test x"$enable_nls" != xno],
68 [AC_MSG_WARN([*** Disabling NLS support because intltool was not found])
74 AS_IF([test x"$enable_nls" != xno -o "x$enable_polkit" != xno], [
75 # intltoolize greps for '^(AC|IT)_PROG_INTLTOOL', so it needs to be on its own line
76 IT_PROG_INTLTOOL([0.40.0])
79 AS_IF([test -z "$INTLTOOL_POLICY_RULE"], [
80 # If intltool is not available, provide a dummy rule to fail generation of %.policy files with a meaningful error message
81 INTLTOOL_POLICY_RULE='%.policy: %.policy.in ; @echo " ITMRG " $@ && echo "*** intltool support required to build target $@" && false'
82 AC_SUBST(INTLTOOL_POLICY_RULE)
85 GETTEXT_PACKAGE=elogind
86 AC_SUBST(GETTEXT_PACKAGE)
87 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [elogind])
95 AC_PATH_PROG([M4], [m4])
96 AC_PATH_PROG([XSLTPROC], [xsltproc])
98 AC_PATH_PROG([HALT], [halt], [halt])
99 AC_PATH_PROG([REBOOT], [reboot], [reboot])
100 AC_PATH_PROG([KEXEC], [kexec], [/usr/sbin/kexec], [$PATH:/usr/sbin:/sbin])
102 AS_IF([! ln --relative --help > /dev/null 2>&1], [AC_MSG_ERROR([*** ln doesn't support --relative ***])])
106 AC_CHECK_TOOL(OBJCOPY, objcopy)
107 AC_CHECK_TOOL(GPERF, gperf)
108 if test -z "$GPERF" ; then
109 AC_MSG_ERROR([*** gperf not found])
112 # ------------------------------------------------------------------------------
113 address_sanitizer_cflags=
114 address_sanitizer_cppflags=
115 address_sanitizer_ldflags=
116 AC_ARG_ENABLE(address-sanitizer, AS_HELP_STRING([--enable-address-sanitizer], [enable -fsanitize=address]))
117 AS_IF([test "x$enable_address_sanitizer" = "xyes"], [
118 CC_CHECK_FLAG_APPEND([with_as_cflags], [CFLAGS], [-fsanitize=address])
119 AS_IF([test -z "$with_as_cflags"],
120 [AC_MSG_ERROR([*** -fsanitize=address is not supported])])
121 address_sanitizer_cflags="$with_as_cflags -fno-omit-frame-pointer -DVALGRIND=1"
122 address_sanitizer_cppflags="-DVALGRIND=1"
123 address_sanitizer_ldflags="-Wc,-fsanitize=address"
126 undefined_sanitizer_cflags=
127 undefined_sanitizer_cppflags=
128 undefined_sanitizer_ldflags=
129 AC_ARG_ENABLE(undefined-sanitizer, AS_HELP_STRING([--enable-undefined-sanitizer], [enable -fsanitize=undefined]))
130 AS_IF([test "x$enable_undefined_sanitizer" = "xyes"], [
131 CC_CHECK_FLAG_APPEND([with_us_cflags], [CFLAGS], [-fsanitize=undefined])
132 AS_IF([test -z "$with_us_cflags"],
133 [AC_MSG_ERROR([*** -fsanitize=undefined is not supported])])
134 undefined_sanitizer_cflags="$with_us_cflags -fno-omit-frame-pointer -DVALGRIND=1"
135 undefined_sanitizer_cppflags="-DVALGRIND=1"
136 undefined_sanitizer_ldflags="-Wc,-fsanitize=undefined"
139 sanitizer_cflags="$address_sanitizer_cflags $undefined_sanitizer_cflags"
140 sanitizer_cppflags="$address_sanitizer_cppflags $undefined_sanitizer_cppflags"
141 sanitizer_ldflags="$address_sanitizer_ldflags $undefined_sanitizer_ldflags"
143 CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
148 "-Wformat=2 -Wformat-security -Wformat-nonliteral" \
150 -Wmissing-include-dirs \
151 -Wold-style-definition \
154 -Wdeclaration-after-statement \
156 -Wsuggest-attribute=noreturn \
157 -Werror=missing-prototypes \
158 -Werror=implicit-function-declaration \
159 -Werror=missing-declarations \
160 -Werror=return-type \
162 -Wstrict-prototypes \
167 -Wstrict-aliasing=2 \
169 -Wno-unused-parameter \
170 -Wno-missing-field-initializers \
172 -Wno-format-signedness \
178 -fdiagnostics-show-option \
179 -fno-strict-aliasing \
180 -fvisibility=hidden \
182 -fstack-protector-strong \
184 --param=ssp-buffer-size=4])
186 AS_CASE([$CC], [*clang*],
187 [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
188 -Wno-typedef-redefinition \
189 -Wno-gnu-variable-sized-type-not-at-end \
192 dnl AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
193 dnl [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
195 dnl [AC_MSG_RESULT([skipping -flto, optimization not enabled])])
196 dnl AC_SUBST([OUR_CFLAGS], "$with_cflags $sanitizer_cflags")
198 AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
199 [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
200 -Wp,-D_FORTIFY_SOURCE=2])],
201 [AC_MSG_RESULT([skipping -D_FORTIFY_SOURCE, optimization not enabled])])
202 AC_SUBST([OUR_CPPFLAGS], "$with_cppflags $sanitizer_cppflags")
204 AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
205 [CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
206 -Wl,--gc-sections])],
207 [AC_MSG_RESULT([skipping --gc-sections, optimization not enabled])])
208 AC_SUBST([OUR_CFLAGS], "$with_ldflags $sanitizer_cflags")
210 AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
211 [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
212 -ffunction-sections -fdata-sections])],
213 [AC_MSG_RESULT([skipping -ffunction/data-section, optimization not enabled])])
214 AC_SUBST([OUR_CFLAGS], "$with_cflags $sanitizer_cflags")
216 CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
223 AC_SUBST([OUR_LDFLAGS], "$with_ldflags $sanitizer_ldflags")
225 AC_CHECK_SIZEOF(pid_t)
226 AC_CHECK_SIZEOF(uid_t)
227 AC_CHECK_SIZEOF(gid_t)
228 AC_CHECK_SIZEOF(time_t)
229 AC_CHECK_SIZEOF(dev_t)
230 AC_CHECK_SIZEOF(rlim_t,,[
231 #include <sys/time.h>
232 #include <sys/resource.h>
235 GPERF_TEST="$(echo foo,bar | ${GPERF} -L ANSI-C)"
240 const char * in_word_set(const char *, size_t);
243 [GPERF_LEN_TYPE=size_t],
247 const char * in_word_set(const char *, unsigned);
250 [GPERF_LEN_TYPE=unsigned],
251 [AC_MSG_ERROR([** unable to determine gperf len type])]
255 AC_DEFINE_UNQUOTED([GPERF_LEN_TYPE], [$GPERF_LEN_TYPE], [gperf len type])
257 # ------------------------------------------------------------------------------
258 # we use python to build the man page index
260 AC_ARG_WITH([python],
261 [AS_HELP_STRING([--without-python], [Disable building the man page index (default: test)])])
264 AS_IF([test "x$with_python" != "xno"], [
265 AM_PATH_PYTHON(,, [:])
266 AS_IF([test "x$PYTHON" != "x:"], [
267 AC_MSG_CHECKING([for python lxml module])
268 AS_IF(["$PYTHON" -c 'import lxml' 2>/dev/null], [have_lxml=yes])
269 AC_MSG_RESULT([$have_lxml])
270 AS_IF([test "x$have_lxml" = "xyes"], [have_python=yes],
271 [AC_MSG_WARN([*** python support requires python-lxml module installed])])
274 AS_IF([test "$have_python" != "yes"], [
275 AS_IF([test "$with_python" = "yes"],
276 [AC_MSG_ERROR([*** python support requested but python support not found])])
277 AS_IF([test "$with_python" != "no"],
278 [AC_MSG_WARN([*** python support not found, some documentation cannot be built])])
281 AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])
283 # ------------------------------------------------------------------------------
285 AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
286 AC_CHECK_HEADERS([linux/btrfs.h], [], [])
287 AC_CHECK_HEADERS([linux/memfd.h], [], [])
289 # unconditionally pull-in librt with old glibc versions
290 AC_SEARCH_LIBS([clock_gettime], [rt], [], [])
291 AC_SEARCH_LIBS([mq_unlink], [rt], [], [])
293 AC_ARG_WITH([libcap],
294 AS_HELP_STRING([--with-libcap=DIR], [Prefix for libcap]),
295 [CAP_LDFLAGS="-L$with_libcap/lib"],
298 save_LDFLAGS="$LDFLAGS"
300 LDFLAGS="$LDFLAGS $CAP_LDFLAGS"
301 AC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not found])])
304 AC_SUBST(CAP_LDFLAGS)
306 LDFLAGS="$save_LDFLAGS"
308 AC_CHECK_FUNCS([memfd_create])
309 AC_CHECK_FUNCS([__secure_getenv secure_getenv])
310 AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at, setns, getrandom, renameat2, kcmp, LO_FLAGS_PARTSCAN],
312 #include <sys/types.h>
314 #include <sys/mount.h>
317 #include <linux/loop.h>
318 #include <linux/random.h>
321 AC_CHECK_DECLS([IFLA_INET6_ADDR_GEN_MODE,
328 IFLA_VXLAN_REMCSUM_NOPARTIAL,
330 IFLA_IPTUN_ENCAP_DPORT,
331 IFLA_GRE_ENCAP_DPORT,
332 IFLA_BRIDGE_VLAN_INFO,
333 IFLA_BRPORT_LEARNING_SYNC,
337 #include <inttypes.h>
338 #include <netinet/in.h>
339 #include <netinet/ether.h>
340 #include <linux/rtnetlink.h>
342 #include <linux/ip.h>
343 #include <linux/if_tunnel.h>
344 #include <linux/if_link.h>
345 #include <linux/if_bridge.h>
346 #include <linux/if_addr.h>
347 #include <linux/neighbour.h>
350 # This makes sure pkg.m4 is available.
351 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
353 # ------------------------------------------------------------------------------
355 AC_ARG_ENABLE(dbus, AS_HELP_STRING([--disable-dbus], [disable usage of dbus-1 in tests]))
356 AS_IF([test "x$enable_dbus" != "xno"], [
357 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.3.2],
358 [AC_DEFINE(HAVE_DBUS, 1, [Define if dbus-1 library is available]) have_dbus=yes],
360 AS_IF([test "x$have_dbus" = "xno" -a "x$enable_dbus" = "xyes"],
361 [AC_MSG_ERROR([*** dbus-1 support requested but libraries not found])])])
362 AM_CONDITIONAL(HAVE_DBUS, [test "$have_dbus" = "yes"])
364 # ------------------------------------------------------------------------------
365 PKG_CHECK_MODULES(UDEV, [libudev])
367 AC_ARG_WITH([udevrulesdir],
368 AS_HELP_STRING([--with-udevrulesdir=DIR], [Directory for udev rules files]),
370 [with_udevrulesdir=$($PKG_CONFIG --variable=udevdir udev)/rules.d])
371 AC_SUBST([udevrulesdir], [$with_udevrulesdir])
373 AC_ARG_WITH([udevbindir],
374 AS_HELP_STRING([--with-udevbindir=DIR], [Directory for udev binary files]),
376 [with_udevbindir=$($PKG_CONFIG --variable=udevdir udev)])
377 AC_SUBST([udevbindir], [$with_udevbindir])
379 # ------------------------------------------------------------------------------
381 AC_ARG_ENABLE(coverage, AS_HELP_STRING([--enable-coverage], [enable test coverage]))
382 if test "x$enable_coverage" = "xyes" ; then
383 AC_CHECK_PROG(lcov_found, [lcov], [yes], [no])
384 if test "x$lcov_found" = xno ; then
385 AC_MSG_ERROR([*** lcov support requested but the program was not found])
387 lcov_version_major="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 1`"
388 lcov_version_minor="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 2`"
389 if test "$lcov_version_major" -eq 1 -a "$lcov_version_minor" -lt 10; then
390 AC_MSG_ERROR([*** lcov version is too old. 1.10 required])
393 CC_CHECK_FLAGS_APPEND([with_coverage_cflags], [CFLAGS], [\
396 AC_SUBST([OUR_CFLAGS], "$with_cflags $with_coverage_cflags")
400 AM_CONDITIONAL(ENABLE_COVERAGE, [test "$have_coverage" = "yes"])
402 # ------------------------------------------------------------------------------
404 AC_ARG_ENABLE(blkid, AS_HELP_STRING([--disable-blkid], [disable blkid support]))
405 if test "x$enable_blkid" != "xno"; then
406 PKG_CHECK_MODULES(BLKID, [ blkid >= 2.24 ],
407 [AC_DEFINE(HAVE_BLKID, 1, [Define if blkid is available]) have_blkid=yes], have_blkid=no)
408 if test "x$have_blkid" = xno -a "x$enable_blkid" = xyes; then
409 AC_MSG_ERROR([*** blkid support requested but libraries not found])
412 AM_CONDITIONAL(HAVE_BLKID, [test "$have_blkid" = "yes"])
414 # ------------------------------------------------------------------------------
416 AC_ARG_ENABLE(seccomp, AS_HELP_STRING([--disable-seccomp], [Disable optional SECCOMP support]))
417 if test "x$enable_seccomp" != "xno"; then
418 PKG_CHECK_MODULES(SECCOMP, [libseccomp >= 1.0.0],
419 [AC_DEFINE(HAVE_SECCOMP, 1, [Define if seccomp is available])
421 M4_DEFINES="$M4_DEFINES -DHAVE_SECCOMP"],
423 if test "x$have_seccomp" = "xno" -a "x$enable_seccomp" = "xyes"; then
424 AC_MSG_ERROR([*** seccomp support requested but libraries not found])
427 AM_CONDITIONAL(HAVE_SECCOMP, [test "$have_seccomp" = "yes"])
429 # ------------------------------------------------------------------------------
431 AC_ARG_ENABLE(selinux, AS_HELP_STRING([--disable-selinux], [Disable optional SELINUX support]))
432 if test "x$enable_selinux" != "xno"; then
433 PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.1.9],
434 [AC_DEFINE(HAVE_SELINUX, 1, [Define if SELinux is available])
436 M4_DEFINES="$M4_DEFINES -DHAVE_SELINUX"],
438 if test "x$have_selinux" = xno -a "x$enable_selinux" = xyes; then
439 AC_MSG_ERROR([*** SELinux support requested but libraries not found])
442 AM_CONDITIONAL(HAVE_SELINUX, [test "$have_selinux" = "yes"])
445 AC_ARG_ENABLE(apparmor, AS_HELP_STRING([--disable-apparmor], [Disable optional AppArmor support]))
446 if test "x$enable_apparmor" != "xno"; then
447 PKG_CHECK_MODULES([APPARMOR], [libapparmor],
448 [AC_DEFINE(HAVE_APPARMOR, 1, [Define if AppArmor is available])
450 M4_DEFINES="$M4_DEFINES -DHAVE_APPARMOR"],
452 if test "x$have_apparmor" = xno -a "x$enable_apparmor" = xyes; then
453 AC_MSG_ERROR([*** AppArmor support requested but libraries not found])
456 AM_CONDITIONAL(HAVE_APPARMOR, [test "$have_apparmor" = "yes"])
458 # ------------------------------------------------------------------------------
460 AS_HELP_STRING([--disable-pam],[Disable optional PAM support]),
461 [case "${enableval}" in
464 *) AC_MSG_ERROR(bad value ${enableval} for --disable-pam) ;;
468 if test "x${have_pam}" != xno ; then
470 [security/pam_modules.h security/pam_modutil.h security/pam_ext.h],
472 [if test "x$have_pam" = xyes ; then
473 AC_MSG_ERROR([*** PAM headers not found.])
480 [if test "x$have_pam" = xyes ; then
481 AC_MSG_ERROR([*** libpam not found.])
484 if test "x$have_pam" = xyes ; then
485 PAM_LIBS="-lpam -lpam_misc"
486 AC_DEFINE(HAVE_PAM, 1, [PAM available])
487 M4_DEFINES="$M4_DEFINES -DHAVE_PAM"
495 AM_CONDITIONAL([HAVE_PAM], [test "x$have_pam" != xno])
497 # ------------------------------------------------------------------------------
499 AS_HELP_STRING([--disable-acl],[Disable optional ACL support]),
500 [case "${enableval}" in
503 *) AC_MSG_ERROR(bad value ${enableval} for --disable-acl) ;;
507 if test "x${have_acl}" != xno ; then
509 [sys/acl.h acl/libacl.h],
511 [if test "x$have_acl" = xyes ; then
512 AC_MSG_ERROR([*** ACL headers not found.])
519 [if test "x$have_acl" = xyes ; then
520 AC_MSG_ERROR([*** libacl not found.])
523 if test "x$have_acl" = xyes ; then
525 AC_DEFINE(HAVE_ACL, 1, [ACL available])
526 M4_DEFINES="$M4_DEFINES -DHAVE_ACL"
534 AM_CONDITIONAL([HAVE_ACL], [test "x$have_acl" != xno])
536 # ------------------------------------------------------------------------------
537 AC_ARG_ENABLE([smack], AS_HELP_STRING([--disable-smack],[Disable optional SMACK support]),
538 [case "${enableval}" in
539 yes) have_smack=yes ;;
541 *) AC_MSG_ERROR(bad value ${enableval} for --disable-smack) ;;
545 if test "x${have_smack}" = xauto; then
546 M4_DEFINES="$M4_DEFINES -DHAVE_SMACK"
550 AC_ARG_WITH(smack-run-label,
551 AS_HELP_STRING([--with-smack-run-label=STRING],
552 [run elogind --system itself with a specific SMACK label]),
553 [AC_DEFINE_UNQUOTED(SMACK_RUN_LABEL, ["$withval"], [Run elogind itself with SMACK label])],
556 AC_ARG_WITH(smack-default-process-label,
557 AS_HELP_STRING([--with-smack-default-process-label=STRING],
558 [default SMACK label for executed processes]),
559 [AC_DEFINE_UNQUOTED(SMACK_DEFAULT_PROCESS_LABEL, ["$withval"], [Default SMACK label for executed processes])],
562 if test "x${have_smack}" = xyes ; then
563 AC_DEFINE(HAVE_SMACK, 1, [Define if SMACK is available])
566 AM_CONDITIONAL([HAVE_SMACK], [test "x$have_smack" = "xyes"])
568 # ------------------------------------------------------------------------------
570 #AC_ARG_ENABLE(logind, AS_HELP_STRING([--disable-logind], [disable login daemon]))
571 #if test "x$enable_logind" != "xno"; then
574 AM_CONDITIONAL(ENABLE_LOGIND, [test "$have_logind" = "yes"])
575 AS_IF([test "$have_logind" = "yes"], [ AC_DEFINE(HAVE_LOGIND, [1], [Logind support available]) ])
577 # ------------------------------------------------------------------------------
578 AC_ARG_WITH(system-uid-max,
579 AS_HELP_STRING([--with-system-uid-max=UID]
580 [Maximum UID for system users]),
581 [SYSTEM_UID_MAX="$withval"],
582 [SYSTEM_UID_MAX="`awk 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }' /etc/login.defs 2>/dev/null || echo 999`"])
584 AC_DEFINE_UNQUOTED(SYSTEM_UID_MAX, [$SYSTEM_UID_MAX], [Maximum System UID])
585 AC_SUBST(SYSTEM_UID_MAX)
587 # ------------------------------------------------------------------------------
588 AC_ARG_WITH(system-gid-max,
589 AS_HELP_STRING([--with-system-gid-max=GID]
590 [Maximum GID for system groups]),
591 [SYSTEM_GID_MAX="$withval"],
592 [SYSTEM_GID_MAX="`awk 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }' /etc/login.defs 2>/dev/null || echo 999`"])
594 AC_DEFINE_UNQUOTED(SYSTEM_GID_MAX, [$SYSTEM_GID_MAX], [Maximum System GID])
595 AC_SUBST(SYSTEM_GID_MAX)
597 # ------------------------------------------------------------------------------
599 AC_ARG_ENABLE(polkit, AS_HELP_STRING([--disable-polkit], [disable PolicyKit support]))
600 if test "x$enable_polkit" != "xno"; then
601 AC_DEFINE(ENABLE_POLKIT, 1, [Define if PolicyKit support is to be enabled])
604 AM_CONDITIONAL(ENABLE_POLKIT, [test "x$have_polkit" = "xyes"])
606 # ------------------------------------------------------------------------------
608 AC_ARG_ENABLE(kdbus, AS_HELP_STRING([--disable-kdbus], [do not connect to kdbus by default]))
609 if test "x$enable_kdbus" != "xno"; then
610 AC_DEFINE(ENABLE_KDBUS, 1, [Define if kdbus is to be connected to by default])
612 M4_DEFINES="$M4_DEFINES -DENABLE_KDBUS"
614 AM_CONDITIONAL(ENABLE_KDBUS, [test "$have_kdbus" = "yes"])
616 # ------------------------------------------------------------------------------
617 AC_CHECK_HEADERS_ONCE([valgrind/memcheck.h valgrind/valgrind.h])
619 # ------------------------------------------------------------------------------
620 PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0 gio-2.0],
621 [have_glib=yes], [have_glib=no])
622 AS_IF([test "x$have_glib" = "xyes"], [ AC_DEFINE(HAVE_GLIB, 1, [Define if glib is available]) ])
624 # ------------------------------------------------------------------------------
626 AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-manpages], [disable manpages]))
627 AS_IF([test "x$enable_manpages" != xno], [have_manpages=yes])
628 AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
630 # ------------------------------------------------------------------------------
633 AC_ARG_WITH([dbuspolicydir],
634 AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
636 [with_dbuspolicydir=${sysconfdir}/dbus-1/system.d])
637 AX_NORMALIZE_PATH([with_dbuspolicydir])
639 AC_ARG_WITH([dbussystemservicedir],
640 AS_HELP_STRING([--with-dbussystemservicedir=DIR], [D-Bus system service directory]),
642 [with_dbussystemservicedir=${datadir}/dbus-1/system-services])
643 AX_NORMALIZE_PATH([with_dbussystemservicedir])
645 AC_ARG_WITH([bashcompletiondir],
646 AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),
648 [AS_IF([$($PKG_CONFIG --exists bash-completion)], [
649 with_bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion)
651 with_bashcompletiondir=${datadir}/bash-completion/completions
653 AM_CONDITIONAL(ENABLE_BASH_COMPLETION, [test "$with_bashcompletiondir" != "no"])
654 AX_NORMALIZE_PATH([with_bashcompletiondir])
656 AC_ARG_WITH([zshcompletiondir],
657 AS_HELP_STRING([--with-zshcompletiondir=DIR], [Zsh completions directory]),
658 [], [with_zshcompletiondir=${datadir}/zsh/site-functions])
659 AM_CONDITIONAL(ENABLE_ZSH_COMPLETION, [test "$with_zshcompletiondir" != "no"])
660 AX_NORMALIZE_PATH([with_zshcompletiondir])
662 AC_ARG_WITH([rootprefix],
663 AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
664 [], [with_rootprefix=${ac_default_prefix}])
665 # --with-rootprefix= (empty) should default to "/" but AX_NORMALIZE_PATH
666 # defaults those to ".", solve that here for now until we can find a suitable
667 # fix for AX_NORMALIZE_PATH upstream at autoconf-archive.
668 # See: https://github.com/systemd/systemd/issues/54
669 if test "x${with_rootprefix}" = "x"; then
672 AX_NORMALIZE_PATH([with_rootprefix])
674 AC_ARG_WITH([rootlibdir],
675 AS_HELP_STRING([--with-rootlibdir=DIR], [Root directory for libraries necessary for boot]),
677 [with_rootlibdir=${libdir}])
678 AX_NORMALIZE_PATH([with_rootlibdir])
680 AC_ARG_WITH([pamlibdir],
681 AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]),
683 [with_pamlibdir=${with_rootlibdir}/security])
684 AX_NORMALIZE_PATH([with_pamlibdir])
686 AC_ARG_WITH([pamconfdir],
687 AS_HELP_STRING([--with-pamconfdir=DIR], [Directory for PAM configuration]),
689 [with_pamconfdir=${sysconfdir}/pam.d])
690 AX_NORMALIZE_PATH([with_pamconfdir])
692 AC_ARG_ENABLE([split-usr],
693 AS_HELP_STRING([--enable-split-usr], [Assume that /bin, /sbin aren\'t symlinks into /usr]),
695 [AS_IF([test "x${ac_default_prefix}" != "x${with_rootprefix}"], [
701 AS_IF([test "x${enable_split_usr}" = "xyes"], [
702 AC_DEFINE(HAVE_SPLIT_USR, 1, [Define if /bin, /sbin aren't symlinks into /usr])
704 AM_CONDITIONAL(ENABLE_SPLIT_USR, [test "x${enable_split_usr}" = "xyes"])
706 # work around intltool-update issues during 'make distcheck'
707 AS_IF([test "x$0" != "x./configure"], [
708 AC_SUBST([INTLTOOL_UPDATE], [/usr/bin/env true])
712 [AC_HELP_STRING([--disable-tests], [disable tests])],
713 enable_tests=$enableval, enable_tests=yes)
714 AM_CONDITIONAL(ENABLE_TESTS, [test x$enable_tests = xyes])
717 [AC_HELP_STRING([--enable-debug@<:@=LIST@:>@], [enable extra debugging (hashmap,mmap-cache)])],
718 [if test "x$enableval" = "xyes"; then
719 enableval="hashmap,mmap-cache"
722 IFS="$IFS$PATH_SEPARATOR,"
723 for name in $enableval; do
726 enable_debug_hashmap=yes
729 enable_debug_mmap_cache=yes
733 IFS="$saved_ifs"],[])
736 AS_IF([test x$enable_debug_hashmap = xyes], [
737 AC_DEFINE(ENABLE_DEBUG_HASHMAP, 1, [Define if hashmap debugging is to be enabled])
738 enable_debug="hashmap $enable_debug"
740 AS_IF([test x$enable_debug_mmap_cache = xyes], [
741 AC_DEFINE(ENABLE_DEBUG_MMAP_CACHE, 1, [Define if mmap cache debugging is to be enabled])
742 enable_debug="mmap-cache $enable_debug"
744 test -z "$enable_debug" && enable_debug="none"
746 AC_SUBST([dbuspolicydir], [$with_dbuspolicydir])
747 AC_SUBST([dbussystemservicedir], [$with_dbussystemservicedir])
748 AC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
749 AC_SUBST([zshcompletiondir], [$with_zshcompletiondir])
750 AC_SUBST([pamlibdir], [$with_pamlibdir])
751 AC_SUBST([pamconfdir], [$with_pamconfdir])
752 AC_SUBST([rootprefix], [$with_rootprefix])
753 AC_SUBST([rootlibdir], [$with_rootlibdir])
762 $PACKAGE_NAME $VERSION
765 AppArmor: ${have_apparmor}
766 SELinux: ${have_selinux}
767 SECCOMP: ${have_seccomp}
770 polkit: ${have_polkit}
774 Python: ${have_python}
775 man pages: ${have_manpages}
776 test coverage: ${have_coverage}
777 Split /usr: ${enable_split_usr}
778 extra debugging: ${enable_debug}
781 rootprefix: ${with_rootprefix}
782 sysconf dir: ${sysconfdir}
783 datarootdir: ${datarootdir}
784 includedir: ${includedir}
786 rootlib dir: ${with_rootlibdir}
787 PAM modules dir: ${with_pamlibdir}
788 PAM configuration dir: ${with_pamconfdir}
789 D-Bus policy dir: ${with_dbuspolicydir}
790 D-Bus system dir: ${with_dbussystemservicedir}
791 Bash completions dir: ${with_bashcompletiondir}
792 Zsh completions dir: ${with_zshcompletiondir}
793 Maximum System UID: ${SYSTEM_UID_MAX}
794 Maximum System GID: ${SYSTEM_GID_MAX}
796 CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
797 CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
798 LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}