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 LT_INIT([disable-static])
44 AS_IF([test "x$enable_static" = "xyes"], [AC_MSG_ERROR([--enable-static is not supported by elogind])])
45 AS_IF([test "x$enable_largefile" = "xno"], [AC_MSG_ERROR([--disable-largefile is not supported by elogind])])
47 SET_ARCH(X86_64, x86_64*)
50 SET_ARCH(AARCH64, aarch64*)
52 # i18n stuff for the PolicyKit policy files, heck whether intltool can be found, disable NLS otherwise
53 AC_CHECK_PROG(intltool_found, [intltool-merge], [yes], [no])
54 AS_IF([test x"$intltool_found" != xyes],
55 [AS_IF([test x"$enable_nls" = xyes],
56 [AC_MSG_ERROR([--enable-nls requested but intltool not found])],
57 [AS_IF([test x"$enable_nls" != xno],
58 [AC_MSG_WARN([*** Disabling NLS support because intltool was not found])
64 AS_IF([test x"$enable_nls" != xno -o "x$enable_polkit" != xno], [
65 # intltoolize greps for '^(AC|IT)_PROG_INTLTOOL', so it needs to be on its own line
66 IT_PROG_INTLTOOL([0.40.0])
69 AS_IF([test -z "$INTLTOOL_POLICY_RULE"], [
70 # If intltool is not available, provide a dummy rule to fail generation of %.policy files with a meaningful error message
71 INTLTOOL_POLICY_RULE='%.policy: %.policy.in ; @echo " ITMRG " $@ && echo "*** intltool support required to build target $@" && false'
72 AC_SUBST(INTLTOOL_POLICY_RULE)
75 GETTEXT_PACKAGE=elogind
76 AC_SUBST(GETTEXT_PACKAGE)
77 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [elogind])
87 AC_PATH_PROG([M4], [m4])
88 AC_PATH_PROG([XSLTPROC], [xsltproc])
90 AC_PATH_PROG([HALT], [halt], [halt])
91 AC_PATH_PROG([REBOOT], [reboot], [reboot])
92 AC_PATH_PROG([KEXEC], [kexec], [/usr/sbin/kexec], [$PATH:/usr/sbin:/sbin])
94 AS_IF([! ln --relative --help > /dev/null 2>&1], [AC_MSG_ERROR([*** ln doesn't support --relative ***])])
98 AC_CHECK_TOOL(OBJCOPY, objcopy)
99 AC_CHECK_TOOL(GPERF, gperf)
100 if test -z "$GPERF" ; then
101 AC_MSG_ERROR([*** gperf not found])
104 # ------------------------------------------------------------------------------
105 address_sanitizer_cflags=
106 address_sanitizer_cppflags=
107 address_sanitizer_ldflags=
108 AC_ARG_ENABLE(address-sanitizer, AS_HELP_STRING([--enable-address-sanitizer], [enable -fsanitize=address]))
109 AS_IF([test "x$enable_address_sanitizer" = "xyes"], [
110 CC_CHECK_FLAG_APPEND([with_as_cflags], [CFLAGS], [-fsanitize=address])
111 AS_IF([test -z "$with_as_cflags"],
112 [AC_MSG_ERROR([*** -fsanitize=address is not supported])])
113 address_sanitizer_cflags="$with_as_cflags -fno-omit-frame-pointer -DVALGRIND=1"
114 address_sanitizer_cppflags="-DVALGRIND=1"
115 address_sanitizer_ldflags="-Wc,-fsanitize=address"
118 undefined_sanitizer_cflags=
119 undefined_sanitizer_cppflags=
120 undefined_sanitizer_ldflags=
121 AC_ARG_ENABLE(undefined-sanitizer, AS_HELP_STRING([--enable-undefined-sanitizer], [enable -fsanitize=undefined]))
122 AS_IF([test "x$enable_undefined_sanitizer" = "xyes"], [
123 CC_CHECK_FLAG_APPEND([with_us_cflags], [CFLAGS], [-fsanitize=undefined])
124 AS_IF([test -z "$with_us_cflags"],
125 [AC_MSG_ERROR([*** -fsanitize=undefined is not supported])])
126 undefined_sanitizer_cflags="$with_us_cflags -fno-omit-frame-pointer -DVALGRIND=1"
127 undefined_sanitizer_cppflags="-DVALGRIND=1"
128 undefined_sanitizer_ldflags="-Wc,-fsanitize=undefined"
131 sanitizer_cflags="$address_sanitizer_cflags $undefined_sanitizer_cflags"
132 sanitizer_cppflags="$address_sanitizer_cppflags $undefined_sanitizer_cppflags"
133 sanitizer_ldflags="$address_sanitizer_ldflags $undefined_sanitizer_ldflags"
135 CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
140 "-Wformat=2 -Wformat-security -Wformat-nonliteral" \
142 -Wmissing-include-dirs \
143 -Wold-style-definition \
146 -Wdeclaration-after-statement \
148 -Wsuggest-attribute=noreturn \
149 -Werror=missing-prototypes \
150 -Werror=implicit-function-declaration \
151 -Werror=missing-declarations \
152 -Werror=return-type \
154 -Wstrict-prototypes \
159 -Wstrict-aliasing=2 \
161 -Wno-unused-parameter \
162 -Wno-missing-field-initializers \
164 -Wno-format-signedness \
170 -fdiagnostics-show-option \
171 -fno-strict-aliasing \
172 -fvisibility=hidden \
174 -fstack-protector-strong \
176 --param=ssp-buffer-size=4])
178 AS_CASE([$CC], [*clang*],
179 [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
180 -Wno-typedef-redefinition \
181 -Wno-gnu-variable-sized-type-not-at-end \
184 dnl AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
185 dnl [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
186 dnl -flto -ffat-lto-objects])],
187 dnl [AC_MSG_RESULT([skipping -flto, optimization not enabled])])
188 AC_SUBST([OUR_CFLAGS], "$with_cflags $sanitizer_cflags")
190 AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
191 [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
192 -Wp,-D_FORTIFY_SOURCE=2])],
193 [AC_MSG_RESULT([skipping -D_FORTIFY_SOURCE, optimization not enabled])])
194 AC_SUBST([OUR_CPPFLAGS], "$with_cppflags $sanitizer_cppflags")
196 AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
197 [CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
198 -Wl,--gc-sections])],
199 [AC_MSG_RESULT([skipping --gc-sections, optimization not enabled])])
200 AC_SUBST([OUR_CFLAGS], "$with_ldflags $sanitizer_cflags")
202 AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
203 [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
204 -ffunction-sections -fdata-sections])],
205 [AC_MSG_RESULT([skipping -ffunction/data-section, optimization not enabled])])
206 AC_SUBST([OUR_CFLAGS], "$with_cflags $sanitizer_cflags")
208 CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
215 AC_SUBST([OUR_LDFLAGS], "$with_ldflags $sanitizer_ldflags")
217 AC_CHECK_SIZEOF(pid_t)
218 AC_CHECK_SIZEOF(uid_t)
219 AC_CHECK_SIZEOF(gid_t)
220 AC_CHECK_SIZEOF(time_t)
221 AC_CHECK_SIZEOF(dev_t)
222 AC_CHECK_SIZEOF(rlim_t,,[
223 #include <sys/time.h>
224 #include <sys/resource.h>
227 # ------------------------------------------------------------------------------
228 # we use python to build the man page index, and for systemd-python
230 AC_ARG_WITH([python],
231 [AS_HELP_STRING([--without-python], [Disable building the man page index and systemd-python (default: test)])])
234 AS_IF([test "x$with_python" != "xno"], [
235 AM_PATH_PYTHON(,, [:])
236 AS_IF([test "x$PYTHON" != "x:"], [
237 AC_MSG_CHECKING([for python lxml module])
238 AS_IF(["$PYTHON" -c 'import lxml' 2>/dev/null], [have_lxml=yes])
239 AC_MSG_RESULT([$have_lxml])
240 AS_IF([test "x$have_lxml" = "xyes"], [have_python=yes],
241 [AC_MSG_WARN([*** python support requires python-lxml module installed])])
244 AS_IF([test "$have_python" != "yes"], [
245 AS_IF([test "$with_python" = "yes"],
246 [AC_MSG_ERROR([*** python support requested but python support not found])])
247 AS_IF([test "$with_python" != "no"],
248 [AC_MSG_WARN([*** python support not found, some documentation cannot be built])])
251 AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])
252 AS_IF([test "x$PYTHON_BINARY" = "x"],
253 [AS_IF([test "x$have_python" = "xyes"],
254 [PYTHON_BINARY="$(which "$PYTHON")"],
255 [PYTHON_BINARY=/usr/bin/python])])
256 AC_ARG_VAR(PYTHON_BINARY, [Python binary used to launch installed scripts])
258 AS_IF([test "x$have_python" != "xyes" -a "x$enable_python_devel" = "xyes"],
259 [AC_MSG_ERROR([*** python-devel support requires --with-python])])
262 AC_ARG_ENABLE(python_devel, AS_HELP_STRING([--disable-python-devel], [Do not build python modules]))
263 AS_IF([test "x$have_python" = "xyes" -a "x$enable_python_devel" != "xno"], [
264 PKG_CHECK_MODULES([PYTHON_DEVEL], [python-${PYTHON_VERSION}],
265 [have_python_devel=yes],
266 [PKG_CHECK_MODULES([PYTHON_DEVEL], [python],
267 [have_python_devel=yes],
268 [have_python_devel=no])])
269 AS_IF([test "x$have_python_devel" = xno -a "x$enable_python_devel" = xyes],
270 [AC_MSG_ERROR([*** python-devel support requested but libraries not found])])
271 AC_PATH_PROGS(SPHINX_BUILD, sphinx-build-${PYTHON_VERSION} sphinx-build)
273 AM_CONDITIONAL([HAVE_PYTHON_DEVEL], [test "$have_python_devel" = "yes"])
275 # ------------------------------------------------------------------------------
277 AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
278 AC_CHECK_HEADERS([linux/btrfs.h], [], [])
279 AC_CHECK_HEADERS([linux/memfd.h], [], [])
281 # unconditionally pull-in librt with old glibc versions
282 AC_SEARCH_LIBS([clock_gettime], [rt], [], [])
283 AC_SEARCH_LIBS([mq_unlink], [rt], [], [])
285 AC_ARG_WITH([libcap],
286 AS_HELP_STRING([--with-libcap=DIR], [Prefix for libcap]),
287 [CAP_LDFLAGS="-L$with_libcap/lib"],
290 save_LDFLAGS="$LDFLAGS"
292 LDFLAGS="$LDFLAGS $CAP_LDFLAGS"
293 AC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not found])])
296 AC_SUBST(CAP_LDFLAGS)
298 LDFLAGS="$save_LDFLAGS"
300 AC_CHECK_FUNCS([memfd_create])
301 AC_CHECK_FUNCS([__secure_getenv secure_getenv])
302 AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at, setns, getrandom, renameat2, kcmp, LO_FLAGS_PARTSCAN],
304 #include <sys/types.h>
306 #include <sys/mount.h>
309 #include <linux/loop.h>
310 #include <linux/random.h>
313 AC_CHECK_DECLS([IFLA_INET6_ADDR_GEN_MODE,
320 IFLA_VXLAN_REMCSUM_NOPARTIAL,
322 IFLA_IPTUN_6RD_RELAY_PREFIXLEN,
323 IFLA_BRIDGE_VLAN_INFO,
324 IFLA_BRPORT_UNICAST_FLOOD,
328 #include <inttypes.h>
329 #include <netinet/in.h>
330 #include <netinet/ether.h>
331 #include <linux/rtnetlink.h>
333 #include <linux/ip.h>
334 #include <linux/if_tunnel.h>
335 #include <linux/if_link.h>
336 #include <linux/if_bridge.h>
337 #include <linux/if_addr.h>
338 #include <linux/neighbour.h>
341 # This makes sure pkg.m4 is available.
342 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
344 # ------------------------------------------------------------------------------
346 AC_ARG_ENABLE(dbus, AS_HELP_STRING([--disable-dbus], [disable usage of dbus-1 in tests]))
347 AS_IF([test "x$enable_dbus" != "xno"], [
348 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.3.2],
349 [AC_DEFINE(HAVE_DBUS, 1, [Define if dbus-1 library is available]) have_dbus=yes],
351 AS_IF([test "x$have_dbus" = "xno" -a "x$enable_dbus" = "xyes"],
352 [AC_MSG_ERROR([*** dbus-1 support requested but libraries not found])])])
353 AM_CONDITIONAL(HAVE_DBUS, [test "$have_dbus" = "yes"])
355 # ------------------------------------------------------------------------------
356 PKG_CHECK_MODULES(UDEV, [libudev])
358 AC_ARG_WITH([udevrulesdir],
359 AS_HELP_STRING([--with-udevrulesdir=DIR], [Directory for udev rules files]),
361 [with_udevrulesdir=$($PKG_CONFIG --variable=udevdir udev)/rules.d])
362 AC_SUBST([udevrulesdir], [$with_udevrulesdir])
364 AC_ARG_WITH([udevbindir],
365 AS_HELP_STRING([--with-udevbindir=DIR], [Directory for udev binary files]),
367 [with_udevbindir=$($PKG_CONFIG --variable=udevdir udev)])
368 AC_SUBST([udevbindir], [$with_udevbindir])
370 # ------------------------------------------------------------------------------
372 AC_ARG_ENABLE(coverage, AS_HELP_STRING([--enable-coverage], [enable test coverage]))
373 if test "x$enable_coverage" = "xyes" ; then
374 AC_CHECK_PROG(lcov_found, [lcov], [yes], [no])
375 if test "x$lcov_found" = xno ; then
376 AC_MSG_ERROR([*** lcov support requested but the program was not found])
378 lcov_version_major="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 1`"
379 lcov_version_minor="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 2`"
380 if test "$lcov_version_major" -eq 1 -a "$lcov_version_minor" -lt 10; then
381 AC_MSG_ERROR([*** lcov version is too old. 1.10 required])
384 CC_CHECK_FLAGS_APPEND([with_coverage_cflags], [CFLAGS], [\
387 AC_SUBST([OUR_CFLAGS], "$with_cflags $with_coverage_cflags")
391 AM_CONDITIONAL(ENABLE_COVERAGE, [test "$have_coverage" = "yes"])
393 # ------------------------------------------------------------------------------
395 AC_ARG_ENABLE(blkid, AS_HELP_STRING([--disable-blkid], [disable blkid support]))
396 if test "x$enable_blkid" != "xno"; then
397 PKG_CHECK_MODULES(BLKID, [ blkid >= 2.24 ],
398 [AC_DEFINE(HAVE_BLKID, 1, [Define if blkid is available]) have_blkid=yes], have_blkid=no)
399 if test "x$have_blkid" = xno -a "x$enable_blkid" = xyes; then
400 AC_MSG_ERROR([*** blkid support requested but libraries not found])
403 AM_CONDITIONAL(HAVE_BLKID, [test "$have_blkid" = "yes"])
405 # ------------------------------------------------------------------------------
407 AC_ARG_ENABLE(seccomp, AS_HELP_STRING([--disable-seccomp], [Disable optional SECCOMP support]))
408 if test "x$enable_seccomp" != "xno"; then
409 PKG_CHECK_MODULES(SECCOMP, [libseccomp >= 1.0.0],
410 [AC_DEFINE(HAVE_SECCOMP, 1, [Define if seccomp is available])
412 M4_DEFINES="$M4_DEFINES -DHAVE_SECCOMP"],
414 if test "x$have_seccomp" = "xno" -a "x$enable_seccomp" = "xyes"; then
415 AC_MSG_ERROR([*** seccomp support requested but libraries not found])
418 AM_CONDITIONAL(HAVE_SECCOMP, [test "$have_seccomp" = "yes"])
420 # ------------------------------------------------------------------------------
422 AC_ARG_ENABLE(selinux, AS_HELP_STRING([--disable-selinux], [Disable optional SELINUX support]))
423 if test "x$enable_selinux" != "xno"; then
424 PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.1.9],
425 [AC_DEFINE(HAVE_SELINUX, 1, [Define if SELinux is available])
427 M4_DEFINES="$M4_DEFINES -DHAVE_SELINUX"],
429 if test "x$have_selinux" = xno -a "x$enable_selinux" = xyes; then
430 AC_MSG_ERROR([*** SELinux support requested but libraries not found])
433 AM_CONDITIONAL(HAVE_SELINUX, [test "$have_selinux" = "yes"])
436 AC_ARG_ENABLE(apparmor, AS_HELP_STRING([--disable-apparmor], [Disable optional AppArmor support]))
437 if test "x$enable_apparmor" != "xno"; then
438 PKG_CHECK_MODULES([APPARMOR], [libapparmor],
439 [AC_DEFINE(HAVE_APPARMOR, 1, [Define if AppArmor is available])
441 M4_DEFINES="$M4_DEFINES -DHAVE_APPARMOR"],
443 if test "x$have_apparmor" = xno -a "x$enable_apparmor" = xyes; then
444 AC_MSG_ERROR([*** AppArmor support requested but libraries not found])
447 AM_CONDITIONAL(HAVE_APPARMOR, [test "$have_apparmor" = "yes"])
449 # ------------------------------------------------------------------------------
451 AS_HELP_STRING([--disable-pam],[Disable optional PAM support]),
452 [case "${enableval}" in
455 *) AC_MSG_ERROR(bad value ${enableval} for --disable-pam) ;;
459 if test "x${have_pam}" != xno ; then
461 [security/pam_modules.h security/pam_modutil.h security/pam_ext.h],
463 [if test "x$have_pam" = xyes ; then
464 AC_MSG_ERROR([*** PAM headers not found.])
471 [if test "x$have_pam" = xyes ; then
472 AC_MSG_ERROR([*** libpam not found.])
475 if test "x$have_pam" = xyes ; then
476 PAM_LIBS="-lpam -lpam_misc"
477 AC_DEFINE(HAVE_PAM, 1, [PAM available])
478 M4_DEFINES="$M4_DEFINES -DHAVE_PAM"
486 AM_CONDITIONAL([HAVE_PAM], [test "x$have_pam" != xno])
488 # ------------------------------------------------------------------------------
490 AS_HELP_STRING([--disable-acl],[Disable optional ACL support]),
491 [case "${enableval}" in
494 *) AC_MSG_ERROR(bad value ${enableval} for --disable-acl) ;;
498 if test "x${have_acl}" != xno ; then
500 [sys/acl.h acl/libacl.h],
502 [if test "x$have_acl" = xyes ; then
503 AC_MSG_ERROR([*** ACL headers not found.])
510 [if test "x$have_acl" = xyes ; then
511 AC_MSG_ERROR([*** libacl not found.])
514 if test "x$have_acl" = xyes ; then
516 AC_DEFINE(HAVE_ACL, 1, [ACL available])
517 M4_DEFINES="$M4_DEFINES -DHAVE_ACL"
525 AM_CONDITIONAL([HAVE_ACL], [test "x$have_acl" != xno])
527 # ------------------------------------------------------------------------------
528 AC_ARG_ENABLE([smack], AS_HELP_STRING([--disable-smack],[Disable optional SMACK support]),
529 [case "${enableval}" in
530 yes) have_smack=yes ;;
532 *) AC_MSG_ERROR(bad value ${enableval} for --disable-smack) ;;
536 if test "x${have_smack}" = xauto; then
537 M4_DEFINES="$M4_DEFINES -DHAVE_SMACK"
541 AC_ARG_WITH(smack-run-label,
542 AS_HELP_STRING([--with-smack-run-label=STRING],
543 [run elogind --system itself with a specific SMACK label]),
544 [AC_DEFINE_UNQUOTED(SMACK_RUN_LABEL, ["$withval"], [Run elogind itself with SMACK label])],
547 AC_ARG_WITH(smack-default-process-label,
548 AS_HELP_STRING([--with-smack-default-process-label=STRING],
549 [default SMACK label for executed processes]),
550 [AC_DEFINE_UNQUOTED(SMACK_DEFAULT_PROCESS_LABEL, ["$withval"], [Default SMACK label for executed processes])],
553 if test "x${have_smack}" = xyes ; then
554 AC_DEFINE(HAVE_SMACK, 1, [Define if SMACK is available])
557 AM_CONDITIONAL([HAVE_SMACK], [test "x$have_smack" = "xyes"])
559 # ------------------------------------------------------------------------------
561 #AC_ARG_ENABLE(logind, AS_HELP_STRING([--disable-logind], [disable login daemon]))
562 #if test "x$enable_logind" != "xno"; then
565 AM_CONDITIONAL(ENABLE_LOGIND, [test "$have_logind" = "yes"])
566 AS_IF([test "$have_logind" = "yes"], [ AC_DEFINE(HAVE_LOGIND, [1], [Logind support available]) ])
568 # ------------------------------------------------------------------------------
569 AC_ARG_WITH(system-uid-max,
570 AS_HELP_STRING([--with-system-uid-max=UID]
571 [Maximum UID for system users]),
572 [SYSTEM_UID_MAX="$withval"],
573 [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`"])
575 AC_DEFINE_UNQUOTED(SYSTEM_UID_MAX, [$SYSTEM_UID_MAX], [Maximum System UID])
576 AC_SUBST(SYSTEM_UID_MAX)
578 # ------------------------------------------------------------------------------
579 AC_ARG_WITH(system-gid-max,
580 AS_HELP_STRING([--with-system-gid-max=GID]
581 [Maximum GID for system groups]),
582 [SYSTEM_GID_MAX="$withval"],
583 [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`"])
585 AC_DEFINE_UNQUOTED(SYSTEM_GID_MAX, [$SYSTEM_GID_MAX], [Maximum System GID])
586 AC_SUBST(SYSTEM_GID_MAX)
588 # ------------------------------------------------------------------------------
590 AC_ARG_ENABLE(polkit, AS_HELP_STRING([--disable-polkit], [disable PolicyKit support]))
591 if test "x$enable_polkit" != "xno"; then
592 AC_DEFINE(ENABLE_POLKIT, 1, [Define if PolicyKit support is to be enabled])
595 AM_CONDITIONAL(ENABLE_POLKIT, [test "x$have_polkit" = "xyes"])
597 # ------------------------------------------------------------------------------
599 AC_ARG_ENABLE(kdbus, AS_HELP_STRING([--disable-kdbus], [do not connect to kdbus by default]))
600 if test "x$enable_kdbus" != "xno"; then
601 AC_DEFINE(ENABLE_KDBUS, 1, [Define if kdbus is to be connected to by default])
603 M4_DEFINES="$M4_DEFINES -DENABLE_KDBUS"
605 AM_CONDITIONAL(ENABLE_KDBUS, [test "$have_kdbus" = "yes"])
607 # ------------------------------------------------------------------------------
608 AC_CHECK_HEADERS_ONCE([valgrind/memcheck.h valgrind/valgrind.h])
610 # ------------------------------------------------------------------------------
611 PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0 gio-2.0],
612 [have_glib=yes], [have_glib=no])
613 AS_IF([test "x$have_glib" = "xyes"], [ AC_DEFINE(HAVE_GLIB, 1, [Define if glib is available]) ])
615 # ------------------------------------------------------------------------------
617 AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-manpages], [disable manpages]))
618 AS_IF([test "x$enable_manpages" != xno], [have_manpages=yes])
619 AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
621 # ------------------------------------------------------------------------------
624 AC_ARG_WITH([dbuspolicydir],
625 AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
627 [with_dbuspolicydir=${sysconfdir}/dbus-1/system.d])
628 AX_NORMALIZE_PATH([with_dbuspolicydir])
630 AC_ARG_WITH([dbussystemservicedir],
631 AS_HELP_STRING([--with-dbussystemservicedir=DIR], [D-Bus system service directory]),
633 [with_dbussystemservicedir=${datadir}/dbus-1/system-services])
634 AX_NORMALIZE_PATH([with_dbussystemservicedir])
636 AC_ARG_WITH([bashcompletiondir],
637 AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),
639 [AS_IF([$($PKG_CONFIG --exists bash-completion)], [
640 with_bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion)
642 with_bashcompletiondir=${datadir}/bash-completion/completions
644 AX_NORMALIZE_PATH([with_bashcompletiondir])
646 AC_ARG_WITH([zshcompletiondir],
647 AS_HELP_STRING([--with-zshcompletiondir=DIR], [Zsh completions directory]),
648 [], [with_zshcompletiondir=${datadir}/zsh/site-functions])
649 AX_NORMALIZE_PATH([with_zshcompletiondir])
651 AC_ARG_WITH([rootprefix],
652 AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
653 [], [with_rootprefix=${ac_default_prefix}])
654 # --with-rootprefix= (empty) should default to "/" but AX_NORMALIZE_PATH
655 # defaults those to ".", solve that here for now until we can find a suitable
656 # fix for AX_NORMALIZE_PATH upstream at autoconf-archive.
657 # See: https://github.com/systemd/systemd/issues/54
658 if test "x${with_rootprefix}" = "x"; then
661 AX_NORMALIZE_PATH([with_rootprefix])
663 AC_ARG_WITH([rootlibdir],
664 AS_HELP_STRING([--with-rootlibdir=DIR], [Root directory for libraries necessary for boot]),
666 [with_rootlibdir=${libdir}])
667 AX_NORMALIZE_PATH([with_rootlibdir])
669 AC_ARG_WITH([pamlibdir],
670 AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]),
672 [with_pamlibdir=${with_rootlibdir}/security])
673 AX_NORMALIZE_PATH([with_pamlibdir])
675 AC_ARG_WITH([pamconfdir],
676 AS_HELP_STRING([--with-pamconfdir=DIR], [Directory for PAM configuration]),
678 [with_pamconfdir=${sysconfdir}/pam.d])
679 AX_NORMALIZE_PATH([with_pamconfdir])
681 AC_ARG_ENABLE([split-usr],
682 AS_HELP_STRING([--enable-split-usr], [Assume that /bin, /sbin aren\'t symlinks into /usr]),
684 [AS_IF([test "x${ac_default_prefix}" != "x${with_rootprefix}"], [
690 AS_IF([test "x${enable_split_usr}" = "xyes"], [
691 AC_DEFINE(HAVE_SPLIT_USR, 1, [Define if /bin, /sbin aren't symlinks into /usr])
693 AM_CONDITIONAL(ENABLE_SPLIT_USR, [test "x${enable_split_usr}" = "xyes"])
695 # work around intltool-update issues during 'make distcheck'
696 AS_IF([test "x$0" != "x./configure"], [
697 AC_SUBST([INTLTOOL_UPDATE], [/usr/bin/env true])
701 [AC_HELP_STRING([--disable-tests], [disable tests])],
702 enable_tests=$enableval, enable_tests=yes)
703 AM_CONDITIONAL(ENABLE_TESTS, [test x$enable_tests = xyes])
706 [AC_HELP_STRING([--enable-debug@<:@=LIST@:>@], [enable extra debugging (hashmap,mmap-cache)])],
707 [if test "x$enableval" = "xyes"; then
708 enableval="hashmap,mmap-cache"
711 IFS="$IFS$PATH_SEPARATOR,"
712 for name in $enableval; do
715 enable_debug_hashmap=yes
718 enable_debug_mmap_cache=yes
722 IFS="$saved_ifs"],[])
725 AS_IF([test x$enable_debug_hashmap = xyes], [
726 AC_DEFINE(ENABLE_DEBUG_HASHMAP, 1, [Define if hashmap debugging is to be enabled])
727 enable_debug="hashmap $enable_debug"
729 AS_IF([test x$enable_debug_mmap_cache = xyes], [
730 AC_DEFINE(ENABLE_DEBUG_MMAP_CACHE, 1, [Define if mmap cache debugging is to be enabled])
731 enable_debug="mmap-cache $enable_debug"
733 test -z "$enable_debug" && enable_debug="none"
735 AC_SUBST([dbuspolicydir], [$with_dbuspolicydir])
736 AC_SUBST([dbussystemservicedir], [$with_dbussystemservicedir])
737 AC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
738 AC_SUBST([zshcompletiondir], [$with_zshcompletiondir])
739 AC_SUBST([pamlibdir], [$with_pamlibdir])
740 AC_SUBST([pamconfdir], [$with_pamconfdir])
741 AC_SUBST([rootprefix], [$with_rootprefix])
742 AC_SUBST([rootlibdir], [$with_rootlibdir])
751 $PACKAGE_NAME $VERSION
754 AppArmor: ${have_apparmor}
755 SELinux: ${have_selinux}
756 SECCOMP: ${have_seccomp}
759 polkit: ${have_polkit}
763 man pages: ${have_manpages}
764 test coverage: ${have_coverage}
765 Split /usr: ${enable_split_usr}
766 extra debugging: ${enable_debug}
769 rootprefix: ${with_rootprefix}
770 sysconf dir: ${sysconfdir}
771 datarootdir: ${datarootdir}
772 includedir: ${includedir}
774 rootlib dir: ${with_rootlibdir}
775 PAM modules dir: ${with_pamlibdir}
776 PAM configuration dir: ${with_pamconfdir}
777 D-Bus policy dir: ${with_dbuspolicydir}
778 D-Bus system dir: ${with_dbussystemservicedir}
779 Bash completions dir: ${with_bashcompletiondir}
780 Zsh completions dir: ${with_zshcompletiondir}
781 Maximum System UID: ${SYSTEM_UID_MAX}
782 Maximum System GID: ${SYSTEM_GID_MAX}
784 CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
785 CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
786 LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}