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.])
42 AC_CHECK_TOOLS([AR], [gcc-ar ar], [:])
43 AC_CHECK_TOOLS([NM], [gcc-nm nm], [:])
44 AC_CHECK_TOOLS([RANLIB], [gcc-ranlib ranlib], [:])
47 LT_INIT([disable-static])
49 AS_IF([test "x$enable_static" = "xyes"], [AC_MSG_ERROR([--enable-static is not supported by elogind])])
50 AS_IF([test "x$enable_largefile" = "xno"], [AC_MSG_ERROR([--disable-largefile is not supported by elogind])])
52 SET_ARCH(X86_64, x86_64*)
55 SET_ARCH(AARCH64, aarch64*)
57 # i18n stuff for the PolicyKit policy files, heck whether intltool can be found, disable NLS otherwise
58 AC_CHECK_PROG(intltool_found, [intltool-merge], [yes], [no])
59 AS_IF([test x"$intltool_found" != xyes],
60 [AS_IF([test x"$enable_nls" = xyes],
61 [AC_MSG_ERROR([--enable-nls requested but intltool not found])],
62 [AS_IF([test x"$enable_nls" != xno],
63 [AC_MSG_WARN([*** Disabling NLS support because intltool was not found])
69 AS_IF([test x"$enable_nls" != xno -o "x$enable_polkit" != xno], [
70 # intltoolize greps for '^(AC|IT)_PROG_INTLTOOL', so it needs to be on its own line
71 IT_PROG_INTLTOOL([0.40.0])
74 AS_IF([test -z "$INTLTOOL_POLICY_RULE"], [
75 # If intltool is not available, provide a dummy rule to fail generation of %.policy files with a meaningful error message
76 INTLTOOL_POLICY_RULE='%.policy: %.policy.in ; @echo " ITMRG " $@ && echo "*** intltool support required to build target $@" && false'
77 AC_SUBST(INTLTOOL_POLICY_RULE)
80 GETTEXT_PACKAGE=elogind
81 AC_SUBST(GETTEXT_PACKAGE)
82 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [elogind])
92 AC_PATH_PROG([M4], [m4])
93 AC_PATH_PROG([XSLTPROC], [xsltproc])
95 AC_PATH_PROG([HALT], [halt], [halt])
96 AC_PATH_PROG([REBOOT], [reboot], [reboot])
97 AC_PATH_PROG([KEXEC], [kexec], [/usr/sbin/kexec], [$PATH:/usr/sbin:/sbin])
99 AS_IF([! ln --relative --help > /dev/null 2>&1], [AC_MSG_ERROR([*** ln doesn't support --relative ***])])
103 AC_CHECK_TOOL(OBJCOPY, objcopy)
104 AC_CHECK_TOOL(GPERF, gperf)
105 if test -z "$GPERF" ; then
106 AC_MSG_ERROR([*** gperf not found])
109 # ------------------------------------------------------------------------------
110 address_sanitizer_cflags=
111 address_sanitizer_cppflags=
112 address_sanitizer_ldflags=
113 AC_ARG_ENABLE(address-sanitizer, AS_HELP_STRING([--enable-address-sanitizer], [enable -fsanitize=address]))
114 AS_IF([test "x$enable_address_sanitizer" = "xyes"], [
115 CC_CHECK_FLAG_APPEND([with_as_cflags], [CFLAGS], [-fsanitize=address])
116 AS_IF([test -z "$with_as_cflags"],
117 [AC_MSG_ERROR([*** -fsanitize=address is not supported])])
118 address_sanitizer_cflags="$with_as_cflags -fno-omit-frame-pointer -DVALGRIND=1"
119 address_sanitizer_cppflags="-DVALGRIND=1"
120 address_sanitizer_ldflags="-Wc,-fsanitize=address"
123 undefined_sanitizer_cflags=
124 undefined_sanitizer_cppflags=
125 undefined_sanitizer_ldflags=
126 AC_ARG_ENABLE(undefined-sanitizer, AS_HELP_STRING([--enable-undefined-sanitizer], [enable -fsanitize=undefined]))
127 AS_IF([test "x$enable_undefined_sanitizer" = "xyes"], [
128 CC_CHECK_FLAG_APPEND([with_us_cflags], [CFLAGS], [-fsanitize=undefined])
129 AS_IF([test -z "$with_us_cflags"],
130 [AC_MSG_ERROR([*** -fsanitize=undefined is not supported])])
131 undefined_sanitizer_cflags="$with_us_cflags -fno-omit-frame-pointer -DVALGRIND=1"
132 undefined_sanitizer_cppflags="-DVALGRIND=1"
133 undefined_sanitizer_ldflags="-Wc,-fsanitize=undefined"
136 sanitizer_cflags="$address_sanitizer_cflags $undefined_sanitizer_cflags"
137 sanitizer_cppflags="$address_sanitizer_cppflags $undefined_sanitizer_cppflags"
138 sanitizer_ldflags="$address_sanitizer_ldflags $undefined_sanitizer_ldflags"
140 CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
145 "-Wformat=2 -Wformat-security -Wformat-nonliteral" \
147 -Wmissing-include-dirs \
148 -Wold-style-definition \
151 -Wdeclaration-after-statement \
153 -Wsuggest-attribute=noreturn \
154 -Werror=missing-prototypes \
155 -Werror=implicit-function-declaration \
156 -Werror=missing-declarations \
157 -Werror=return-type \
159 -Wstrict-prototypes \
164 -Wstrict-aliasing=2 \
166 -Wno-unused-parameter \
167 -Wno-missing-field-initializers \
169 -Wno-format-signedness \
175 -fdiagnostics-show-option \
176 -fno-strict-aliasing \
177 -fvisibility=hidden \
179 -fstack-protector-strong \
181 --param=ssp-buffer-size=4])
183 AS_CASE([$CC], [*clang*],
184 [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
185 -Wno-typedef-redefinition \
186 -Wno-gnu-variable-sized-type-not-at-end \
189 AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
190 [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
192 [AC_MSG_RESULT([skipping -flto, optimization not enabled])])
193 AC_SUBST([OUR_CFLAGS], "$with_cflags $sanitizer_cflags")
195 AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
196 [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
197 -Wp,-D_FORTIFY_SOURCE=2])],
198 [AC_MSG_RESULT([skipping -D_FORTIFY_SOURCE, optimization not enabled])])
199 AC_SUBST([OUR_CPPFLAGS], "$with_cppflags $sanitizer_cppflags")
201 AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
202 [CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
203 -Wl,--gc-sections])],
204 [AC_MSG_RESULT([skipping --gc-sections, optimization not enabled])])
205 AC_SUBST([OUR_CFLAGS], "$with_ldflags $sanitizer_cflags")
207 AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
208 [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
209 -ffunction-sections -fdata-sections])],
210 [AC_MSG_RESULT([skipping -ffunction/data-section, optimization not enabled])])
211 AC_SUBST([OUR_CFLAGS], "$with_cflags $sanitizer_cflags")
213 CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
220 AC_SUBST([OUR_LDFLAGS], "$with_ldflags $sanitizer_ldflags")
222 AC_CHECK_SIZEOF(pid_t)
223 AC_CHECK_SIZEOF(uid_t)
224 AC_CHECK_SIZEOF(gid_t)
225 AC_CHECK_SIZEOF(time_t)
226 AC_CHECK_SIZEOF(dev_t)
227 AC_CHECK_SIZEOF(rlim_t,,[
228 #include <sys/time.h>
229 #include <sys/resource.h>
232 # ------------------------------------------------------------------------------
233 # we use python to build the man page index
235 AC_ARG_WITH([python],
236 [AS_HELP_STRING([--without-python], [Disable building the man page index and systemd-python (default: test)])])
239 AS_IF([test "x$with_python" != "xno"], [
240 AM_PATH_PYTHON(,, [:])
241 AS_IF([test "x$PYTHON" != "x:"], [
242 AC_MSG_CHECKING([for python lxml module])
243 AS_IF(["$PYTHON" -c 'import lxml' 2>/dev/null], [have_lxml=yes])
244 AC_MSG_RESULT([$have_lxml])
245 AS_IF([test "x$have_lxml" = "xyes"], [have_python=yes],
246 [AC_MSG_WARN([*** python support requires python-lxml module installed])])
249 AS_IF([test "$have_python" != "yes"], [
250 AS_IF([test "$with_python" = "yes"],
251 [AC_MSG_ERROR([*** python support requested but python support not found])])
252 AS_IF([test "$with_python" != "no"],
253 [AC_MSG_WARN([*** python support not found, some documentation cannot be built])])
256 AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])
258 # ------------------------------------------------------------------------------
260 AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
261 AC_CHECK_HEADERS([linux/btrfs.h], [], [])
262 AC_CHECK_HEADERS([linux/memfd.h], [], [])
264 # unconditionally pull-in librt with old glibc versions
265 AC_SEARCH_LIBS([clock_gettime], [rt], [], [])
266 AC_SEARCH_LIBS([mq_unlink], [rt], [], [])
268 AC_ARG_WITH([libcap],
269 AS_HELP_STRING([--with-libcap=DIR], [Prefix for libcap]),
270 [CAP_LDFLAGS="-L$with_libcap/lib"],
273 save_LDFLAGS="$LDFLAGS"
275 LDFLAGS="$LDFLAGS $CAP_LDFLAGS"
276 AC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not found])])
279 AC_SUBST(CAP_LDFLAGS)
281 LDFLAGS="$save_LDFLAGS"
283 AC_CHECK_FUNCS([memfd_create])
284 AC_CHECK_FUNCS([__secure_getenv secure_getenv])
285 AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at, setns, getrandom, renameat2, kcmp, LO_FLAGS_PARTSCAN],
287 #include <sys/types.h>
289 #include <sys/mount.h>
292 #include <linux/loop.h>
293 #include <linux/random.h>
296 AC_CHECK_DECLS([IFLA_INET6_ADDR_GEN_MODE,
303 IFLA_VXLAN_REMCSUM_NOPARTIAL,
305 IFLA_IPTUN_ENCAP_DPORT,
306 IFLA_GRE_ENCAP_DPORT,
307 IFLA_BRIDGE_VLAN_INFO,
308 IFLA_BRPORT_LEARNING_SYNC,
312 #include <inttypes.h>
313 #include <netinet/in.h>
314 #include <netinet/ether.h>
315 #include <linux/rtnetlink.h>
317 #include <linux/ip.h>
318 #include <linux/if_tunnel.h>
319 #include <linux/if_link.h>
320 #include <linux/if_bridge.h>
321 #include <linux/if_addr.h>
322 #include <linux/neighbour.h>
325 # This makes sure pkg.m4 is available.
326 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
328 # ------------------------------------------------------------------------------
330 AC_ARG_ENABLE(dbus, AS_HELP_STRING([--disable-dbus], [disable usage of dbus-1 in tests]))
331 AS_IF([test "x$enable_dbus" != "xno"], [
332 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.3.2],
333 [AC_DEFINE(HAVE_DBUS, 1, [Define if dbus-1 library is available]) have_dbus=yes],
335 AS_IF([test "x$have_dbus" = "xno" -a "x$enable_dbus" = "xyes"],
336 [AC_MSG_ERROR([*** dbus-1 support requested but libraries not found])])])
337 AM_CONDITIONAL(HAVE_DBUS, [test "$have_dbus" = "yes"])
339 # ------------------------------------------------------------------------------
340 PKG_CHECK_MODULES(UDEV, [libudev])
342 AC_ARG_WITH([udevrulesdir],
343 AS_HELP_STRING([--with-udevrulesdir=DIR], [Directory for udev rules files]),
345 [with_udevrulesdir=$($PKG_CONFIG --variable=udevdir udev)/rules.d])
346 AC_SUBST([udevrulesdir], [$with_udevrulesdir])
348 AC_ARG_WITH([udevbindir],
349 AS_HELP_STRING([--with-udevbindir=DIR], [Directory for udev binary files]),
351 [with_udevbindir=$($PKG_CONFIG --variable=udevdir udev)])
352 AC_SUBST([udevbindir], [$with_udevbindir])
354 # ------------------------------------------------------------------------------
356 AC_ARG_ENABLE(coverage, AS_HELP_STRING([--enable-coverage], [enable test coverage]))
357 if test "x$enable_coverage" = "xyes" ; then
358 AC_CHECK_PROG(lcov_found, [lcov], [yes], [no])
359 if test "x$lcov_found" = xno ; then
360 AC_MSG_ERROR([*** lcov support requested but the program was not found])
362 lcov_version_major="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 1`"
363 lcov_version_minor="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 2`"
364 if test "$lcov_version_major" -eq 1 -a "$lcov_version_minor" -lt 10; then
365 AC_MSG_ERROR([*** lcov version is too old. 1.10 required])
368 CC_CHECK_FLAGS_APPEND([with_coverage_cflags], [CFLAGS], [\
371 AC_SUBST([OUR_CFLAGS], "$with_cflags $with_coverage_cflags")
375 AM_CONDITIONAL(ENABLE_COVERAGE, [test "$have_coverage" = "yes"])
377 # ------------------------------------------------------------------------------
379 AC_ARG_ENABLE(blkid, AS_HELP_STRING([--disable-blkid], [disable blkid support]))
380 if test "x$enable_blkid" != "xno"; then
381 PKG_CHECK_MODULES(BLKID, [ blkid >= 2.24 ],
382 [AC_DEFINE(HAVE_BLKID, 1, [Define if blkid is available]) have_blkid=yes], have_blkid=no)
383 if test "x$have_blkid" = xno -a "x$enable_blkid" = xyes; then
384 AC_MSG_ERROR([*** blkid support requested but libraries not found])
387 AM_CONDITIONAL(HAVE_BLKID, [test "$have_blkid" = "yes"])
389 # ------------------------------------------------------------------------------
391 AC_ARG_ENABLE(seccomp, AS_HELP_STRING([--disable-seccomp], [Disable optional SECCOMP support]))
392 if test "x$enable_seccomp" != "xno"; then
393 PKG_CHECK_MODULES(SECCOMP, [libseccomp >= 1.0.0],
394 [AC_DEFINE(HAVE_SECCOMP, 1, [Define if seccomp is available])
396 M4_DEFINES="$M4_DEFINES -DHAVE_SECCOMP"],
398 if test "x$have_seccomp" = "xno" -a "x$enable_seccomp" = "xyes"; then
399 AC_MSG_ERROR([*** seccomp support requested but libraries not found])
402 AM_CONDITIONAL(HAVE_SECCOMP, [test "$have_seccomp" = "yes"])
404 # ------------------------------------------------------------------------------
406 AC_ARG_ENABLE(selinux, AS_HELP_STRING([--disable-selinux], [Disable optional SELINUX support]))
407 if test "x$enable_selinux" != "xno"; then
408 PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.1.9],
409 [AC_DEFINE(HAVE_SELINUX, 1, [Define if SELinux is available])
411 M4_DEFINES="$M4_DEFINES -DHAVE_SELINUX"],
413 if test "x$have_selinux" = xno -a "x$enable_selinux" = xyes; then
414 AC_MSG_ERROR([*** SELinux support requested but libraries not found])
417 AM_CONDITIONAL(HAVE_SELINUX, [test "$have_selinux" = "yes"])
420 AC_ARG_ENABLE(apparmor, AS_HELP_STRING([--disable-apparmor], [Disable optional AppArmor support]))
421 if test "x$enable_apparmor" != "xno"; then
422 PKG_CHECK_MODULES([APPARMOR], [libapparmor],
423 [AC_DEFINE(HAVE_APPARMOR, 1, [Define if AppArmor is available])
425 M4_DEFINES="$M4_DEFINES -DHAVE_APPARMOR"],
427 if test "x$have_apparmor" = xno -a "x$enable_apparmor" = xyes; then
428 AC_MSG_ERROR([*** AppArmor support requested but libraries not found])
431 AM_CONDITIONAL(HAVE_APPARMOR, [test "$have_apparmor" = "yes"])
433 # ------------------------------------------------------------------------------
435 AS_HELP_STRING([--disable-pam],[Disable optional PAM support]),
436 [case "${enableval}" in
439 *) AC_MSG_ERROR(bad value ${enableval} for --disable-pam) ;;
443 if test "x${have_pam}" != xno ; then
445 [security/pam_modules.h security/pam_modutil.h security/pam_ext.h],
447 [if test "x$have_pam" = xyes ; then
448 AC_MSG_ERROR([*** PAM headers not found.])
455 [if test "x$have_pam" = xyes ; then
456 AC_MSG_ERROR([*** libpam not found.])
459 if test "x$have_pam" = xyes ; then
460 PAM_LIBS="-lpam -lpam_misc"
461 AC_DEFINE(HAVE_PAM, 1, [PAM available])
462 M4_DEFINES="$M4_DEFINES -DHAVE_PAM"
470 AM_CONDITIONAL([HAVE_PAM], [test "x$have_pam" != xno])
472 # ------------------------------------------------------------------------------
474 AS_HELP_STRING([--disable-acl],[Disable optional ACL support]),
475 [case "${enableval}" in
478 *) AC_MSG_ERROR(bad value ${enableval} for --disable-acl) ;;
482 if test "x${have_acl}" != xno ; then
484 [sys/acl.h acl/libacl.h],
486 [if test "x$have_acl" = xyes ; then
487 AC_MSG_ERROR([*** ACL headers not found.])
494 [if test "x$have_acl" = xyes ; then
495 AC_MSG_ERROR([*** libacl not found.])
498 if test "x$have_acl" = xyes ; then
500 AC_DEFINE(HAVE_ACL, 1, [ACL available])
501 M4_DEFINES="$M4_DEFINES -DHAVE_ACL"
509 AM_CONDITIONAL([HAVE_ACL], [test "x$have_acl" != xno])
511 # ------------------------------------------------------------------------------
512 AC_ARG_ENABLE([smack], AS_HELP_STRING([--disable-smack],[Disable optional SMACK support]),
513 [case "${enableval}" in
514 yes) have_smack=yes ;;
516 *) AC_MSG_ERROR(bad value ${enableval} for --disable-smack) ;;
520 if test "x${have_smack}" = xauto; then
521 M4_DEFINES="$M4_DEFINES -DHAVE_SMACK"
525 AC_ARG_WITH(smack-run-label,
526 AS_HELP_STRING([--with-smack-run-label=STRING],
527 [run elogind --system itself with a specific SMACK label]),
528 [AC_DEFINE_UNQUOTED(SMACK_RUN_LABEL, ["$withval"], [Run elogind itself with SMACK label])],
531 AC_ARG_WITH(smack-default-process-label,
532 AS_HELP_STRING([--with-smack-default-process-label=STRING],
533 [default SMACK label for executed processes]),
534 [AC_DEFINE_UNQUOTED(SMACK_DEFAULT_PROCESS_LABEL, ["$withval"], [Default SMACK label for executed processes])],
537 if test "x${have_smack}" = xyes ; then
538 AC_DEFINE(HAVE_SMACK, 1, [Define if SMACK is available])
541 AM_CONDITIONAL([HAVE_SMACK], [test "x$have_smack" = "xyes"])
543 # ------------------------------------------------------------------------------
545 #AC_ARG_ENABLE(logind, AS_HELP_STRING([--disable-logind], [disable login daemon]))
546 #if test "x$enable_logind" != "xno"; then
549 AM_CONDITIONAL(ENABLE_LOGIND, [test "$have_logind" = "yes"])
550 AS_IF([test "$have_logind" = "yes"], [ AC_DEFINE(HAVE_LOGIND, [1], [Logind support available]) ])
552 # ------------------------------------------------------------------------------
553 AC_ARG_WITH(system-uid-max,
554 AS_HELP_STRING([--with-system-uid-max=UID]
555 [Maximum UID for system users]),
556 [SYSTEM_UID_MAX="$withval"],
557 [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`"])
559 AC_DEFINE_UNQUOTED(SYSTEM_UID_MAX, [$SYSTEM_UID_MAX], [Maximum System UID])
560 AC_SUBST(SYSTEM_UID_MAX)
562 # ------------------------------------------------------------------------------
563 AC_ARG_WITH(system-gid-max,
564 AS_HELP_STRING([--with-system-gid-max=GID]
565 [Maximum GID for system groups]),
566 [SYSTEM_GID_MAX="$withval"],
567 [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`"])
569 AC_DEFINE_UNQUOTED(SYSTEM_GID_MAX, [$SYSTEM_GID_MAX], [Maximum System GID])
570 AC_SUBST(SYSTEM_GID_MAX)
572 # ------------------------------------------------------------------------------
574 AC_ARG_ENABLE(polkit, AS_HELP_STRING([--disable-polkit], [disable PolicyKit support]))
575 if test "x$enable_polkit" != "xno"; then
576 AC_DEFINE(ENABLE_POLKIT, 1, [Define if PolicyKit support is to be enabled])
579 AM_CONDITIONAL(ENABLE_POLKIT, [test "x$have_polkit" = "xyes"])
581 # ------------------------------------------------------------------------------
583 AC_ARG_ENABLE(kdbus, AS_HELP_STRING([--disable-kdbus], [do not connect to kdbus by default]))
584 if test "x$enable_kdbus" != "xno"; then
585 AC_DEFINE(ENABLE_KDBUS, 1, [Define if kdbus is to be connected to by default])
587 M4_DEFINES="$M4_DEFINES -DENABLE_KDBUS"
589 AM_CONDITIONAL(ENABLE_KDBUS, [test "$have_kdbus" = "yes"])
591 # ------------------------------------------------------------------------------
592 AC_CHECK_HEADERS_ONCE([valgrind/memcheck.h valgrind/valgrind.h])
594 # ------------------------------------------------------------------------------
595 PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0 gio-2.0],
596 [have_glib=yes], [have_glib=no])
597 AS_IF([test "x$have_glib" = "xyes"], [ AC_DEFINE(HAVE_GLIB, 1, [Define if glib is available]) ])
599 # ------------------------------------------------------------------------------
601 AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-manpages], [disable manpages]))
602 AS_IF([test "x$enable_manpages" != xno], [have_manpages=yes])
603 AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
605 # ------------------------------------------------------------------------------
608 AC_ARG_WITH([dbuspolicydir],
609 AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
611 [with_dbuspolicydir=${sysconfdir}/dbus-1/system.d])
612 AX_NORMALIZE_PATH([with_dbuspolicydir])
614 AC_ARG_WITH([dbussystemservicedir],
615 AS_HELP_STRING([--with-dbussystemservicedir=DIR], [D-Bus system service directory]),
617 [with_dbussystemservicedir=${datadir}/dbus-1/system-services])
618 AX_NORMALIZE_PATH([with_dbussystemservicedir])
620 AC_ARG_WITH([bashcompletiondir],
621 AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),
623 [AS_IF([$($PKG_CONFIG --exists bash-completion)], [
624 with_bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion)
626 with_bashcompletiondir=${datadir}/bash-completion/completions
628 AX_NORMALIZE_PATH([with_bashcompletiondir])
630 AC_ARG_WITH([zshcompletiondir],
631 AS_HELP_STRING([--with-zshcompletiondir=DIR], [Zsh completions directory]),
632 [], [with_zshcompletiondir=${datadir}/zsh/site-functions])
633 AX_NORMALIZE_PATH([with_zshcompletiondir])
635 AC_ARG_WITH([rootprefix],
636 AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
637 [], [with_rootprefix=${ac_default_prefix}])
638 # --with-rootprefix= (empty) should default to "/" but AX_NORMALIZE_PATH
639 # defaults those to ".", solve that here for now until we can find a suitable
640 # fix for AX_NORMALIZE_PATH upstream at autoconf-archive.
641 # See: https://github.com/systemd/systemd/issues/54
642 if test "x${with_rootprefix}" = "x"; then
645 AX_NORMALIZE_PATH([with_rootprefix])
647 AC_ARG_WITH([rootlibdir],
648 AS_HELP_STRING([--with-rootlibdir=DIR], [Root directory for libraries necessary for boot]),
650 [with_rootlibdir=${libdir}])
651 AX_NORMALIZE_PATH([with_rootlibdir])
653 AC_ARG_WITH([pamlibdir],
654 AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]),
656 [with_pamlibdir=${with_rootlibdir}/security])
657 AX_NORMALIZE_PATH([with_pamlibdir])
659 AC_ARG_WITH([pamconfdir],
660 AS_HELP_STRING([--with-pamconfdir=DIR], [Directory for PAM configuration]),
662 [with_pamconfdir=${sysconfdir}/pam.d])
663 AX_NORMALIZE_PATH([with_pamconfdir])
665 AC_ARG_ENABLE([split-usr],
666 AS_HELP_STRING([--enable-split-usr], [Assume that /bin, /sbin aren\'t symlinks into /usr]),
668 [AS_IF([test "x${ac_default_prefix}" != "x${with_rootprefix}"], [
674 AS_IF([test "x${enable_split_usr}" = "xyes"], [
675 AC_DEFINE(HAVE_SPLIT_USR, 1, [Define if /bin, /sbin aren't symlinks into /usr])
677 AM_CONDITIONAL(ENABLE_SPLIT_USR, [test "x${enable_split_usr}" = "xyes"])
679 # work around intltool-update issues during 'make distcheck'
680 AS_IF([test "x$0" != "x./configure"], [
681 AC_SUBST([INTLTOOL_UPDATE], [/usr/bin/env true])
685 [AC_HELP_STRING([--disable-tests], [disable tests])],
686 enable_tests=$enableval, enable_tests=yes)
687 AM_CONDITIONAL(ENABLE_TESTS, [test x$enable_tests = xyes])
690 [AC_HELP_STRING([--enable-debug@<:@=LIST@:>@], [enable extra debugging (hashmap,mmap-cache)])],
691 [if test "x$enableval" = "xyes"; then
692 enableval="hashmap,mmap-cache"
695 IFS="$IFS$PATH_SEPARATOR,"
696 for name in $enableval; do
699 enable_debug_hashmap=yes
702 enable_debug_mmap_cache=yes
706 IFS="$saved_ifs"],[])
709 AS_IF([test x$enable_debug_hashmap = xyes], [
710 AC_DEFINE(ENABLE_DEBUG_HASHMAP, 1, [Define if hashmap debugging is to be enabled])
711 enable_debug="hashmap $enable_debug"
713 AS_IF([test x$enable_debug_mmap_cache = xyes], [
714 AC_DEFINE(ENABLE_DEBUG_MMAP_CACHE, 1, [Define if mmap cache debugging is to be enabled])
715 enable_debug="mmap-cache $enable_debug"
717 test -z "$enable_debug" && enable_debug="none"
719 AC_SUBST([dbuspolicydir], [$with_dbuspolicydir])
720 AC_SUBST([dbussystemservicedir], [$with_dbussystemservicedir])
721 AC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
722 AC_SUBST([zshcompletiondir], [$with_zshcompletiondir])
723 AC_SUBST([pamlibdir], [$with_pamlibdir])
724 AC_SUBST([pamconfdir], [$with_pamconfdir])
725 AC_SUBST([rootprefix], [$with_rootprefix])
726 AC_SUBST([rootlibdir], [$with_rootlibdir])
735 $PACKAGE_NAME $VERSION
738 AppArmor: ${have_apparmor}
739 SELinux: ${have_selinux}
740 SECCOMP: ${have_seccomp}
743 polkit: ${have_polkit}
747 Python: ${have_python}
748 man pages: ${have_manpages}
749 test coverage: ${have_coverage}
750 Split /usr: ${enable_split_usr}
751 extra debugging: ${enable_debug}
754 rootprefix: ${with_rootprefix}
755 sysconf dir: ${sysconfdir}
756 datarootdir: ${datarootdir}
757 includedir: ${includedir}
759 rootlib dir: ${with_rootlibdir}
760 Build Python: ${PYTHON}
761 PAM modules dir: ${with_pamlibdir}
762 PAM configuration dir: ${with_pamconfdir}
763 D-Bus policy dir: ${with_dbuspolicydir}
764 D-Bus system dir: ${with_dbussystemservicedir}
765 Bash completions dir: ${with_bashcompletiondir}
766 Zsh completions dir: ${with_zshcompletiondir}
767 Maximum System UID: ${SYSTEM_UID_MAX}
768 Maximum System GID: ${SYSTEM_GID_MAX}
770 CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
771 CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
772 LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}