configure.ac revision 626851be97b4332fc0401d754c81ae7bbc0f5dc4
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering# This file is part of systemd.
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering# Copyright 2010-2012 Lennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering# Copyright 2010-2012 Kay Sievers
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering# systemd is free software; you can redistribute it and/or modify it
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering# under the terms of the GNU Lesser General Public License as published by
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering# the Free Software Foundation; either version 2.1 of the License, or
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering# (at your option) any later version.
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering# systemd is distributed in the hope that it will be useful, but
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering# WITHOUT ANY WARRANTY; without even the implied warranty of
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering# Lesser General Public License for more details.
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering# You should have received a copy of the GNU Lesser General Public License
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering# along with systemd; If not, see <http://www.gnu.org/licenses/>.
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_PREREQ([2.64])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_INIT([systemd],
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [http://bugs.freedesktop.org/enter_bug.cgi?product=systemd],
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [http://www.freedesktop.org/wiki/Software/systemd])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAC_CONFIG_SRCDIR([src/core/main.c])
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart PoetteringAC_CONFIG_MACRO_DIR([m4])
25300b5a1fcf54674a69d0f4ab08925be00b0227Lennart PoetteringAC_CONFIG_HEADERS([config.h])
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart PoetteringAC_CONFIG_AUX_DIR([build-aux])
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart PoetteringAC_USE_SYSTEM_EXTENSIONS
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart PoetteringAC_SYS_LARGEFILE
b1d4f8e154bf61b5de1b27461ef8e9c8c5e838a1Lennart PoetteringAC_PREFIX_DEFAULT([/usr])
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart PoetteringAM_MAINTAINER_MODE([enable])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects check-news])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAM_SILENT_RULES([yes])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAC_CANONICAL_HOST
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [Canonical host string.])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAS_IF([test "x$host_cpu" = "xmips" || test "x$host_cpu" = "xmipsel" ||
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poettering test "x$host_cpu" = "xmips64" || test "x$host_cpu" = "xmips64el"],
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [AC_DEFINE(ARCH_MIPS, [], [Whether on mips arch])])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringLT_INIT([disable-static])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAS_IF([test "x$enable_static" = "xyes"], [AC_MSG_ERROR([--enable-static is not supported by systemd])])
3a6fb33c54bc64398e0af1c9d7c74a6b614a849dLennart PoetteringAS_IF([test "x$enable_largefile" = "xno"], [AC_MSG_ERROR([--disable-largefile is not supported by systemd])])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering# i18n stuff for the PolicyKit policy files
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart PoetteringIT_PROG_INTLTOOL([0.40.0])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringGETTEXT_PACKAGE=systemd
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_SUBST(GETTEXT_PACKAGE)
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_PROG_MKDIR_P
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_PATH_PROG([M4], [m4])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_PATH_PROG([XSLTPROC], [xsltproc])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_PATH_PROG([QUOTAON], [quotaon], [/usr/sbin/quotaon])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_PATH_PROG([QUOTACHECK], [quotacheck], [/usr/sbin/quotacheck])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_PATH_PROG([SETCAP], [setcap], [/usr/sbin/setcap])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_PATH_PROG([KILL], [kill], [/usr/bin/kill])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_PATH_PROG([KMOD], [kmod], [/usr/bin/kmod])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_PATH_PROG([KEXEC], [kexec], [/usr/sbin/kexec])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering# gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poetteringm4_ifdef([GTK_DOC_CHECK], [
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringGTK_DOC_CHECK([1.18],[--flavour no-tmpl])],
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [AM_CONDITIONAL([ENABLE_GTK_DOC], [false])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering enable_gtk_doc=no])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAS_IF([test "x$enable_gtk_doc" = "xyes" -a "x$XSLTPROC" = x], [
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering AC_MSG_ERROR([*** GTK doc requested but xsltproc not found])
03976f7b4a84b8b1492a549a3470b2bba8f37008Lennart Poetteringm4_ifdef([GOBJECT_INTROSPECTION_CHECK], [
634af5665fda8776d22624d947c8de830e30a874Lennart PoetteringGOBJECT_INTROSPECTION_CHECK([1.31.1])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering AM_CONDITIONAL([HAVE_INTROSPECTION], [false])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering enable_introspection=no])
634af5665fda8776d22624d947c8de830e30a874Lennart PoetteringAC_CHECK_TOOL(STRINGS, strings)
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_CHECK_TOOL(GPERF, gperf)
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poetteringif test -z "$GPERF" ; then
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering AC_MSG_ERROR([*** gperf not found])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering# ------------------------------------------------------------------------------
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poetteringaddress_sanitizer_cflags=
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poetteringaddress_sanitizer_cppflags=
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poetteringaddress_sanitizer_ldflags=
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_ARG_ENABLE(address-sanitizer, AS_HELP_STRING([--enable-address-sanitizer], [enable -fsanitize=address]))
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAS_IF([test "x$enable_address_sanitizer" = "xyes"], [
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering CC_CHECK_FLAG_APPEND([with_as_cflags], [CFLAGS], [-fsanitize=address])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering AS_IF([test -z "$with_as_cflags"],
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [AC_MSG_ERROR([*** -fsanitize=address is not supported])])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering address_sanitizer_cflags="$with_as_cflags -fno-omit-frame-pointer -DVALGRIND=1"
634af5665fda8776d22624d947c8de830e30a874Lennart Poettering address_sanitizer_cppflags="-DVALGRIND=1"
634af5665fda8776d22624d947c8de830e30a874Lennart Poettering address_sanitizer_ldflags="-Wc,-fsanitize=address"
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringCC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering "-Wformat=2 -Wformat-security -Wformat-nonliteral" \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -Wlogical-op \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -Wsign-compare \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -Wmissing-include-dirs \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -Wold-style-definition \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -Wpointer-arith \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -Wdeclaration-after-statement \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -Wfloat-equal \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -Wmissing-prototypes \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -Wstrict-prototypes \
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poettering -Wredundant-decls \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -Wmissing-declarations \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -Wmissing-noreturn \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -Wendif-labels \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -Wcast-align \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -Wstrict-aliasing=2 \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -Wwrite-strings \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -Wno-long-long \
555bd6e95bf2b469306d9cd86e126c0122d0895bLennart Poettering -Wno-overlength-strings \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -Wno-unused-parameter \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -Wno-missing-field-initializers \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -Wno-unused-result \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -Werror=overflow \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -fdiagnostics-show-option \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -fdiagnostics-color \
555bd6e95bf2b469306d9cd86e126c0122d0895bLennart Poettering -fno-strict-aliasing \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -fvisibility=hidden \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -ffunction-sections \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -fdata-sections \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -fstack-protector \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering --param=ssp-buffer-size=4])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAS_CASE([$CFLAGS], [*-O[[12345\ ]]*],
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [AC_MSG_RESULT([skipping -flto, optimization not enabled])])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_SUBST([OUR_CFLAGS], "$with_cflags $address_sanitizer_cflags")
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart PoetteringAS_CASE([$CFLAGS], [*-O[[12345\ ]]*],
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -Wp,-D_FORTIFY_SOURCE=2])],
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [AC_MSG_RESULT([skipping -D_FORTIFY_SOURCE, optimization not enabled])])
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart PoetteringAC_SUBST([OUR_CPPFLAGS], "$with_cppflags $address_sanitizer_cppflags")
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringCC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -Wl,--as-needed \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -Wl,--no-undefined \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -Wl,--gc-sections \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -Wl,-z,relro \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_SUBST([OUR_LDFLAGS], "$with_ldflags $address_sanitizer_ldflags")
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering# ------------------------------------------------------------------------------
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering# we use python to build the man page index, and for systemd-python
555bd6e95bf2b469306d9cd86e126c0122d0895bLennart PoetteringAC_ARG_WITH([python],
555bd6e95bf2b469306d9cd86e126c0122d0895bLennart Poettering [AS_HELP_STRING([--without-python], [Disable building the man page index and systemd-python (default: test)])])
555bd6e95bf2b469306d9cd86e126c0122d0895bLennart PoetteringAS_IF([test "x$with_python" != "xno"], [
9d485985338a46b8cb1acdf1af6c1eb2e88acfeeLennart Poettering AM_PATH_PYTHON(,, [:])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering AS_IF([test "$PYTHON" != :], [have_python=yes])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAS_IF([test "x$PYTHON_BINARY" = "x"],
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [AS_IF([test "x$have_python" = "xyes"],
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [PYTHON_BINARY="$(which "$PYTHON")"],
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [PYTHON_BINARY=/usr/bin/python])])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_ARG_VAR(PYTHON_BINARY, [Python binary used to launch installed scripts])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAS_IF([test "x$have_python" != "xyes" -a "x$enable_python_devel" = "xyes"],
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [AC_MSG_ERROR([*** python-devel support requires --with-python])])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poetteringhave_python_devel=no
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_ARG_ENABLE(python_devel, AS_HELP_STRING([--disable-python-devel], [Do not build python modules]))
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAS_IF([test "x$have_python" = "xyes" -a "x$enable_python_devel" != "xno"], [
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering PKG_CHECK_MODULES([PYTHON_DEVEL], [python-${PYTHON_VERSION}],
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [have_python_devel=yes],
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [PKG_CHECK_MODULES([PYTHON_DEVEL], [python],
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [have_python_devel=yes],
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [have_python_devel=no])])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering AS_IF([test "x$have_python_devel" = xno -a "x$enable_python_devel" = xyes],
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [AC_MSG_ERROR([*** python-devel support requested but libraries not found])])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering AC_PATH_PROGS(SPHINX_BUILD, sphinx-build-${PYTHON_VERSION} sphinx-build)
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAM_CONDITIONAL([HAVE_PYTHON_DEVEL], [test "$have_python_devel" = "yes"])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering# ------------------------------------------------------------------------------
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_SEARCH_LIBS([dlsym], [dl], [], [AC_MSG_ERROR([*** Dynamic linking loader library not found])])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_CHECK_HEADERS([linux/btrfs.h], [], [])
e70df46b9721a3d025e7a0b4ffb5893cbde5e55dLennart Poettering# unconditionally pull-in librt with old glibc versions
e70df46b9721a3d025e7a0b4ffb5893cbde5e55dLennart PoetteringAC_SEARCH_LIBS([clock_gettime], [rt], [], [])
e70df46b9721a3d025e7a0b4ffb5893cbde5e55dLennart Poetteringsave_LIBS="$LIBS"
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not found])])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringCAP_LIBS="$LIBS"
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_SUBST(CAP_LIBS)
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_SEARCH_LIBS([mq_open], [rt], [], [AC_MSG_ERROR([*** POSIX RT library not found])])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringRT_LIBS="$LIBS"
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_SUBST(RT_LIBS)
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringLIBS="$save_LIBS"
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_CHECK_FUNCS([fanotify_init fanotify_mark])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_CHECK_FUNCS([__secure_getenv secure_getenv])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at], [], [], [[#include <sys/types.h>
03976f7b4a84b8b1492a549a3470b2bba8f37008Lennart Poettering# This makes sure pkg.m4 is available.
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poetteringm4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering# ------------------------------------------------------------------------------
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringPKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.3.2], have_dbus=yes, have_dbus=no])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAS_IF([test "$have_dbus" = "yes"], [ AC_DEFINE(HAVE_DBUS, [1], [Define if dbus-1 is available]) ])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAM_CONDITIONAL(HAVE_DBUS, [test "$have_dbus" = "yes"])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering# ------------------------------------------------------------------------------
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poetteringhave_coverage=no
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_ARG_ENABLE(coverage, AS_HELP_STRING([--enable-coverage], [enable test coverage]))
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poetteringif test "x$enable_coverage" = "xyes" ; then
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering AC_CHECK_PROG(lcov_found, [lcov], [yes], [no])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if test "x$lcov_found" = xno ; then
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering AC_MSG_ERROR([*** lcov support requested but the program was not found])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering lcov_version_major="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 1`"
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering lcov_version_minor="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 2`"
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if test "$lcov_version_major" -eq 1 -a "$lcov_version_minor" -lt 10; then
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering AC_MSG_ERROR([*** lcov version is too old. 1.10 required])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering have_coverage=yes
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering CC_CHECK_FLAGS_APPEND([with_coverage_cflags], [CFLAGS], [\
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -fprofile-arcs \
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering -ftest-coverage])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering AC_SUBST([OUR_CFLAGS], "$with_cflags $with_coverage_cflags")
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAM_CONDITIONAL(ENABLE_COVERAGE, [test "$have_coverage" = "yes"])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering# ------------------------------------------------------------------------------
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_ARG_ENABLE(kmod, AS_HELP_STRING([--disable-kmod], [disable loadable modules support]))
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poetteringif test "x$enable_kmod" != "xno"; then
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering PKG_CHECK_EXISTS([ libkmod ], have_kmod=yes, have_kmod=no)
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if test "x$have_kmod" = "xyes"; then
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering PKG_CHECK_MODULES(KMOD, [ libkmod >= 15 ],
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [AC_DEFINE(HAVE_KMOD, 1, [Define if kmod is available])],
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering AC_MSG_ERROR([*** kmod version >= 15 not found]))
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if test "x$have_kmod" = xno -a "x$enable_kmod" = xyes; then
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering AC_MSG_ERROR([*** kmod support requested, but libraries not found])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAM_CONDITIONAL(HAVE_KMOD, [test "$have_kmod" = "yes"])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering# ------------------------------------------------------------------------------
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_ARG_ENABLE(blkid, AS_HELP_STRING([--disable-blkid], [disable blkid support]))
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poetteringif test "x$enable_blkid" != "xno"; then
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering PKG_CHECK_MODULES(BLKID, [ blkid >= 2.20 ],
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [AC_DEFINE(HAVE_BLKID, 1, [Define if blkid is available]) have_blkid=yes], have_blkid=no)
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if test "x$have_blkid" = xno -a "x$enable_blkid" = xyes; then
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering AC_MSG_ERROR([*** blkid support requested but libraries not found])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAM_CONDITIONAL(HAVE_BLKID, [test "$have_blkid" = "yes"])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering# ------------------------------------------------------------------------------
66a16e7e9fc501d371b57cbe2ae5d130fe930c6dThomas Hindoe Paaboel AndersenAC_ARG_ENABLE([ima], AS_HELP_STRING([--disable-ima],[Disable optional IMA support]),
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [case "${enableval}" in
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering yes) have_ima=yes ;;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering no) have_ima=no ;;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering *) AC_MSG_ERROR(bad value ${enableval} for --disable-ima) ;;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [have_ima=yes])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poetteringif test "x${have_ima}" != xno ; then
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering AC_DEFINE(HAVE_IMA, 1, [Define if IMA is available])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering# ------------------------------------------------------------------------------
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poetteringhave_chkconfig=yes
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_ARG_ENABLE([chkconfig], AS_HELP_STRING([--disable-chkconfig],[Disable optional chkconfig support]),
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [case "${enableval}" in
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering yes) have_chkconfig=yes ;;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering no) have_chkconfig=no ;;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering *) AC_MSG_ERROR(bad value ${enableval} for --disable-chkconfig) ;;
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poettering [AC_PATH_PROG(CHKCONFIG, chkconfig)
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poettering if test -z "$CHKCONFIG"; then
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering have_chkconfig=no
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering have_chkconfig=yes
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poetteringif test "x${have_chkconfig}" != xno ; then
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering AC_DEFINE(HAVE_CHKCONFIG, 1, [Define if CHKCONFIG is available])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering# ------------------------------------------------------------------------------
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poetteringhave_selinux=no
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_ARG_ENABLE(selinux, AS_HELP_STRING([--disable-selinux], [Disable optional SELINUX support]))
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poetteringif test "x$enable_selinux" != "xno"; then
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.1.9],
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [AC_DEFINE(HAVE_SELINUX, 1, [Define if SELinux is available]) have_selinux=yes], have_selinux=no)
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if test "x$have_selinux" = xno -a "x$enable_selinux" = xyes; then
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering AC_MSG_ERROR([*** SELinux support requested but libraries not found])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAM_CONDITIONAL(HAVE_SELINUX, [test "$have_selinux" = "yes"])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_ARG_WITH(debug-shell,
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering AS_HELP_STRING([--with-debug-shell=PATH],
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [Path to debug shell binary]),
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [SUSHELL="$withval"],[
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering AS_IF([test "x${have_selinux}" != "xno"], [SUSHELL="/sbin/sushell"] , [SUSHELL="/bin/sh"])])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_SUBST(SUSHELL)
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_ARG_WITH([debug-tty],
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering AS_HELP_STRING([--with-debug-tty=PATH],
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [Specify the tty device for debug shell]),
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [DEBUGTTY="$withval"],
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_SUBST(DEBUGTTY)
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering# ------------------------------------------------------------------------------
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_ARG_ENABLE(xz, AS_HELP_STRING([--disable-xz], [Disable optional XZ support]))
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poetteringif test "x$enable_xz" != "xno"; then
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering PKG_CHECK_MODULES(XZ, [ liblzma ],
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [AC_DEFINE(HAVE_XZ, 1, [Define if XZ is available]) have_xz=yes], have_xz=no)
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if test "x$have_xz" = xno -a "x$enable_xz" = xyes; then
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering AC_MSG_ERROR([*** Xz support requested but libraries not found])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAM_CONDITIONAL(HAVE_XZ, [test "$have_xz" = "yes"])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering# ------------------------------------------------------------------------------
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart PoetteringAC_ARG_ENABLE([tcpwrap],
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering AS_HELP_STRING([--disable-tcpwrap],[Disable optional TCP wrappers support]),
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering [case "${enableval}" in
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering yes) have_tcpwrap=yes ;;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering no) have_tcpwrap=no ;;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering *) AC_MSG_ERROR(bad value ${enableval} for --disable-tcpwrap) ;;
e70df46b9721a3d025e7a0b4ffb5893cbde5e55dLennart Poettering [have_tcpwrap=auto])
e70df46b9721a3d025e7a0b4ffb5893cbde5e55dLennart Poetteringif test "x${have_tcpwrap}" != xno ; then
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if test "x${LIBWRAP_LIBS}" = x ; then
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if test "x$have_tcpwrap" = xyes ; then
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering AC_MSG_ERROR([*** TCP wrappers support not found.])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering have_tcpwrap=no
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering have_tcpwrap=yes
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAC_SUBST(LIBWRAP_LIBS)
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering# ------------------------------------------------------------------------------
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAC_ARG_ENABLE([pam],
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AS_HELP_STRING([--disable-pam],[Disable optional PAM support]),
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [case "${enableval}" in
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering yes) have_pam=yes ;;
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering no) have_pam=no ;;
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering *) AC_MSG_ERROR(bad value ${enableval} for --disable-pam) ;;
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [have_pam=auto])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poetteringif test "x${have_pam}" != xno ; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AC_CHECK_HEADERS(
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [security/pam_modules.h security/pam_modutil.h security/pam_ext.h],
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [have_pam=yes],
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [if test "x$have_pam" = xyes ; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AC_MSG_ERROR([*** PAM headers not found.])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [have_pam=yes],
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [if test "x$have_pam" = xyes ; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AC_MSG_ERROR([*** libpam not found.])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering if test "x$have_pam" = xyes ; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering PAM_LIBS="-lpam -lpam_misc"
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AC_DEFINE(HAVE_PAM, 1, [PAM available])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAC_SUBST(PAM_LIBS)
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAM_CONDITIONAL([HAVE_PAM], [test "x$have_pam" != xno])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering# ------------------------------------------------------------------------------
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAC_ARG_ENABLE([acl],
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AS_HELP_STRING([--disable-acl],[Disable optional ACL support]),
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [case "${enableval}" in
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering yes) have_acl=yes ;;
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering no) have_acl=no ;;
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering *) AC_MSG_ERROR(bad value ${enableval} for --disable-acl) ;;
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [have_acl=auto])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poetteringif test "x${have_acl}" != xno ; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AC_CHECK_HEADERS(
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [have_acl=yes],
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [if test "x$have_acl" = xyes ; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AC_MSG_ERROR([*** ACL headers not found.])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [acl_get_file],
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [have_acl=yes],
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [if test "x$have_acl" = xyes ; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AC_MSG_ERROR([*** libacl not found.])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering if test "x$have_acl" = xyes ; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering ACL_LIBS="-lacl"
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AC_DEFINE(HAVE_ACL, 1, [ACL available])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAC_SUBST(ACL_LIBS)
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAM_CONDITIONAL([HAVE_ACL], [test "x$have_acl" != xno])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering# ------------------------------------------------------------------------------
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAC_ARG_ENABLE([xattr],
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AS_HELP_STRING([--disable-xattr],[Disable optional XATTR support]),
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [case "${enableval}" in
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering yes) have_xattr=yes ;;
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering no) have_xattr=no ;;
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering *) AC_MSG_ERROR(bad value ${enableval} for --disable-xattr) ;;
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [have_xattr=auto])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poetteringif test "x${have_xattr}" != xno ; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AC_CHECK_HEADERS(
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [have_xattr=yes],
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [if test "x$have_xattr" = xyes ; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AC_MSG_ERROR([*** XATTR headers not found.])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [have_xattr=yes],
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [if test "x$have_xattr" = xyes ; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AC_MSG_ERROR([*** libattr not found.])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering if test "x$have_xattr" = xyes ; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering XATTR_LIBS="-lattr"
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AC_DEFINE(HAVE_XATTR, 1, [XATTR available])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAC_SUBST(XATTR_LIBS)
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAM_CONDITIONAL([HAVE_XATTR], [test "x$have_xattr" != xno])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering# ------------------------------------------------------------------------------
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAC_ARG_ENABLE([smack], AS_HELP_STRING([--disable-smack],[Disable optional SMACK support]),
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [case "${enableval}" in
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering yes) have_smack=yes ;;
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering no) have_smack=no ;;
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering *) AC_MSG_ERROR(bad value ${enableval} for --disable-smack) ;;
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [have_smack=auto])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poetteringif test "x${have_xattr}" = xno; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering if test "x${have_smack}" = xyes; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AC_MSG_ERROR(SMACK requires xattr support)
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering if test "x${have_smack}" = xauto; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering have_smack=yes
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAC_ARG_WITH(smack-run-label,
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAS_HELP_STRING([--with-smack-run-label=STRING],
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [run systemd --system with a specific SMACK label]),
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [AC_DEFINE_UNQUOTED(SMACK_RUN_LABEL, ["$withval"], [Run with a smack label])],
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poetteringif test "x${have_smack}" = xyes ; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AC_DEFINE(HAVE_SMACK, 1, [Define if SMACK is available])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering# ------------------------------------------------------------------------------
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAC_ARG_ENABLE([gcrypt],
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AS_HELP_STRING([--disable-gcrypt],[Disable optional GCRYPT support]),
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [case "${enableval}" in
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering yes) have_gcrypt=yes ;;
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering no) have_gcrypt=no ;;
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering *) AC_MSG_ERROR(bad value ${enableval} for --disable-gcrypt) ;;
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [have_gcrypt=auto])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poetteringif test "x${have_gcrypt}" != xno ; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AM_PATH_LIBGCRYPT(
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [have_gcrypt=yes],
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [if test "x$have_gcrypt" = xyes ; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AC_MSG_ERROR([*** GCRYPT headers not found.])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering if test "x$have_gcrypt" = xyes ; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering GCRYPT_LIBS="$LIBGCRYPT_LIBS"
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering GCRYPT_CFLAGS="$LIBGCRYPT_CFLAGS"
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AC_DEFINE(HAVE_GCRYPT, 1, [GCRYPT available])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering have_gcrypt=no
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering GCRYPT_CFLAGS=
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAC_SUBST(GCRYPT_LIBS)
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAC_SUBST(GCRYPT_CFLAGS)
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAM_CONDITIONAL([HAVE_GCRYPT], [test "x$have_gcrypt" != xno])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering# ------------------------------------------------------------------------------
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAC_ARG_ENABLE([audit],
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AS_HELP_STRING([--disable-audit],[Disable optional AUDIT support]),
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [case "${enableval}" in
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering yes) have_audit=yes ;;
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering no) have_audit=no ;;
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering *) AC_MSG_ERROR(bad value ${enableval} for --disable-audit) ;;
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [have_audit=auto])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poetteringif test "x${have_audit}" != xno ; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AC_CHECK_HEADERS(
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [have_audit=yes],
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [if test "x$have_audit" = xyes ; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AC_MSG_ERROR([*** AUDIT headers not found.])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [have_audit=yes],
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [if test "x$have_audit" = xyes ; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AC_MSG_ERROR([*** libaudit not found.])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering if test "x$have_audit" = xyes ; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AUDIT_LIBS="-laudit"
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AC_DEFINE(HAVE_AUDIT, 1, [AUDIT available])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAC_SUBST(AUDIT_LIBS)
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering# ------------------------------------------------------------------------------
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poetteringhave_libcryptsetup=no
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAC_ARG_ENABLE(libcryptsetup, AS_HELP_STRING([--disable-libcryptsetup], [disable libcryptsetup tools]))
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poetteringif test "x$enable_libcryptsetup" != "xno"; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering PKG_CHECK_MODULES(LIBCRYPTSETUP, [ libcryptsetup >= 1.6.0 ],
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [AC_DEFINE(HAVE_LIBCRYPTSETUP, 1, [Define if libcryptsetup is available]) have_libcryptsetup=yes], have_libcryptsetup=no)
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering if test "x$have_libcryptsetup" = xno -a "x$enable_libcryptsetup" = xyes; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AC_MSG_ERROR([*** libcryptsetup support requested but libraries not found])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAM_CONDITIONAL(HAVE_LIBCRYPTSETUP, [test "$have_libcryptsetup" = "yes"])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering# ------------------------------------------------------------------------------
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poetteringhave_qrencode=no
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAC_ARG_ENABLE(qrencode, AS_HELP_STRING([--disable-qrencode], [disable qrencode support]))
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poetteringif test "x$enable_qrencode" != "xno"; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering PKG_CHECK_MODULES(QRENCODE, [ libqrencode ],
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [AC_DEFINE(HAVE_QRENCODE, 1, [Define if qrencode is available]) have_qrencode=yes], have_qrencode=no)
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering if test "x$have_qrencode" = xno -a "x$enable_qrencode" = xyes; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AC_MSG_ERROR([*** qrencode support requested but libraries not found])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAM_CONDITIONAL(HAVE_QRENCODE, [test "$have_qrencode" = "yes"])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering# ------------------------------------------------------------------------------
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poetteringhave_microhttpd=no
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAC_ARG_ENABLE(microhttpd, AS_HELP_STRING([--disable-microhttpd], [disable microhttpd support]))
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poetteringif test "x$enable_microhttpd" != "xno"; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering PKG_CHECK_MODULES(MICROHTTPD, [libmicrohttpd >= 0.9.5],
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering [AC_DEFINE(HAVE_MICROHTTPD, 1, [Define if microhttpd is available]) have_microhttpd=yes], have_microhttpd=no)
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering if test "x$have_microhttpd" = xno -a "x$enable_microhttpd" = xyes; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering AC_MSG_ERROR([*** microhttpd support requested but libraries not found])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAM_CONDITIONAL(HAVE_MICROHTTPD, [test "$have_microhttpd" = "yes"])
c077529ba6852192c464772ce907670850210dfeLennart Poettering# ------------------------------------------------------------------------------
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAC_ARG_ENABLE(binfmt, AS_HELP_STRING([--disable-binfmt], [disable binfmt tool]))
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poetteringif test "x$enable_binfmt" != "xno"; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering have_binfmt=yes
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAM_CONDITIONAL(ENABLE_BINFMT, [test "$have_binfmt" = "yes"])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering# ------------------------------------------------------------------------------
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poetteringhave_vconsole=no
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAC_ARG_ENABLE(vconsole, AS_HELP_STRING([--disable-vconsole], [disable vconsole tool]))
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poetteringif test "x$enable_vconsole" != "xno"; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering have_vconsole=yes
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAM_CONDITIONAL(ENABLE_VCONSOLE, [test "$have_vconsole" = "yes"])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering# ------------------------------------------------------------------------------
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poetteringhave_readahead=no
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAC_ARG_ENABLE(readahead, AS_HELP_STRING([--disable-readahead], [disable readahead tools]))
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poetteringif test "x$enable_readahead" != "xno"; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering have_readahead=yes
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAM_CONDITIONAL(ENABLE_READAHEAD, [test "$have_readahead" = "yes"])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering# ------------------------------------------------------------------------------
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poetteringhave_bootchart=no
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAC_ARG_ENABLE(bootchart, AS_HELP_STRING([--disable-bootchart], [disable bootchart tool]))
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poetteringif test "x$enable_bootchart" != "xno"; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering have_bootchart=yes
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAM_CONDITIONAL(ENABLE_BOOTCHART, [test "$have_bootchart" = "yes"])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering# ------------------------------------------------------------------------------
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poetteringhave_quotacheck=no
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAC_ARG_ENABLE(quotacheck, AS_HELP_STRING([--disable-quotacheck], [disable quotacheck tools]))
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poetteringif test "x$enable_quotacheck" != "xno"; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering have_quotacheck=yes
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAM_CONDITIONAL(ENABLE_QUOTACHECK, [test "$have_quotacheck" = "yes"])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering# ------------------------------------------------------------------------------
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poetteringhave_tmpfiles=no
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAC_ARG_ENABLE(tmpfiles, AS_HELP_STRING([--disable-tmpfiles], [disable tmpfiles support]))
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poetteringif test "x$enable_tmpfiles" != "xno"; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering have_tmpfiles=yes
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAM_CONDITIONAL(ENABLE_TMPFILES, [test "$have_tmpfiles" = "yes"])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering# ------------------------------------------------------------------------------
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poetteringhave_randomseed=no
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAC_ARG_ENABLE(randomseed, AS_HELP_STRING([--disable-randomseed], [disable randomseed tools]))
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poetteringif test "x$enable_randomseed" != "xno"; then
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering have_randomseed=yes
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAM_CONDITIONAL(ENABLE_RANDOMSEED, [test "$have_randomseed" = "yes"])
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering# ------------------------------------------------------------------------------
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poetteringhave_backlight=no
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart PoetteringAC_ARG_ENABLE(backlight, AS_HELP_STRING([--disable-backlight], [disable backlight tools]))
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poetteringif test "x$enable_backlight" != "xno"; then
AS_IF([test "$have_machined" = "yes"], [ AC_DEFINE(HAVE_MACHINED, [1], [Machined support available]) ])
[Path to /etc/rc.local]),
[RC_LOCAL_SCRIPT_PATH_START="/etc/rc.local"])
[Path to /usr/sbin/halt.local]),
[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])
[KBD_LOADKEYS="/usr/bin/loadkeys"])
[KBD_SETFONT="/usr/bin/setfont"])
[TELINIT="/lib/sysvinit/telinit"])
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_CHECK_FUNCS([gethostbyaddr gethostbyname gettimeofday inet_ntoa memset select socket strcspn strdup strerror strncasecmp strcasecmp strspn])
AS_IF([test "x${FIRMWARE_PATH}" != "x"], [ AC_DEFINE(HAVE_FIRMWARE, 1, [Define if FIRMWARE is available]) ])
AS_IF([test "x$enable_gudev" = "xyes"], [ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0 gio-2.0]) ])
SYSTEM_SYSVINIT_PATH=/etc/init.d
SYSTEM_SYSVRCND_PATH=/etc/rc.d
[Specify the path to the base directory for the SysV rcN.d directories])],
AC_DEFINE(HAVE_SYSV_COMPAT, [], [SysV init scripts and rcN.d links are supported.])
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.])
[with_dbuspolicydir=$($PKG_CONFIG --variable=sysconfdir dbus-1)/dbus-1/system.d])
[with_dbussystemservicedir=$(readlink -m $($PKG_CONFIG --variable=session_bus_services_dir dbus-1)/../system-services)])
[with_dbusinterfacedir=$(readlink -m $($PKG_CONFIG --variable=session_bus_services_dir dbus-1)/../interfaces)])
with_bashcompletiondir=${datadir}/bash-completion/completions
[], [with_zshcompletiondir=${datadir}/zsh/site-functions])
AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
[with_pamconfdir=${sysconfdir}/pam.d])
AM_CONDITIONAL([ENABLE_GTK_DOC_TESTS], [test "x$0" = "x./configure"],
AS_IF([test "x$0" != "x./configure"], [
AC_SUBST([INTLTOOL_UPDATE], [/bin/true])
Makefile po/Makefile.in