configure.ac revision b5e6a3768c8d8d79f367439e08aa8d7f1183be2d
45312f52ff3a3d4c137447be4c7556500c2f8bf2Timo Sirainen# -*- Autoconf -*-
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Process this file with autoconf to produce a configure script.
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenm4_define([lxc_version_major], 2)
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenm4_define([lxc_version_minor], 0)
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenm4_define([lxc_version_micro], 0)
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenm4_define([lxc_version_beta], rc5)
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenm4_define([lxc_version_abi], 1.2.0)
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenm4_define([lxc_version_base], [lxc_version_major.lxc_version_minor.lxc_version_micro])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenm4_define([lxc_version],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [ifelse(lxc_version_beta, [], [lxc_version_base], [lxc_version_base.lxc_version_beta])])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_INIT([lxc], [lxc_version])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# We need pkg-config
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenPKG_PROG_PKG_CONFIG
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_SUBST(LXC_VERSION_BASE, lxc_version_base)
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_SUBST(LXC_VERSION_BETA, lxc_version_beta)
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_SUBST([LXC_VERSION_MAJOR], [lxc_version_major])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_SUBST([LXC_VERSION_MINOR], [lxc_version_minor])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_SUBST([LXC_VERSION_MICRO], [lxc_version_micro])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_SUBST([LXC_VERSION_ABI], [lxc_version_abi])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_SUBST([LXC_VERSION], [lxc_version])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_CONFIG_SRCDIR([configure.ac])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_CONFIG_AUX_DIR([config])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_CONFIG_HEADERS([src/config.h])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability subdir-objects])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_CANONICAL_HOST
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_PROG_CC_C_O
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Detect the distribution. This is used for the default configuration and
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# for some distro-specific build options.
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_MSG_CHECKING([host distribution])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, oracle, centos, fedora, suse, gentoo, debian, arch, slackware, plamo, paldo, openmandriva, pardus, sparclinux.]))
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenif type lsb_release >/dev/null 2>&1 && test "z$with_distro" = "z"; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen with_distro=`lsb_release -is`
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenif test "z$with_distro" = "z"; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat")
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_CHECK_FILE(/etc/oracle-release,with_distro="oracle")
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_CHECK_FILE(/etc/sparclinux-release,with_distro="sparclinux")
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_CHECK_FILE(/etc/centos-release,with_distro="centos")
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_CHECK_FILE(/etc/fedora-release,with_distro="fedora")
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_CHECK_FILE(/etc/gentoo-release,with_distro="gentoo")
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_CHECK_FILE(/etc/debian_version,with_distro="debian")
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_CHECK_FILE(/etc/arch-release,with_distro="arch")
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware")
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_CHECK_FILE(/etc/plamo-version,with_distro="plamo")
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_CHECK_FILE(/etc/frugalware-release,with_distro="frugalware")
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_CHECK_FILE(/etc/mandrakelinux-release, with_distro="openmandriva")
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_CHECK_FILE(/etc/mandriva-release,with_distro="openmandriva")
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_CHECK_FILE(/etc/pardus-release,with_distro="pardus")
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenwith_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]'`
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenif test "z$with_distro" = "zforsparc"; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen with_distro="sparclinux"
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenif test "z$with_distro" = "z"; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen with_distro="unknown"
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainencase $with_distro in
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen ubuntu|raspbian)
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen distrosysconf="$sysconfdir/default"
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen redhat|centos|fedora|oracle|oracleserver|sparclinux|suse|opensuse*|plamo)
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen distrosysconf="$sysconfdir/default"
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_MSG_RESULT([$with_distro])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_CONDITIONAL([HAVE_DEBIAN], [test x"$with_distro" = "xdebian" -o x"$with_distro" = "xubuntu" -o x"$with_distro" = "xraspbian"])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_CONDITIONAL([DISTRO_UBUNTU], [test "x$with_distro" = "xubuntu"])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_CONFIG_LINKS([config/etc/default.conf:config/etc/${distroconf}])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Check for init system type
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_MSG_CHECKING([for init system type])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_ARG_WITH([init-script],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_HELP_STRING([--with-init-script@<:@=TYPE@<:@,TYPE,...@:>@@:>@],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [Type(s) of init script to install: sysvinit, systemd, upstart,
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen distro @<:@default=distro@:>@])],[],[with_init_script=distro])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainencase "$with_init_script" in
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen case $with_distro in
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen fedora|opensuse*)
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen init_script=systemd
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen redhat|centos|oracle|oracleserver|sparclinux|plamo)
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen init_script=sysvinit
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen debian|raspbian)
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen init_script=upstart,systemd
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen init_script=upstart,systemd
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen echo -n "Linux distribution init system unknown."
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen init_script=$with_init_script
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Check valid init systems were given, run in subshell so we don't mess up IFS
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen(IFS="," ; for init_sys in $init_script;
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen case "$init_sys" in
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen none|sysvinit|systemd|upstart)
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainendone) || AC_MSG_ERROR([Unknown init system type in $init_script])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_CONDITIONAL([INIT_SCRIPT_SYSV], [echo "$init_script" |grep -q "sysvinit"])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_CONDITIONAL([INIT_SCRIPT_SYSTEMD], [echo "$init_script" |grep -q "systemd"])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_CONDITIONAL([INIT_SCRIPT_UPSTART], [echo "$init_script" |grep -q "upstart"])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_MSG_RESULT($init_script)
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# systemd unit dir
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_ARG_WITH([systemdsystemunitdir],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenif test -z "$with_systemdsystemunitdir"; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen with_systemdsystemunitdir=/lib/systemd/system
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenif test "x$with_systemdsystemunitdir" != "xno"; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_SUBST([SYSTEMD_UNIT_DIR], [$with_systemdsystemunitdir])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Allow enabling deprecated executables
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_ARG_ENABLE([deprecated],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_HELP_STRING([--enable-deprecated],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [enable deprecated executables [default=no]])],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [], [enable_deprecated=false])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_CONDITIONAL([ENABLE_DEPRECATED], [test "x$enable_deprecated" = "xyes"])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Allow disabling rpath
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_ARG_ENABLE([rpath],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_HELP_STRING([--enable-rpath], [set rpath in executables [default=no]])],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [], [enable_rpath=no])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_CONDITIONAL([ENABLE_RPATH], [test "x$enable_rpath" = "xyes"])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Documentation (manpages)
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_ARG_ENABLE([doc],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_HELP_STRING([--enable-doc], [make man pages [default=auto]])],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [], [enable_doc=auto])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenif test "x$enable_doc" = "xyes" -o "x$enable_doc" = "xauto"; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen dbparsers="docbook2x-man db2x_docbook2man docbook2man docbook-to-man"
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_MSG_CHECKING(for docbook2x-man)
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen for name in ${dbparsers}; do
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen if "$name" --help >/dev/null 2>&1; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen db2xman="$name"
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen if test -n "${db2xman}"; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_MSG_RESULT([${db2xman}])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen enable_doc="yes"
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_MSG_RESULT([no])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen if test "x$enable_doc" = "xyes"; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_MSG_ERROR([docbook2x-man is required, but could not be found])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen enable_doc="no"
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_SUBST(db2xman)
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_CONDITIONAL([ENABLE_DOCBOOK], [test "x$db2xman" != "x"])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_CONDITIONAL([USE_DOCBOOK2X], [test "x$db2xman" != "xdocbook2man"])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenif test "x$db2xman" = "xdocbook2man"; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen docdtd="\"-//Davenport//DTD DocBook V3.0//EN\""
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen docdtd="\"-//OASIS//DTD DocBook XML\" \"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd\""
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_SUBST(docdtd)
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Documentation (API)
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_ARG_ENABLE([api-docs],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_HELP_STRING([--enable-api-docs],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [make API documentation [default=auto]])],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [], [enable_api_docs=auto])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenif test "x$enable_api_docs" = "xyes" -o "x$enable_api_docs" = "xauto"; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_CHECK_PROGS([HAVE_DOXYGEN],[doxygen])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_SUBST([HAVE_DOXYGEN])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen if test "x$HAVE_DOXYGEN" != "x"; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen enable_api_docs="yes"
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen if test "x$enable_api_docs" = "xyes"; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_MSG_ERROR([doxygen is required, but could not be found])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen enable_api_docs="no"
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_CONDITIONAL([ENABLE_API_DOCS], [test "x$HAVE_DOXYGEN" != "x"])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_ARG_ENABLE([apparmor],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_HELP_STRING([--enable-apparmor], [enable apparmor support [default=auto]])],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [], [enable_apparmor=auto])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenif test "$enable_apparmor" = "auto" ; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_CHECK_LIB([apparmor],[aa_change_profile],[enable_apparmor=yes], [enable_apparmor=no])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_CONDITIONAL([ENABLE_APPARMOR], [test "x$enable_apparmor" = "xyes"])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_CHECK_LIB([gnutls], [gnutls_hash_fast], [enable_gnutls=yes], [enable_gnutls=no])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_COND_IF([ENABLE_APPARMOR],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_CHECK_HEADER([sys/apparmor.h],[],[AC_MSG_ERROR([You must install the AppArmor development package in order to compile lxc])])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_CHECK_LIB([apparmor], [aa_change_profile],[],[AC_MSG_ERROR([You must install the AppArmor development package in order to compile lxc])])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_SUBST([APPARMOR_LIBS], [-lapparmor])])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_ARG_ENABLE([selinux],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_HELP_STRING([--enable-selinux], [enable SELinux support [default=auto]])],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [], [enable_selinux=auto])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenif test "x$enable_selinux" = xauto; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_CHECK_LIB([selinux],[setexeccon_raw],[enable_selinux=yes],[enable_selinux=no])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_CONDITIONAL([ENABLE_SELINUX], [test "x$enable_selinux" = "xyes"])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_COND_IF([ENABLE_SELINUX],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_CHECK_HEADER([selinux/selinux.h],[],[AC_MSG_ERROR([You must install the SELinux development package in order to compile lxc])])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_CHECK_LIB([selinux], [setexeccon_raw],[true],[AC_MSG_ERROR([You must install the SELinux development package in order to compile lxc])])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_SUBST([SELINUX_LIBS], [-lselinux])])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Seccomp syscall filter
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_ARG_ENABLE([seccomp],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_HELP_STRING([--enable-seccomp], [enable seccomp support [default=auto]])],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [], [enable_seccomp=auto])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenif test "x$enable_seccomp" = "xauto" ; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_CHECK_LIB([seccomp],[seccomp_init],[enable_seccomp=yes],[enable_seccomp=no])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_CONDITIONAL([ENABLE_SECCOMP], [test "x$enable_seccomp" = "xyes"])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_COND_IF([ENABLE_SECCOMP],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [PKG_CHECK_MODULES([SECCOMP],[libseccomp],[],[
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_CHECK_HEADER([seccomp.h],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_CHECK_LIB([seccomp], [seccomp_init],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_SUBST([SECCOMP_LIBS], [-lseccomp])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_ARG_ENABLE([cgmanager],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_HELP_STRING([--enable-cgmanager], [enable cgmanager support [default=auto]])],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [], [enable_cgmanager=auto])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenif test "x$enable_cgmanager" = "xauto" ; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_CHECK_LIB([cgmanager],[cgmanager_create],[enable_cgmanager=yes],[enable_cgmanager=no],[-lnih -lnih-dbus -ldbus-1])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_CONDITIONAL([ENABLE_CGMANAGER], [test "x$enable_cgmanager" = "xyes"])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_COND_IF([ENABLE_CGMANAGER],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [PKG_CHECK_MODULES([CGMANAGER], [libcgmanager])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen PKG_CHECK_MODULES([NIH], [libnih >= 1.0.2])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen PKG_CHECK_MODULES([NIH_DBUS], [libnih-dbus >= 1.0.0])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen PKG_CHECK_MODULES([DBUS], [dbus-1 >= 1.2.16])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_MSG_CHECKING(for get_pid_cgroup_abs_sync)
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainensave_LIBS=$LIBS
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_SEARCH_LIBS([cgmanager_get_pid_cgroup_abs_sync], [cgmanager], [have_abs_cgroups=yes], [have_abs_cgroups=no], [-lnih -lnih-dbus -ldbus-1])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenLIBS=$save_LIBS
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenif test "x$have_abs_cgroups" = "xyes"; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_DEFINE([HAVE_CGMANAGER_GET_PID_CGROUP_ABS_SYNC], 1, [Have cgmanager_get_pid_cgroup_abs_sync])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_MSG_RESULT([yes])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_MSG_RESULT([no])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_MSG_CHECKING(for cgmanager_list_controllers)
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainensave_LIBS=$LIBS
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_SEARCH_LIBS([cgmanager_list_controllers_sync], [cgmanager], [have_list_controllers=yes], [have_list_controllers=no], [-lnih -lnih-dbus -ldbus-1])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenLIBS=$save_LIBS
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenif test "x$have_list_controllers" = "xyes"; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_DEFINE([HAVE_CGMANAGER_LIST_CONTROLLERS], 1, [Have cgmanager_list_controllers])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_MSG_RESULT([yes])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_MSG_RESULT([no])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Check for static libcap, make sure the function checked for differs from the
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# the one checked below so the cache doesn't give a wrong answer
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenOLD_CFLAGS="$CFLAGS"
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenCFLAGS="$CFLAGS -static"
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_CHECK_LIB([cap],[cap_init],[have_static_libcap=yes],[have_static_libcap=no])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_CONDITIONAL([HAVE_STATIC_LIBCAP], [test "x$have_static_libcap" = "xyes"])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenif test "x$have_static_libcap" = "xyes"; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_DEFINE([HAVE_STATIC_LIBCAP], 1, [Have static libcap])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenCFLAGS="$OLD_CFLAGS"
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Linux capabilities
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_ARG_ENABLE([capabilities],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_HELP_STRING([--enable-capabilities], [enable kernel capabilities support [default=auto]])],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [], [enable_capabilities=auto])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenif test "x$enable_capabilities" = "xauto"; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_CHECK_LIB([cap],[cap_set_proc],[enable_capabilities=yes],[enable_capabilities=no])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_CONDITIONAL([ENABLE_CAP], [test "x$enable_capabilities" = "xyes"])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_COND_IF([ENABLE_CAP],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_CHECK_LIB(cap,cap_set_proc,[true],[AC_MSG_ERROR([You are missing libcap support.])])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_SUBST([CAP_LIBS], [-lcap])])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# HAVE_SCMP_FILTER_CTX=1 will tell us we have libseccomp api >= 1.0.0
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenOLD_CFLAGS="$CFLAGS"
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenCFLAGS="$CFLAGS $SECCOMP_CFLAGS"
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_CHECK_TYPES([scmp_filter_ctx], [], [], [[#include <seccomp.h>]])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_CHECK_DECLS([seccomp_syscall_resolve_name_arch], [], [], [[#include <seccomp.h>]])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenCFLAGS="$OLD_CFLAGS"
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Configuration examples
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_ARG_ENABLE([examples],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_HELP_STRING([--enable-examples], [install examples [default=yes]])],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [], [enable_examples=yes])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" = "xyes"])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Python3 module and scripts
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_ARG_ENABLE([python],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_HELP_STRING([--enable-python], [enable python binding [default=auto]])],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [], [enable_python=auto])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenif test "x$enable_python" = "xauto"; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen PKG_CHECK_MODULES([PYTHONDEV], [python3 >= 3.2],[enable_python=yes],[enable_python=no])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen if test "$CC" = "clang"; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen enable_python=no
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenif test "x$enable_python" = "xyes" && test "$CC" = "clang"; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_MSG_ERROR([Python3 is incompatible with the clang compiler])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_CONDITIONAL([ENABLE_PYTHON], [test "x$enable_python" = "xyes"])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_COND_IF([ENABLE_PYTHON],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AM_PATH_PYTHON([3.2], [], [AC_MSG_ERROR([You must install python3])])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen PKG_CHECK_MODULES([PYTHONDEV], [python3 >= 3.2],[],[AC_MSG_ERROR([You must install python3-dev])])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_DEFINE_UNQUOTED([ENABLE_PYTHON], 1, [Python3 is available])])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Enable dumping stack traces
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_ARG_ENABLE([mutex-debugging],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_HELP_STRING([--enable-mutex-debugging], [Makes mutexes to report error and provide stack trace [default=no]])],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [], [enable_mutex_debugging=no])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_CONDITIONAL([MUTEX_DEBUGGING], [test "x$enable_mutex_debugging" = "xyes"])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_COND_IF([MUTEX_DEBUGGING],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_DEFINE_UNQUOTED([MUTEX_DEBUGGING], 1, [Enabling mutex debugging]))
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Not in older autoconf versions
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# AS_VAR_COPY(DEST, SOURCE)
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# -------------------------
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Set the polymorphic shell variable DEST to the contents of the polymorphic
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# shell variable SOURCE.
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenm4_ifdef([AS_VAR_COPY], [],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen[AC_DEFUN([AS_VAR_COPY],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainendnl PKG_CHECK_VAR was introduced with pkg-config 0.28
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenm4_ifdef([PKG_CHECK_VAR], [],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen[AC_DEFUN([PKG_CHECK_VAR],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen _PKG_CONFIG([$1], [variable="][$3]["], [$2])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AS_VAR_COPY([$1], [pkg_cv_][$1])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AS_VAR_IF([$1], [""], [$5], [$4])dnl
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen ])# PKG_CHECK_VAR
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Lua module and scripts
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_ARG_ENABLE([lua],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_HELP_STRING([--enable-lua], [enable lua binding [default=auto]])],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [], [enable_lua=auto])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_ARG_WITH([lua-pc],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AS_HELP_STRING(
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [--with-lua-pc=PKG],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [Specify pkg-config package name for lua]
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen )], [], [with_lua_pc=no])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenif test "x$enable_lua" = "xyes" -a "x$with_lua_pc" != "xno"; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen # exit with error if not found
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen PKG_CHECK_MODULES([LUA], [$with_lua_pc], [LUAPKGCONFIG=$with_lua_pc])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenif test "x$enable_lua" = "xauto" -a "x$with_lua_pc" != "xno"; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen PKG_CHECK_MODULES([LUA], [$with_lua_pc],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [LUAPKGCONFIG=$with_lua_pc
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen enable_lua=yes],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [enable_lua=no])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenif test "x$enable_lua" != "xno"; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen PKG_CHECK_MODULES([LUA], [lua], [LUAPKGCONFIG=lua],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [PKG_CHECK_MODULES([LUA], [lua5.2], [LUAPKGCONFIG=lua5.2],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [PKG_CHECK_MODULES([LUA], [lua5.1], [LUAPKGCONFIG=lua5.1],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AS_IF([test "x$enable_lua" = "xyes"],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_MSG_ERROR([Lua not found. Please use --with-lua-pc=PKG])],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [enable_lua=no])]
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AS_IF([test "x$LUAPKGCONFIG" != "x"], [enable_lua=yes])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_CONDITIONAL([ENABLE_LUA],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [test "x$enable_lua" = "xyes"])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_COND_IF([ENABLE_LUA],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_MSG_CHECKING([Lua version])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen PKG_CHECK_VAR([LUA_VERSION], [$LUAPKGCONFIG], [V],,
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [PKG_CHECK_VAR([LUA_VERSION], [$LUAPKGCONFIG], [major_version])])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_MSG_RESULT([$LUA_VERSION])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_SUBST([LUA_LIBDIR], [$libdir/lua/$LUA_VERSION])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_SUBST([LUA_SHAREDIR], [$datadir/lua/$LUA_VERSION])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Optional bash integration
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_ARG_ENABLE([bash],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_HELP_STRING([--enable-bash], [build bash integration [default=yes]])],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [], [enable_bash=yes])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_CONDITIONAL([ENABLE_BASH], [test "x$enable_bash" = "xyes"])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Optional test binaries
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_ARG_ENABLE([tests],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_HELP_STRING([--enable-tests], [build test/example binaries [default=no]])],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [], [enable_tests=no])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_CONDITIONAL([ENABLE_TESTS], [test "x$enable_tests" = "xyes"])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Allow overriding the default runtime dir (/run)
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_ARG_WITH([runtime-path],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_HELP_STRING(
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [--with-runtime-path=dir],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [runtime directory (default: /run)]
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen )], [], [with_runtime_path=['/run']])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# LXC container path, where the containers are actually stored
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# This is overridden by an entry in the file called LXCCONF
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_ARG_WITH([config-path],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_HELP_STRING(
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [--with-config-path=dir],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [lxc configuration repository path]
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen )], [], [with_config_path=['${localstatedir}/lib/lxc']])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# The path of the global lxc configuration file.
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_ARG_WITH([global-conf],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_HELP_STRING(
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [--with-global-conf=dir],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [global lxc configuration file]
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen )], [], [with_global_conf=['${sysconfdir}/lxc/lxc.conf']])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# The path of the userns network configuration file
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_ARG_WITH([usernic-conf],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_HELP_STRING(
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [--with-usernic-conf],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [user network interface configuration file]
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen )], [], [with_usernic_conf=['${sysconfdir}/lxc/lxc-usernet']])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# The path of the runtime usernic database
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_ARG_WITH([usernic-db],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_HELP_STRING(
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [--with-usernic-db],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [lxc user nic database]
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen )], [], [with_usernic_db=['${with_runtime_path}/lxc/nics']])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Rootfs path, where the container mount structure is assembled
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_ARG_WITH([rootfs-path],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_HELP_STRING(
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [--with-rootfs-path=dir],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [lxc rootfs mount point]
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen )], [], [with_rootfs_path=['${libdir}/lxc/rootfs']])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# cgroup pattern specification
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_ARG_WITH([cgroup-pattern],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_HELP_STRING(
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [--with-cgroup-pattern=pattern],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [pattern for container cgroups]
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen )], [], [with_cgroup_pattern=['/lxc/%n']])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Container log path. By default, use $lxcpath.
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_MSG_CHECKING([Whether to place logfiles in container config path])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_ARG_ENABLE([configpath-log],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_HELP_STRING([--enable-configpath-log], [use logfiles in config path [default=no]])],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [], [enable_configpath_log=no])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_MSG_RESULT([$enable_configpath_log])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_CONDITIONAL([USE_CONFIGPATH_LOGS], [test "$enable_configpath_log" = "yes"])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenif test "$enable_configpath_log" = "yes"; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen default_log_path="${with_config_path}"
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen default_log_path="${localstatedir}/log/lxc"
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_ARG_WITH([log-path],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [AC_HELP_STRING(
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [--with-log-path=dir],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [per container log path]
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen )], [], [with_log_path=['${default_log_path}']])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Expand some useful variables
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAS_AC_EXPAND(PREFIX, "$prefix")
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAS_AC_EXPAND(LIBDIR, "$libdir")
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAS_AC_EXPAND(BINDIR, "$bindir")
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAS_AC_EXPAND(SBINDIR, "$sbindir")
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAS_AC_EXPAND(LIBEXECDIR, "$libexecdir")
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAS_AC_EXPAND(INCLUDEDIR, "$includedir")
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAS_AC_EXPAND(SYSCONFDIR, "$sysconfdir")
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAS_AC_EXPAND(LXC_DEFAULT_CONFIG, "$sysconfdir/lxc/default.conf")
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAS_AC_EXPAND(DATADIR, "$datadir")
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAS_AC_EXPAND(LOCALSTATEDIR, "$localstatedir")
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAS_AC_EXPAND(DOCDIR, "$docdir")
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAS_AC_EXPAND(LXCPATH, "$with_config_path")
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAS_AC_EXPAND(LXC_GLOBAL_CONF, "$with_global_conf")
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAS_AC_EXPAND(LXC_USERNIC_CONF, "$with_usernic_conf")
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAS_AC_EXPAND(LXC_USERNIC_DB, "$with_usernic_db")
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAS_AC_EXPAND(LXC_DISTRO_SYSCONF, "$distrosysconf")
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAS_AC_EXPAND(LXCROOTFSMOUNT, "$with_rootfs_path")
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAS_AC_EXPAND(LXCTEMPLATEDIR, "$datadir/lxc/templates")
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAS_AC_EXPAND(LXCTEMPLATECONFIG, "$datadir/lxc/config")
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAS_AC_EXPAND(LXCHOOKDIR, "$datadir/lxc/hooks")
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAS_AC_EXPAND(LXCBINHOOKDIR, "$libexecdir/lxc/hooks")
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAS_AC_EXPAND(LXCINITDIR, "$libexecdir")
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAS_AC_EXPAND(LOGPATH, "$with_log_path")
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAS_AC_EXPAND(RUNTIME_PATH, "$with_runtime_path")
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_SUBST(DEFAULT_CGROUP_PATTERN, ["$with_cgroup_pattern"])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# We need the install path so criu knows where to reference the hook scripts.
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_DEFINE_UNQUOTED([DATADIR], "$DATADIR", ["Prefix for shared files."])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Check for some standard kernel headers
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_CHECK_HEADERS([linux/unistd.h linux/netlink.h linux/genetlink.h],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_MSG_ERROR([Please install the Linux kernel headers.]),
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Check for alternate C libraries
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_MSG_CHECKING(for bionic libc)
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_COMPILE_IFELSE([AC_LANG_PROGRAM(
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [[#ifndef __ANDROID__
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenerror: Not bionic!
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [is_bionic=yes],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen [is_bionic=no])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenif test "x$is_bionic" = "xyes"; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_DEFINE([IS_BIONIC], 1, [bionic libc])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_MSG_RESULT([yes])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_MSG_RESULT([no])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAM_CONDITIONAL([IS_BIONIC], [test "x$is_bionic" = "xyes"])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Check for some headers
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_CHECK_HEADERS([sys/signalfd.h pty.h ifaddrs.h sys/capability.h sys/personality.h utmpx.h sys/timerfd.h])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Check for some syscalls functions
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_CHECK_FUNCS([setns pivot_root sethostname unshare rand_r confstr faccessat])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Check for some functions
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_CHECK_LIB(pthread, main)
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_CHECK_FUNCS(pthread_atfork)
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_CHECK_FUNCS(statvfs)
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_CHECK_LIB(util, openpty)
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_CHECK_FUNCS([openpty hasmntopt setmntent endmntent utmpxname])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_CHECK_FUNCS([getline],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AM_CONDITIONAL(HAVE_GETLINE, true)
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_DEFINE(HAVE_GETLINE,1,[Have getline]),
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AM_CONDITIONAL(HAVE_GETLINE, false))
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_CHECK_FUNCS([getsubopt],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AM_CONDITIONAL(HAVE_GETSUBOPT, true)
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_DEFINE(HAVE_GETSUBOPT,1,[Have getsubopt]),
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AM_CONDITIONAL(HAVE_GETSUBOPT, false))
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_CHECK_FUNCS([fgetln],
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AM_CONDITIONAL(HAVE_FGETLN, true)
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AC_DEFINE(HAVE_FGETLN,1,[Have fgetln]),
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen AM_CONDITIONAL(HAVE_FGETLN, false))
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Check for some libraries
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_SEARCH_LIBS(sem_open, [rt pthread])
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_SEARCH_LIBS(clock_gettime, [rt])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Check for some standard binaries
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_PROG_GCC_TRADITIONAL
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# See if we support thread-local storage.
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenif test "x$GCC" = "xyes"; then
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen CFLAGS="$CFLAGS -Wall -Werror"
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Files requiring some variable expansion
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_CONFIG_FILES([
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenAC_CONFIG_COMMANDS([default],[[]],[[]])
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen# Configuration overview
b6dff2ba7a4640c1c4fa8fcad5602d236c31a2e4Timo Sirainen----------------------------
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen - compiler: $CC
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen - distribution: $with_distro
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen - init script type(s): $init_script
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen - rpath: $enable_rpath
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen - GnuTLS: $enable_gnutls
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen - Bash integration: $enable_bash
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenSecurity features:
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen - Apparmor: $enable_apparmor
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen - Linux capabilities: $enable_capabilities
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen - seccomp: $enable_seccomp
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen - SELinux: $enable_selinux
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen - cgmanager: $enable_cgmanager
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen - lua: $enable_lua
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen - python3: $enable_python
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenDocumentation:
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen - examples: $enable_examples
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen - API documentation: $enable_api_docs
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen - user documentation: $enable_doc
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen - tests: $enable_tests
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen - mutex debugging: $enable_mutex_debugging
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen - Logs in configpath: $enable_configpath_log
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainenif test "x$ac_cv_func_pthread_atfork" = "xno" ; then
a914bff43644dd9b3977244203839ca74161e40cTimo SirainenWARNING: Threading not supported on your platform
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen You are compiling LXC for bionic target which lacks certain threading related functionality used by LXC API (like pthread_atfork).
a914bff43644dd9b3977244203839ca74161e40cTimo Sirainen Please note that, because of the missing functionality, multithreaded usage of LXC API cause some problems.