configure.ac revision c932fb71cc90461b88ecdffe47c071d001d78fb4
9262a519468491c80df2998eda238e2ac86a810dLennart Poettering#
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# This file is part of systemd.
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering#
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers# Copyright 2010-2012 Lennart Poettering
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers# Copyright 2010-2012 Kay Sievers
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering#
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# systemd is free software; you can redistribute it and/or modify it
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering# under the terms of the GNU Lesser General Public License as published by
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering# the Free Software Foundation; either version 2.1 of the License, or
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# (at your option) any later version.
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering#
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# systemd is distributed in the hope that it will be useful, but
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# WITHOUT ANY WARRANTY; without even the implied warranty of
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering# Lesser General Public License for more details.
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering#
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering# You should have received a copy of the GNU Lesser General Public License
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# along with systemd; If not, see <http://www.gnu.org/licenses/>.
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering
4e949c11a1df4547d5f102e4131e07b026369cd7Javier JardónAC_PREREQ([2.64])
4e949c11a1df4547d5f102e4131e07b026369cd7Javier Jardón
4e949c11a1df4547d5f102e4131e07b026369cd7Javier JardónAC_INIT([systemd],
c4f1b86299c4ce2a62ce845bc48f2794f5459762Lennart Poettering [228],
4e949c11a1df4547d5f102e4131e07b026369cd7Javier Jardón [http://github.com/systemd/systemd/issues],
4e949c11a1df4547d5f102e4131e07b026369cd7Javier Jardón [systemd],
4e949c11a1df4547d5f102e4131e07b026369cd7Javier Jardón [http://www.freedesktop.org/wiki/Software/systemd])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering
78a825f216d39ee0295b00647b059d45467e1d02Kay SieversAC_CONFIG_SRCDIR([src/core/main.c])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_CONFIG_MACRO_DIR([m4])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_CONFIG_HEADERS([config.h])
a80db8bd5f7f15859e8891aab9fc3694ce4cd0bdJavier JardónAC_CONFIG_AUX_DIR([build-aux])
a80db8bd5f7f15859e8891aab9fc3694ce4cd0bdJavier Jardón
4db6d587c37c0357d20c79bf1a7c9afd4c7ced61Kay SieversAC_USE_SYSTEM_EXTENSIONS
907dd1953b7517534d646f5b2777780020c896e2Kay SieversAC_SYS_LARGEFILE
eb7bbee6cd182d5c4eb1e1180631c35158f59379Kay SieversAC_PREFIX_DEFAULT([/usr])
bbd9b8c2139a70005e4e83d198575e2a10fe1db2Lennart PoetteringAM_MAINTAINER_MODE([enable])
3e2147858f21943d5f4a781c60f33ac22c6096edKay SieversAM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects parallel-tests])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAM_SILENT_RULES([yes])
22be093ffb403a1c474037939ca9b88b1ee39f77Lennart PoetteringAC_CANONICAL_HOST
d59d0a2b4b41a75eaf618b26b8f8bd1e17de7e2bceeAC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [Canonical host string.])
d59d0a2b4b41a75eaf618b26b8f8bd1e17de7e2bcee
d59d0a2b4b41a75eaf618b26b8f8bd1e17de7e2bceeAC_PROG_CC_C99
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering
3e2147858f21943d5f4a781c60f33ac22c6096edKay SieversAX_COMPILER_VENDOR
3e2147858f21943d5f4a781c60f33ac22c6096edKay SieversAS_IF([test "x$ax_cv_c_compiler_vendor" = "xgnu"], [
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering AC_CHECK_TOOLS([AR], [gcc-ar ar], [:])
1c7dde3e475978c569a982d65fd86d4b4e3caad8Bastien Nocera AC_CHECK_TOOLS([NM], [gcc-nm nm], [:])
1c7dde3e475978c569a982d65fd86d4b4e3caad8Bastien Nocera AC_CHECK_TOOLS([RANLIB], [gcc-ranlib ranlib], [:])
1c7dde3e475978c569a982d65fd86d4b4e3caad8Bastien Nocera])
1c7dde3e475978c569a982d65fd86d4b4e3caad8Bastien Nocera
1c7dde3e475978c569a982d65fd86d4b4e3caad8Bastien NoceraLT_PREREQ(2.2)
1c7dde3e475978c569a982d65fd86d4b4e3caad8Bastien NoceraLT_INIT([disable-static])
e9da3678fcfc774b325dc1eaa054d0e00028a1fcLennart Poettering
e9da3678fcfc774b325dc1eaa054d0e00028a1fcLennart PoetteringAS_IF([test "x$enable_static" = "xyes"], [AC_MSG_ERROR([--enable-static is not supported by systemd])])
e9da3678fcfc774b325dc1eaa054d0e00028a1fcLennart PoetteringAS_IF([test "x$enable_largefile" = "xno"], [AC_MSG_ERROR([--disable-largefile is not supported by systemd])])
3ce4fad8f548db9edb19869ea540e3192d2123f4Kay Sievers
f975e971accc4d50c73ae53167db3df7a7099cf2Lennart PoetteringSET_ARCH(X86_64, x86_64*)
e9da3678fcfc774b325dc1eaa054d0e00028a1fcLennart PoetteringSET_ARCH(IA32, i*86*)
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringSET_ARCH(MIPS, mips*)
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringSET_ARCH(AARCH64, aarch64*)
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# i18n stuff for the PolicyKit policy files, heck whether intltool can be found, disable NLS otherwise
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_CHECK_PROG(intltool_found, [intltool-merge], [yes], [no])
3e2147858f21943d5f4a781c60f33ac22c6096edKay SieversAS_IF([test x"$intltool_found" != xyes],
92ec4495f76a7a2a6c31f5bb2a5240f78dcfe1d2Javier Jardón [AS_IF([test x"$enable_nls" = xyes],
80a5cbace45a6adbf2f9119edc5a4b10db493064Kay Sievers [AC_MSG_ERROR([--enable-nls requested but intltool not found])],
92ec4495f76a7a2a6c31f5bb2a5240f78dcfe1d2Javier Jardón [AS_IF([test x"$enable_nls" != xno],
9e45e7d8f0d8d3f31d790f85694585d0d4b368b8Javier Jardón [AC_MSG_WARN([*** Disabling NLS support because intltool was not found])
6e92b23f0d6dd398848376bbaf47e54a90ed3389Kay Sievers enable_nls=no])
92ec4495f76a7a2a6c31f5bb2a5240f78dcfe1d2Javier Jardón ])
6e92b23f0d6dd398848376bbaf47e54a90ed3389Kay Sievers ])
0eaeca1f2373a323b98c86b47561d98e59c67b25Kay Sievers
6e92b23f0d6dd398848376bbaf47e54a90ed3389Kay SieversAM_NLS
3e2147858f21943d5f4a781c60f33ac22c6096edKay SieversAS_IF([test x"$enable_nls" != xno -o "x$enable_polkit" != xno], [
9a60da2834074d970ca063c210fe9d2f05c70532Thierry Reding # intltoolize greps for '^(AC|IT)_PROG_INTLTOOL', so it needs to be on its own line
9a60da2834074d970ca063c210fe9d2f05c70532Thierry RedingIT_PROG_INTLTOOL([0.40.0])
f975e971accc4d50c73ae53167db3df7a7099cf2Lennart Poettering])
b62cfcea00862ccbf0e5e297f8a339f70987edefMichael Biebl
b62cfcea00862ccbf0e5e297f8a339f70987edefMichael BieblAS_IF([test -z "$INTLTOOL_POLICY_RULE"], [
b62cfcea00862ccbf0e5e297f8a339f70987edefMichael Biebl # If intltool is not available, provide a dummy rule to fail generation of %.policy files with a meaningful error message
9a60da2834074d970ca063c210fe9d2f05c70532Thierry Reding INTLTOOL_POLICY_RULE='%.policy: %.policy.in ; @echo " ITMRG " $@ && echo "*** intltool support required to build target $@" && false'
9c4fa6ed1069e98db5f01a5d1056b443a04cc7d9Lennart Poettering AC_SUBST(INTLTOOL_POLICY_RULE)
9c4fa6ed1069e98db5f01a5d1056b443a04cc7d9Lennart Poettering])
9c4fa6ed1069e98db5f01a5d1056b443a04cc7d9Lennart Poettering
9c4fa6ed1069e98db5f01a5d1056b443a04cc7d9Lennart PoetteringGETTEXT_PACKAGE=systemd
eb2e280f9c59b66965c9316eadc4c113a13ca744Lucas De MarchiAC_SUBST(GETTEXT_PACKAGE)
be1a67d9d63bfdd4a5f8ba9cfc804030f10f5833Lennart PoetteringAC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [systemd])
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart PoetteringAC_PROG_MKDIR_P
27765dfc7a32d790badb29e6498b34edb0b60c33Lennart PoetteringAC_PROG_LN_S
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart PoetteringAC_PROG_SED
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart PoetteringAC_PROG_GREP
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart PoetteringAC_PROG_AWK
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart PoetteringAC_PATH_PROG([M4], [m4])
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart PoetteringAC_PATH_PROG([QUOTAON], [quotaon], [/usr/sbin/quotaon], [$PATH:/usr/sbin:/sbin])
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart PoetteringAC_PATH_PROG([QUOTACHECK], [quotacheck], [/usr/sbin/quotacheck], [$PATH:/usr/sbin:/sbin])
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart PoetteringAC_PATH_PROG([SETCAP], [setcap], [/usr/sbin/setcap], [$PATH:/usr/sbin:/sbin])
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart PoetteringAC_PATH_PROG([KILL], [kill], [/usr/bin/kill], [$PATH:/usr/sbin:/sbin])
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart PoetteringAC_PATH_PROG([KMOD], [kmod], [/usr/bin/kmod], [$PATH:/usr/sbin:/sbin])
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart PoetteringAC_PATH_PROG([KEXEC], [kexec], [/usr/sbin/kexec], [$PATH:/usr/sbin:/sbin])
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart PoetteringAC_PATH_PROG([SULOGIN], [sulogin], [/usr/sbin/sulogin], [$PATH:/usr/sbin:/sbin])
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart PoetteringAC_PATH_PROG([MOUNT_PATH], [mount], [/usr/bin/mount], [$PATH:/usr/sbin:/sbin])
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart PoetteringAC_PATH_PROG([UMOUNT_PATH], [umount], [/usr/bin/umount], [$PATH:/usr/sbin:/sbin])
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering
be1a67d9d63bfdd4a5f8ba9cfc804030f10f5833Lennart PoetteringAS_IF([! ln --relative --help > /dev/null 2>&1], [AC_MSG_ERROR([*** ln doesn't support --relative ***])])
be1a67d9d63bfdd4a5f8ba9cfc804030f10f5833Lennart Poettering
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart PoetteringM4_DEFINES=
be1a67d9d63bfdd4a5f8ba9cfc804030f10f5833Lennart Poettering
8745297f9853c4a17bac69e1b7e652fe81bc1940Lennart PoetteringAC_CHECK_TOOL(OBJCOPY, objcopy)
d200735e13c52dcfe36c0e066f9f6c2fbfb85a9cMichal SchmidtAC_CHECK_TOOL(STRINGS, strings)
be1a67d9d63bfdd4a5f8ba9cfc804030f10f5833Lennart PoetteringAC_CHECK_TOOL(GPERF, gperf)
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poetteringif test -z "$GPERF" ; then
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering AC_MSG_ERROR([*** gperf not found])
9b85fc6a89386582bfe792dba881800b0a093839Gustavo Sverzut Barbierifi
9b85fc6a89386582bfe792dba881800b0a093839Gustavo Sverzut Barbieri
9b85fc6a89386582bfe792dba881800b0a093839Gustavo Sverzut Barbieri# ------------------------------------------------------------------------------
5a45a93627609451784a04366cfa1150d32611d1Lennart Poetteringaddress_sanitizer_cflags=
c1663b9daf5a43425e54bbe3daf6b10e64578f80Lennart Poetteringaddress_sanitizer_cppflags=
c1663b9daf5a43425e54bbe3daf6b10e64578f80Lennart Poetteringaddress_sanitizer_ldflags=
5a45a93627609451784a04366cfa1150d32611d1Lennart PoetteringAC_ARG_ENABLE(address-sanitizer, AS_HELP_STRING([--enable-address-sanitizer], [enable -fsanitize=address]))
5a45a93627609451784a04366cfa1150d32611d1Lennart PoetteringAS_IF([test "x$enable_address_sanitizer" = "xyes"], [
5a45a93627609451784a04366cfa1150d32611d1Lennart Poettering CC_CHECK_FLAG_APPEND([with_as_cflags], [CFLAGS], [-fsanitize=address])
5a45a93627609451784a04366cfa1150d32611d1Lennart Poettering AS_IF([test -z "$with_as_cflags"],
5a45a93627609451784a04366cfa1150d32611d1Lennart Poettering [AC_MSG_ERROR([*** -fsanitize=address is not supported])])
9e7adc3ae1133fa08a468768a490812299fad030Lucas De Marchi address_sanitizer_cflags="$with_as_cflags -fno-omit-frame-pointer -DVALGRIND=1"
9e7adc3ae1133fa08a468768a490812299fad030Lucas De Marchi address_sanitizer_cppflags="-DVALGRIND=1"
9b85fc6a89386582bfe792dba881800b0a093839Gustavo Sverzut Barbieri address_sanitizer_ldflags="-Wc,-fsanitize=address"
5a45a93627609451784a04366cfa1150d32611d1Lennart Poettering ])
5a45a93627609451784a04366cfa1150d32611d1Lennart Poettering
5a45a93627609451784a04366cfa1150d32611d1Lennart Poetteringundefined_sanitizer_cflags=
5a45a93627609451784a04366cfa1150d32611d1Lennart Poetteringundefined_sanitizer_cppflags=
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poetteringundefined_sanitizer_ldflags=
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_ARG_ENABLE(undefined-sanitizer, AS_HELP_STRING([--enable-undefined-sanitizer], [enable -fsanitize=undefined]))
afea26ad7d406d8b6c95d2642cb5a1d807b87546Lennart PoetteringAS_IF([test "x$enable_undefined_sanitizer" = "xyes"], [
85f19d825e7504676f3a80c78c1d9a7ec35a3b3fMichael Biebl CC_CHECK_FLAG_APPEND([with_us_cflags], [CFLAGS], [-fsanitize=undefined])
85f19d825e7504676f3a80c78c1d9a7ec35a3b3fMichael Biebl AS_IF([test -z "$with_us_cflags"],
85f19d825e7504676f3a80c78c1d9a7ec35a3b3fMichael Biebl [AC_MSG_ERROR([*** -fsanitize=undefined is not supported])])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering undefined_sanitizer_cflags="$with_us_cflags -fno-omit-frame-pointer -DVALGRIND=1"
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering undefined_sanitizer_cppflags="-DVALGRIND=1"
85f19d825e7504676f3a80c78c1d9a7ec35a3b3fMichael Biebl undefined_sanitizer_ldflags="-Wc,-fsanitize=undefined"
85f19d825e7504676f3a80c78c1d9a7ec35a3b3fMichael Biebl ])
85f19d825e7504676f3a80c78c1d9a7ec35a3b3fMichael Biebl
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poetteringsanitizer_cflags="$address_sanitizer_cflags $undefined_sanitizer_cflags"
b237ef2cfac7ab0b33170809e8cb64628606207dTollef Fog Heensanitizer_cppflags="$address_sanitizer_cppflags $undefined_sanitizer_cppflags"
a9b5b03212f9c854938483b8901e433c2ba6619bMichael Tremersanitizer_ldflags="$address_sanitizer_ldflags $undefined_sanitizer_ldflags"
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering
3e2147858f21943d5f4a781c60f33ac22c6096edKay SieversCC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers -pipe \
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers -Wall \
728beb28a713709f521d374c9f8f3da781969d26Tom Gundersen -Wextra \
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers -Wundef \
816115863962548a9a0d9fbfe429c7f8e685beacRoberto Sassu "-Wformat=2 -Wformat-security -Wformat-nonliteral" \
816115863962548a9a0d9fbfe429c7f8e685beacRoberto Sassu -Wlogical-op \
816115863962548a9a0d9fbfe429c7f8e685beacRoberto Sassu -Wmissing-include-dirs \
816115863962548a9a0d9fbfe429c7f8e685beacRoberto Sassu -Wold-style-definition \
816115863962548a9a0d9fbfe429c7f8e685beacRoberto Sassu -Wpointer-arith \
816115863962548a9a0d9fbfe429c7f8e685beacRoberto Sassu -Winit-self \
816115863962548a9a0d9fbfe429c7f8e685beacRoberto Sassu -Wdeclaration-after-statement \
816115863962548a9a0d9fbfe429c7f8e685beacRoberto Sassu -Wfloat-equal \
816115863962548a9a0d9fbfe429c7f8e685beacRoberto Sassu -Wsuggest-attribute=noreturn \
816115863962548a9a0d9fbfe429c7f8e685beacRoberto Sassu -Werror=missing-prototypes \
816115863962548a9a0d9fbfe429c7f8e685beacRoberto Sassu -Werror=implicit-function-declaration \
816115863962548a9a0d9fbfe429c7f8e685beacRoberto Sassu -Werror=missing-declarations \
816115863962548a9a0d9fbfe429c7f8e685beacRoberto Sassu -Werror=return-type \
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers -Wstrict-prototypes \
591622d7efbc828f00f190d91b6608148b967ff5Lennart Poettering -Wredundant-decls \
591622d7efbc828f00f190d91b6608148b967ff5Lennart Poettering -Wmissing-noreturn \
591622d7efbc828f00f190d91b6608148b967ff5Lennart Poettering -Wshadow \
591622d7efbc828f00f190d91b6608148b967ff5Lennart Poettering -Wendif-labels \
591622d7efbc828f00f190d91b6608148b967ff5Lennart Poettering -Wstrict-aliasing=2 \
591622d7efbc828f00f190d91b6608148b967ff5Lennart Poettering -Wwrite-strings \
591622d7efbc828f00f190d91b6608148b967ff5Lennart Poettering -Wno-unused-parameter \
591622d7efbc828f00f190d91b6608148b967ff5Lennart Poettering -Wno-missing-field-initializers \
56cf987fe74270bde4e16c7ec9e0414a9030723bDaniel J Walsh -Wno-unused-result \
591622d7efbc828f00f190d91b6608148b967ff5Lennart Poettering -Wno-format-signedness \
ed061a8dc2acd93c2eb569d2d983d5a77f7e5b77Michal Schmidt -Werror=overflow \
ed061a8dc2acd93c2eb569d2d983d5a77f7e5b77Michal Schmidt -Wdate-time \
ed061a8dc2acd93c2eb569d2d983d5a77f7e5b77Michal Schmidt -Wnested-externs \
ed061a8dc2acd93c2eb569d2d983d5a77f7e5b77Michal Schmidt -ffast-math \
ed061a8dc2acd93c2eb569d2d983d5a77f7e5b77Michal Schmidt -fno-common \
ed061a8dc2acd93c2eb569d2d983d5a77f7e5b77Michal Schmidt -fdiagnostics-show-option \
56cf987fe74270bde4e16c7ec9e0414a9030723bDaniel J Walsh -fno-strict-aliasing \
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers -fvisibility=hidden \
807e17f05e217b474af39503efb9503d81b12596Lennart Poettering -fstack-protector \
807e17f05e217b474af39503efb9503d81b12596Lennart Poettering -fstack-protector-strong \
807e17f05e217b474af39503efb9503d81b12596Lennart Poettering -fPIE \
807e17f05e217b474af39503efb9503d81b12596Lennart Poettering --param=ssp-buffer-size=4])
807e17f05e217b474af39503efb9503d81b12596Lennart Poettering
807e17f05e217b474af39503efb9503d81b12596Lennart PoetteringCC_CHECK_FLAG_APPEND([with_cflags], [CFLAGS], [-Werror=shadow], [
807e17f05e217b474af39503efb9503d81b12596Lennart Poettering#include <time.h>
807e17f05e217b474af39503efb9503d81b12596Lennart Poettering#include <inttypes.h>
807e17f05e217b474af39503efb9503d81b12596Lennart Poetteringtypedef uint64_t usec_t;
807e17f05e217b474af39503efb9503d81b12596Lennart Poetteringusec_t now(clockid_t clock);
807e17f05e217b474af39503efb9503d81b12596Lennart Poetteringint main(void) {
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers struct timespec now;
0213c3f8102bdc934c629d11a44ca0b408762287Lennart Poettering return 0;
0213c3f8102bdc934c629d11a44ca0b408762287Lennart Poettering}
0213c3f8102bdc934c629d11a44ca0b408762287Lennart Poettering])
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poettering
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart PoetteringAS_CASE([$CC], [*clang*],
0213c3f8102bdc934c629d11a44ca0b408762287Lennart Poettering [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
0213c3f8102bdc934c629d11a44ca0b408762287Lennart Poettering -Wno-typedef-redefinition \
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poettering -Wno-gnu-variable-sized-type-not-at-end \
0213c3f8102bdc934c629d11a44ca0b408762287Lennart Poettering ])])
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poettering
0213c3f8102bdc934c629d11a44ca0b408762287Lennart PoetteringAS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
0213c3f8102bdc934c629d11a44ca0b408762287Lennart Poettering [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poettering -flto])],
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poettering [AC_MSG_RESULT([skipping -flto, optimization not enabled])])
0213c3f8102bdc934c629d11a44ca0b408762287Lennart PoetteringAC_SUBST([OUR_CFLAGS], "$with_cflags $sanitizer_cflags")
812cce323db081634f37e4ec6d29f2b9328a3f52Lennart Poettering
0213c3f8102bdc934c629d11a44ca0b408762287Lennart PoetteringAS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poettering [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
0213c3f8102bdc934c629d11a44ca0b408762287Lennart Poettering -Wp,-D_FORTIFY_SOURCE=2])],
0213c3f8102bdc934c629d11a44ca0b408762287Lennart Poettering [AC_MSG_RESULT([skipping -D_FORTIFY_SOURCE, optimization not enabled])])
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart PoetteringAC_SUBST([OUR_CPPFLAGS], "$with_cppflags $sanitizer_cppflags")
0213c3f8102bdc934c629d11a44ca0b408762287Lennart Poettering
0213c3f8102bdc934c629d11a44ca0b408762287Lennart PoetteringAS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
0213c3f8102bdc934c629d11a44ca0b408762287Lennart Poettering [CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers -Wl,--gc-sections])],
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poettering [AC_MSG_RESULT([skipping --gc-sections, optimization not enabled])])
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart PoetteringAC_SUBST([OUR_CFLAGS], "$with_ldflags $sanitizer_cflags")
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poettering
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart PoetteringAS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poettering [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poettering -ffunction-sections -fdata-sections])],
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poettering [AC_MSG_RESULT([skipping -ffunction/data-section, optimization not enabled])])
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart PoetteringAC_SUBST([OUR_CFLAGS], "$with_cflags $sanitizer_cflags")
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poettering
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart PoetteringCC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poettering -Wl,--as-needed \
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poettering -Wl,--no-undefined \
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poettering -Wl,-z,relro \
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poettering -Wl,-z,now \
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poettering -pie \
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poettering -Wl,-fuse-ld=gold])
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart PoetteringAC_SUBST([OUR_LDFLAGS], "$with_ldflags $sanitizer_ldflags")
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poettering
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart PoetteringAC_CHECK_SIZEOF(pid_t)
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart PoetteringAC_CHECK_SIZEOF(uid_t)
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart PoetteringAC_CHECK_SIZEOF(gid_t)
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart PoetteringAC_CHECK_SIZEOF(time_t)
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart PoetteringAC_CHECK_SIZEOF(dev_t)
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart PoetteringAC_CHECK_SIZEOF(rlim_t,,[
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poettering #include <sys/time.h>
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poettering #include <sys/resource.h>
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poettering])
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poettering
812cce323db081634f37e4ec6d29f2b9328a3f52Lennart Poettering# ------------------------------------------------------------------------------
812cce323db081634f37e4ec6d29f2b9328a3f52Lennart Poettering# we use python to build the man page index
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poetteringhave_python=no
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart PoetteringAC_ARG_WITH([python],
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poettering [AS_HELP_STRING([--without-python], [Disable building the man page index and systemd-python (default: test)])])
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poettering
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poetteringhave_lxml=no
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart PoetteringAS_IF([test "x$with_python" != "xno"], [
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poettering AM_PATH_PYTHON(,, [:])
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers AS_IF([test "x$PYTHON" != "x:"], [
5eda94dda25bccda928c4b33c790dbe748573a22Lennart Poettering AC_MSG_CHECKING([for python lxml module])
5eda94dda25bccda928c4b33c790dbe748573a22Lennart Poettering AS_IF(["$PYTHON" -c 'import lxml' 2>/dev/null], [have_lxml=yes])
5eda94dda25bccda928c4b33c790dbe748573a22Lennart Poettering AC_MSG_RESULT([$have_lxml])
5eda94dda25bccda928c4b33c790dbe748573a22Lennart Poettering AS_IF([test "x$have_lxml" = "xyes"], [have_python=yes],
5eda94dda25bccda928c4b33c790dbe748573a22Lennart Poettering [AC_MSG_WARN([*** python support requires python-lxml module installed])])
5eda94dda25bccda928c4b33c790dbe748573a22Lennart Poettering ])
5eda94dda25bccda928c4b33c790dbe748573a22Lennart Poettering])
5eda94dda25bccda928c4b33c790dbe748573a22Lennart PoetteringAS_IF([test "$have_python" != "yes"], [
5eda94dda25bccda928c4b33c790dbe748573a22Lennart Poettering AS_IF([test "$with_python" = "yes"],
5eda94dda25bccda928c4b33c790dbe748573a22Lennart Poettering [AC_MSG_ERROR([*** python support requested but python support not found])])
5eda94dda25bccda928c4b33c790dbe748573a22Lennart Poettering AS_IF([test "$with_python" != "no"],
5eda94dda25bccda928c4b33c790dbe748573a22Lennart Poettering [AC_MSG_WARN([*** python support not found, some documentation cannot be built])])
5eda94dda25bccda928c4b33c790dbe748573a22Lennart Poettering])
5eda94dda25bccda928c4b33c790dbe748573a22Lennart PoetteringAM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])
5eda94dda25bccda928c4b33c790dbe748573a22Lennart Poettering
5eda94dda25bccda928c4b33c790dbe748573a22Lennart Poettering# ------------------------------------------------------------------------------
5eda94dda25bccda928c4b33c790dbe748573a22Lennart Poettering
5eda94dda25bccda928c4b33c790dbe748573a22Lennart PoetteringAC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
5eda94dda25bccda928c4b33c790dbe748573a22Lennart PoetteringAC_CHECK_HEADERS([linux/btrfs.h], [], [])
5eda94dda25bccda928c4b33c790dbe748573a22Lennart PoetteringAC_CHECK_HEADERS([linux/memfd.h], [], [])
5eda94dda25bccda928c4b33c790dbe748573a22Lennart Poettering
5eda94dda25bccda928c4b33c790dbe748573a22Lennart Poettering# unconditionally pull-in librt with old glibc versions
5eda94dda25bccda928c4b33c790dbe748573a22Lennart PoetteringAC_SEARCH_LIBS([clock_gettime], [rt], [], [])
5eda94dda25bccda928c4b33c790dbe748573a22Lennart Poettering
5eda94dda25bccda928c4b33c790dbe748573a22Lennart Poetteringsave_LIBS="$LIBS"
5eda94dda25bccda928c4b33c790dbe748573a22Lennart PoetteringLIBS=
5eda94dda25bccda928c4b33c790dbe748573a22Lennart PoetteringAC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not found])])
5eda94dda25bccda928c4b33c790dbe748573a22Lennart PoetteringCAP_LIBS="$LIBS"
5eda94dda25bccda928c4b33c790dbe748573a22Lennart PoetteringLIBS="$save_LIBS"
5eda94dda25bccda928c4b33c790dbe748573a22Lennart PoetteringAC_SUBST(CAP_LIBS)
5eda94dda25bccda928c4b33c790dbe748573a22Lennart Poettering
5eda94dda25bccda928c4b33c790dbe748573a22Lennart PoetteringAC_CHECK_FUNCS([memfd_create])
5eda94dda25bccda928c4b33c790dbe748573a22Lennart PoetteringAC_CHECK_FUNCS([__secure_getenv secure_getenv])
5eda94dda25bccda928c4b33c790dbe748573a22Lennart PoetteringAC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at, setns, getrandom, renameat2,
5eda94dda25bccda928c4b33c790dbe748573a22Lennart Poettering kcmp, keyctl, key_serial_t, char16_t, char32_t, LO_FLAGS_PARTSCAN],
5eda94dda25bccda928c4b33c790dbe748573a22Lennart Poettering [], [], [[
5eda94dda25bccda928c4b33c790dbe748573a22Lennart Poettering#include <sys/types.h>
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers#include <unistd.h>
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering#include <sys/mount.h>
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering#include <fcntl.h>
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering#include <sched.h>
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering#include <linux/loop.h>
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering#include <linux/random.h>
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering]])
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart PoetteringAC_CHECK_DECLS([IFLA_INET6_ADDR_GEN_MODE,
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering IFLA_MACVLAN_FLAGS,
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering IFLA_IPVLAN_MODE,
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering IFLA_VTI_REMOTE,
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering IFLA_PHYS_PORT_ID,
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering IFLA_BOND_AD_INFO,
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering IFLA_VLAN_PROTOCOL,
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering IFLA_VXLAN_REMCSUM_NOPARTIAL,
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering IFLA_IPTUN_ENCAP_DPORT,
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering IFLA_GRE_ENCAP_DPORT,
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering IFLA_BRIDGE_VLAN_INFO,
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering IFLA_BRPORT_LEARNING_SYNC,
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering IFLA_BR_PRIORITY,
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering NDA_IFINDEX,
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering IFA_FLAGS],
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering[], [], [[
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering#include <inttypes.h>
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering#include <netinet/in.h>
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering#include <netinet/ether.h>
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering#include <linux/rtnetlink.h>
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering#include <net/if.h>
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering#include <linux/ip.h>
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering#include <linux/if_tunnel.h>
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering#include <linux/if_link.h>
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering#include <linux/if_bridge.h>
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering#include <linux/if_addr.h>
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering#include <linux/neighbour.h>
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering]])
4927fcae48de061393b3ce9c12d49f80d73fbf1dLennart Poettering
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers# This makes sure pkg.m4 is available.
7f4e08056de0184b205a20632e62db73d299937eLennart Poetteringm4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
7f4e08056de0184b205a20632e62db73d299937eLennart Poettering
7f4e08056de0184b205a20632e62db73d299937eLennart Poettering# ------------------------------------------------------------------------------
880a599e262b9193219e612d827b35bb0c292daeTom Gundersenhave_dbus=no
7f4e08056de0184b205a20632e62db73d299937eLennart PoetteringAC_ARG_ENABLE(dbus, AS_HELP_STRING([--disable-dbus], [disable usage of dbus-1 in tests]))
7f4e08056de0184b205a20632e62db73d299937eLennart PoetteringAS_IF([test "x$enable_dbus" != "xno"], [
591622d7efbc828f00f190d91b6608148b967ff5Lennart Poettering PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.3.2],
7f4e08056de0184b205a20632e62db73d299937eLennart Poettering [AC_DEFINE(HAVE_DBUS, 1, [Define if dbus-1 library is available]) have_dbus=yes],
7f4e08056de0184b205a20632e62db73d299937eLennart Poettering [have_dbus=no])
7f4e08056de0184b205a20632e62db73d299937eLennart Poettering AS_IF([test "x$have_dbus" = "xno" -a "x$enable_dbus" = "xyes"],
7f4e08056de0184b205a20632e62db73d299937eLennart Poettering [AC_MSG_ERROR([*** dbus-1 support requested but libraries not found])])])
3e2147858f21943d5f4a781c60f33ac22c6096edKay SieversAM_CONDITIONAL(HAVE_DBUS, [test "$have_dbus" = "yes"])
27669061f40766457db93d5cc3dfe00dce240806Miklos Vajna
27669061f40766457db93d5cc3dfe00dce240806Miklos Vajna# ------------------------------------------------------------------------------
27669061f40766457db93d5cc3dfe00dce240806Miklos Vajnahave_utmp=yes
be31376e6c9add0786f31a38eec2ecfdb73eb115Kay SieversAC_ARG_ENABLE([utmp], AS_HELP_STRING([--disable-utmp], [disable utmp/wtmp log handling]),
27669061f40766457db93d5cc3dfe00dce240806Miklos Vajna AS_CASE("x${enableval}",
27669061f40766457db93d5cc3dfe00dce240806Miklos Vajna [xyes], [have_utmp=yes],
27669061f40766457db93d5cc3dfe00dce240806Miklos Vajna [xno], [have_utmp=no],
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers AC_MSG_ERROR(bad value ${enableval} for --enable-utmp)))
e5e83e8362e946890ac991fc86a2c5869f9befdfLennart PoetteringAS_IF([test "x$have_utmp" = "xyes"], [AC_DEFINE(HAVE_UTMP, 1, [Define if utmp/wtmp support is enabled])])
e5e83e8362e946890ac991fc86a2c5869f9befdfLennart PoetteringAM_CONDITIONAL([HAVE_UTMP], [test "x$have_utmp" = "xyes"])
e5e83e8362e946890ac991fc86a2c5869f9befdfLennart Poettering
be31376e6c9add0786f31a38eec2ecfdb73eb115Kay Sievers# ------------------------------------------------------------------------------
e5e83e8362e946890ac991fc86a2c5869f9befdfLennart Poetteringhave_compat_libs=no
e5e83e8362e946890ac991fc86a2c5869f9befdfLennart PoetteringAC_ARG_ENABLE([compat_libs], AS_HELP_STRING([--enable-compat-libs],[Enable creation of compatibility libraries]),
e5e83e8362e946890ac991fc86a2c5869f9befdfLennart Poettering [case "${enableval}" in
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers yes) have_compat_libs=yes ;;
e5e83e8362e946890ac991fc86a2c5869f9befdfLennart Poettering no) have_compat_libs=no ;;
e5e83e8362e946890ac991fc86a2c5869f9befdfLennart Poettering *) AC_MSG_ERROR(bad value ${enableval} for --enable-compat-libs) ;;
e5e83e8362e946890ac991fc86a2c5869f9befdfLennart Poettering esac],
be31376e6c9add0786f31a38eec2ecfdb73eb115Kay Sievers [have_compat_libs=no])
e5e83e8362e946890ac991fc86a2c5869f9befdfLennart PoetteringAM_CONDITIONAL([ENABLE_COMPAT_LIBS], [test "$have_compat_libs" = "yes"])
e5e83e8362e946890ac991fc86a2c5869f9befdfLennart Poettering
e5e83e8362e946890ac991fc86a2c5869f9befdfLennart Poettering# ------------------------------------------------------------------------------
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievershave_coverage=no
4de856120f252e7aa19c923c10fbf23310d623aaLennart PoetteringAC_ARG_ENABLE(coverage, AS_HELP_STRING([--enable-coverage], [enable test coverage]))
4de856120f252e7aa19c923c10fbf23310d623aaLennart Poetteringif test "x$enable_coverage" = "xyes" ; then
4de856120f252e7aa19c923c10fbf23310d623aaLennart Poettering AC_CHECK_PROG(lcov_found, [lcov], [yes], [no])
be31376e6c9add0786f31a38eec2ecfdb73eb115Kay Sievers if test "x$lcov_found" = xno ; then
4de856120f252e7aa19c923c10fbf23310d623aaLennart Poettering AC_MSG_ERROR([*** lcov support requested but the program was not found])
4de856120f252e7aa19c923c10fbf23310d623aaLennart Poettering else
4de856120f252e7aa19c923c10fbf23310d623aaLennart Poettering lcov_version_major="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 1`"
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers lcov_version_minor="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 2`"
4de856120f252e7aa19c923c10fbf23310d623aaLennart Poettering if test "$lcov_version_major" -eq 1 -a "$lcov_version_minor" -lt 10; then
4de856120f252e7aa19c923c10fbf23310d623aaLennart Poettering AC_MSG_ERROR([*** lcov version is too old. 1.10 required])
4de856120f252e7aa19c923c10fbf23310d623aaLennart Poettering else
be31376e6c9add0786f31a38eec2ecfdb73eb115Kay Sievers have_coverage=yes
4de856120f252e7aa19c923c10fbf23310d623aaLennart Poettering CC_CHECK_FLAGS_APPEND([with_coverage_cflags], [CFLAGS], [\
4de856120f252e7aa19c923c10fbf23310d623aaLennart Poettering -fprofile-arcs \
4de856120f252e7aa19c923c10fbf23310d623aaLennart Poettering -ftest-coverage])
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers AC_SUBST([OUR_CFLAGS], "$with_cflags $with_coverage_cflags")
2a018e83ded29c9719b2478a65ee6245c829c0f5Kay Sievers fi
2a018e83ded29c9719b2478a65ee6245c829c0f5Kay Sievers fi
2a018e83ded29c9719b2478a65ee6245c829c0f5Kay Sieversfi
be31376e6c9add0786f31a38eec2ecfdb73eb115Kay SieversAM_CONDITIONAL(ENABLE_COVERAGE, [test "$have_coverage" = "yes"])
2a018e83ded29c9719b2478a65ee6245c829c0f5Kay Sievers
2a018e83ded29c9719b2478a65ee6245c829c0f5Kay Sievers# ------------------------------------------------------------------------------
4c80c73c2b804576b1de27e644c1da4dab2f9026Kay Sievershave_kmod=no
2a018e83ded29c9719b2478a65ee6245c829c0f5Kay SieversAC_ARG_ENABLE(kmod, AS_HELP_STRING([--disable-kmod], [disable loadable modules support]))
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sieversif test "x$enable_kmod" != "xno"; then
b2e9fb99ab288e8817302851743ed1a3cddd384bMiklos Vajna PKG_CHECK_EXISTS([ libkmod ], have_kmod=yes, have_kmod=no)
b2e9fb99ab288e8817302851743ed1a3cddd384bMiklos Vajna if test "x$have_kmod" = "xyes"; then
b2e9fb99ab288e8817302851743ed1a3cddd384bMiklos Vajna PKG_CHECK_MODULES(KMOD, [ libkmod >= 15 ],
be31376e6c9add0786f31a38eec2ecfdb73eb115Kay Sievers [AC_DEFINE(HAVE_KMOD, 1, [Define if kmod is available])],
b2e9fb99ab288e8817302851743ed1a3cddd384bMiklos Vajna AC_MSG_ERROR([*** kmod version >= 15 not found]))
b2e9fb99ab288e8817302851743ed1a3cddd384bMiklos Vajna fi
b2e9fb99ab288e8817302851743ed1a3cddd384bMiklos Vajna if test "x$have_kmod" = xno -a "x$enable_kmod" = xyes; then
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers AC_MSG_ERROR([*** kmod support requested, but libraries not found])
f47cd184c0ff80e025428e9e385e61bda1ef3d69Miklos Vajna fi
f47cd184c0ff80e025428e9e385e61bda1ef3d69Miklos Vajnafi
f47cd184c0ff80e025428e9e385e61bda1ef3d69Miklos VajnaAM_CONDITIONAL(HAVE_KMOD, [test "$have_kmod" = "yes"])
be31376e6c9add0786f31a38eec2ecfdb73eb115Kay Sievers
f47cd184c0ff80e025428e9e385e61bda1ef3d69Miklos Vajna# ------------------------------------------------------------------------------
f47cd184c0ff80e025428e9e385e61bda1ef3d69Miklos Vajnahave_xkbcommon=no
f47cd184c0ff80e025428e9e385e61bda1ef3d69Miklos VajnaAC_ARG_ENABLE(xkbcommon, AS_HELP_STRING([--disable-xkbcommon], [disable xkbcommon keymap support]))
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sieversif test "x$enable_xkbcommon" != "xno"; then
4cd1eaa54507a65286413363216ad407fa7c6e50Miklos Vajna PKG_CHECK_MODULES(XKBCOMMON, [ xkbcommon >= 0.3.0 ],
4cd1eaa54507a65286413363216ad407fa7c6e50Miklos Vajna [AC_DEFINE(HAVE_XKBCOMMON, 1, [Define if libxkbcommon is available]) have_xkbcommon=yes], have_xkbcommon=no)
4cd1eaa54507a65286413363216ad407fa7c6e50Miklos Vajna if test "x$have_xkbcommon" = xno -a "x$enable_xkbcommon" = xyes; then
be31376e6c9add0786f31a38eec2ecfdb73eb115Kay Sievers AC_MSG_ERROR([*** xkbcommon support requested but libraries not found])
4cd1eaa54507a65286413363216ad407fa7c6e50Miklos Vajna fi
4cd1eaa54507a65286413363216ad407fa7c6e50Miklos Vajnafi
4cd1eaa54507a65286413363216ad407fa7c6e50Miklos VajnaAM_CONDITIONAL(HAVE_XKBCOMMON, [test "$have_xkbcommon" = "yes"])
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers
f5e04665ebf7124f3ea17dcf258793ed73a95fe1Lennart Poettering# ------------------------------------------------------------------------------
f5e04665ebf7124f3ea17dcf258793ed73a95fe1Lennart Poetteringhave_blkid=no
f5e04665ebf7124f3ea17dcf258793ed73a95fe1Lennart PoetteringAC_ARG_ENABLE(blkid, AS_HELP_STRING([--disable-blkid], [disable blkid support]))
be31376e6c9add0786f31a38eec2ecfdb73eb115Kay Sieversif test "x$enable_blkid" != "xno"; then
f5e04665ebf7124f3ea17dcf258793ed73a95fe1Lennart Poettering PKG_CHECK_MODULES(BLKID, [ blkid >= 2.24 ],
f5e04665ebf7124f3ea17dcf258793ed73a95fe1Lennart Poettering [AC_DEFINE(HAVE_BLKID, 1, [Define if blkid is available]) have_blkid=yes], have_blkid=no)
f5e04665ebf7124f3ea17dcf258793ed73a95fe1Lennart Poettering if test "x$have_blkid" = xno -a "x$enable_blkid" = xyes; then
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers AC_MSG_ERROR([*** blkid support requested but libraries not found])
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers fi
9a203affa6e1866f9b9b68501d10102d21c9d0daKay Sieversfi
9a203affa6e1866f9b9b68501d10102d21c9d0daKay SieversAM_CONDITIONAL(HAVE_BLKID, [test "$have_blkid" = "yes"])
9a203affa6e1866f9b9b68501d10102d21c9d0daKay Sievers
9a203affa6e1866f9b9b68501d10102d21c9d0daKay Sievers# ------------------------------------------------------------------------------
9a203affa6e1866f9b9b68501d10102d21c9d0daKay Sievershave_libmount=no
9a203affa6e1866f9b9b68501d10102d21c9d0daKay SieversPKG_CHECK_MODULES(MOUNT, [ mount >= 2.27 ],
9a203affa6e1866f9b9b68501d10102d21c9d0daKay Sievers [AC_DEFINE(HAVE_LIBMOUNT, 1, [Define if libmount is available]) have_libmount=yes], have_libmount=no)
9a203affa6e1866f9b9b68501d10102d21c9d0daKay Sieversif test "x$have_libmount" = xno; then
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers AC_MSG_ERROR([*** libmount support required but libraries not found])
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sieversfi
3e2147858f21943d5f4a781c60f33ac22c6096edKay SieversAM_CONDITIONAL(HAVE_LIBMOUNT, [test "$have_libmount" = "yes"])
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers# ------------------------------------------------------------------------------
9a203affa6e1866f9b9b68501d10102d21c9d0daKay Sievershave_seccomp=no
9a203affa6e1866f9b9b68501d10102d21c9d0daKay SieversAC_ARG_ENABLE(seccomp, AS_HELP_STRING([--disable-seccomp], [Disable optional SECCOMP support]))
9a203affa6e1866f9b9b68501d10102d21c9d0daKay Sieversif test "x$enable_seccomp" != "xno"; then
9a203affa6e1866f9b9b68501d10102d21c9d0daKay Sievers PKG_CHECK_MODULES(SECCOMP, [libseccomp >= 1.0.0],
9a203affa6e1866f9b9b68501d10102d21c9d0daKay Sievers [AC_DEFINE(HAVE_SECCOMP, 1, [Define if seccomp is available])
9a203affa6e1866f9b9b68501d10102d21c9d0daKay Sievers have_seccomp=yes
9a203affa6e1866f9b9b68501d10102d21c9d0daKay Sievers M4_DEFINES="$M4_DEFINES -DHAVE_SECCOMP"],
9a203affa6e1866f9b9b68501d10102d21c9d0daKay Sievers [have_seccomp=no])
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers if test "x$have_seccomp" = "xno" -a "x$enable_seccomp" = "xyes"; then
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers AC_MSG_ERROR([*** seccomp support requested but libraries not found])
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers fi
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sieversfi
3e2147858f21943d5f4a781c60f33ac22c6096edKay SieversAM_CONDITIONAL(HAVE_SECCOMP, [test "$have_seccomp" = "yes"])
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers# ------------------------------------------------------------------------------
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievershave_ima=yes
3e2147858f21943d5f4a781c60f33ac22c6096edKay SieversAC_ARG_ENABLE([ima], AS_HELP_STRING([--disable-ima],[Disable optional IMA support]),
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers [case "${enableval}" in
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers yes) have_ima=yes ;;
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers no) have_ima=no ;;
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers *) AC_MSG_ERROR(bad value ${enableval} for --disable-ima) ;;
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers esac],
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers [have_ima=yes])
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sieversif test "x${have_ima}" != xno ; then
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers AC_DEFINE(HAVE_IMA, 1, [Define if IMA is available])
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sieversfi
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers# ------------------------------------------------------------------------------
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievershave_selinux=no
3e2147858f21943d5f4a781c60f33ac22c6096edKay SieversAC_ARG_ENABLE(selinux, AS_HELP_STRING([--disable-selinux], [Disable optional SELINUX support]))
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sieversif test "x$enable_selinux" != "xno"; then
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.1.9],
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers [AC_DEFINE(HAVE_SELINUX, 1, [Define if SELinux is available])
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers have_selinux=yes
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers M4_DEFINES="$M4_DEFINES -DHAVE_SELINUX"],
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers [have_selinux=no])
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers if test "x$have_selinux" = xno -a "x$enable_selinux" = xyes; then
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers AC_MSG_ERROR([*** SELinux support requested but libraries not found])
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers fi
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sieversfi
3e2147858f21943d5f4a781c60f33ac22c6096edKay SieversAM_CONDITIONAL(HAVE_SELINUX, [test "$have_selinux" = "yes"])
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievershave_apparmor=no
3e2147858f21943d5f4a781c60f33ac22c6096edKay SieversAC_ARG_ENABLE(apparmor, AS_HELP_STRING([--disable-apparmor], [Disable optional AppArmor support]))
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sieversif test "x$enable_apparmor" != "xno"; then
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers PKG_CHECK_MODULES([APPARMOR], [libapparmor],
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers [AC_DEFINE(HAVE_APPARMOR, 1, [Define if AppArmor is available])
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers have_apparmor=yes
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers M4_DEFINES="$M4_DEFINES -DHAVE_APPARMOR"],
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers [have_apparmor=no])
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers if test "x$have_apparmor" = xno -a "x$enable_apparmor" = xyes; then
75db9a77605b33a1b9355eae957f26380441fce6Lennart Poettering AC_MSG_ERROR([*** AppArmor support requested but libraries not found])
4c2b0e4e423fe73fafef10a5efa6fb778784cebcLennart Poettering fi
75db9a77605b33a1b9355eae957f26380441fce6Lennart Poetteringfi
be31376e6c9add0786f31a38eec2ecfdb73eb115Kay SieversAM_CONDITIONAL(HAVE_APPARMOR, [test "$have_apparmor" = "yes"])
75db9a77605b33a1b9355eae957f26380441fce6Lennart Poettering
75db9a77605b33a1b9355eae957f26380441fce6Lennart Poettering
75db9a77605b33a1b9355eae957f26380441fce6Lennart PoetteringAC_ARG_WITH(debug-shell,
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers AS_HELP_STRING([--with-debug-shell=PATH],
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering [Path to debug shell binary]),
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering [SUSHELL="$withval"],[
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering AS_IF([test "x${have_selinux}" != "xno"], [SUSHELL="/sbin/sushell"] , [SUSHELL="/bin/sh"])])
8401e9f91d65c3d8d49cf0d2e35d03146354e957Auke Kok
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart PoetteringAC_SUBST(SUSHELL)
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart PoetteringAC_ARG_WITH([debug-tty],
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering AS_HELP_STRING([--with-debug-tty=PATH],
c87f7103fe38434f0b88df5c2b080c7b558feabfZbigniew Jędrzejewski-Szmek [Specify the tty device for debug shell]),
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering [DEBUGTTY="$withval"],
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering [DEBUGTTY=/dev/tty9])
3ce4fad8f548db9edb19869ea540e3192d2123f4Kay Sievers
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart PoetteringAC_SUBST(DEBUGTTY)
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart PoetteringAC_ARG_WITH([certificate-root],
7d568925bda9797f611e36d1d00cd941701cb3c8Lennart Poettering AS_HELP_STRING([--with-certificate-root=PATH],
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering [Specify the prefix for TLS certificates [/etc/ssl]]),
34eff652cedec3cac34b92629ead5f140334b689Lennart Poettering [CERTIFICATEROOT="$withval"],
34eff652cedec3cac34b92629ead5f140334b689Lennart Poettering [CERTIFICATEROOT="/etc/ssl"])
f1dd0c3f9b4a257e81ff9c6a08070c702a0db45aLennart Poettering
34eff652cedec3cac34b92629ead5f140334b689Lennart PoetteringAC_SUBST(CERTIFICATEROOT)
f975e971accc4d50c73ae53167db3df7a7099cf2Lennart Poettering
12e84679cc81cdf5f042540e54131a0ce37147adLennart Poettering# ------------------------------------------------------------------------------
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poetteringhave_xz=no
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart PoetteringAC_ARG_ENABLE(xz, AS_HELP_STRING([--disable-xz], [Disable optional XZ support]))
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart PoetteringAS_IF([test "x$enable_xz" != "xno"], [
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering PKG_CHECK_MODULES(XZ, [ liblzma ],
f975e971accc4d50c73ae53167db3df7a7099cf2Lennart Poettering [AC_DEFINE(HAVE_XZ, 1, [Define if XZ is available])
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering have_xz=yes],
3ce4fad8f548db9edb19869ea540e3192d2123f4Kay Sievers have_xz=no)
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering AS_IF([test "x$have_xz" = xno -a "x$enable_xz" = xyes],
634826b51b074b2e6d9314031bdd9abdcf862b54Pavol Rusnak [AC_MSG_ERROR([*** XZ support requested but libraries not found])])
f975e971accc4d50c73ae53167db3df7a7099cf2Lennart Poettering])
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart PoetteringAM_CONDITIONAL(HAVE_XZ, [test "$have_xz" = "yes"])
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering# ------------------------------------------------------------------------------
858dae181bb5461201ac1c04732d3ef4c67a0256Andrew Edmundshave_zlib=no
f975e971accc4d50c73ae53167db3df7a7099cf2Lennart PoetteringAC_ARG_ENABLE(zlib, AS_HELP_STRING([--disable-zlib], [Disable optional ZLIB support]))
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart PoetteringAS_IF([test "x$enable_zlib" != "xno"], [
858dae181bb5461201ac1c04732d3ef4c67a0256Andrew Edmunds PKG_CHECK_MODULES(ZLIB, [ zlib ],
858dae181bb5461201ac1c04732d3ef4c67a0256Andrew Edmunds [AC_DEFINE(HAVE_ZLIB, 1, [Define if ZLIB is available])
858dae181bb5461201ac1c04732d3ef4c67a0256Andrew Edmunds have_zlib=yes],
f975e971accc4d50c73ae53167db3df7a7099cf2Lennart Poettering have_zlib=no)
858dae181bb5461201ac1c04732d3ef4c67a0256Andrew Edmunds AS_IF([test "x$have_zlib" = xno -a "x$enable_zlib" = xyes],
d7c114c00030309435fc56c77c8578a25d228ebeDave Reisner [AC_MSG_ERROR([*** ZLIB support requested but libraries not found])])
4bf43a32a96465d2f9c244adea3e661075f208bfTom Gundersen])
4bf43a32a96465d2f9c244adea3e661075f208bfTom GundersenAM_CONDITIONAL(HAVE_ZLIB, [test "$have_zlib" = "yes"])
d7c114c00030309435fc56c77c8578a25d228ebeDave Reisner
f975e971accc4d50c73ae53167db3df7a7099cf2Lennart Poettering# ------------------------------------------------------------------------------
d7c114c00030309435fc56c77c8578a25d228ebeDave Reisnerhave_bzip2=no
f2b4af1cd4112df6ce56f8fc1e677639935e3d0eFabian HenzeAC_ARG_ENABLE(bzip2, AS_HELP_STRING([--enable-bzip2], [Disable optional BZIP2 support]))
07459bb6b92268beb2599f65cf195708d88c51ccFabiano FidêncioAS_IF([test "x$enable_bzip2" != "xno"], [
07459bb6b92268beb2599f65cf195708d88c51ccFabiano Fidêncio AC_CHECK_HEADERS(bzlib.h,
f2b4af1cd4112df6ce56f8fc1e677639935e3d0eFabian Henze [AC_DEFINE(HAVE_BZIP2, 1, [Define if BZIP2 is available])
f975e971accc4d50c73ae53167db3df7a7099cf2Lennart Poettering have_bzip2=yes],
f2b4af1cd4112df6ce56f8fc1e677639935e3d0eFabian Henze [AS_IF([test "x$enable_bzip2" = xyes],
65c8976ab12f13fc339a16d108e620bf2fd703f4Malcolm Studd [AC_MSG_ERROR([*** BZIP2 support requested but headers not found])])]
65c8976ab12f13fc339a16d108e620bf2fd703f4Malcolm Studd )
65c8976ab12f13fc339a16d108e620bf2fd703f4Malcolm Studd])
f975e971accc4d50c73ae53167db3df7a7099cf2Lennart PoetteringAM_CONDITIONAL(HAVE_BZIP2, [test "$have_bzip2" = "yes"])
65c8976ab12f13fc339a16d108e620bf2fd703f4Malcolm Studd
f5c88ec1330b61787441156de7d764a140774bd2Miklos Vajna# ------------------------------------------------------------------------------
f5c88ec1330b61787441156de7d764a140774bd2Miklos Vajnahave_lz4=no
f5c88ec1330b61787441156de7d764a140774bd2Miklos VajnaAC_ARG_ENABLE(lz4, AS_HELP_STRING([--disable-lz4], [Disable optional LZ4 support]))
f975e971accc4d50c73ae53167db3df7a7099cf2Lennart PoetteringAS_IF([test "x$enable_lz4" != "xno"], [
f5c88ec1330b61787441156de7d764a140774bd2Miklos Vajna PKG_CHECK_MODULES(LZ4, [ liblz4 >= 125 ],
a338bab5d0603a179befce062bc6fc8a6521a232Alexey Shabalin [AC_DEFINE(HAVE_LZ4, 1, [Define in LZ4 is available])
a338bab5d0603a179befce062bc6fc8a6521a232Alexey Shabalin have_lz4=yes],
a338bab5d0603a179befce062bc6fc8a6521a232Alexey Shabalin have_lz4=no)
f975e971accc4d50c73ae53167db3df7a7099cf2Lennart Poettering AS_IF([test "x$have_lz4" = xno -a "x$enable_lz4" = xyes],
a338bab5d0603a179befce062bc6fc8a6521a232Alexey Shabalin [AC_MSG_ERROR([*** LZ4 support requested but libraries not found])])
1de4d79bf554946f486adf56ed765c5335816f15Andrey Borzenkov])
1de4d79bf554946f486adf56ed765c5335816f15Andrey BorzenkovAM_CONDITIONAL(HAVE_LZ4, [test "$have_lz4" = "yes"])
1de4d79bf554946f486adf56ed765c5335816f15Andrey Borzenkov
f975e971accc4d50c73ae53167db3df7a7099cf2Lennart PoetteringAM_CONDITIONAL(HAVE_COMPRESSION, [test "$have_xz" = "yes" -o "$have_lz4" = "yes"])
1de4d79bf554946f486adf56ed765c5335816f15Andrey Borzenkov
1bd8b8184ee3bc7fc023d6d6dfb2ca99fb6612f3Koen Kooi# ------------------------------------------------------------------------------
1bd8b8184ee3bc7fc023d6d6dfb2ca99fb6612f3Koen KooiAC_ARG_ENABLE([pam],
1bd8b8184ee3bc7fc023d6d6dfb2ca99fb6612f3Koen Kooi AS_HELP_STRING([--disable-pam],[Disable optional PAM support]),
f975e971accc4d50c73ae53167db3df7a7099cf2Lennart Poettering [case "${enableval}" in
1bd8b8184ee3bc7fc023d6d6dfb2ca99fb6612f3Koen Kooi yes) have_pam=yes ;;
6fdae8a6a40d6a3b5f77516abaee23b3eab002f6Dexter Morgan no) have_pam=no ;;
6fdae8a6a40d6a3b5f77516abaee23b3eab002f6Dexter Morgan *) AC_MSG_ERROR(bad value ${enableval} for --disable-pam) ;;
6fdae8a6a40d6a3b5f77516abaee23b3eab002f6Dexter Morgan esac],
fbf5b12653e29674b1e85c73d446b13ac3a15b38Colin Guthrie [have_pam=auto])
6fdae8a6a40d6a3b5f77516abaee23b3eab002f6Dexter Morgan
bf024b022d9f53d2bb8d26107b4878cede3167b7Tollef Fog Heenif test "x${have_pam}" != xno ; then
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering AC_CHECK_HEADERS(
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering [security/pam_modules.h security/pam_modutil.h security/pam_ext.h],
bf024b022d9f53d2bb8d26107b4878cede3167b7Tollef Fog Heen [have_pam=yes],
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering [if test "x$have_pam" = xyes ; then
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering AC_MSG_ERROR([*** PAM headers not found.])
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering fi])
136337ff74f05be3d42a769d9f0cb99716c5c40fTollef Fog Heen
be31376e6c9add0786f31a38eec2ecfdb73eb115Kay Sievers AC_CHECK_LIB(
be31376e6c9add0786f31a38eec2ecfdb73eb115Kay Sievers [pam],
be31376e6c9add0786f31a38eec2ecfdb73eb115Kay Sievers [pam_syslog],
be31376e6c9add0786f31a38eec2ecfdb73eb115Kay Sievers [have_pam=yes],
136337ff74f05be3d42a769d9f0cb99716c5c40fTollef Fog Heen [if test "x$have_pam" = xyes ; then
136337ff74f05be3d42a769d9f0cb99716c5c40fTollef Fog Heen AC_MSG_ERROR([*** libpam not found.])
136337ff74f05be3d42a769d9f0cb99716c5c40fTollef Fog Heen fi])
136337ff74f05be3d42a769d9f0cb99716c5c40fTollef Fog Heen
136337ff74f05be3d42a769d9f0cb99716c5c40fTollef Fog Heen if test "x$have_pam" = xyes ; then
136337ff74f05be3d42a769d9f0cb99716c5c40fTollef Fog Heen PAM_LIBS="-lpam -lpam_misc"
136337ff74f05be3d42a769d9f0cb99716c5c40fTollef Fog Heen AC_DEFINE(HAVE_PAM, 1, [PAM available])
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering M4_DEFINES="$M4_DEFINES -DHAVE_PAM"
d64b723a9e275ee4c6ccb947e3fd6ed6b3e4c359Lennart Poettering else
f975e971accc4d50c73ae53167db3df7a7099cf2Lennart Poettering have_pam=no
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering fi
07459bb6b92268beb2599f65cf195708d88c51ccFabiano Fidêncioelse
07459bb6b92268beb2599f65cf195708d88c51ccFabiano Fidêncio PAM_LIBS=
07459bb6b92268beb2599f65cf195708d88c51ccFabiano Fidênciofi
f975e971accc4d50c73ae53167db3df7a7099cf2Lennart PoetteringAC_SUBST(PAM_LIBS)
07459bb6b92268beb2599f65cf195708d88c51ccFabiano FidêncioAM_CONDITIONAL([HAVE_PAM], [test "x$have_pam" != xno])
07459bb6b92268beb2599f65cf195708d88c51ccFabiano Fidêncio
07459bb6b92268beb2599f65cf195708d88c51ccFabiano Fidêncio# ------------------------------------------------------------------------------
07459bb6b92268beb2599f65cf195708d88c51ccFabiano FidêncioAC_ARG_ENABLE([acl],
07459bb6b92268beb2599f65cf195708d88c51ccFabiano Fidêncio AS_HELP_STRING([--disable-acl],[Disable optional ACL support]),
07459bb6b92268beb2599f65cf195708d88c51ccFabiano Fidêncio [case "${enableval}" in
bef2733fae665e880da6ea011b1f918e6900bb42Lennart Poettering yes) have_acl=yes ;;
a05ea46dc788929bc8b13afb4208ca29cad68572Michael Biebl no) have_acl=no ;;
bef2733fae665e880da6ea011b1f918e6900bb42Lennart Poettering *) AC_MSG_ERROR(bad value ${enableval} for --disable-acl) ;;
bef2733fae665e880da6ea011b1f918e6900bb42Lennart Poettering esac],
bef2733fae665e880da6ea011b1f918e6900bb42Lennart Poettering [have_acl=auto])
bef2733fae665e880da6ea011b1f918e6900bb42Lennart Poettering
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poetteringif test "x${have_acl}" != xno ; then
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering AC_CHECK_HEADERS(
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering [sys/acl.h acl/libacl.h],
858dae181bb5461201ac1c04732d3ef4c67a0256Andrew Edmunds [have_acl=yes],
858dae181bb5461201ac1c04732d3ef4c67a0256Andrew Edmunds [if test "x$have_acl" = xyes ; then
d7c114c00030309435fc56c77c8578a25d228ebeDave Reisner AC_MSG_ERROR([*** ACL headers not found.])
f2b4af1cd4112df6ce56f8fc1e677639935e3d0eFabian Henze fi])
65c8976ab12f13fc339a16d108e620bf2fd703f4Malcolm Studd
f5c88ec1330b61787441156de7d764a140774bd2Miklos Vajna AC_CHECK_LIB(
a338bab5d0603a179befce062bc6fc8a6521a232Alexey Shabalin [acl],
1de4d79bf554946f486adf56ed765c5335816f15Andrey Borzenkov [acl_get_file],
1bd8b8184ee3bc7fc023d6d6dfb2ca99fb6612f3Koen Kooi [have_acl=yes],
6fdae8a6a40d6a3b5f77516abaee23b3eab002f6Dexter Morgan [if test "x$have_acl" = xyes ; then
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering AC_MSG_ERROR([*** libacl not found.])
cca4aeeead1985f503d175eb1fcad9ed66f2e25dLennart Poettering fi])
cd3f8b7ddb052ab5e4eab420968bae689db3899aJeff Mahoney
d2d12cd1bfd90f3a13273d82331a7cbd36a93231Lennart Poettering if test "x$have_acl" = xyes ; then
d2d12cd1bfd90f3a13273d82331a7cbd36a93231Lennart Poettering ACL_LIBS="-lacl"
d2d12cd1bfd90f3a13273d82331a7cbd36a93231Lennart Poettering AC_DEFINE(HAVE_ACL, 1, [ACL available])
d2d12cd1bfd90f3a13273d82331a7cbd36a93231Lennart Poettering M4_DEFINES="$M4_DEFINES -DHAVE_ACL"
d122948d6fbaac4505cf14a08f1237daa89efdd0Lennart Poettering else
d2d12cd1bfd90f3a13273d82331a7cbd36a93231Lennart Poettering have_acl=no
d2d12cd1bfd90f3a13273d82331a7cbd36a93231Lennart Poettering fi
d2d12cd1bfd90f3a13273d82331a7cbd36a93231Lennart Poetteringelse
d2d12cd1bfd90f3a13273d82331a7cbd36a93231Lennart Poettering ACL_LIBS=
d122948d6fbaac4505cf14a08f1237daa89efdd0Lennart Poetteringfi
d2d12cd1bfd90f3a13273d82331a7cbd36a93231Lennart PoetteringAC_SUBST(ACL_LIBS)
d2d12cd1bfd90f3a13273d82331a7cbd36a93231Lennart PoetteringAM_CONDITIONAL([HAVE_ACL], [test "x$have_acl" != xno])
d2d12cd1bfd90f3a13273d82331a7cbd36a93231Lennart Poettering
d2d12cd1bfd90f3a13273d82331a7cbd36a93231Lennart Poettering# ------------------------------------------------------------------------------
d122948d6fbaac4505cf14a08f1237daa89efdd0Lennart PoetteringAC_ARG_ENABLE([smack], AS_HELP_STRING([--disable-smack],[Disable optional SMACK support]),
d2d12cd1bfd90f3a13273d82331a7cbd36a93231Lennart Poettering [case "${enableval}" in
d2d12cd1bfd90f3a13273d82331a7cbd36a93231Lennart Poettering yes) have_smack=yes ;;
d2d12cd1bfd90f3a13273d82331a7cbd36a93231Lennart Poettering no) have_smack=no ;;
d2d12cd1bfd90f3a13273d82331a7cbd36a93231Lennart Poettering *) AC_MSG_ERROR(bad value ${enableval} for --disable-smack) ;;
d122948d6fbaac4505cf14a08f1237daa89efdd0Lennart Poettering esac],
b8079ae19b41c9b61850c796dddc601b826850e0Kay Sievers [have_smack=auto])
b8079ae19b41c9b61850c796dddc601b826850e0Kay Sievers
39ad55a9aa99451f982628af6e14581092b2d2f6Kay Sieversif test "x${have_smack}" != xno; then
d2d12cd1bfd90f3a13273d82331a7cbd36a93231Lennart Poettering AC_DEFINE(HAVE_SMACK, 1, [Define if SMACK is available])
ae446765eb0605d2451bb4dd7c336672bcc7ab0cKay Sievers M4_DEFINES="$M4_DEFINES -DHAVE_SMACK"
ae446765eb0605d2451bb4dd7c336672bcc7ab0cKay Sievers have_smack=yes
ae446765eb0605d2451bb4dd7c336672bcc7ab0cKay Sieversfi
ae446765eb0605d2451bb4dd7c336672bcc7ab0cKay Sievers
ae446765eb0605d2451bb4dd7c336672bcc7ab0cKay SieversAM_CONDITIONAL([HAVE_SMACK], [test "x$have_smack" = "xyes"])
9d3203b4765e64300ab8e8d6d3d1b9ed0c514d5eKay Sievers
b0cca7d886583a10b9342796b4619eca4d582cb2Michael Bieblhave_smack_run_label=no
9d3203b4765e64300ab8e8d6d3d1b9ed0c514d5eKay SieversAC_ARG_WITH(smack-run-label,
9d3203b4765e64300ab8e8d6d3d1b9ed0c514d5eKay SieversAS_HELP_STRING([--with-smack-run-label=STRING],
9d3203b4765e64300ab8e8d6d3d1b9ed0c514d5eKay Sievers [run systemd --system itself with a specific SMACK label]),
bc9bdbbab45ea2c10fdd8ad7c517b5e4a358bdfbMichał Górny [AC_DEFINE_UNQUOTED(SMACK_RUN_LABEL, ["$withval"], [Run systemd itself with SMACK label]) have_smack_run_label=yes],
bc9bdbbab45ea2c10fdd8ad7c517b5e4a358bdfbMichał Górny [])
bc9bdbbab45ea2c10fdd8ad7c517b5e4a358bdfbMichał Górny
bc9bdbbab45ea2c10fdd8ad7c517b5e4a358bdfbMichał Górnyif test "x${have_smack_run_label}" = xyes; then
bc9bdbbab45ea2c10fdd8ad7c517b5e4a358bdfbMichał Górny M4_DEFINES="$M4_DEFINES -DHAVE_SMACK_RUN_LABEL"
bc9bdbbab45ea2c10fdd8ad7c517b5e4a358bdfbMichał Górnyfi
bc9bdbbab45ea2c10fdd8ad7c517b5e4a358bdfbMichał Górny
bc9bdbbab45ea2c10fdd8ad7c517b5e4a358bdfbMichał GórnyAC_ARG_WITH(smack-default-process-label,
bc9bdbbab45ea2c10fdd8ad7c517b5e4a358bdfbMichał GórnyAS_HELP_STRING([--with-smack-default-process-label=STRING],
bc9bdbbab45ea2c10fdd8ad7c517b5e4a358bdfbMichał Górny [default SMACK label for executed processes]),
2c6db6fb9b1a10184b086df0d23228c4c0205a49Lennart Poettering [AC_DEFINE_UNQUOTED(SMACK_DEFAULT_PROCESS_LABEL, ["$withval"], [Default SMACK label for executed processes])],
bc9bdbbab45ea2c10fdd8ad7c517b5e4a358bdfbMichał Górny [])
2c6db6fb9b1a10184b086df0d23228c4c0205a49Lennart Poettering
d2d12cd1bfd90f3a13273d82331a7cbd36a93231Lennart Poettering# ------------------------------------------------------------------------------
d2d12cd1bfd90f3a13273d82331a7cbd36a93231Lennart PoetteringAC_ARG_ENABLE([gcrypt],
d2d12cd1bfd90f3a13273d82331a7cbd36a93231Lennart Poettering AS_HELP_STRING([--disable-gcrypt],[Disable optional GCRYPT support]),
d2d12cd1bfd90f3a13273d82331a7cbd36a93231Lennart Poettering [case "${enableval}" in
8c6db8336536916d0476ff8233e0abf40a2f6aabLennart Poettering yes) have_gcrypt=yes ;;
b8079ae19b41c9b61850c796dddc601b826850e0Kay Sievers no) have_gcrypt=no ;;
ae446765eb0605d2451bb4dd7c336672bcc7ab0cKay Sievers *) AC_MSG_ERROR(bad value ${enableval} for --disable-gcrypt) ;;
8c4a3079a7f358c179430d1aec59de8b670b5f6eLennart Poettering esac],
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers [have_gcrypt=auto])
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers
bb061708d5aa83579f213bdfb67253f7027217c3Kay Sieversif test "x${have_gcrypt}" != xno ; then
bb061708d5aa83579f213bdfb67253f7027217c3Kay Sievers m4_define([AM_PATH_LIBGCRYPT_FAIL],
bb061708d5aa83579f213bdfb67253f7027217c3Kay Sievers [{ test "x$have_gcrypt" != xyes || AC_MSG_ERROR([*** GCRYPT/GPG-ERROR headers not found.]); }]
bb061708d5aa83579f213bdfb67253f7027217c3Kay Sievers )
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers m4_ifdef([AM_PATH_LIBGCRYPT], [AM_PATH_LIBGCRYPT(
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers [1.4.5],
a45a909fbbe11ad8c75cda5639d875476ac65453Christian Ruppert [have_gcrypt=yes],
ae446765eb0605d2451bb4dd7c336672bcc7ab0cKay Sievers dnl If we have the gcrypt m4 macros, but don't have
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering dnl gcrypt, throw an error if gcrypt is explicitly
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering dnl requested.
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering [AM_PATH_LIBGCRYPT_FAIL]
07459bb6b92268beb2599f65cf195708d88c51ccFabiano Fidêncio )],
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering dnl If we don't have the gcrypt m4 macros, but build with
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering dnl gcrypt explicitly requested, throw an error.
7f4e08056de0184b205a20632e62db73d299937eLennart Poettering [AM_PATH_LIBGCRYPT_FAIL]
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poettering )
5b6319dceedd81f3f1ce7eb70ea5defaef43bcecLennart Poettering
1271623839b5bb4f0f383a8ad5500462dda0a94aLennart Poettering have_gpg_error=no
816115863962548a9a0d9fbfe429c7f8e685beacRoberto Sassu m4_ifdef([AM_PATH_GPG_ERROR], [AM_PATH_GPG_ERROR(
1271623839b5bb4f0f383a8ad5500462dda0a94aLennart Poettering [1.12],
807e17f05e217b474af39503efb9503d81b12596Lennart Poettering [have_gpg_error=yes],
5eda94dda25bccda928c4b33c790dbe748573a22Lennart Poettering [AM_PATH_LIBGCRYPT_FAIL]
27669061f40766457db93d5cc3dfe00dce240806Miklos Vajna )],
e5e83e8362e946890ac991fc86a2c5869f9befdfLennart Poettering [AM_PATH_LIBGCRYPT_FAIL]
e5e83e8362e946890ac991fc86a2c5869f9befdfLennart Poettering )
4de856120f252e7aa19c923c10fbf23310d623aaLennart Poettering
4de856120f252e7aa19c923c10fbf23310d623aaLennart Poettering if test "x$have_gcrypt" = xyes -a "x$have_gpg_error" = xyes ; then
2a018e83ded29c9719b2478a65ee6245c829c0f5Kay Sievers GCRYPT_LIBS="$LIBGCRYPT_LIBS $GPG_ERROR_LIBS"
b2e9fb99ab288e8817302851743ed1a3cddd384bMiklos Vajna GCRYPT_CFLAGS="$LIBGCRYPT_CFLAGS $GPG_ERROR_CFLAGS"
f47cd184c0ff80e025428e9e385e61bda1ef3d69Miklos Vajna AC_DEFINE(HAVE_GCRYPT, 1, [GCRYPT available])
4cd1eaa54507a65286413363216ad407fa7c6e50Miklos Vajna else
f5e04665ebf7124f3ea17dcf258793ed73a95fe1Lennart Poettering have_gcrypt=no
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers have_gpg_error=no
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers fi
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sieverselse
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers GCRYPT_LIBS=
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers GCRYPT_CFLAGS=
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sieversfi
3e2147858f21943d5f4a781c60f33ac22c6096edKay SieversAC_SUBST(GCRYPT_LIBS)
8c4a3079a7f358c179430d1aec59de8b670b5f6eLennart PoetteringAC_SUBST(GCRYPT_CFLAGS)
b8079ae19b41c9b61850c796dddc601b826850e0Kay SieversAM_CONDITIONAL([HAVE_GCRYPT], [test "x$have_gcrypt" != xno])
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers# ------------------------------------------------------------------------------
3e2147858f21943d5f4a781c60f33ac22c6096edKay SieversAC_ARG_ENABLE([audit],
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers AS_HELP_STRING([--disable-audit],[Disable optional AUDIT support]),
ae446765eb0605d2451bb4dd7c336672bcc7ab0cKay Sievers [case "${enableval}" in
ae446765eb0605d2451bb4dd7c336672bcc7ab0cKay Sievers yes) have_audit=yes ;;
2c6db6fb9b1a10184b086df0d23228c4c0205a49Lennart Poettering no) have_audit=no ;;
2c6db6fb9b1a10184b086df0d23228c4c0205a49Lennart Poettering *) AC_MSG_ERROR(bad value ${enableval} for --disable-audit) ;;
2c6db6fb9b1a10184b086df0d23228c4c0205a49Lennart Poettering esac],
2c6db6fb9b1a10184b086df0d23228c4c0205a49Lennart Poettering [have_audit=auto])
2c6db6fb9b1a10184b086df0d23228c4c0205a49Lennart Poettering
bc9bdbbab45ea2c10fdd8ad7c517b5e4a358bdfbMichał Górnyif test "x${have_audit}" != xno ; then
5ee9f21e86bb6a06d3eb956546f85338e81395e6Lennart Poettering AC_CHECK_HEADERS(
66be6554807773028a0111addb8e75c3cab11117Kay Sievers [libaudit.h],
5a45a93627609451784a04366cfa1150d32611d1Lennart Poettering [have_audit=yes],
5a45a93627609451784a04366cfa1150d32611d1Lennart Poettering [if test "x$have_audit" = xyes ; then
5a45a93627609451784a04366cfa1150d32611d1Lennart Poettering AC_MSG_ERROR([*** AUDIT headers not found.])
ae446765eb0605d2451bb4dd7c336672bcc7ab0cKay Sievers fi])
AC_CHECK_LIB(
[audit],
[audit_open],
[have_audit=yes],
[if test "x$have_audit" = xyes ; then
AC_MSG_ERROR([*** libaudit not found.])
fi])
if test "x$have_audit" = xyes ; then
AUDIT_LIBS="-laudit"
AC_DEFINE(HAVE_AUDIT, 1, [AUDIT available])
else
have_audit=no
fi
else
AUDIT_LIBS=
fi
AC_SUBST(AUDIT_LIBS)
AM_CONDITIONAL([HAVE_AUDIT], [test "x$have_audit" != xno])
# ------------------------------------------------------------------------------
AC_ARG_ENABLE([elfutils],
AS_HELP_STRING([--disable-elfutils],[Disable optional ELFUTILS support]),
[case "${enableval}" in
yes) have_elfutils=yes ;;
no) have_elfutils=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-elfutils) ;;
esac],
[have_elfutils=auto])
if test "x${have_elfutils}" != xno ; then
AC_CHECK_HEADERS(
[elfutils/libdwfl.h],
[],
[if test "x$have_elfutils" = xyes ; then
AC_MSG_ERROR([*** ELFUTILS headers not found.])
fi])
AC_CHECK_LIB(
[dw],
[dwfl_core_file_attach],
[have_elfutils=yes],
[if test "x$have_elfutils" = xyes ; then
AC_MSG_ERROR([*** ELFUTILS >= 158 is required.])
fi])
if test "x$have_elfutils" = xyes ; then
ELFUTILS_LIBS="-lelf -ldw"
AC_DEFINE(HAVE_ELFUTILS, 1, [ELFUTILS available])
else
have_elfutils=no
fi
else
ELFUTILS_LIBS=
fi
AC_SUBST(ELFUTILS_LIBS)
AM_CONDITIONAL(HAVE_ELFUTILS, [test "$have_elfutils" = "yes"])
# ------------------------------------------------------------------------------
have_libcryptsetup=no
AC_ARG_ENABLE(libcryptsetup, AS_HELP_STRING([--disable-libcryptsetup], [disable libcryptsetup tools]))
if test "x$enable_libcryptsetup" != "xno"; then
PKG_CHECK_MODULES(LIBCRYPTSETUP, [ libcryptsetup >= 1.6.0 ],
[AC_DEFINE(HAVE_LIBCRYPTSETUP, 1, [Define if libcryptsetup is available]) have_libcryptsetup=yes], have_libcryptsetup=no)
if test "x$have_libcryptsetup" = xno -a "x$enable_libcryptsetup" = xyes; then
AC_MSG_ERROR([*** libcryptsetup support requested but libraries not found])
fi
fi
AM_CONDITIONAL(HAVE_LIBCRYPTSETUP, [test "$have_libcryptsetup" = "yes"])
# ------------------------------------------------------------------------------
have_qrencode=no
AC_ARG_ENABLE(qrencode, AS_HELP_STRING([--disable-qrencode], [disable qrencode support]))
if test "x$enable_qrencode" != "xno"; then
PKG_CHECK_MODULES(QRENCODE, [ libqrencode ],
[AC_DEFINE(HAVE_QRENCODE, 1, [Define if qrencode is available]) have_qrencode=yes], have_qrencode=no)
if test "x$have_qrencode" = xno -a "x$enable_qrencode" = xyes; then
AC_MSG_ERROR([*** qrencode support requested but libraries not found])
fi
fi
AM_CONDITIONAL(HAVE_QRENCODE, [test "$have_qrencode" = "yes"])
# ------------------------------------------------------------------------------
have_gnutls=no
AC_ARG_ENABLE(gnutls, AS_HELP_STRING([--disable-gnutls], [disable gnutls support]))
if test "x$enable_gnutls" != "xno"; then
PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.1.4],
[AC_DEFINE(HAVE_GNUTLS, 1, [Define if gnutls is available]) have_gnutls=yes], have_gnutls=no)
if test "x$have_gnutls" = xno -a "x$enable_gnutls" = xyes; then
AC_MSG_ERROR([*** gnutls support requested but libraries not found])
fi
fi
AM_CONDITIONAL(HAVE_GNUTLS, [test "$have_gnutls" = "yes"])
# ------------------------------------------------------------------------------
have_microhttpd=no
AC_ARG_ENABLE(microhttpd, AS_HELP_STRING([--disable-microhttpd], [disable microhttpd support]))
if test "x$enable_microhttpd" != "xno"; then
PKG_CHECK_MODULES(MICROHTTPD, [libmicrohttpd >= 0.9.33],
[AC_DEFINE(HAVE_MICROHTTPD, 1, [Define if microhttpd is available])
have_microhttpd=yes
M4_DEFINES="$M4_DEFINES -DHAVE_MICROHTTPD"],
[have_microhttpd=no])
if test "x$have_microhttpd" = xno -a "x$enable_microhttpd" = xyes; then
AC_MSG_ERROR([*** microhttpd support requested but libraries not found])
fi
fi
AM_CONDITIONAL(HAVE_MICROHTTPD, [test "$have_microhttpd" = "yes"])
# ------------------------------------------------------------------------------
have_libcurl=no
AC_ARG_ENABLE(libcurl, AS_HELP_STRING([--disable-libcurl], [disable libcurl support]))
if test "x$enable_libcurl" != "xno"; then
PKG_CHECK_MODULES(LIBCURL, [libcurl],
[AC_DEFINE(HAVE_LIBCURL, 1, [Define if libcurl is available])
have_libcurl=yes
M4_DEFINES="$M4_DEFINES -DHAVE_LIBCURL"],
[have_libcurl=no])
if test "x$have_libcurl" = xno -a "x$enable_libcurl" = xyes; then
AC_MSG_ERROR([*** libcurl support requested but libraries not found])
fi
fi
AM_CONDITIONAL(HAVE_LIBCURL, [test "$have_libcurl" = "yes"])
# ------------------------------------------------------------------------------
AM_CONDITIONAL(HAVE_REMOTE, [test "$have_microhttpd" = "yes" -o "$have_libcurl" = "yes"])
# ------------------------------------------------------------------------------
have_libidn=no
AC_ARG_ENABLE(libidn, AS_HELP_STRING([--disable-libidn], [Disable optional LIBIDN support]))
if test "x$enable_libidn" != "xno"; then
PKG_CHECK_MODULES(LIBIDN, [libidn],
[AC_DEFINE(HAVE_LIBIDN, 1, [Define if libidn is available])
have_libidn=yes
M4_DEFINES="$M4_DEFINES -DHAVE_LIBIDN"],
[have_libidn=no])
if test "x$have_libidn" = "xno" -a "x$enable_libidn" = "xyes"; then
AC_MSG_ERROR([*** libidn support requested but libraries not found])
fi
fi
AM_CONDITIONAL(HAVE_LIBIDN, [test "$have_libidn" = "yes"])
# ------------------------------------------------------------------------------
have_libiptc=no
AC_ARG_ENABLE(libiptc, AS_HELP_STRING([--disable-libiptc], [Disable optional LIBIPTC support]))
if test "x$enable_libiptc" != "xno"; then
PKG_CHECK_MODULES(LIBIPTC, [libiptc],
[AC_DEFINE(HAVE_LIBIPTC, 1, [Define if libiptc is available])
have_libiptc=yes
M4_DEFINES="$M4_DEFINES -DHAVE_LIBIPTC"],
[have_libiptc=no])
if test "x$have_libiptc" = "xno" -a "x$enable_libiptc" = "xyes"; then
AC_MSG_ERROR([*** libiptc support requested but libraries not found])
fi
fi
AM_CONDITIONAL(HAVE_LIBIPTC, [test "$have_libiptc" = "yes"])
# ------------------------------------------------------------------------------
have_binfmt=no
AC_ARG_ENABLE(binfmt, AS_HELP_STRING([--disable-binfmt], [disable binfmt tool]))
if test "x$enable_binfmt" != "xno"; then
have_binfmt=yes
fi
AM_CONDITIONAL(ENABLE_BINFMT, [test "$have_binfmt" = "yes"])
# ------------------------------------------------------------------------------
have_vconsole=no
AC_ARG_ENABLE(vconsole, AS_HELP_STRING([--disable-vconsole], [disable vconsole tool]))
if test "x$enable_vconsole" != "xno"; then
have_vconsole=yes
fi
AM_CONDITIONAL(ENABLE_VCONSOLE, [test "$have_vconsole" = "yes"])
# ------------------------------------------------------------------------------
have_bootchart=no
AC_ARG_ENABLE(bootchart, AS_HELP_STRING([--disable-bootchart], [disable bootchart tool]))
if test "x$enable_bootchart" != "xno"; then
have_bootchart=yes
fi
AM_CONDITIONAL(ENABLE_BOOTCHART, [test "$have_bootchart" = "yes"])
# ------------------------------------------------------------------------------
have_quotacheck=no
AC_ARG_ENABLE(quotacheck, AS_HELP_STRING([--disable-quotacheck], [disable quotacheck tools]))
if test "x$enable_quotacheck" != "xno"; then
have_quotacheck=yes
fi
AM_CONDITIONAL(ENABLE_QUOTACHECK, [test "$have_quotacheck" = "yes"])
# ------------------------------------------------------------------------------
have_tmpfiles=no
AC_ARG_ENABLE(tmpfiles, AS_HELP_STRING([--disable-tmpfiles], [disable tmpfiles support]))
if test "x$enable_tmpfiles" != "xno"; then
have_tmpfiles=yes
fi
AM_CONDITIONAL(ENABLE_TMPFILES, [test "$have_tmpfiles" = "yes"])
# ------------------------------------------------------------------------------
have_sysusers=no
AC_ARG_ENABLE(sysusers, AS_HELP_STRING([--disable-sysusers], [disable sysusers support]))
if test "x$enable_sysusers" != "xno"; then
have_sysusers=yes
fi
AM_CONDITIONAL(ENABLE_SYSUSERS, [test "$have_sysusers" = "yes"])
# ------------------------------------------------------------------------------
have_firstboot=no
AC_ARG_ENABLE(firstboot, AS_HELP_STRING([--disable-firstboot], [disable firstboot support]))
if test "x$enable_firstboot" != "xno"; then
have_firstboot=yes
fi
AM_CONDITIONAL(ENABLE_FIRSTBOOT, [test "$have_firstboot" = "yes"])
# ------------------------------------------------------------------------------
have_randomseed=no
AC_ARG_ENABLE(randomseed, AS_HELP_STRING([--disable-randomseed], [disable randomseed tools]))
if test "x$enable_randomseed" != "xno"; then
have_randomseed=yes
fi
AM_CONDITIONAL(ENABLE_RANDOMSEED, [test "$have_randomseed" = "yes"])
# ------------------------------------------------------------------------------
have_backlight=no
AC_ARG_ENABLE(backlight, AS_HELP_STRING([--disable-backlight], [disable backlight tools]))
if test "x$enable_backlight" != "xno"; then
have_backlight=yes
fi
AM_CONDITIONAL(ENABLE_BACKLIGHT, [test "$have_backlight" = "yes"])
# ------------------------------------------------------------------------------
have_rfkill=no
AC_ARG_ENABLE(rfkill, AS_HELP_STRING([--disable-rfkill], [disable rfkill tools]))
if test "x$enable_rfkill" != "xno"; then
have_rfkill=yes
fi
AM_CONDITIONAL(ENABLE_RFKILL, [test "$have_rfkill" = "yes"])
# ------------------------------------------------------------------------------
have_logind=no
AC_ARG_ENABLE(logind, AS_HELP_STRING([--disable-logind], [disable login daemon]))
if test "x$enable_logind" != "xno"; then
have_logind=yes
fi
AM_CONDITIONAL(ENABLE_LOGIND, [test "$have_logind" = "yes"])
AS_IF([test "$have_logind" = "yes"], [ AC_DEFINE(HAVE_LOGIND, [1], [Logind support available]) ])
# ------------------------------------------------------------------------------
have_machined=no
AC_ARG_ENABLE(machined, AS_HELP_STRING([--disable-machined], [disable machine daemon]))
if test "x$enable_machined" != "xno"; then
have_machined=yes
fi
AM_CONDITIONAL(ENABLE_MACHINED, [test "$have_machined" = "yes"])
AS_IF([test "$have_machined" = "yes"], [ AC_DEFINE(HAVE_MACHINED, [1], [Machined support available]) ])
# ------------------------------------------------------------------------------
have_importd=no
AC_ARG_ENABLE(importd, AS_HELP_STRING([--disable-importd], [disable import daemon]))
if test "x$enable_importd" != "xno"; then
have_importd=yes
fi
AM_CONDITIONAL(ENABLE_IMPORTD, [test "$have_importd" = "yes"])
AS_IF([test "$have_importd" = "yes"], [ AC_DEFINE(HAVE_IMPORTD, [1], [Importd support available]) ])
# ------------------------------------------------------------------------------
have_hostnamed=no
AC_ARG_ENABLE(hostnamed, AS_HELP_STRING([--disable-hostnamed], [disable hostname daemon]))
if test "x$enable_hostnamed" != "xno"; then
have_hostnamed=yes
fi
AM_CONDITIONAL(ENABLE_HOSTNAMED, [test "$have_hostnamed" = "yes"])
# ------------------------------------------------------------------------------
have_timedated=no
AC_ARG_ENABLE(timedated, AS_HELP_STRING([--disable-timedated], [disable timedate daemon]))
if test "x$enable_timedated" != "xno"; then
have_timedated=yes
fi
AM_CONDITIONAL(ENABLE_TIMEDATED, [test "$have_timedated" = "yes"])
# ------------------------------------------------------------------------------
have_timesyncd=no
AC_ARG_ENABLE(timesyncd, AS_HELP_STRING([--disable-timesyncd], [disable timesync daemon]))
if test "x$enable_timesyncd" != "xno"; then
have_timesyncd=yes
M4_DEFINES="$M4_DEFINES -DENABLE_TIMESYNCD"
fi
AM_CONDITIONAL(ENABLE_TIMESYNCD, [test "$have_timesyncd" = "yes"])
AC_ARG_WITH(ntp-servers,
AS_HELP_STRING([--with-ntp-servers=NTPSERVERS],
[Space-separated list of default NTP servers]),
[NTP_SERVERS="$withval"],
[NTP_SERVERS="time1.google.com time2.google.com time3.google.com time4.google.com"
AC_MSG_WARN([*** Using Google NTP servers.
Do not ship OSes or devices with these default settings.
See DISTRO_PORTING for details!])])
AC_DEFINE_UNQUOTED(NTP_SERVERS, ["$NTP_SERVERS"], [Default NTP Servers])
AC_SUBST(NTP_SERVERS)
AC_ARG_WITH(time-epoch,
AS_HELP_STRING([--with-time-epoch=SECONDS],
[Time epoch for time clients]),
[TIME_EPOCH="$withval"],
[TIME_EPOCH="`stat -c %Y ${srcdir}/NEWS 2>/dev/null || echo 0`"])
AC_DEFINE_UNQUOTED(TIME_EPOCH, [$TIME_EPOCH], [Time Epoch])
# ------------------------------------------------------------------------------
AC_ARG_WITH(system-uid-max,
AS_HELP_STRING([--with-system-uid-max=UID]
[Maximum UID for system users]),
[SYSTEM_UID_MAX="$withval"],
[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`"])
AC_DEFINE_UNQUOTED(SYSTEM_UID_MAX, [$SYSTEM_UID_MAX], [Maximum System UID])
AC_SUBST(SYSTEM_UID_MAX)
# ------------------------------------------------------------------------------
AC_ARG_WITH(system-gid-max,
AS_HELP_STRING([--with-system-gid-max=GID]
[Maximum GID for system groups]),
[SYSTEM_GID_MAX="$withval"],
[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`"])
AC_DEFINE_UNQUOTED(SYSTEM_GID_MAX, [$SYSTEM_GID_MAX], [Maximum System GID])
AC_SUBST(SYSTEM_GID_MAX)
# ------------------------------------------------------------------------------
have_localed=no
AC_ARG_ENABLE(localed, AS_HELP_STRING([--disable-localed], [disable locale daemon]))
if test "x$enable_localed" != "xno"; then
have_localed=yes
fi
AM_CONDITIONAL(ENABLE_LOCALED, [test "$have_localed" = "yes"])
# ------------------------------------------------------------------------------
have_coredump=no
AC_ARG_ENABLE(coredump, AS_HELP_STRING([--disable-coredump], [disable coredump hook]))
if test "x$enable_coredump" != "xno"; then
have_coredump=yes
fi
AM_CONDITIONAL(ENABLE_COREDUMP, [test "$have_coredump" = "yes"])
# ------------------------------------------------------------------------------
have_polkit=no
AC_ARG_ENABLE(polkit, AS_HELP_STRING([--disable-polkit], [disable PolicyKit support]))
if test "x$enable_polkit" != "xno"; then
AC_DEFINE(ENABLE_POLKIT, 1, [Define if PolicyKit support is to be enabled])
have_polkit=yes
fi
AM_CONDITIONAL(ENABLE_POLKIT, [test "x$have_polkit" = "xyes"])
# ------------------------------------------------------------------------------
have_resolved=no
AC_ARG_ENABLE(resolved, AS_HELP_STRING([--disable-resolved], [disable resolve daemon]))
AS_IF([test "x$enable_resolved" != "xno"], [
AC_CHECK_LIB([dl], [dlsym], [true], [AC_MSG_ERROR([*** Dynamic linking loader library not found])])
have_resolved=yes
M4_DEFINES="$M4_DEFINES -DENABLE_RESOLVED"
])
AM_CONDITIONAL(ENABLE_RESOLVED, [test "$have_resolved" = "yes"])
AC_ARG_WITH(dns-servers,
AS_HELP_STRING([--with-dns-servers=DNSSERVERS],
[Space-separated list of default DNS servers]),
[DNS_SERVERS="$withval"],
[DNS_SERVERS="8.8.8.8 8.8.4.4 2001:4860:4860::8888 2001:4860:4860::8844"])
AC_DEFINE_UNQUOTED(DNS_SERVERS, ["$DNS_SERVERS"], [Default DNS Servers])
AC_SUBST(DNS_SERVERS)
# ------------------------------------------------------------------------------
have_networkd=no
AC_ARG_ENABLE(networkd, AS_HELP_STRING([--disable-networkd], [disable networkd]))
AS_IF([test "x$enable_networkd" != "xno"], [
AC_DEFINE(ENABLE_NETWORKD, 1, [Define if networkd support is to be enabled])
have_networkd=yes
M4_DEFINES="$M4_DEFINES -DENABLE_NETWORKD"
])
AM_CONDITIONAL(ENABLE_NETWORKD, [test "x$have_networkd" = "xyes"])
# ------------------------------------------------------------------------------
have_efi=no
AC_ARG_ENABLE(efi, AS_HELP_STRING([--disable-efi], [disable EFI support]))
if test "x$enable_efi" != "xno"; then
AC_DEFINE(ENABLE_EFI, 1, [Define if EFI support is to be enabled])
have_efi=yes
fi
AM_CONDITIONAL(ENABLE_EFI, [test "x$have_efi" = "xyes"])
# ------------------------------------------------------------------------------
AC_CHECK_TOOL(EFI_CC, gcc)
EFI_ARCH=`echo $host | sed "s/\(-\).*$//"`
AM_COND_IF(ARCH_IA32, [
EFI_ARCH=ia32
EFI_MACHINE_TYPE_NAME=ia32])
AM_COND_IF(ARCH_X86_64, [
EFI_MACHINE_TYPE_NAME=x64])
AM_COND_IF(ARCH_AARCH64, [
EFI_MACHINE_TYPE_NAME=aa64])
AC_SUBST([EFI_ARCH])
AC_SUBST([EFI_MACHINE_TYPE_NAME])
have_gnuefi=no
AC_ARG_ENABLE(gnuefi, AS_HELP_STRING([--enable-gnuefi], [Disable optional gnuefi support]))
AS_IF([test "x$enable_gnuefi" != "xno"], [
AC_CHECK_HEADERS(efi/${EFI_ARCH}/efibind.h,
[AC_DEFINE(HAVE_GNUEFI, 1, [Define if gnuefi is available])
have_gnuefi=yes],
[AS_IF([test "x$enable_gnuefi" = xyes],
[AC_MSG_ERROR([*** gnuefi support requested but headers not found])])
])
efiroot=$(echo $(cd /usr/lib/$(${EFI_CC} -print-multi-os-directory); pwd))
EFI_LIB_DIR="$efiroot"
AC_ARG_WITH(efi-libdir,
AS_HELP_STRING([--with-efi-libdir=PATH], [Path to EFI lib directory]),
[EFI_LIB_DIR="$withval"], [EFI_LIB_DIR="$efiroot"]
)
AC_SUBST([EFI_LIB_DIR])
have_efi_lds=no
AC_ARG_WITH(efi-ldsdir,
AS_HELP_STRING([--with-efi-ldsdir=PATH], [Path to EFI lds directory]),
[EFI_LDS_DIR="$withval" && AS_IF([test -f "${EFI_LDS_DIR}/elf_${EFI_ARCH}_efi.lds"],
[have_efi_lds=yes])],
[AS_FOR([DIR], [EFI_LDS_DIR], ["${EFI_LIB_DIR}/gnuefi" "${EFI_LIB_DIR}"],
[AS_IF([test -f "${EFI_LDS_DIR}/elf_${EFI_ARCH}_efi.lds"],
[have_efi_lds=yes && break])])])
AS_IF([test "x$have_efi_lds" = xyes],
[AC_SUBST([EFI_LDS_DIR])],
[AS_IF([test "x$enable_gnuefi" = xyes],
[AC_MSG_ERROR([*** gnuefi support requested but files not found])],
[have_gnuefi=no])])
AC_ARG_WITH(efi-includedir,
AS_HELP_STRING([--with-efi-includedir=PATH], [Path to EFI include directory]),
[EFI_INC_DIR="$withval"], [EFI_INC_DIR="/usr/include"]
)
AC_SUBST([EFI_INC_DIR])
])
AM_CONDITIONAL(HAVE_GNUEFI, [test "x$have_gnuefi" = xyes])
# ------------------------------------------------------------------------------
have_kdbus=no
AC_ARG_ENABLE(kdbus, AS_HELP_STRING([--disable-kdbus], [do not connect to kdbus by default]))
if test "x$enable_kdbus" != "xno"; then
AC_DEFINE(ENABLE_KDBUS, 1, [Define if kdbus is to be connected to by default])
have_kdbus=yes
M4_DEFINES="$M4_DEFINES -DENABLE_KDBUS"
fi
AM_CONDITIONAL(ENABLE_KDBUS, [test "$have_kdbus" = "yes"])
# ------------------------------------------------------------------------------
AC_ARG_WITH(rc-local-script-path-start,
AS_HELP_STRING([--with-rc-local-script-path-start=PATH],
[Path to /etc/rc.local]),
[RC_LOCAL_SCRIPT_PATH_START="$withval"],
[RC_LOCAL_SCRIPT_PATH_START="/etc/rc.local"])
AC_ARG_WITH(rc-local-script-path-stop,
AS_HELP_STRING([--with-rc-local-script-path-stop=PATH],
[Path to /usr/sbin/halt.local]),
[RC_LOCAL_SCRIPT_PATH_STOP="$withval"],
[RC_LOCAL_SCRIPT_PATH_STOP="/usr/sbin/halt.local"])
AC_DEFINE_UNQUOTED(RC_LOCAL_SCRIPT_PATH_START, ["$RC_LOCAL_SCRIPT_PATH_START"], [Path of /etc/rc.local script])
AC_DEFINE_UNQUOTED(RC_LOCAL_SCRIPT_PATH_STOP, ["$RC_LOCAL_SCRIPT_PATH_STOP"], [Path of /usr/sbin/halt.local script])
AC_SUBST(RC_LOCAL_SCRIPT_PATH_START)
AC_SUBST(RC_LOCAL_SCRIPT_PATH_STOP)
# ------------------------------------------------------------------------------
AC_ARG_WITH(kbd-loadkeys,
AS_HELP_STRING([--with-kbd-loadkeys=PATH],
[Path to loadkeys]),
[KBD_LOADKEYS="$withval"],
[KBD_LOADKEYS="/usr/bin/loadkeys"])
AC_ARG_WITH(kbd-setfont,
AS_HELP_STRING([--with-kbd-setfont=PATH],
[Path to setfont]),
[KBD_SETFONT="$withval"],
[KBD_SETFONT="/usr/bin/setfont"])
AC_DEFINE_UNQUOTED(KBD_LOADKEYS, ["$KBD_LOADKEYS"], [Path of loadkeys])
AC_DEFINE_UNQUOTED(KBD_SETFONT, ["$KBD_SETFONT"], [Path of setfont])
AC_SUBST(KBD_LOADKEYS)
AC_SUBST(KBD_SETFONT)
AC_ARG_WITH(telinit,
AS_HELP_STRING([--with-telinit=PATH],
[Path to telinit]),
[TELINIT="$withval"],
[TELINIT="/lib/sysvinit/telinit"])
AC_DEFINE_UNQUOTED(TELINIT, ["$TELINIT"], [Path to telinit])
AC_SUBST(TELINIT)
AC_CHECK_HEADERS_ONCE([valgrind/memcheck.h valgrind/valgrind.h])
# ------------------------------------------------------------------------------
have_myhostname=no
AC_ARG_ENABLE(myhostname, AS_HELP_STRING([--disable-myhostname], [disable nss-myhostname support]))
if test "x$enable_myhostname" != "xno"; then
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h nss.h sys/ioctl.h sys/auxv.h])
AC_C_CONST
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_FUNC_SELECT_ARGTYPES
AC_CHECK_FUNCS([gethostbyaddr gethostbyname gettimeofday inet_ntoa memset select socket strcspn strdup strerror strncasecmp strcasecmp strspn])
have_myhostname=yes
fi
AM_CONDITIONAL(HAVE_MYHOSTNAME, [test "$have_myhostname" = "yes"])
# ------------------------------------------------------------------------------
AC_ARG_ENABLE(hwdb, [AC_HELP_STRING([--disable-hwdb], [disable hardware database support])],
enable_hwdb=$enableval, enable_hwdb=yes)
AM_CONDITIONAL(ENABLE_HWDB, [test x$enable_hwdb = xyes])
# ------------------------------------------------------------------------------
have_manpages=no
AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-manpages], [disable manpages]))
AC_PATH_PROG([XSLTPROC], [xsltproc])
AS_IF([test "x$enable_manpages" != xno], [
have_manpages=yes
AS_IF([test -z "$XSLTPROC"],
AC_MSG_ERROR([*** xsltproc is required for man pages]))
])
AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
# ------------------------------------------------------------------------------
AC_ARG_ENABLE(hibernate,
[AC_HELP_STRING([--disable-hibernate], [disable hibernation support])],
enable_hibernate=$enableval, enable_hibernate=yes)
AM_CONDITIONAL(ENABLE_HIBERNATE, [test x$enable_hibernate = xyes])
# ------------------------------------------------------------------------------
AC_ARG_ENABLE(ldconfig,
[AC_HELP_STRING([--disable-ldconfig], [disable ldconfig])],
enable_ldconfig=$enableval, enable_ldconfig=yes)
AM_CONDITIONAL(ENABLE_LDCONFIG, [test x$enable_ldconfig = xyes])
# ------------------------------------------------------------------------------
# Location of the init scripts as mandated by LSB
SYSTEM_SYSVINIT_PATH=/etc/init.d
SYSTEM_SYSVRCND_PATH=/etc/rc.d
AC_ARG_WITH([sysvinit-path],
[AS_HELP_STRING([--with-sysvinit-path=PATH],
[Specify the path to where the SysV init scripts are located])],
[SYSTEM_SYSVINIT_PATH="$withval"],
[])
AC_ARG_WITH([sysvrcnd-path],
[AS_HELP_STRING([--with-sysvrcnd-path=PATH],
[Specify the path to the base directory for the SysV rcN.d directories])],
[SYSTEM_SYSVRCND_PATH="$withval"],
[])
if test "x${SYSTEM_SYSVINIT_PATH}" != "x" -a "x${SYSTEM_SYSVRCND_PATH}" != "x"; then
AC_DEFINE(HAVE_SYSV_COMPAT, [], [SysV init scripts and rcN.d links are supported.])
SYSTEM_SYSV_COMPAT="yes"
M4_DEFINES="$M4_DEFINES -DHAVE_SYSV_COMPAT"
elif test "x${SYSTEM_SYSVINIT_PATH}" != "x" -o "x${SYSTEM_SYSVRCND_PATH}" != "x"; then
AC_MSG_ERROR([*** You need both --with-sysvinit-path=PATH and --with-sysvrcnd-path=PATH to enable SysV compatibility support, or both empty to disable it.])
else
SYSTEM_SYSV_COMPAT="no"
fi
AC_SUBST(SYSTEM_SYSVINIT_PATH)
AC_SUBST(SYSTEM_SYSVRCND_PATH)
AC_SUBST(M4_DEFINES)
AM_CONDITIONAL(HAVE_SYSV_COMPAT, test "$SYSTEM_SYSV_COMPAT" = "yes")
AC_ARG_WITH([tty-gid],
[AS_HELP_STRING([--with-tty-gid=GID],
[Specify the numeric GID of the 'tty' group])],
[TTY_GID="$withval"],
[TTY_GID="5"])
AC_DEFINE_UNQUOTED(TTY_GID, [$TTY_GID], [GID of the 'tty' group])
AC_SUBST(TTY_GID)
AC_ARG_WITH([dbuspolicydir],
AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
[],
[with_dbuspolicydir=${sysconfdir}/dbus-1/system.d])
AX_NORMALIZE_PATH([with_dbuspolicydir])
AC_ARG_WITH([dbussessionservicedir],
AS_HELP_STRING([--with-dbussessionservicedir=DIR], [D-Bus session service directory]),
[],
[with_dbussessionservicedir=${datadir}/dbus-1/services])
AX_NORMALIZE_PATH([with_dbussessionservicedir])
AC_ARG_WITH([dbussystemservicedir],
AS_HELP_STRING([--with-dbussystemservicedir=DIR], [D-Bus system service directory]),
[],
[with_dbussystemservicedir=${datadir}/dbus-1/system-services])
AX_NORMALIZE_PATH([with_dbussystemservicedir])
AC_ARG_WITH([bashcompletiondir],
AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),
[],
[AS_IF([$($PKG_CONFIG --exists bash-completion)], [
with_bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion)
] , [
with_bashcompletiondir=${datadir}/bash-completion/completions
])])
AM_CONDITIONAL(ENABLE_BASH_COMPLETION, [test "$with_bashcompletiondir" != "no"])
AX_NORMALIZE_PATH([with_bashcompletiondir])
AC_ARG_WITH([zshcompletiondir],
AS_HELP_STRING([--with-zshcompletiondir=DIR], [Zsh completions directory]),
[], [with_zshcompletiondir=${datadir}/zsh/site-functions])
AM_CONDITIONAL(ENABLE_ZSH_COMPLETION, [test "$with_zshcompletiondir" != "no"])
AX_NORMALIZE_PATH([with_zshcompletiondir])
AC_ARG_WITH([rootprefix],
AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
[], [with_rootprefix=${ac_default_prefix}])
# --with-rootprefix= (empty) should default to "/" but AX_NORMALIZE_PATH
# defaults those to ".", solve that here for now until we can find a suitable
# fix for AX_NORMALIZE_PATH upstream at autoconf-archive.
# See: https://github.com/systemd/systemd/issues/54
if test "x${with_rootprefix}" = "x"; then
with_rootprefix="/"
fi
AX_NORMALIZE_PATH([with_rootprefix])
AC_ARG_WITH([rootlibdir],
AS_HELP_STRING([--with-rootlibdir=DIR], [Root directory for libraries necessary for boot]),
[],
[with_rootlibdir=${libdir}])
AX_NORMALIZE_PATH([with_rootlibdir])
AC_ARG_WITH([pamlibdir],
AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]),
[],
[with_pamlibdir=${with_rootlibdir}/security])
AX_NORMALIZE_PATH([with_pamlibdir])
AC_ARG_WITH([pamconfdir],
AS_HELP_STRING([--with-pamconfdir=DIR], [Directory for PAM configuration]),
[],
[with_pamconfdir=${sysconfdir}/pam.d])
AX_NORMALIZE_PATH([with_pamconfdir])
AC_ARG_ENABLE([split-usr],
AS_HELP_STRING([--enable-split-usr], [Assume that /bin, /sbin aren\'t symlinks into /usr]),
[],
[AS_IF([test "x${ac_default_prefix}" != "x${with_rootprefix}"], [
enable_split_usr=yes
], [
enable_split_usr=no
])])
AS_IF([test "x${enable_split_usr}" = "xyes"], [
AC_DEFINE(HAVE_SPLIT_USR, 1, [Define if /bin, /sbin aren't symlinks into /usr])
])
AM_CONDITIONAL(ENABLE_SPLIT_USR, [test "x${enable_split_usr}" = "xyes"])
# work around intltool-update issues during 'make distcheck'
AS_IF([test "x$0" != "x./configure"], [
AC_SUBST([INTLTOOL_UPDATE], [/bin/true])
])
# QEMU and OVMF UEFI firmware
AS_IF([test x"$cross_compiling" = "xyes"], [], [
AC_PATH_PROG([QEMU], [qemu-system-x86_64])
AC_CHECK_FILE([/usr/share/qemu/bios-ovmf.bin], [QEMU_BIOS=/usr/share/qemu/bios-ovmf.bin],
[AC_CHECK_FILE([/usr/share/qemu-ovmf/bios.bin], [QEMU_BIOS=/usr/share/qemu-ovmf/bios.bin])])
AC_SUBST([QEMU_BIOS])
])
AC_ARG_ENABLE(tests,
[AC_HELP_STRING([--disable-tests], [disable tests])],
enable_tests=$enableval, enable_tests=yes)
AM_CONDITIONAL(ENABLE_TESTS, [test x$enable_tests = xyes])
AC_ARG_ENABLE(debug,
[AC_HELP_STRING([--enable-debug@<:@=LIST@:>@], [enable extra debugging (hashmap,mmap-cache)])],
[if test "x$enableval" = "xyes"; then
enableval="hashmap,mmap-cache"
fi
saved_ifs="$IFS"
IFS="$IFS$PATH_SEPARATOR,"
for name in $enableval; do
case $name in
hashmap)
enable_debug_hashmap=yes
;;
mmap-cache)
enable_debug_mmap_cache=yes
;;
esac
done
IFS="$saved_ifs"],[])
enable_debug=""
AS_IF([test x$enable_debug_hashmap = xyes], [
AC_DEFINE(ENABLE_DEBUG_HASHMAP, 1, [Define if hashmap debugging is to be enabled])
enable_debug="hashmap $enable_debug"
])
AS_IF([test x$enable_debug_mmap_cache = xyes], [
AC_DEFINE(ENABLE_DEBUG_MMAP_CACHE, 1, [Define if mmap cache debugging is to be enabled])
enable_debug="mmap-cache $enable_debug"
])
test -z "$enable_debug" && enable_debug="none"
AC_SUBST([dbuspolicydir], [$with_dbuspolicydir])
AC_SUBST([dbussessionservicedir], [$with_dbussessionservicedir])
AC_SUBST([dbussystemservicedir], [$with_dbussystemservicedir])
AC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
AC_SUBST([zshcompletiondir], [$with_zshcompletiondir])
AC_SUBST([pamlibdir], [$with_pamlibdir])
AC_SUBST([pamconfdir], [$with_pamconfdir])
AC_SUBST([rootprefix], [$with_rootprefix])
AC_SUBST([rootlibdir], [$with_rootlibdir])
AC_CONFIG_FILES([
Makefile
po/Makefile.in
])
AC_OUTPUT
AC_MSG_RESULT([
$PACKAGE_NAME $VERSION
libcryptsetup: ${have_libcryptsetup}
PAM: ${have_pam}
AUDIT: ${have_audit}
IMA: ${have_ima}
AppArmor: ${have_apparmor}
SELinux: ${have_selinux}
SECCOMP: ${have_seccomp}
SMACK: ${have_smack}
ZLIB: ${have_zlib}
XZ: ${have_xz}
LZ4: ${have_lz4}
BZIP2: ${have_bzip2}
ACL: ${have_acl}
GCRYPT: ${have_gcrypt}
QRENCODE: ${have_qrencode}
MICROHTTPD: ${have_microhttpd}
GNUTLS: ${have_gnutls}
libcurl: ${have_libcurl}
libidn: ${have_libidn}
libiptc: ${have_libiptc}
ELFUTILS: ${have_elfutils}
binfmt: ${have_binfmt}
vconsole: ${have_vconsole}
bootchart: ${have_bootchart}
quotacheck: ${have_quotacheck}
tmpfiles: ${have_tmpfiles}
sysusers: ${have_sysusers}
firstboot: ${have_firstboot}
randomseed: ${have_randomseed}
backlight: ${have_backlight}
rfkill: ${have_rfkill}
logind: ${have_logind}
machined: ${have_machined}
importd: ${have_importd}
hostnamed: ${have_hostnamed}
timedated: ${have_timedated}
timesyncd: ${have_timesyncd}
default NTP servers: ${NTP_SERVERS}
time epoch: ${TIME_EPOCH}
localed: ${have_localed}
networkd: ${have_networkd}
resolved: ${have_resolved}
default DNS servers: ${DNS_SERVERS}
coredump: ${have_coredump}
polkit: ${have_polkit}
efi: ${have_efi}
gnuefi: ${have_gnuefi}
efi arch: ${EFI_ARCH}
EFI machine type: ${EFI_MACHINE_TYPE_NAME}
EFI CC ${EFI_CC}
EFI libdir: ${EFI_LIB_DIR}
EFI ldsdir: ${EFI_LDS_DIR}
EFI includedir: ${EFI_INC_DIR}
kmod: ${have_kmod}
xkbcommon: ${have_xkbcommon}
blkid: ${have_blkid}
libmount: ${have_libmount}
dbus: ${have_dbus}
nss-myhostname: ${have_myhostname}
hwdb: ${enable_hwdb}
kdbus: ${have_kdbus}
Python: ${have_python}
man pages: ${have_manpages}
test coverage: ${have_coverage}
Split /usr: ${enable_split_usr}
SysV compatibility: ${SYSTEM_SYSV_COMPAT}
compatibility libraries: ${have_compat_libs}
utmp/wtmp support: ${have_utmp}
ldconfig support: ${enable_ldconfig}
hibernate support: ${enable_hibernate}
extra debugging: ${enable_debug}
prefix: ${prefix}
rootprefix: ${with_rootprefix}
sysconf dir: ${sysconfdir}
datarootdir: ${datarootdir}
includedir: ${includedir}
lib dir: ${libdir}
rootlib dir: ${with_rootlibdir}
SysV init scripts: ${SYSTEM_SYSVINIT_PATH}
SysV rc?.d directories: ${SYSTEM_SYSVRCND_PATH}
Build Python: ${PYTHON}
PAM modules dir: ${with_pamlibdir}
PAM configuration dir: ${with_pamconfdir}
D-Bus policy dir: ${with_dbuspolicydir}
D-Bus session dir: ${with_dbussessionservicedir}
D-Bus system dir: ${with_dbussystemservicedir}
Bash completions dir: ${with_bashcompletiondir}
Zsh completions dir: ${with_zshcompletiondir}
Extra start script: ${RC_LOCAL_SCRIPT_PATH_START}
Extra stop script: ${RC_LOCAL_SCRIPT_PATH_STOP}
Debug shell: ${SUSHELL} @ ${DEBUGTTY}
TTY GID: ${TTY_GID}
Maximum System UID: ${SYSTEM_UID_MAX}
Maximum System GID: ${SYSTEM_GID_MAX}
Certificate root: ${CERTIFICATEROOT}
CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
])