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, check 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])
113 # ------------------------------------------------------------------------------
114 # Find running cgroup controller
116 AS_IF( [test -f /proc/self/cgroup], [
117 # If the init system is a cgroup controler, it will be position 1.
118 # Secondary controllers, like cgmanager, do not work.
119 with_cgroupctrl=`grep "^1:name=" /proc/self/cgroup | cut -d ':' -f 2`
120 AS_IF( [test -z "$with_cgroupctrl"], [
121 # Try to be our own cgroup controller
122 with_cgroupctrl="name=elogind"
125 AS_IF( [test -z "$with_cgroupctrl"],
126 AC_MSG_ERROR([No running cgroup controller found]))
129 # ------------------------------------------------------------------------------
130 address_sanitizer_cflags=
131 address_sanitizer_cppflags=
132 address_sanitizer_ldflags=
133 AC_ARG_ENABLE(address-sanitizer, AS_HELP_STRING([--enable-address-sanitizer], [enable -fsanitize=address]))
134 AS_IF([test "x$enable_address_sanitizer" = "xyes"], [
135 CC_CHECK_FLAG_APPEND([with_as_cflags], [CFLAGS], [-fsanitize=address])
136 AS_IF([test -z "$with_as_cflags"],
137 [AC_MSG_ERROR([*** -fsanitize=address is not supported])])
138 address_sanitizer_cflags="$with_as_cflags -fno-omit-frame-pointer -DVALGRIND=1"
139 address_sanitizer_cppflags="-DVALGRIND=1"
140 address_sanitizer_ldflags="-Wc,-fsanitize=address"
143 undefined_sanitizer_cflags=
144 undefined_sanitizer_cppflags=
145 undefined_sanitizer_ldflags=
146 AC_ARG_ENABLE(undefined-sanitizer, AS_HELP_STRING([--enable-undefined-sanitizer], [enable -fsanitize=undefined]))
147 AS_IF([test "x$enable_undefined_sanitizer" = "xyes"], [
148 CC_CHECK_FLAG_APPEND([with_us_cflags], [CFLAGS], [-fsanitize=undefined])
149 AS_IF([test -z "$with_us_cflags"],
150 [AC_MSG_ERROR([*** -fsanitize=undefined is not supported])])
151 undefined_sanitizer_cflags="$with_us_cflags -fno-omit-frame-pointer -DVALGRIND=1"
152 undefined_sanitizer_cppflags="-DVALGRIND=1"
153 undefined_sanitizer_ldflags="-Wc,-fsanitize=undefined"
156 sanitizer_cflags="$address_sanitizer_cflags $undefined_sanitizer_cflags"
157 sanitizer_cppflags="$address_sanitizer_cppflags $undefined_sanitizer_cppflags"
158 sanitizer_ldflags="$address_sanitizer_ldflags $undefined_sanitizer_ldflags"
160 CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
165 "-Wformat=2 -Wformat-security -Wformat-nonliteral" \
167 -Wmissing-include-dirs \
168 -Wold-style-definition \
171 -Wdeclaration-after-statement \
173 -Wsuggest-attribute=noreturn \
174 -Werror=missing-prototypes \
175 -Werror=implicit-function-declaration \
176 -Werror=missing-declarations \
177 -Werror=return-type \
178 -Wstrict-prototypes \
183 -Wstrict-aliasing=2 \
185 -Wno-unused-parameter \
186 -Wno-missing-field-initializers \
188 -Wno-format-signedness \
194 -fdiagnostics-show-option \
195 -fno-strict-aliasing \
196 -fvisibility=hidden \
198 -fstack-protector-strong \
200 --param=ssp-buffer-size=4])
202 CC_CHECK_FLAG_APPEND([with_cflags], [CFLAGS], [-Werror=shadow], [
204 #include <inttypes.h>
205 typedef uint64_t usec_t;
206 usec_t now(clockid_t clock);
213 AS_CASE([$CC], [*clang*],
214 [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
215 -Wno-typedef-redefinition \
216 -Wno-gnu-variable-sized-type-not-at-end \
220 # ------------------------------------------------------------------------------
221 # On some distributions -flto, even if available, leads to linking errors.
222 # We therefore make it optional
225 [AS_HELP_STRING([--disable-lto], [Disable link time optimization (default: test)])])
227 AS_IF([test "x$enable_lto" != "xno"], [
228 AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
230 [AC_MSG_RESULT([skipping -flto, optimization not enabled])])
231 AS_IF([test "$have_lto" != "no"],
232 [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [-flto])]
234 AC_SUBST([OUR_CFLAGS], "$with_cflags $sanitizer_cflags")
237 # ------------------------------------------------------------------------------
238 AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
239 [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
240 -Wp,-D_FORTIFY_SOURCE=2])],
241 [AC_MSG_RESULT([skipping -D_FORTIFY_SOURCE, optimization not enabled])])
242 AC_SUBST([OUR_CPPFLAGS], "$with_cppflags $sanitizer_cppflags")
244 AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
245 [CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
246 -Wl,--gc-sections])],
247 [AC_MSG_RESULT([skipping --gc-sections, optimization not enabled])])
248 AC_SUBST([OUR_CFLAGS], "$with_ldflags $sanitizer_cflags")
250 AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
251 [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
252 -ffunction-sections -fdata-sections])],
253 [AC_MSG_RESULT([skipping -ffunction/data-section, optimization not enabled])])
254 AC_SUBST([OUR_CFLAGS], "$with_cflags $sanitizer_cflags")
256 CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
263 AC_SUBST([OUR_LDFLAGS], "$with_ldflags $sanitizer_ldflags")
265 AC_CHECK_SIZEOF(pid_t)
266 AC_CHECK_SIZEOF(uid_t)
267 AC_CHECK_SIZEOF(gid_t)
268 AC_CHECK_SIZEOF(time_t)
269 AC_CHECK_SIZEOF(dev_t)
270 AC_CHECK_SIZEOF(rlim_t,,[
271 #include <sys/time.h>
272 #include <sys/resource.h>
275 GPERF_TEST="$(echo foo,bar | ${GPERF} -L ANSI-C)"
276 save_CFLAGS="$CFLAGS"
277 CFLAGS="$CFLAGS -Wno-error"
281 const char * in_word_set(const char *, size_t);
284 [GPERF_LEN_TYPE=size_t],
288 const char * in_word_set(const char *, unsigned);
291 [GPERF_LEN_TYPE=unsigned],
292 [AC_MSG_ERROR([** unable to determine gperf len type])]
295 CFLAGS="$save_CFLAGS"
297 AC_DEFINE_UNQUOTED([GPERF_LEN_TYPE], [$GPERF_LEN_TYPE], [gperf len type])
299 # ------------------------------------------------------------------------------
300 # we use python to build the man page index
302 AC_ARG_WITH([python],
303 [AS_HELP_STRING([--without-python], [Disable building the man page index and systemd-python (default: test)])])
306 AS_IF([test "x$with_python" != "xno"], [
307 AM_PATH_PYTHON(,, [:])
308 AS_IF([test "x$PYTHON" != "x:"], [
309 AC_MSG_CHECKING([for python lxml module])
310 AS_IF(["$PYTHON" -c 'import lxml' 2>/dev/null], [have_lxml=yes])
311 AC_MSG_RESULT([$have_lxml])
312 AS_IF([test "x$have_lxml" = "xyes"], [have_python=yes],
313 [AC_MSG_WARN([*** python support requires python-lxml module installed])])
316 AS_IF([test "$have_python" != "yes"], [
317 AS_IF([test "$with_python" = "yes"],
318 [AC_MSG_ERROR([*** python support requested but python support not found])])
319 AS_IF([test "$with_python" != "no"],
320 [AC_MSG_WARN([*** python support not found, some documentation cannot be built])])
322 AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])
324 # ------------------------------------------------------------------------------
326 AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
327 AC_CHECK_HEADERS([linux/memfd.h], [], [])
329 AC_CHECK_HEADERS([printf.h], [have_printf_h=yes], [have_printf_h=no])
330 AS_IF([test x$have_printf_h = xyes], [
331 AC_DEFINE(HAVE_PRINTF_H, 1, [Define if printf.h was found])
336 # unconditionally pull-in librt with old glibc versions
337 dnl AC_SEARCH_LIBS([clock_gettime], [rt], [], [])
338 dnl AC_SEARCH_LIBS([mq_unlink], [rt], [], [])
342 AC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not found])])
346 AC_CHECK_FUNCS([__secure_getenv secure_getenv])
360 #include <sys/types.h>
362 #include <sys/mount.h>
365 #include <linux/loop.h>
366 #include <linux/random.h>
369 AC_CHECK_TYPES([char16_t, char32_t, key_serial_t],
374 AC_CHECK_DECLS([IFLA_INET6_ADDR_GEN_MODE,
381 IFLA_VXLAN_REMCSUM_NOPARTIAL,
382 IFLA_IPTUN_ENCAP_DPORT,
383 IFLA_GRE_ENCAP_DPORT,
384 IFLA_BRIDGE_VLAN_INFO,
385 IFLA_BRPORT_PROXYARP,
386 IFLA_BRPORT_LEARNING_SYNC,
387 IFLA_BR_VLAN_DEFAULT_PVID,
391 #include <inttypes.h>
392 #include <netinet/in.h>
393 #include <netinet/ether.h>
394 #include <linux/rtnetlink.h>
396 #include <linux/ip.h>
397 #include <linux/if_tunnel.h>
398 #include <linux/if_link.h>
399 #include <linux/if_bridge.h>
400 #include <linux/if_addr.h>
401 #include <linux/neighbour.h>
404 # This makes sure pkg.m4 is available.
405 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
408 # ------------------------------------------------------------------------------
409 PKG_CHECK_MODULES(UDEV, [libudev])
411 AC_ARG_WITH([udevrulesdir],
412 AS_HELP_STRING([--with-udevrulesdir=DIR], [Directory for udev rules files]),
414 [with_udevrulesdir=$($PKG_CONFIG --variable=udevdir udev)/rules.d])
415 AC_SUBST([udevrulesdir], [$with_udevrulesdir])
417 AC_ARG_WITH([udevbindir],
418 AS_HELP_STRING([--with-udevbindir=DIR], [Directory for udev binary files]),
420 [with_udevbindir=$($PKG_CONFIG --variable=udevdir udev)])
421 AC_SUBST([udevbindir], [$with_udevbindir])
423 # ------------------------------------------------------------------------------
425 AC_ARG_ENABLE([utmp], AS_HELP_STRING([--disable-utmp], [disable utmp/wtmp log handling]),
426 AS_CASE("x${enableval}",
427 [xyes], [have_utmp=yes],
428 [xno], [have_utmp=no],
429 AC_MSG_ERROR(bad value ${enableval} for --enable-utmp)))
430 AS_IF([test "x$have_utmp" = "xyes"], [AC_DEFINE(HAVE_UTMP, 1, [Define if utmp/wtmp support is enabled])])
431 AM_CONDITIONAL([HAVE_UTMP], [test "x$have_utmp" = "xyes"])
433 # ------------------------------------------------------------------------------
435 AC_ARG_ENABLE(coverage, AS_HELP_STRING([--enable-coverage], [enable test coverage]))
436 if test "x$enable_coverage" = "xyes" ; then
437 AC_CHECK_PROG(lcov_found, [lcov], [yes], [no])
438 if test "x$lcov_found" = xno ; then
439 AC_MSG_ERROR([*** lcov support requested but the program was not found])
441 lcov_version_major="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 1`"
442 lcov_version_minor="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 2`"
443 if test "$lcov_version_major" -eq 1 -a "$lcov_version_minor" -lt 10; then
444 AC_MSG_ERROR([*** lcov version is too old. 1.10 required])
447 CC_CHECK_FLAGS_APPEND([with_coverage_cflags], [CFLAGS], [\
450 AC_SUBST([OUR_CFLAGS], "$with_cflags $with_coverage_cflags")
454 AM_CONDITIONAL(ENABLE_COVERAGE, [test "$have_coverage" = "yes"])
456 # ------------------------------------------------------------------------------
458 AC_ARG_ENABLE(selinux, AS_HELP_STRING([--disable-selinux], [Disable optional SELINUX support]))
459 if test "x$enable_selinux" != "xno"; then
460 PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.1.9],
461 [AC_DEFINE(HAVE_SELINUX, 1, [Define if SELinux is available])
463 M4_DEFINES="$M4_DEFINES -DHAVE_SELINUX"],
465 if test "x$have_selinux" = xno -a "x$enable_selinux" = xyes; then
466 AC_MSG_ERROR([*** SELinux support requested but libraries not found])
469 AM_CONDITIONAL(HAVE_SELINUX, [test "$have_selinux" = "yes"])
471 # ------------------------------------------------------------------------------
472 AC_ARG_WITH([kill-user-processes],
473 [AS_HELP_STRING([--without-kill-user-processes], [Set elogind's KillUserProcesses=no by default])])
474 AS_IF([test "$with_kill_user_processes" != "no"],
475 [kill_user_processes=true
476 KILL_USER_PROCESSES=yes],
477 [kill_user_processes=false
478 KILL_USER_PROCESSES=no])
479 AC_DEFINE_UNQUOTED(KILL_USER_PROCESSES, [$kill_user_processes], [Default KillUserProcesses setting])
480 AC_SUBST(KILL_USER_PROCESSES)
482 # ------------------------------------------------------------------------------
484 AS_HELP_STRING([--disable-pam],[Disable optional PAM support]),
485 [case "${enableval}" in
488 *) AC_MSG_ERROR(bad value ${enableval} for --disable-pam) ;;
492 if test "x${have_pam}" != xno ; then
494 [security/pam_modules.h security/pam_modutil.h security/pam_ext.h],
496 [if test "x$have_pam" = xyes ; then
497 AC_MSG_ERROR([*** PAM headers not found.])
504 [if test "x$have_pam" = xyes ; then
505 AC_MSG_ERROR([*** libpam not found.])
508 if test "x$have_pam" = xyes ; then
509 PAM_LIBS="-lpam -lpam_misc"
510 AC_DEFINE(HAVE_PAM, 1, [PAM available])
511 M4_DEFINES="$M4_DEFINES -DHAVE_PAM"
519 AM_CONDITIONAL([HAVE_PAM], [test "x$have_pam" != xno])
521 # ------------------------------------------------------------------------------
523 AS_HELP_STRING([--disable-acl],[Disable optional ACL support]),
524 [case "${enableval}" in
527 *) AC_MSG_ERROR(bad value ${enableval} for --disable-acl) ;;
531 if test "x${have_acl}" != xno ; then
533 [sys/acl.h acl/libacl.h],
535 [if test "x$have_acl" = xyes ; then
536 AC_MSG_ERROR([*** ACL headers not found.])
543 [if test "x$have_acl" = xyes ; then
544 AC_MSG_ERROR([*** libacl not found.])
547 if test "x$have_acl" = xyes ; then
549 AC_DEFINE(HAVE_ACL, 1, [ACL available])
550 M4_DEFINES="$M4_DEFINES -DHAVE_ACL"
558 AM_CONDITIONAL([HAVE_ACL], [test "x$have_acl" != xno])
560 # ------------------------------------------------------------------------------
561 AC_ARG_ENABLE([smack], AS_HELP_STRING([--disable-smack],[Disable optional SMACK support]),
562 [case "${enableval}" in
563 yes) have_smack=yes ;;
565 *) AC_MSG_ERROR(bad value ${enableval} for --disable-smack) ;;
569 if test "x${have_smack}" != xno; then
570 AC_DEFINE(HAVE_SMACK, 1, [Define if SMACK is available])
571 M4_DEFINES="$M4_DEFINES -DHAVE_SMACK"
575 AM_CONDITIONAL([HAVE_SMACK], [test "x$have_smack" = "xyes"])
577 have_smack_run_label=no
578 AC_ARG_WITH(smack-run-label,
579 AS_HELP_STRING([--with-smack-run-label=STRING],
580 [run systemd --system itself with a specific SMACK label]),
581 [AC_DEFINE_UNQUOTED(SMACK_RUN_LABEL, ["$withval"], [Run systemd itself with SMACK label]) have_smack_run_label=yes],
584 if test "x${have_smack_run_label}" = xyes; then
585 M4_DEFINES="$M4_DEFINES -DHAVE_SMACK_RUN_LABEL"
588 AC_ARG_WITH(smack-default-process-label,
589 AS_HELP_STRING([--with-smack-default-process-label=STRING],
590 [default SMACK label for executed processes]),
591 [AC_DEFINE_UNQUOTED(SMACK_DEFAULT_PROCESS_LABEL, ["$withval"], [Default SMACK label for executed processes])],
594 # ------------------------------------------------------------------------------
595 AC_ARG_WITH(system-uid-max,
596 AS_HELP_STRING([--with-system-uid-max=UID]
597 [Maximum UID for system users]),
598 [SYSTEM_UID_MAX="$withval"],
599 [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`"])
601 AC_DEFINE_UNQUOTED(SYSTEM_UID_MAX, [$SYSTEM_UID_MAX], [Maximum System UID])
602 AC_SUBST(SYSTEM_UID_MAX)
604 # ------------------------------------------------------------------------------
605 AC_ARG_WITH(system-gid-max,
606 AS_HELP_STRING([--with-system-gid-max=GID]
607 [Maximum GID for system groups]),
608 [SYSTEM_GID_MAX="$withval"],
609 [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`"])
611 AC_DEFINE_UNQUOTED(SYSTEM_GID_MAX, [$SYSTEM_GID_MAX], [Maximum System GID])
612 AC_SUBST(SYSTEM_GID_MAX)
614 # ------------------------------------------------------------------------------
616 AC_ARG_ENABLE(polkit, AS_HELP_STRING([--disable-polkit], [disable PolicyKit support]))
617 if test "x$enable_polkit" != "xno"; then
618 AC_DEFINE(ENABLE_POLKIT, 1, [Define if PolicyKit support is to be enabled])
621 AM_CONDITIONAL(ENABLE_POLKIT, [test "x$have_polkit" = "xyes"])
623 # ------------------------------------------------------------------------------
625 AC_ARG_ENABLE(kdbus, AS_HELP_STRING([--disable-kdbus], [do not connect to kdbus by default]))
626 if test "x$enable_kdbus" != "xno"; then
627 AC_DEFINE(ENABLE_KDBUS, 1, [Define if kdbus is to be connected to by default])
629 M4_DEFINES="$M4_DEFINES -DENABLE_KDBUS"
631 AM_CONDITIONAL(ENABLE_KDBUS, [test "$have_kdbus" = "yes"])
633 # ------------------------------------------------------------------------------
634 AC_CHECK_HEADERS_ONCE([valgrind/memcheck.h valgrind/valgrind.h])
636 # ------------------------------------------------------------------------------
638 AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-manpages], [disable manpages]))
639 AC_PATH_PROG([XSLTPROC], [xsltproc])
640 AS_IF([test "x$enable_manpages" != xno], [have_manpages=yes])
641 AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
643 # ------------------------------------------------------------------------------
646 AC_ARG_WITH([dbuspolicydir],
647 AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
649 [with_dbuspolicydir=${sysconfdir}/dbus-1/system.d])
650 AX_NORMALIZE_PATH([with_dbuspolicydir])
652 AC_ARG_WITH([dbussystemservicedir],
653 AS_HELP_STRING([--with-dbussystemservicedir=DIR], [D-Bus system service directory]),
655 [with_dbussystemservicedir=${datadir}/dbus-1/system-services])
656 AX_NORMALIZE_PATH([with_dbussystemservicedir])
658 AC_ARG_WITH([bashcompletiondir],
659 AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),
661 [AS_IF([$($PKG_CONFIG --exists bash-completion)], [
662 with_bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion)
664 with_bashcompletiondir=${datadir}/bash-completion/completions
666 AM_CONDITIONAL(ENABLE_BASH_COMPLETION, [test "$with_bashcompletiondir" != "no"])
667 AX_NORMALIZE_PATH([with_bashcompletiondir])
669 AC_ARG_WITH([zshcompletiondir],
670 AS_HELP_STRING([--with-zshcompletiondir=DIR], [Zsh completions directory]),
671 [], [with_zshcompletiondir=${datadir}/zsh/site-functions])
672 AM_CONDITIONAL(ENABLE_ZSH_COMPLETION, [test "$with_zshcompletiondir" != "no"])
673 AX_NORMALIZE_PATH([with_zshcompletiondir])
675 AC_ARG_WITH([rootprefix],
676 AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
677 [], [with_rootprefix=${ac_default_prefix}])
678 # --with-rootprefix= (empty) should default to "/" but AX_NORMALIZE_PATH
679 # defaults those to ".", solve that here for now until we can find a suitable
680 # fix for AX_NORMALIZE_PATH upstream at autoconf-archive.
681 # See: https://github.com/systemd/systemd/issues/54
682 if test "x${with_rootprefix}" = "x"; then
685 AX_NORMALIZE_PATH([with_rootprefix])
687 AC_ARG_WITH([rootlibdir],
688 AS_HELP_STRING([--with-rootlibdir=DIR], [Root directory for libraries necessary for boot]),
690 [with_rootlibdir=${libdir}])
691 AX_NORMALIZE_PATH([with_rootlibdir])
693 AC_ARG_WITH([pamlibdir],
694 AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]),
696 [with_pamlibdir=${with_rootlibdir}/security])
697 AX_NORMALIZE_PATH([with_pamlibdir])
699 AC_ARG_WITH([pamconfdir],
700 AS_HELP_STRING([--with-pamconfdir=DIR], [Directory for PAM configuration]),
702 [with_pamconfdir=${sysconfdir}/pam.d])
703 AX_NORMALIZE_PATH([with_pamconfdir])
705 AC_ARG_ENABLE([split-usr],
706 AS_HELP_STRING([--enable-split-usr], [Assume that /bin, /sbin aren\'t symlinks into /usr]),
708 [AS_IF([test "x${ac_default_prefix}" != "x${with_rootprefix}"], [
714 AS_IF([test "x${enable_split_usr}" = "xyes"], [
715 AC_DEFINE(HAVE_SPLIT_USR, 1, [Define if /bin, /sbin aren't symlinks into /usr])
717 AM_CONDITIONAL(ENABLE_SPLIT_USR, [test "x${enable_split_usr}" = "xyes"])
719 # work around intltool-update issues during 'make distcheck'
720 AS_IF([test "x$0" != "x./configure"], [
721 AC_SUBST([INTLTOOL_UPDATE], [/usr/bin/env true])
725 [AC_HELP_STRING([--disable-tests], [disable tests])],
726 enable_tests=$enableval, enable_tests=yes)
727 AM_CONDITIONAL(ENABLE_TESTS, [test x$enable_tests = xyes])
730 [AC_HELP_STRING([--enable-debug@<:@=LIST@:>@], [enable extra debugging (elogind,hashmap,mmap-cache)])],
731 [if test "x$enableval" = "xyes"; then
732 enableval="elogind,hashmap,mmap-cache"
735 IFS="$IFS$PATH_SEPARATOR,"
736 for name in $enableval; do
739 enable_debug_elogind=yes
742 enable_debug_hashmap=yes
745 enable_debug_mmap_cache=yes
749 IFS="$saved_ifs"],[])
752 AS_IF([test x$enable_debug_elogind = xyes], [
753 AC_DEFINE(ENABLE_DEBUG_ELOGIND, 1, [Define if elogind debugging is to be enabled])
754 enable_debug="elogind $enable_debug"
756 AS_IF([test x$enable_debug_hashmap = xyes], [
757 AC_DEFINE(ENABLE_DEBUG_HASHMAP, 1, [Define if hashmap debugging is to be enabled])
758 enable_debug="hashmap $enable_debug"
760 AS_IF([test x$enable_debug_mmap_cache = xyes], [
761 AC_DEFINE(ENABLE_DEBUG_MMAP_CACHE, 1, [Define if mmap cache debugging is to be enabled])
762 enable_debug="mmap-cache $enable_debug"
764 test -z "$enable_debug" && enable_debug="none"
766 AC_SUBST([dbuspolicydir], [$with_dbuspolicydir])
767 AC_SUBST([dbussystemservicedir], [$with_dbussystemservicedir])
768 AC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
769 AC_SUBST([zshcompletiondir], [$with_zshcompletiondir])
770 AC_SUBST([pamlibdir], [$with_pamlibdir])
771 AC_SUBST([pamconfdir], [$with_pamconfdir])
772 AC_SUBST([rootprefix], [$with_rootprefix])
773 AC_SUBST([rootlibdir], [$with_rootlibdir])
774 AC_SUBST([cgroup_controller], [$with_cgroupctrl])
783 $PACKAGE_NAME $VERSION
786 SELinux: ${have_selinux}
789 KillUserProcesses default: ${KILL_USER_PROCESSES}
790 polkit: ${have_polkit}
792 Python: ${have_python}
793 man pages: ${have_manpages}
794 test coverage: ${have_coverage}
795 Split /usr: ${enable_split_usr}
796 utmp/wtmp support: ${have_utmp}
797 Link time optimization: ${have_lto}
798 extra debugging: ${enable_debug}
799 cgroup controller: ${with_cgroupctrl}
802 rootprefix: ${with_rootprefix}
803 sysconf dir: ${sysconfdir}
804 datarootdir: ${datarootdir}
805 includedir: ${includedir}
807 rootlib dir: ${with_rootlibdir}
808 PAM modules dir: ${with_pamlibdir}
809 PAM configuration dir: ${with_pamconfdir}
810 D-Bus policy dir: ${with_dbuspolicydir}
811 D-Bus system dir: ${with_dbussystemservicedir}
812 Bash completions dir: ${with_bashcompletiondir}
813 Zsh completions dir: ${with_zshcompletiondir}
814 Maximum System UID: ${SYSTEM_UID_MAX}
815 Maximum System GID: ${SYSTEM_GID_MAX}
817 CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
818 CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
819 LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}