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