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 # Let users set the cgroup controller to use, in case the target controller
115 # isn't currently running the show.
116 # Example: Gentoo Linux, user wants to switch from systemd to openrc+elogind,
117 # and emerges elogind before having booted the machine with openrc.
118 # See: https://github.com/elogind/elogind/issues/18
120 AC_ARG_WITH([cgroup-controller],
121 AS_HELP_STRING([--with-cgroup-controller=name],
122 [Set the name of the cgroup controller to use.
123 Use this when the autodetection fails, or you plan to use your system with a different controller than the one in place now.
124 The value 'auto' (default) detects the running controller.
125 The values 'none' and 'elogind' will cause elogind to be its own (very limited) controller.
126 When elogind shall be its own controller, there *MUST NOT* be any other controller running!
127 Another popular controller would be 'openrc'.]),
128 [with_cgroupctrl=$withval],
129 [with_cgroupctrl=auto])
131 # ------------------------------------------------------------------------------
132 # Find running cgroup controller, if none was set
133 AS_IF( [test "x$with_cgroupctrl" = "xauto"], [
134 AS_IF([test -f /proc/self/cgroup], [
135 # If the init system is a cgroup controler, it will be position 1.
136 # Secondary controllers, like cgmanager, do not work.
137 with_cgroupctrl=`grep "^1:name=" /proc/self/cgroup | \
138 sed -n 's/.*=//p' | sed -e 's/:.*$//'`
139 AS_IF( [test -z "$with_cgroupctrl"], [
140 # Try to be our own cgroup controller
141 with_cgroupctrl="elogind"
144 # 'auto' but no cgroup fs is a problem.
149 # If the user specified 'none', switch to 'elogind'.
150 # 'none' is allowed, as this means "there is no controller now"
151 AS_IF( [test "x$with_cgroupctrl" = "xnone"], [with_cgroupctrl=elogind])
153 # If this was not possible, /proc/self/cgroup not mounted yet, and 'auto'
155 AS_IF( [test -z "$with_cgroupctrl"],
156 AC_MSG_ERROR([No running cgroup controller found]), [
157 # Otherwise add the 'name=' prefix
158 with_cgroupctrl="name=$with_cgroupctrl"
161 # ------------------------------------------------------------------------------
162 address_sanitizer_cflags=
163 address_sanitizer_cppflags=
164 address_sanitizer_ldflags=
165 AC_ARG_ENABLE(address-sanitizer, AS_HELP_STRING([--enable-address-sanitizer], [enable -fsanitize=address]))
166 AS_IF([test "x$enable_address_sanitizer" = "xyes"], [
167 CC_CHECK_FLAG_APPEND([with_as_cflags], [CFLAGS], [-fsanitize=address])
168 AS_IF([test -z "$with_as_cflags"],
169 [AC_MSG_ERROR([*** -fsanitize=address is not supported])])
170 address_sanitizer_cflags="$with_as_cflags -fno-omit-frame-pointer -DVALGRIND=1"
171 address_sanitizer_cppflags="-DVALGRIND=1"
172 address_sanitizer_ldflags="-Wc,-fsanitize=address"
175 undefined_sanitizer_cflags=
176 undefined_sanitizer_cppflags=
177 undefined_sanitizer_ldflags=
178 AC_ARG_ENABLE(undefined-sanitizer, AS_HELP_STRING([--enable-undefined-sanitizer], [enable -fsanitize=undefined]))
179 AS_IF([test "x$enable_undefined_sanitizer" = "xyes"], [
180 CC_CHECK_FLAG_APPEND([with_us_cflags], [CFLAGS], [-fsanitize=undefined])
181 AS_IF([test -z "$with_us_cflags"],
182 [AC_MSG_ERROR([*** -fsanitize=undefined is not supported])])
183 undefined_sanitizer_cflags="$with_us_cflags -fno-omit-frame-pointer -DVALGRIND=1"
184 undefined_sanitizer_cppflags="-DVALGRIND=1"
185 undefined_sanitizer_ldflags="-Wc,-fsanitize=undefined"
188 sanitizer_cflags="$address_sanitizer_cflags $undefined_sanitizer_cflags"
189 sanitizer_cppflags="$address_sanitizer_cppflags $undefined_sanitizer_cppflags"
190 sanitizer_ldflags="$address_sanitizer_ldflags $undefined_sanitizer_ldflags"
192 CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
197 "-Wformat=2 -Wformat-security -Wformat-nonliteral" \
199 -Wmissing-include-dirs \
200 -Wold-style-definition \
203 -Wdeclaration-after-statement \
205 -Wsuggest-attribute=noreturn \
206 -Werror=missing-prototypes \
207 -Werror=implicit-function-declaration \
208 -Werror=missing-declarations \
209 -Werror=return-type \
210 -Wstrict-prototypes \
215 -Wstrict-aliasing=2 \
217 -Wno-unused-parameter \
218 -Wno-missing-field-initializers \
220 -Wno-format-signedness \
226 -fdiagnostics-show-option \
227 -fno-strict-aliasing \
228 -fvisibility=hidden \
230 -fstack-protector-strong \
232 --param=ssp-buffer-size=4])
234 CC_CHECK_FLAG_APPEND([with_cflags], [CFLAGS], [-Werror=shadow], [
236 #include <inttypes.h>
237 typedef uint64_t usec_t;
238 usec_t now(clockid_t clock);
245 AS_CASE([$CC], [*clang*],
246 [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
247 -Wno-typedef-redefinition \
248 -Wno-gnu-variable-sized-type-not-at-end \
252 # ------------------------------------------------------------------------------
253 # On some distributions -flto, even if available, leads to linking errors.
254 # We therefore make it optional
257 [AS_HELP_STRING([--disable-lto], [Disable link time optimization (default: test)])])
259 AS_IF([test "x$enable_lto" != "xno"], [
260 AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
262 [AC_MSG_RESULT([skipping -flto, optimization not enabled])])
263 AS_IF([test "$have_lto" != "no"],
264 [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [-flto])]
266 AC_SUBST([OUR_CFLAGS], "$with_cflags $sanitizer_cflags")
269 # ------------------------------------------------------------------------------
270 AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
271 [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
272 -Wp,-D_FORTIFY_SOURCE=2])],
273 [AC_MSG_RESULT([skipping -D_FORTIFY_SOURCE, optimization not enabled])])
274 AC_SUBST([OUR_CPPFLAGS], "$with_cppflags $sanitizer_cppflags")
276 AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
277 [CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
278 -Wl,--gc-sections])],
279 [AC_MSG_RESULT([skipping --gc-sections, optimization not enabled])])
280 AC_SUBST([OUR_CFLAGS], "$with_ldflags $sanitizer_cflags")
282 AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
283 [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
284 -ffunction-sections -fdata-sections])],
285 [AC_MSG_RESULT([skipping -ffunction/data-section, optimization not enabled])])
286 AC_SUBST([OUR_CFLAGS], "$with_cflags $sanitizer_cflags")
288 CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
295 AC_SUBST([OUR_LDFLAGS], "$with_ldflags $sanitizer_ldflags")
297 AC_CHECK_SIZEOF(pid_t)
298 AC_CHECK_SIZEOF(uid_t)
299 AC_CHECK_SIZEOF(gid_t)
300 AC_CHECK_SIZEOF(time_t)
301 AC_CHECK_SIZEOF(dev_t)
302 AC_CHECK_SIZEOF(ino_t)
303 AC_CHECK_SIZEOF(rlim_t,,[
304 #include <sys/time.h>
305 #include <sys/resource.h>
308 GPERF_TEST="$(echo foo,bar | ${GPERF} -L ANSI-C)"
309 save_CFLAGS="$CFLAGS"
310 CFLAGS="$CFLAGS -Wno-error"
314 const char * in_word_set(const char *, size_t);
317 [GPERF_LEN_TYPE=size_t],
321 const char * in_word_set(const char *, unsigned);
324 [GPERF_LEN_TYPE=unsigned],
325 [AC_MSG_ERROR([** unable to determine gperf len type])]
328 CFLAGS="$save_CFLAGS"
330 AC_DEFINE_UNQUOTED([GPERF_LEN_TYPE], [$GPERF_LEN_TYPE], [gperf len type])
332 # ------------------------------------------------------------------------------
333 # we use python to build the man page index
335 AC_ARG_WITH([python],
336 [AS_HELP_STRING([--without-python], [Disable building the man page index and systemd-python (default: test)])])
339 AS_IF([test "x$with_python" != "xno"], [
340 AM_PATH_PYTHON(,, [:])
341 AS_IF([test "x$PYTHON" != "x:"], [
342 AC_MSG_CHECKING([for python lxml module])
343 AS_IF(["$PYTHON" -c 'import lxml' 2>/dev/null], [have_lxml=yes])
344 AC_MSG_RESULT([$have_lxml])
345 AS_IF([test "x$have_lxml" = "xyes"], [have_python=yes],
346 [AC_MSG_WARN([*** python support requires python-lxml module installed])])
349 AS_IF([test "$have_python" != "yes"], [
350 AS_IF([test "$with_python" = "yes"],
351 [AC_MSG_ERROR([*** python support requested but python support not found])])
352 AS_IF([test "$with_python" != "no"],
353 [AC_MSG_WARN([*** python support not found, some documentation cannot be built])])
355 AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])
357 # ------------------------------------------------------------------------------
359 AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
360 AC_CHECK_HEADERS([linux/memfd.h], [], [])
362 AC_CHECK_HEADERS([printf.h], [have_printf_h=yes], [have_printf_h=no])
363 AS_IF([test x$have_printf_h = xyes], [
364 AC_DEFINE(HAVE_PRINTF_H, 1, [Define if printf.h was found])
369 # unconditionally pull-in librt with old glibc versions
370 dnl AC_SEARCH_LIBS([clock_gettime], [rt], [], [])
371 dnl AC_SEARCH_LIBS([mq_unlink], [rt], [], [])
375 AC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not found])])
379 AC_CHECK_FUNCS([__secure_getenv secure_getenv])
393 #include <sys/types.h>
395 #include <sys/mount.h>
398 #include <linux/loop.h>
399 #include <linux/random.h>
402 AC_CHECK_TYPES([char16_t, char32_t, key_serial_t],
407 AC_CHECK_DECLS([IFLA_INET6_ADDR_GEN_MODE,
408 IN6_ADDR_GEN_MODE_STABLE_PRIVACY,
416 IFLA_VXLAN_REMCSUM_NOPARTIAL,
417 IFLA_IPTUN_ENCAP_DPORT,
418 IFLA_GRE_ENCAP_DPORT,
419 IFLA_BRIDGE_VLAN_INFO,
420 IFLA_BRPORT_PROXYARP,
421 IFLA_BRPORT_LEARNING_SYNC,
422 IFLA_BR_VLAN_DEFAULT_PVID,
426 #include <inttypes.h>
427 #include <netinet/in.h>
428 #include <netinet/ether.h>
429 #include <linux/rtnetlink.h>
431 #include <linux/ip.h>
432 #include <linux/if_tunnel.h>
433 #include <linux/if_link.h>
434 #include <linux/if_bridge.h>
435 #include <linux/if_addr.h>
436 #include <linux/neighbour.h>
439 # This makes sure pkg.m4 is available.
440 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
443 # ------------------------------------------------------------------------------
444 PKG_CHECK_MODULES(UDEV, [libudev])
446 AC_ARG_WITH([udevrulesdir],
447 AS_HELP_STRING([--with-udevrulesdir=DIR], [Directory for udev rules files]),
449 [with_udevrulesdir=$($PKG_CONFIG --variable=udevdir udev)/rules.d])
450 AC_SUBST([udevrulesdir], [$with_udevrulesdir])
452 AC_ARG_WITH([udevbindir],
453 AS_HELP_STRING([--with-udevbindir=DIR], [Directory for udev binary files]),
455 [with_udevbindir=$($PKG_CONFIG --variable=udevdir udev)])
456 AC_SUBST([udevbindir], [$with_udevbindir])
458 # ------------------------------------------------------------------------------
460 AC_ARG_ENABLE([utmp], AS_HELP_STRING([--disable-utmp], [disable utmp/wtmp log handling]),
461 AS_CASE("x${enableval}",
462 [xyes], [have_utmp=yes],
463 [xno], [have_utmp=no],
464 AC_MSG_ERROR(bad value ${enableval} for --enable-utmp)))
465 AS_IF([test "x$have_utmp" = "xyes"], [AC_DEFINE(HAVE_UTMP, 1, [Define if utmp/wtmp support is enabled])])
466 AM_CONDITIONAL([HAVE_UTMP], [test "x$have_utmp" = "xyes"])
468 # ------------------------------------------------------------------------------
470 AC_ARG_ENABLE(coverage, AS_HELP_STRING([--enable-coverage], [enable test coverage]))
471 if test "x$enable_coverage" = "xyes" ; then
472 AC_CHECK_PROG(lcov_found, [lcov], [yes], [no])
473 if test "x$lcov_found" = xno ; then
474 AC_MSG_ERROR([*** lcov support requested but the program was not found])
476 lcov_version_major="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 1`"
477 lcov_version_minor="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 2`"
478 if test "$lcov_version_major" -eq 1 -a "$lcov_version_minor" -lt 10; then
479 AC_MSG_ERROR([*** lcov version is too old. 1.10 required])
482 CC_CHECK_FLAGS_APPEND([with_coverage_cflags], [CFLAGS], [\
485 AC_SUBST([OUR_CFLAGS], "$with_cflags $with_coverage_cflags")
489 AM_CONDITIONAL(ENABLE_COVERAGE, [test "$have_coverage" = "yes"])
491 # ------------------------------------------------------------------------------
493 AC_ARG_ENABLE(selinux, AS_HELP_STRING([--disable-selinux], [Disable optional SELINUX support]))
494 if test "x$enable_selinux" != "xno"; then
495 PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.1.9],
496 [AC_DEFINE(HAVE_SELINUX, 1, [Define if SELinux is available])
498 M4_DEFINES="$M4_DEFINES -DHAVE_SELINUX"],
500 if test "x$have_selinux" = xno -a "x$enable_selinux" = xyes; then
501 AC_MSG_ERROR([*** SELinux support requested but libraries not found])
504 AM_CONDITIONAL(HAVE_SELINUX, [test "$have_selinux" = "yes"])
506 # ------------------------------------------------------------------------------
507 AC_ARG_WITH([kill-user-processes],
508 [AS_HELP_STRING([--without-kill-user-processes], [Set elogind's KillUserProcesses=no by default])])
509 AS_IF([test "$with_kill_user_processes" != "no"],
510 [kill_user_processes=true
511 KILL_USER_PROCESSES=yes],
512 [kill_user_processes=false
513 KILL_USER_PROCESSES=no])
514 AC_DEFINE_UNQUOTED(KILL_USER_PROCESSES, [$kill_user_processes], [Default KillUserProcesses setting])
515 AC_SUBST(KILL_USER_PROCESSES)
517 # ------------------------------------------------------------------------------
519 AS_HELP_STRING([--disable-pam],[Disable optional PAM support]),
520 [case "${enableval}" in
523 *) AC_MSG_ERROR(bad value ${enableval} for --disable-pam) ;;
527 if test "x${have_pam}" != xno ; then
529 [security/pam_modules.h security/pam_modutil.h security/pam_ext.h],
531 [if test "x$have_pam" = xyes ; then
532 AC_MSG_ERROR([*** PAM headers not found.])
539 [if test "x$have_pam" = xyes ; then
540 AC_MSG_ERROR([*** libpam not found.])
543 if test "x$have_pam" = xyes ; then
544 PAM_LIBS="-lpam -lpam_misc"
545 AC_DEFINE(HAVE_PAM, 1, [PAM available])
546 M4_DEFINES="$M4_DEFINES -DHAVE_PAM"
554 AM_CONDITIONAL([HAVE_PAM], [test "x$have_pam" != xno])
556 # ------------------------------------------------------------------------------
558 AS_HELP_STRING([--disable-acl],[Disable optional ACL support]),
559 [case "${enableval}" in
562 *) AC_MSG_ERROR(bad value ${enableval} for --disable-acl) ;;
566 if test "x${have_acl}" != xno ; then
568 [sys/acl.h acl/libacl.h],
570 [if test "x$have_acl" = xyes ; then
571 AC_MSG_ERROR([*** ACL headers not found.])
578 [if test "x$have_acl" = xyes ; then
579 AC_MSG_ERROR([*** libacl not found.])
582 if test "x$have_acl" = xyes ; then
584 AC_DEFINE(HAVE_ACL, 1, [ACL available])
585 M4_DEFINES="$M4_DEFINES -DHAVE_ACL"
593 AM_CONDITIONAL([HAVE_ACL], [test "x$have_acl" != xno])
595 # ------------------------------------------------------------------------------
596 AC_ARG_ENABLE([smack], AS_HELP_STRING([--disable-smack],[Disable optional SMACK support]),
597 [case "${enableval}" in
598 yes) have_smack=yes ;;
600 *) AC_MSG_ERROR(bad value ${enableval} for --disable-smack) ;;
604 if test "x${have_smack}" != xno; then
605 AC_DEFINE(HAVE_SMACK, 1, [Define if SMACK is available])
606 M4_DEFINES="$M4_DEFINES -DHAVE_SMACK"
610 AM_CONDITIONAL([HAVE_SMACK], [test "x$have_smack" = "xyes"])
612 have_smack_run_label=no
613 AC_ARG_WITH(smack-run-label,
614 AS_HELP_STRING([--with-smack-run-label=STRING],
615 [run systemd --system itself with a specific SMACK label]),
616 [AC_DEFINE_UNQUOTED(SMACK_RUN_LABEL, ["$withval"], [Run systemd itself with SMACK label]) have_smack_run_label=yes],
619 if test "x${have_smack_run_label}" = xyes; then
620 M4_DEFINES="$M4_DEFINES -DHAVE_SMACK_RUN_LABEL"
623 AC_ARG_WITH(smack-default-process-label,
624 AS_HELP_STRING([--with-smack-default-process-label=STRING],
625 [default SMACK label for executed processes]),
626 [AC_DEFINE_UNQUOTED(SMACK_DEFAULT_PROCESS_LABEL, ["$withval"], [Default SMACK label for executed processes])],
629 # ------------------------------------------------------------------------------
630 AC_ARG_WITH(system-uid-max,
631 AS_HELP_STRING([--with-system-uid-max=UID]
632 [Maximum UID for system users]),
633 [SYSTEM_UID_MAX="$withval"],
634 [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`"])
636 AC_DEFINE_UNQUOTED(SYSTEM_UID_MAX, [$SYSTEM_UID_MAX], [Maximum System UID])
637 AC_SUBST(SYSTEM_UID_MAX)
639 # ------------------------------------------------------------------------------
640 AC_ARG_WITH(system-gid-max,
641 AS_HELP_STRING([--with-system-gid-max=GID]
642 [Maximum GID for system groups]),
643 [SYSTEM_GID_MAX="$withval"],
644 [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`"])
646 AC_DEFINE_UNQUOTED(SYSTEM_GID_MAX, [$SYSTEM_GID_MAX], [Maximum System GID])
647 AC_SUBST(SYSTEM_GID_MAX)
649 # ------------------------------------------------------------------------------
651 AC_ARG_ENABLE(polkit, AS_HELP_STRING([--disable-polkit], [disable PolicyKit support]))
652 if test "x$enable_polkit" != "xno"; then
653 AC_DEFINE(ENABLE_POLKIT, 1, [Define if PolicyKit support is to be enabled])
656 AM_CONDITIONAL(ENABLE_POLKIT, [test "x$have_polkit" = "xyes"])
658 # ------------------------------------------------------------------------------
659 AC_CHECK_HEADERS_ONCE([valgrind/memcheck.h valgrind/valgrind.h])
661 # ------------------------------------------------------------------------------
663 AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-manpages], [disable manpages]))
664 AC_PATH_PROG([XSLTPROC], [xsltproc])
665 AS_IF([test "x$enable_manpages" != xno], [have_manpages=yes])
666 AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
668 # ------------------------------------------------------------------------------
671 AC_ARG_WITH([dbuspolicydir],
672 AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
674 [with_dbuspolicydir=${sysconfdir}/dbus-1/system.d])
675 AX_NORMALIZE_PATH([with_dbuspolicydir])
677 AC_ARG_WITH([dbussystemservicedir],
678 AS_HELP_STRING([--with-dbussystemservicedir=DIR], [D-Bus system service directory]),
680 [with_dbussystemservicedir=${datadir}/dbus-1/system-services])
681 AX_NORMALIZE_PATH([with_dbussystemservicedir])
683 AC_ARG_WITH([bashcompletiondir],
684 AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),
686 [AS_IF([$($PKG_CONFIG --exists bash-completion)], [
687 with_bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion)
689 with_bashcompletiondir=${datadir}/bash-completion/completions
691 AM_CONDITIONAL(ENABLE_BASH_COMPLETION, [test "$with_bashcompletiondir" != "no"])
692 AX_NORMALIZE_PATH([with_bashcompletiondir])
694 AC_ARG_WITH([zshcompletiondir],
695 AS_HELP_STRING([--with-zshcompletiondir=DIR], [Zsh completions directory]),
696 [], [with_zshcompletiondir=${datadir}/zsh/site-functions])
697 AM_CONDITIONAL(ENABLE_ZSH_COMPLETION, [test "$with_zshcompletiondir" != "no"])
698 AX_NORMALIZE_PATH([with_zshcompletiondir])
700 AC_ARG_WITH([rootprefix],
701 AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
702 [], [with_rootprefix=${ac_default_prefix}])
703 # --with-rootprefix= (empty) should default to "/" but AX_NORMALIZE_PATH
704 # defaults those to ".", solve that here for now until we can find a suitable
705 # fix for AX_NORMALIZE_PATH upstream at autoconf-archive.
706 # See: https://github.com/systemd/systemd/issues/54
707 if test "x${with_rootprefix}" = "x"; then
710 AX_NORMALIZE_PATH([with_rootprefix])
712 AC_ARG_WITH([rootlibdir],
713 AS_HELP_STRING([--with-rootlibdir=DIR], [Root directory for libraries necessary for boot]),
715 [with_rootlibdir=${libdir}])
716 AX_NORMALIZE_PATH([with_rootlibdir])
718 AC_ARG_WITH([pamlibdir],
719 AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]),
721 [with_pamlibdir=${with_rootlibdir}/security])
722 AX_NORMALIZE_PATH([with_pamlibdir])
724 AC_ARG_WITH([pamconfdir],
725 AS_HELP_STRING([--with-pamconfdir=DIR], [Directory for PAM configuration]),
727 [with_pamconfdir=${sysconfdir}/pam.d])
728 AX_NORMALIZE_PATH([with_pamconfdir])
730 AC_ARG_ENABLE([split-usr],
731 AS_HELP_STRING([--enable-split-usr], [Assume that /bin, /sbin aren\'t symlinks into /usr]),
733 [AS_IF([test "x${ac_default_prefix}" != "x${with_rootprefix}"], [
739 AS_IF([test "x${enable_split_usr}" = "xyes"], [
740 AC_DEFINE(HAVE_SPLIT_USR, 1, [Define if /bin, /sbin aren't symlinks into /usr])
742 AM_CONDITIONAL(ENABLE_SPLIT_USR, [test "x${enable_split_usr}" = "xyes"])
744 # work around intltool-update issues during 'make distcheck'
745 AS_IF([test "x$0" != "x./configure"], [
746 AC_SUBST([INTLTOOL_UPDATE], [/usr/bin/env true])
750 [AC_HELP_STRING([--disable-tests], [disable tests])],
751 enable_tests=$enableval, enable_tests=yes)
752 AM_CONDITIONAL(ENABLE_TESTS, [test x$enable_tests = xyes])
755 [AC_HELP_STRING([--enable-debug@<:@=LIST@:>@], [enable extra debugging (elogind,hashmap,mmap-cache)])],
756 [if test "x$enableval" = "xyes"; then
757 enableval="elogind,hashmap,mmap-cache"
760 IFS="$IFS$PATH_SEPARATOR,"
761 for name in $enableval; do
764 enable_debug_elogind=yes
767 enable_debug_hashmap=yes
770 enable_debug_mmap_cache=yes
774 IFS="$saved_ifs"],[])
777 AS_IF([test x$enable_debug_elogind = xyes], [
778 AC_DEFINE(ENABLE_DEBUG_ELOGIND, 1, [Define if elogind debugging is to be enabled])
779 enable_debug="elogind $enable_debug"
781 AS_IF([test x$enable_debug_hashmap = xyes], [
782 AC_DEFINE(ENABLE_DEBUG_HASHMAP, 1, [Define if hashmap debugging is to be enabled])
783 enable_debug="hashmap $enable_debug"
785 AS_IF([test x$enable_debug_mmap_cache = xyes], [
786 AC_DEFINE(ENABLE_DEBUG_MMAP_CACHE, 1, [Define if mmap cache debugging is to be enabled])
787 enable_debug="mmap-cache $enable_debug"
789 test -z "$enable_debug" && enable_debug="none"
791 AC_SUBST([dbuspolicydir], [$with_dbuspolicydir])
792 AC_SUBST([dbussystemservicedir], [$with_dbussystemservicedir])
793 AC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
794 AC_SUBST([zshcompletiondir], [$with_zshcompletiondir])
795 AC_SUBST([pamlibdir], [$with_pamlibdir])
796 AC_SUBST([pamconfdir], [$with_pamconfdir])
797 AC_SUBST([rootprefix], [$with_rootprefix])
798 AC_SUBST([rootlibdir], [$with_rootlibdir])
799 AC_SUBST([cgroup_controller], [$with_cgroupctrl])
808 $PACKAGE_NAME $VERSION
811 SELinux: ${have_selinux}
814 KillUserProcesses default: ${KILL_USER_PROCESSES}
815 polkit: ${have_polkit}
816 Python: ${have_python}
817 man pages: ${have_manpages}
818 test coverage: ${have_coverage}
819 Split /usr: ${enable_split_usr}
820 utmp/wtmp support: ${have_utmp}
821 Link time optimization: ${have_lto}
822 extra debugging: ${enable_debug}
823 cgroup controller: ${with_cgroupctrl}
826 rootprefix: ${with_rootprefix}
827 sysconf dir: ${sysconfdir}
828 datarootdir: ${datarootdir}
829 includedir: ${includedir}
831 rootlib dir: ${with_rootlibdir}
832 PAM modules dir: ${with_pamlibdir}
833 PAM configuration dir: ${with_pamconfdir}
834 D-Bus policy dir: ${with_dbuspolicydir}
835 D-Bus system dir: ${with_dbussystemservicedir}
836 Bash completions dir: ${with_bashcompletiondir}
837 Zsh completions dir: ${with_zshcompletiondir}
838 Maximum System UID: ${SYSTEM_UID_MAX}
839 Maximum System GID: ${SYSTEM_GID_MAX}
841 CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
842 CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
843 LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}