configure.ac revision d79067a726f1b4a06828220cc11dd3cfbc244856
5f5870385cff47efd2f58e7892f251cf13761528Timo Sirainen# -*- Autoconf -*-
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainen# Process this file with autoconf to produce a configure script.
134582c78f038b4d9b9fde127399aefa50935a53Timo Sirainenm4_define([lxc_version_major], 1)
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainenm4_define([lxc_version_minor], 1)
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainenm4_define([lxc_version_micro], 0)
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainenm4_define([lxc_version_beta], [alpha1])
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainenm4_define([lxc_version_base], [lxc_version_major.lxc_version_minor.lxc_version_micro])
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainenm4_define([lxc_version],
134582c78f038b4d9b9fde127399aefa50935a53Timo Sirainen [ifelse(lxc_version_beta, [], [lxc_version_base], [lxc_version_base.lxc_version_beta])])
134582c78f038b4d9b9fde127399aefa50935a53Timo SirainenAC_INIT([lxc], [lxc_version])
134582c78f038b4d9b9fde127399aefa50935a53Timo Sirainen# We need pkg-config
134582c78f038b4d9b9fde127399aefa50935a53Timo SirainenPKG_PROG_PKG_CONFIG
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo SirainenAC_SUBST(LXC_VERSION_BASE, lxc_version_base)
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo SirainenAC_SUBST(LXC_VERSION_BETA, lxc_version_beta)
134582c78f038b4d9b9fde127399aefa50935a53Timo SirainenAC_SUBST([LXC_VERSION_MAJOR], [lxc_version_major])
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo SirainenAC_SUBST([LXC_VERSION_MINOR], [lxc_version_minor])
134582c78f038b4d9b9fde127399aefa50935a53Timo SirainenAC_SUBST([LXC_VERSION_MICRO], [lxc_version_micro])
134582c78f038b4d9b9fde127399aefa50935a53Timo SirainenAC_SUBST([LXC_VERSION], [lxc_version])
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo SirainenAC_CONFIG_SRCDIR([configure.ac])
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo SirainenAC_CONFIG_AUX_DIR([config])
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo SirainenAC_CONFIG_HEADERS([src/config.h])
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo SirainenAM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability subdir-objects])
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo SirainenAC_CANONICAL_HOST
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo SirainenAM_PROG_CC_C_O
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainen# Detect the distribution. This is used for the default configuration and
134582c78f038b4d9b9fde127399aefa50935a53Timo Sirainen# for some distro-specific build options.
134582c78f038b4d9b9fde127399aefa50935a53Timo SirainenAC_MSG_CHECKING([host distribution])
134582c78f038b4d9b9fde127399aefa50935a53Timo 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, paldo, openmandriva or pardus.]))
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainenif type lsb_release >/dev/null 2>&1 && test "z$with_distro" = "z"; then
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainen with_distro=`lsb_release -is`
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainenif test "z$with_distro" = "z"; then
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainen AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat")
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainen AC_CHECK_FILE(/etc/oracle-release,with_distro="oracle")
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainen AC_CHECK_FILE(/etc/centos-release,with_distro="centos")
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainen AC_CHECK_FILE(/etc/fedora-release,with_distro="fedora")
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainen AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainen AC_CHECK_FILE(/etc/gentoo-release,with_distro="gentoo")
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainen AC_CHECK_FILE(/etc/debian_version,with_distro="debian")
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainen AC_CHECK_FILE(/etc/arch-release,with_distro="arch")
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainen AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware")
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainen AC_CHECK_FILE(/etc/frugalware-release,with_distro="frugalware")
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainen AC_CHECK_FILE(/etc/mandrakelinux-release, with_distro="openmandriva")
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainen AC_CHECK_FILE(/etc/mandriva-release,with_distro="openmandriva")
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainen AC_CHECK_FILE(/etc/pardus-release,with_distro="pardus")
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainenwith_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]'`
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainenif test "z$with_distro" = "z"; then
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainen with_distro="unknown"
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainencase $with_distro in
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainen ubuntu|raspbian)
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainen redhat|centos|fedora|oracle|oracleserver)
5fbccc935e3f7b916aa7c6e302a212821072e83aTimo SirainenAC_MSG_RESULT([$with_distro])
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo SirainenAM_CONDITIONAL([HAVE_DEBIAN], [test x"$with_distro" = "xdebian" -o x"$with_distro" = "xubuntu" -o x"$with_distro" = "xraspbian"])
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo SirainenAM_CONDITIONAL([DISTRO_UBUNTU], [test "x$with_distro" = "xubuntu"])
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo SirainenAC_CONFIG_LINKS([config/etc/default.conf:config/etc/${distroconf}])
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainen# Check for init system type
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo SirainenAC_MSG_CHECKING([for init system type])
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo SirainenAC_ARG_WITH([init-script],
bde78a7bf5f9000f1ae4dc7ce6cabd012e1f8b79Pascal Volk [AC_HELP_STRING([--with-init-script@<:@=TYPE@<:@,TYPE,...@:>@@:>@],
c664d0da658c8d3200d88ea3c4cd580afd33fa73Timo Sirainen [Type(s) of init script to install: sysvinit, systemd, upstart,
134582c78f038b4d9b9fde127399aefa50935a53Timo Sirainen distro @<:@default=distro@:>@])],[],[with_init_script=distro])
134582c78f038b4d9b9fde127399aefa50935a53Timo Sirainencase "$with_init_script" in
134582c78f038b4d9b9fde127399aefa50935a53Timo Sirainen case $with_distro in
134582c78f038b4d9b9fde127399aefa50935a53Timo Sirainen init_script=systemd
134582c78f038b4d9b9fde127399aefa50935a53Timo Sirainen redhat|centos|oracle|oracleserver)
134582c78f038b4d9b9fde127399aefa50935a53Timo Sirainen init_script=sysvinit
4f77d2f0f0743ad09d2a34e18be8eacf8014b7e0Pascal Volk debian|raspbian)
4f77d2f0f0743ad09d2a34e18be8eacf8014b7e0Pascal Volk init_script=upstart,systemd
4f77d2f0f0743ad09d2a34e18be8eacf8014b7e0Pascal Volk init_script=upstart,systemd
4f77d2f0f0743ad09d2a34e18be8eacf8014b7e0Pascal Volk echo -n "Linux distribution init system unknown."
4f77d2f0f0743ad09d2a34e18be8eacf8014b7e0Pascal Volk init_script=
134582c78f038b4d9b9fde127399aefa50935a53Timo Sirainen init_script=$with_init_script
134582c78f038b4d9b9fde127399aefa50935a53Timo Sirainen# Check valid init systems were given, run in subshell so we don't mess up IFS
134582c78f038b4d9b9fde127399aefa50935a53Timo Sirainen(IFS="," ; for init_sys in $init_script;
134582c78f038b4d9b9fde127399aefa50935a53Timo Sirainen case "$init_sys" in
134582c78f038b4d9b9fde127399aefa50935a53Timo Sirainen none|sysvinit|systemd|upstart)
with_systemdsystemunitdir=/lib/systemd/system
if "$name" --help >/dev/null 2>&1; then
docdtd="\"-//OASIS//DTD DocBook XML\" \"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd\""
[AC_CHECK_HEADER([sys/apparmor.h],[],[AC_MSG_ERROR([You must install the AppArmor development package in order to compile lxc])])
AC_CHECK_LIB([apparmor], [aa_change_profile],[],[AC_MSG_ERROR([You must install the AppArmor development package in order to compile lxc])])
[AC_CHECK_HEADER([selinux/selinux.h],[],[AC_MSG_ERROR([You must install the SELinux development package in order to compile lxc])])
AC_CHECK_LIB([selinux], [setexeccon_raw],[true],[AC_MSG_ERROR([You must install the SELinux development package in order to compile lxc])])
AC_CHECK_HEADER([seccomp.h],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])])
AC_CHECK_LIB([seccomp], [seccomp_init],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])])
AC_CHECK_LIB([cgmanager],[cgmanager_create],[enable_cgmanager=yes],[enable_cgmanager=no],[-lnih -lnih-dbus -ldbus-1])
AC_SEARCH_LIBS([cgmanager_get_pid_cgroup_abs_sync], [cgmanager], [have_abs_cgroups=yes], [have_abs_cgroups=no], [-lnih -lnih-dbus -ldbus-1])
AC_CHECK_TYPES([scmp_filter_ctx], [], [], [[#include <seccomp.h>]])
AC_CHECK_DECLS([seccomp_syscall_resolve_name_arch], [], [], [[#include <seccomp.h>]])
[AC_HELP_STRING([--enable-mutex-debugging], [Makes mutexes to report error and provide stack trace [default=no]])],
AC_SUBST([LUA_LIBDIR], [$libdir/lua/$LUA_VERSION])
AC_SUBST([LUA_SHAREDIR], [$datadir/lua/$LUA_VERSION])
[AC_HELP_STRING([--enable-tests], [build test/example binaries [default=no]])],
)], [], [with_config_path=['${localstatedir}/lib/lxc']])
)], [], [with_global_conf=['${sysconfdir}/lxc/lxc.conf']])
)], [], [with_usernic_conf=['${sysconfdir}/lxc/lxc-usernet']])
)], [], [with_usernic_db=['${with_runtime_path}/lxc/nics']])
)], [], [with_rootfs_path=['${libdir}/lxc/rootfs']])
default_log_path="${localstatedir}/log/lxc"
AS_AC_EXPAND(LXC_DEFAULT_CONFIG, "$sysconfdir/lxc/default.conf")
AS_AC_EXPAND(LXCTEMPLATEDIR, "$datadir/lxc/templates")
AS_AC_EXPAND(LXCTEMPLATECONFIG, "$datadir/lxc/config")
AS_AC_EXPAND(LXCHOOKDIR, "$datadir/lxc/hooks")
[#include <sys/socket.h>])
AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
AC_CHECK_HEADERS([sys/signalfd.h pty.h ifaddrs.h sys/capability.h sys/personality.h utmpx.h sys/timerfd.h])
You are compiling LXC for bionic target which lacks certain threading related functionality used by LXC API (like pthread_atfork).