configure.ac revision b850b06e1efcc7e27cfd785759a3a913ac9ed196
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# This file is part of systemd.
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# Copyright 2010-2012 Lennart Poettering
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# Copyright 2010-2012 Kay Sievers
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# systemd is free software; you can redistribute it and/or modify it
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# under the terms of the GNU Lesser General Public License as published by
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# the Free Software Foundation; either version 2.1 of the License, or
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# (at your option) any later version.
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
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# Lesser General Public License for more details.
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart 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 PoetteringAC_PREREQ([2.64])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_INIT([systemd],
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering [http://bugs.freedesktop.org/enter_bug.cgi?product=systemd],
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering [http://www.freedesktop.org/wiki/Software/systemd])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_CONFIG_SRCDIR([src/core/main.c])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_CONFIG_MACRO_DIR([m4])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_CONFIG_HEADERS([config.h])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_CONFIG_AUX_DIR([build-aux])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_USE_SYSTEM_EXTENSIONS
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_SYS_LARGEFILE
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_PREFIX_DEFAULT([/usr])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAM_MAINTAINER_MODE([enable])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects check-news])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAM_SILENT_RULES([yes])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_CANONICAL_HOST
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [Canonical host string.])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAS_IF([test "x$host_cpu" = "xmips" || test "x$host_cpu" = "xmipsel" ||
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering test "x$host_cpu" = "xmips64" || test "x$host_cpu" = "xmips64el"],
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering [AC_DEFINE(ARCH_MIPS, [], [Whether on mips arch])])
ac8cfcf56c5d7b3eaeec64e94f6c4659e82a2b10Lennart PoetteringLT_INIT([disable-static])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAS_IF([test "x$enable_static" = "xyes"], [AC_MSG_ERROR([--enable-static is not supported by systemd])])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAS_IF([test "x$enable_largefile" = "xno"], [AC_MSG_ERROR([--disable-largefile is not supported by systemd])])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# i18n stuff for the PolicyKit policy files
b237ef2cfac7ab0b33170809e8cb64628606207dTollef Fog HeenIT_PROG_INTLTOOL([0.40.0])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringGETTEXT_PACKAGE=systemd
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_SUBST(GETTEXT_PACKAGE)
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_PROG_MKDIR_P
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_PROG_GCC_TRADITIONAL
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_PATH_PROG([M4], [m4])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_PATH_PROG([XSLTPROC], [xsltproc])
41160f3dbf0cb61e23a02338da1f289a2ff00066Maarten LankhorstAC_PATH_PROG([QUOTAON], [quotaon], [/usr/sbin/quotaon])
41160f3dbf0cb61e23a02338da1f289a2ff00066Maarten LankhorstAC_PATH_PROG([QUOTACHECK], [quotacheck], [/usr/sbin/quotacheck])
41160f3dbf0cb61e23a02338da1f289a2ff00066Maarten LankhorstAC_PATH_PROG([SETCAP], [setcap], [/usr/sbin/setcap])
41160f3dbf0cb61e23a02338da1f289a2ff00066Maarten LankhorstAC_PATH_PROG([KILL], [kill], [/usr/bin/kill])
41160f3dbf0cb61e23a02338da1f289a2ff00066Maarten LankhorstAC_PATH_PROG([KMOD], [kmod], [/usr/bin/kmod])
41160f3dbf0cb61e23a02338da1f289a2ff00066Maarten LankhorstAC_PATH_PROG([KEXEC], [kexec], [/usr/sbin/kexec])
41160f3dbf0cb61e23a02338da1f289a2ff00066Maarten Lankhorst# gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line
41160f3dbf0cb61e23a02338da1f289a2ff00066Maarten Lankhorstm4_ifdef([GTK_DOC_CHECK], [
41160f3dbf0cb61e23a02338da1f289a2ff00066Maarten LankhorstGTK_DOC_CHECK([1.18],[--flavour no-tmpl])],
41160f3dbf0cb61e23a02338da1f289a2ff00066Maarten Lankhorst [AM_CONDITIONAL([ENABLE_GTK_DOC], [false])
41160f3dbf0cb61e23a02338da1f289a2ff00066Maarten Lankhorst enable_gtk_doc=no])
8e27452380193a5f81bfd08a59aab8b07008ba0bLennart PoetteringAS_IF([test "x$enable_gtk_doc" = "xyes" -a "x$XSLTPROC" = x], [
8e27452380193a5f81bfd08a59aab8b07008ba0bLennart Poettering AC_MSG_ERROR([*** GTK doc requested but xsltproc not found])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poetteringm4_ifdef([GOBJECT_INTROSPECTION_CHECK], [
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart PoetteringGOBJECT_INTROSPECTION_CHECK([1.31.1])
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering AM_CONDITIONAL([HAVE_INTROSPECTION], [false])
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering enable_introspection=no])
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart PoetteringAC_CHECK_TOOL(STRINGS, strings)
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart PoetteringAC_CHECK_TOOL(GPERF, gperf)
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poetteringif test -z "$GPERF" ; then
d7c114c00030309435fc56c77c8578a25d228ebeDave Reisner AC_MSG_ERROR([*** gperf not found])
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering# ------------------------------------------------------------------------------
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poetteringaddress_sanitizer_cflags=
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poetteringaddress_sanitizer_cppflags=
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poetteringaddress_sanitizer_ldflags=
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart PoetteringAC_ARG_ENABLE(address-sanitizer, AS_HELP_STRING([--enable-address-sanitizer], [enable -fsanitize=address]))
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart PoetteringAS_IF([test "x$enable_address_sanitizer" = "xyes"], [
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering CC_CHECK_FLAG_APPEND([with_as_cflags], [CFLAGS], [-fsanitize=address])
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering AS_IF([test -z "$with_as_cflags"],
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering [AC_MSG_ERROR([*** -fsanitize=address is not supported])])
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering address_sanitizer_cflags="$with_as_cflags -fno-omit-frame-pointer -DVALGRIND=1"
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering address_sanitizer_cppflags="-DVALGRIND=1"
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering address_sanitizer_ldflags="-Wc,-fsanitize=address"
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart PoetteringCC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering "-Wformat=2 -Wformat-security -Wformat-nonliteral" \
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering -Wlogical-op \
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering -Wsign-compare \
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering -Wmissing-include-dirs \
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering -Wold-style-definition \
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering -Wpointer-arith \
d7c114c00030309435fc56c77c8578a25d228ebeDave Reisner -Wdeclaration-after-statement \
d7c114c00030309435fc56c77c8578a25d228ebeDave Reisner -Wfloat-equal \
d7c114c00030309435fc56c77c8578a25d228ebeDave Reisner -Wmissing-prototypes \
d7c114c00030309435fc56c77c8578a25d228ebeDave Reisner -Wstrict-prototypes \
d7c114c00030309435fc56c77c8578a25d228ebeDave Reisner -Wredundant-decls \
d7c114c00030309435fc56c77c8578a25d228ebeDave Reisner -Wmissing-declarations \
d7c114c00030309435fc56c77c8578a25d228ebeDave Reisner -Wmissing-noreturn \
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering -Wendif-labels \
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering -Wcast-align \
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering -Wstrict-aliasing=2 \
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering -Wwrite-strings \
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering -Wno-long-long \
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering -Wno-overlength-strings \
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering -Wno-unused-parameter \
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering -Wno-missing-field-initializers \
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering -Wno-unused-result \
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering -Werror=overflow \
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering -fdiagnostics-show-option \
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering -fdiagnostics-color \
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering -fno-strict-aliasing \
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering -fvisibility=hidden \
d7c114c00030309435fc56c77c8578a25d228ebeDave Reisner -ffunction-sections \
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering -fdata-sections \
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering -fstack-protector \
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering --param=ssp-buffer-size=4])
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart PoetteringAS_CASE([$CFLAGS], [*-O[[12345\ ]]*],
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering [AC_MSG_RESULT([skipping -flto, optimization not enabled])])
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart PoetteringAC_SUBST([OUR_CFLAGS], "$with_cflags $address_sanitizer_cflags")
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart PoetteringAS_CASE([$CFLAGS], [*-O[[12345\ ]]*],
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering -Wp,-D_FORTIFY_SOURCE=2])],
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering [AC_MSG_RESULT([skipping -D_FORTIFY_SOURCE, optimization not enabled])])
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart PoetteringAC_SUBST([OUR_CPPFLAGS], "$with_cppflags $address_sanitizer_cppflags")
[AS_HELP_STRING([--without-python], [Disable building the man page index and systemd-python (default: test)])])
[PYTHON_BINARY=/usr/bin/python])])
AC_ARG_ENABLE(python_devel, AS_HELP_STRING([--disable-python-devel], [Do not build python modules]))
AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
AC_CHECK_HEADERS([linux/btrfs.h], [], [])
AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at], [], [], [[#include <sys/types.h>
#include <unistd.h>
#include <sys/mount.h>
#include <fcntl.h>]])
# This makes sure pkg.m4 is available.
m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
AC_ARG_ENABLE([chkconfig], AS_HELP_STRING([--disable-chkconfig],[Disable optional chkconfig support]),
[DEBUGTTY=/dev/tty9])
[attr/xattr.h],
[libaudit.h],
AC_ARG_ENABLE(libcryptsetup, AS_HELP_STRING([--disable-libcryptsetup], [disable libcryptsetup tools]))
[AC_DEFINE(HAVE_LIBCRYPTSETUP, 1, [Define if libcryptsetup is available]) have_libcryptsetup=yes], have_libcryptsetup=no)
[AC_DEFINE(HAVE_QRENCODE, 1, [Define if qrencode is available]) have_qrencode=yes], have_qrencode=no)
[AC_DEFINE(HAVE_MICROHTTPD, 1, [Define if microhttpd is available]) have_microhttpd=yes], have_microhttpd=no)
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