configure.ac revision 882ab607fdd7386aae7a00dba76513310f28998c
951N/A# -*- Autoconf -*-
951N/A# Process this file with autoconf to produce a configure script.
951N/A
951N/Am4_define([lxc_version_major], 1)
951N/Am4_define([lxc_version_minor], 1)
951N/Am4_define([lxc_version_micro], 0)
951N/Am4_define([lxc_version_beta], [alpha1])
951N/A
951N/Am4_define([lxc_version_base], [lxc_version_major.lxc_version_minor.lxc_version_micro])
951N/Am4_define([lxc_version],
951N/A [ifelse(lxc_version_beta, [], [lxc_version_base], [lxc_version_base.lxc_version_beta])])
951N/A
951N/AAC_INIT([lxc], [lxc_version])
951N/A
951N/A# We need pkg-config
951N/APKG_PROG_PKG_CONFIG
951N/A
951N/AAC_SUBST(LXC_VERSION_BASE, lxc_version_base)
951N/AAC_SUBST(LXC_VERSION_BETA, lxc_version_beta)
951N/A
951N/AAC_SUBST([LXC_VERSION_MAJOR], [lxc_version_major])
951N/AAC_SUBST([LXC_VERSION_MINOR], [lxc_version_minor])
951N/AAC_SUBST([LXC_VERSION_MICRO], [lxc_version_micro])
951N/AAC_SUBST([LXC_VERSION], [lxc_version])
951N/A
951N/AAC_CONFIG_SRCDIR([configure.ac])
951N/AAC_CONFIG_AUX_DIR([config])
951N/AAC_CONFIG_HEADERS([src/config.h])
951N/AAM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability subdir-objects])
951N/AAC_CANONICAL_HOST
951N/AAM_PROG_CC_C_O
951N/AAC_GNU_SOURCE
951N/A
951N/A# Detect the distribution. This is used for the default configuration and
951N/A# for some distro-specific build options.
951N/AAC_MSG_CHECKING([host distribution])
951N/AAC_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.]))
951N/Aif type lsb_release >/dev/null 2>&1 && test "z$with_distro" = "z"; then
951N/A with_distro=`lsb_release -is`
951N/Afi
951N/Aif test "z$with_distro" = "z"; then
951N/A AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat")
951N/A AC_CHECK_FILE(/etc/oracle-release,with_distro="oracle")
951N/A AC_CHECK_FILE(/etc/centos-release,with_distro="centos")
951N/A AC_CHECK_FILE(/etc/fedora-release,with_distro="fedora")
951N/A AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
951N/A AC_CHECK_FILE(/etc/gentoo-release,with_distro="gentoo")
951N/A AC_CHECK_FILE(/etc/debian_version,with_distro="debian")
951N/A AC_CHECK_FILE(/etc/arch-release,with_distro="arch")
951N/A AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware")
951N/A AC_CHECK_FILE(/etc/frugalware-release,with_distro="frugalware")
951N/A AC_CHECK_FILE(/etc/mandrakelinux-release, with_distro="openmandriva")
958N/A AC_CHECK_FILE(/etc/mandriva-release,with_distro="openmandriva")
951N/A AC_CHECK_FILE(/etc/pardus-release,with_distro="pardus")
951N/Afi
951N/Awith_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]'`
951N/A
951N/Aif test "z$with_distro" = "z"; then
951N/A with_distro="unknown"
951N/Afi
951N/Acase $with_distro in
951N/A ubuntu)
951N/A distroconf=default.conf.ubuntu
951N/A ;;
951N/A redhat|centos|fedora|oracle|oracleserver)
951N/A distroconf=default.conf.libvirt
951N/A ;;
951N/A *)
951N/A distroconf=default.conf.unknown
951N/A ;;
951N/Aesac
951N/AAC_MSG_RESULT([$with_distro])
951N/AAM_CONDITIONAL([HAVE_DEBIAN], [test x"$with_distro" = "xdebian" -o x"$with_distro" = "xubuntu"])
951N/AAM_CONDITIONAL([DISTRO_UBUNTU], [test "x$with_distro" = "xubuntu"])
951N/A
951N/A# Check for init system type
951N/AAC_MSG_CHECKING([for init system type])
951N/AAC_ARG_WITH([init-script],
951N/A [AC_HELP_STRING([--with-init-script@<:@=TYPE@<:@,TYPE,...@:>@@:>@],
951N/A [Type(s) of init script to install: sysvinit, systemd, upstart,
951N/A distro @<:@default=distro@:>@])],[],[with_init_script=distro])
951N/Acase "$with_init_script" in
951N/A distro)
951N/A case $with_distro in
951N/A fedora)
951N/A init_script=systemd
951N/A ;;
951N/A redhat|centos|oracle|oracleserver)
951N/A init_script=sysvinit
951N/A ;;
951N/A debian)
951N/A init_script=upstart,systemd
951N/A ;;
951N/A ubuntu)
951N/A init_script=upstart,systemd
951N/A ;;
951N/A *)
951N/A echo -n "Linux distribution init system unknown."
951N/A init_script=
951N/A ;;
951N/A esac
951N/A ;;
951N/A *)
951N/A init_script=$with_init_script
951N/A ;;
951N/Aesac
951N/A
951N/A# Check valid init systems were given, run in subshell so we don't mess up IFS
951N/A(IFS="," ; for init_sys in $init_script;
951N/Ado
951N/A case "$init_sys" in
951N/A none|sysvinit|systemd|upstart)
951N/A ;;
951N/A *)
951N/A exit 1
951N/A ;;
951N/A esac
951N/Adone) || AC_MSG_ERROR([Unknown init system type in $init_script])
951N/A
951N/AAM_CONDITIONAL([INIT_SCRIPT_SYSV], [echo "$init_script" |grep -q "sysvinit"])
951N/AAM_CONDITIONAL([INIT_SCRIPT_SYSTEMD], [echo "$init_script" |grep -q "systemd"])
951N/AAM_CONDITIONAL([INIT_SCRIPT_UPSTART], [echo "$init_script" |grep -q "upstart"])
951N/AAC_MSG_RESULT($init_script)
951N/A
951N/A# systemd unit dir
951N/AAC_ARG_WITH([systemdsystemunitdir],
951N/A AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
951N/A [],
951N/A [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
951N/Aif test -z "$with_systemdsystemunitdir"; then
951N/A with_systemdsystemunitdir=/lib/systemd/system
951N/Afi
951N/Aif test "x$with_systemdsystemunitdir" != "xno"; then
951N/A AC_SUBST([SYSTEMD_UNIT_DIR], [$with_systemdsystemunitdir])
951N/Afi
951N/A
951N/A# Allow disabling rpath
951N/AAC_ARG_ENABLE([rpath],
951N/A [AC_HELP_STRING([--enable-rpath], [set rpath in executables [default=no]])],
951N/A [], [enable_rpath=no])
951N/AAM_CONDITIONAL([ENABLE_RPATH], [test "x$enable_rpath" = "xyes"])
951N/A
951N/A# Documentation (manpages)
951N/AAC_ARG_ENABLE([doc],
951N/A [AC_HELP_STRING([--enable-doc], [make man pages [default=auto]])],
951N/A [], [enable_doc=auto])
951N/A
951N/Aif test "x$enable_doc" = "xyes" -o "x$enable_doc" = "xauto"; then
951N/A db2xman=""
951N/A dbparsers="docbook2x-man db2x_docbook2man docbook2man docbook-to-man"
951N/A
951N/A AC_MSG_CHECKING(for docbook2x-man)
951N/A for name in ${dbparsers}; do
951N/A if "$name" --help >/dev/null 2>&1; then
951N/A db2xman="$name"
951N/A break;
951N/A fi
951N/A done
951N/A
951N/A if test -n "${db2xman}"; then
951N/A AC_MSG_RESULT([${db2xman}])
951N/A enable_doc="yes"
951N/A else
951N/A AC_MSG_RESULT([no])
951N/A if test "x$enable_doc" = "xyes"; then
951N/A AC_MSG_ERROR([docbook2x-man is required, but could not be found])
951N/A fi
951N/A enable_doc="no"
951N/A fi
951N/A
951N/A AC_SUBST(db2xman)
951N/Afi
951N/AAM_CONDITIONAL([ENABLE_DOCBOOK], [test "x$db2xman" != "x"])
951N/AAM_CONDITIONAL([USE_DOCBOOK2X], [test "x$db2xman" != "xdocbook2man"])
951N/A
951N/Aif test "x$db2xman" = "xdocbook2man"; then
951N/A docdtd="\"-//Davenport//DTD DocBook V3.0//EN\""
951N/Aelse
951N/A docdtd="\"-//OASIS//DTD DocBook XML\" \"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd\""
951N/Afi
951N/AAC_SUBST(docdtd)
951N/A
951N/A# Documentation (API)
951N/AAC_ARG_ENABLE([api-docs],
951N/A [AC_HELP_STRING([--enable-api-docs],
951N/A [make API documentation [default=auto]])],
951N/A [], [enable_api_docs=auto])
951N/A
951N/Aif test "x$enable_api_docs" = "xyes" -o "x$enable_api_docs" = "xauto"; then
951N/A AC_CHECK_PROGS([HAVE_DOXYGEN],[doxygen])
951N/A AC_SUBST([HAVE_DOXYGEN])
951N/A
951N/A if test "x$HAVE_DOXYGEN" != "x"; then
951N/A enable_api_docs="yes"
951N/A else
951N/A if test "x$enable_api_docs" = "xyes"; then
951N/A AC_MSG_ERROR([doxygen is required, but could not be found])
951N/A fi
951N/A enable_api_docs="no"
951N/A fi
951N/Afi
951N/A
951N/AAM_CONDITIONAL([ENABLE_API_DOCS], [test "x$HAVE_DOXYGEN" != "x"])
951N/A
951N/A# Openvswitch
951N/AAC_PATH_PROG([OVS_CTL_PATH],[ovs-vsctl])
951N/Aif test "x$OVS_CTL_PATH" != "x"; then
951N/A enable_ovs="yes"
951N/A AS_AC_EXPAND(OVS_CTL_PATH, "$OVS_CTL_PATH")
951N/Aelse
951N/A enable_ovs="no"
951N/Afi
951N/AAM_CONDITIONAL([HAVE_OVS], [test "x$enable_ovs" = "xyes"])
951N/A
951N/A# Apparmor
951N/AAC_ARG_ENABLE([apparmor],
951N/A [AC_HELP_STRING([--enable-apparmor], [enable apparmor support [default=auto]])],
951N/A [], [enable_apparmor=auto])
951N/A
951N/Aif test "$enable_apparmor" = "auto" ; then
951N/A AC_CHECK_LIB([apparmor],[aa_change_profile],[enable_apparmor=yes], [enable_apparmor=no])
951N/Afi
951N/AAM_CONDITIONAL([ENABLE_APPARMOR], [test "x$enable_apparmor" = "xyes"])
951N/A
951N/AAC_CHECK_LIB([gnutls], [gnutls_hash_fast], [enable_gnutls=yes], [enable_gnutls=no])
951N/A
951N/AAM_COND_IF([ENABLE_APPARMOR],
951N/A [AC_CHECK_HEADER([sys/apparmor.h],[],[AC_MSG_ERROR([You must install the AppArmor development package in order to compile lxc])])
951N/A AC_CHECK_LIB([apparmor], [aa_change_profile],[],[AC_MSG_ERROR([You must install the AppArmor development package in order to compile lxc])])
951N/A AC_SUBST([APPARMOR_LIBS], [-lapparmor])])
951N/A
951N/A# SELinux
951N/AAC_ARG_ENABLE([selinux],
951N/A [AC_HELP_STRING([--enable-selinux], [enable SELinux support [default=auto]])],
951N/A [], [enable_selinux=auto])
951N/A
951N/Aif test "x$enable_selinux" = xauto; then
951N/A AC_CHECK_LIB([selinux],[setexeccon_raw],[enable_selinux=yes],[enable_selinux=no])
951N/Afi
951N/AAM_CONDITIONAL([ENABLE_SELINUX], [test "x$enable_selinux" = "xyes"])
951N/AAM_COND_IF([ENABLE_SELINUX],
951N/A [AC_CHECK_HEADER([selinux/selinux.h],[],[AC_MSG_ERROR([You must install the SELinux development package in order to compile lxc])])
951N/A AC_CHECK_LIB([selinux], [setexeccon_raw],[true],[AC_MSG_ERROR([You must install the SELinux development package in order to compile lxc])])
951N/A AC_SUBST([SELINUX_LIBS], [-lselinux])])
951N/A
951N/A# Seccomp syscall filter
951N/AAC_ARG_ENABLE([seccomp],
951N/A [AC_HELP_STRING([--enable-seccomp], [enable seccomp support [default=auto]])],
951N/A [], [enable_seccomp=auto])
951N/A
951N/Aif test "x$enable_seccomp" = "xauto" ; then
951N/A AC_CHECK_LIB([seccomp],[seccomp_init],[enable_seccomp=yes],[enable_seccomp=no])
958N/Afi
951N/AAM_CONDITIONAL([ENABLE_SECCOMP], [test "x$enable_seccomp" = "xyes"])
951N/A
951N/AAM_COND_IF([ENABLE_SECCOMP],
951N/A [PKG_CHECK_MODULES([SECCOMP],[libseccomp],[],[
951N/A AC_CHECK_HEADER([seccomp.h],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])])
951N/A AC_CHECK_LIB([seccomp], [seccomp_init],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])])
951N/A AC_SUBST([SECCOMP_LIBS], [-lseccomp])
951N/A ])
951N/A ])
951N/A
951N/A# cgmanager
951N/AAC_ARG_ENABLE([cgmanager],
951N/A [AC_HELP_STRING([--enable-cgmanager], [enable cgmanager support [default=auto]])],
951N/A [], [enable_cgmanager=auto])
951N/A
951N/Aif test "x$enable_cgmanager" = "xauto" ; then
951N/A AC_CHECK_LIB([cgmanager],[cgmanager_create],[enable_cgmanager=yes],[enable_cgmanager=no],[-lnih -lnih-dbus -ldbus-1])
951N/Afi
951N/AAM_CONDITIONAL([ENABLE_CGMANAGER], [test "x$enable_cgmanager" = "xyes"])
951N/A
951N/AAM_COND_IF([ENABLE_CGMANAGER],
951N/A [PKG_CHECK_MODULES([CGMANAGER], [libcgmanager])
951N/A PKG_CHECK_MODULES([NIH], [libnih >= 1.0.2])
951N/A PKG_CHECK_MODULES([NIH_DBUS], [libnih-dbus >= 1.0.0])
951N/A PKG_CHECK_MODULES([DBUS], [dbus-1 >= 1.2.16])
951N/A ])
951N/A
951N/AAC_MSG_CHECKING(for get_pid_cgroup_abs_sync)
951N/Asave_LIBS=$LIBS
951N/AAC_SEARCH_LIBS([cgmanager_get_pid_cgroup_abs_sync], [cgmanager], [have_abs_cgroups=yes], [have_abs_cgroups=no], [-lnih -lnih-dbus -ldbus-1])
951N/ALIBS=$save_LIBS
951N/Aif test "x$have_abs_cgroups" = "xyes"; then
951N/A AC_DEFINE([HAVE_CGMANAGER_GET_PID_CGROUP_ABS_SYNC], 1, [Have cgmanager_get_pid_cgroup_abs_sync])
951N/A AC_MSG_RESULT([yes])
951N/Aelse
951N/A AC_MSG_RESULT([no])
951N/Afi
951N/A
951N/A# Check for static libcap, make sure the function checked for differs from the
951N/A# the one checked below so the cache doesn't give a wrong answer
951N/AOLD_CFLAGS="$CFLAGS"
951N/ACFLAGS="$CFLAGS -static"
951N/AAC_CHECK_LIB([cap],[cap_init],[have_static_libcap=yes],[have_static_libcap=no])
951N/AAM_CONDITIONAL([HAVE_STATIC_LIBCAP], [test "x$have_static_libcap" = "xyes"])
951N/Aif test "x$have_static_libcap" = "xyes"; then
951N/A AC_DEFINE([HAVE_STATIC_LIBCAP], 1, [Have static libcap])
951N/Afi
951N/ACFLAGS="$OLD_CFLAGS"
951N/A
951N/A
951N/A# Linux capabilities
951N/AAC_ARG_ENABLE([capabilities],
951N/A [AC_HELP_STRING([--enable-capabilities], [enable kernel capabilities support [default=auto]])],
951N/A [], [enable_capabilities=auto])
951N/A
951N/Aif test "x$enable_capabilities" = "xauto"; then
951N/A AC_CHECK_LIB([cap],[cap_set_proc],[enable_capabilities=yes],[enable_capabilities=no])
951N/Afi
951N/AAM_CONDITIONAL([ENABLE_CAP], [test "x$enable_capabilities" = "xyes"])
951N/A
951N/AAM_COND_IF([ENABLE_CAP],
951N/A [AC_CHECK_LIB(cap,cap_set_proc,[true],[AC_MSG_ERROR([You are missing libcap support.])])
951N/A AC_SUBST([CAP_LIBS], [-lcap])])
951N/A
951N/A# HAVE_SCMP_FILTER_CTX=1 will tell us we have libseccomp api >= 1.0.0
951N/AOLD_CFLAGS="$CFLAGS"
951N/ACFLAGS="$CFLAGS $SECCOMP_CFLAGS"
951N/AAC_CHECK_TYPES([scmp_filter_ctx], [], [], [[#include <seccomp.h>]])
951N/AAC_CHECK_DECLS([seccomp_syscall_resolve_name_arch], [], [], [[#include <seccomp.h>]])
951N/ACFLAGS="$OLD_CFLAGS"
951N/A
951N/A# Configuration examples
951N/AAC_ARG_ENABLE([examples],
951N/A [AC_HELP_STRING([--enable-examples], [install examples [default=yes]])],
951N/A [], [enable_examples=yes])
951N/AAM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" = "xyes"])
951N/A
951N/A# Python3 module and scripts
951N/AAC_ARG_ENABLE([python],
951N/A [AC_HELP_STRING([--enable-python], [enable python binding [default=auto]])],
951N/A [], [enable_python=auto])
951N/A
951N/Aif test "x$enable_python" = "xauto"; then
951N/A PKG_CHECK_MODULES([PYTHONDEV], [python3 >= 3.2],[enable_python=yes],[enable_python=no])
951N/A if test "$CC" = "clang"; then
951N/A enable_python=no
951N/A fi
951N/Afi
951N/A
951N/Aif test "x$enable_python" = "xyes" && test "$CC" = "clang"; then
951N/A AC_MSG_ERROR([Python3 is incompatible with the clang compiler])
951N/Afi
951N/A
951N/AAM_CONDITIONAL([ENABLE_PYTHON], [test "x$enable_python" = "xyes"])
951N/A
951N/AAM_COND_IF([ENABLE_PYTHON],
951N/A [AM_PATH_PYTHON([3.2], [], [AC_MSG_ERROR([You must install python3])])
951N/A PKG_CHECK_MODULES([PYTHONDEV], [python3 >= 3.2],[],[AC_MSG_ERROR([You must install python3-dev])])
951N/A AC_DEFINE_UNQUOTED([ENABLE_PYTHON], 1, [Python3 is available])])
951N/A
951N/A# Enable dumping stack traces
951N/AAC_ARG_ENABLE([mutex-debugging],
951N/A [AC_HELP_STRING([--enable-mutex-debugging], [Makes mutexes to report error and provide stack trace [default=no]])],
951N/A [], [enable_mutex_debugging=no])
951N/AAM_CONDITIONAL([MUTEX_DEBUGGING], [test "x$enable_mutex_debugging" = "xyes"])
951N/A
951N/AAM_COND_IF([MUTEX_DEBUGGING],
951N/A AC_DEFINE_UNQUOTED([MUTEX_DEBUGGING], 1, [Enabling mutex debugging]))
951N/A
951N/A# Not in older autoconf versions
951N/A# AS_VAR_COPY(DEST, SOURCE)
951N/A# -------------------------
951N/A# Set the polymorphic shell variable DEST to the contents of the polymorphic
951N/A# shell variable SOURCE.
951N/Am4_ifdef([AS_VAR_COPY], [],
951N/A[AC_DEFUN([AS_VAR_COPY],
951N/A [AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])])
951N/A])
951N/A
951N/Adnl PKG_CHECK_VAR was introduced with pkg-config 0.28
951N/Am4_ifdef([PKG_CHECK_VAR], [],
951N/A[AC_DEFUN([PKG_CHECK_VAR],
951N/A [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
951N/A AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
951N/A _PKG_CONFIG([$1], [variable="][$3]["], [$2])
951N/A AS_VAR_COPY([$1], [pkg_cv_][$1])
951N/A AS_VAR_IF([$1], [""], [$5], [$4])dnl
951N/A ])# PKG_CHECK_VAR
951N/A])
951N/A
951N/A# Lua module and scripts
951N/AAC_ARG_ENABLE([lua],
951N/A [AC_HELP_STRING([--enable-lua], [enable lua binding [default=auto]])],
951N/A [], [enable_lua=auto])
951N/A
951N/AAC_ARG_WITH([lua-pc],
951N/A [AS_HELP_STRING(
951N/A [--with-lua-pc=PKG],
951N/A [Specify pkg-config package name for lua]
951N/A )], [], [with_lua_pc=no])
951N/A
951N/Aif test "x$enable_lua" = "xyes" -a "x$with_lua_pc" != "xno"; then
951N/A # exit with error if not found
951N/A PKG_CHECK_MODULES([LUA], [$with_lua_pc], [LUAPKGCONFIG=$with_lua_pc])
951N/Afi
951N/A
951N/Aif test "x$enable_lua" = "xauto" -a "x$with_lua_pc" != "xno"; then
951N/A PKG_CHECK_MODULES([LUA], [$with_lua_pc],
951N/A [LUAPKGCONFIG=$with_lua_pc
951N/A enable_lua=yes],
951N/A [enable_lua=no])
951N/Afi
951N/A
951N/Aif test "x$enable_lua" != "xno"; then
951N/A PKG_CHECK_MODULES([LUA], [lua], [LUAPKGCONFIG=lua],
951N/A [PKG_CHECK_MODULES([LUA], [lua5.2], [LUAPKGCONFIG=lua5.2],
951N/A [PKG_CHECK_MODULES([LUA], [lua5.1], [LUAPKGCONFIG=lua5.1],
951N/A [AS_IF([test "x$enable_lua" = "xyes"],
951N/A [AC_MSG_ERROR([Lua not found. Please use --with-lua-pc=PKG])],
951N/A [enable_lua=no])]
951N/A )]
951N/A )])
951N/A AS_IF([test "x$LUAPKGCONFIG" != "x"], [enable_lua=yes])
951N/Afi
951N/A
951N/AAM_CONDITIONAL([ENABLE_LUA],
951N/A [test "x$enable_lua" = "xyes"])
951N/A
951N/AAM_COND_IF([ENABLE_LUA],
951N/A [AC_MSG_CHECKING([Lua version])
951N/A PKG_CHECK_VAR([LUA_VERSION], [$LUAPKGCONFIG], [V],,
951N/A [PKG_CHECK_VAR([LUA_VERSION], [$LUAPKGCONFIG], [major_version])])
951N/A AC_MSG_RESULT([$LUA_VERSION])
951N/A AC_SUBST([LUA_LIBDIR], [$libdir/lua/$LUA_VERSION])
951N/A AC_SUBST([LUA_SHAREDIR], [$datadir/lua/$LUA_VERSION])
951N/A ])
951N/A
951N/A# Optional bash integration
951N/AAC_ARG_ENABLE([bash],
951N/A [AC_HELP_STRING([--enable-bash], [build bash integration [default=yes]])],
951N/A [], [enable_bash=yes])
951N/AAM_CONDITIONAL([ENABLE_BASH], [test "x$enable_bash" = "xyes"])
951N/A
951N/A# Optional test binaries
951N/AAC_ARG_ENABLE([tests],
951N/A [AC_HELP_STRING([--enable-tests], [build test/example binaries [default=no]])],
951N/A [], [enable_tests=no])
951N/AAM_CONDITIONAL([ENABLE_TESTS], [test "x$enable_tests" = "xyes"])
951N/A
951N/A# Allow overriding the default runtime dir (/run)
951N/AAC_ARG_WITH([runtime-path],
951N/A [AC_HELP_STRING(
951N/A [--with-runtime-path=dir],
951N/A [runtime directory (default: /run)]
951N/A )], [], [with_runtime_path=['/run']])
951N/A
951N/A# LXC container path, where the containers are actually stored
951N/A# This is overridden by an entry in the file called LXCCONF
951N/A# (i.e. /etc/lxc/lxc.conf)
951N/AAC_ARG_WITH([config-path],
951N/A [AC_HELP_STRING(
951N/A [--with-config-path=dir],
951N/A [lxc configuration repository path]
951N/A )], [], [with_config_path=['${localstatedir}/lib/lxc']])
951N/A
951N/A# The path of the global lxc configuration file.
951N/AAC_ARG_WITH([global-conf],
951N/A [AC_HELP_STRING(
951N/A [--with-global-conf=dir],
951N/A [global lxc configuration file]
951N/A )], [], [with_global_conf=['${sysconfdir}/lxc/lxc.conf']])
951N/A
951N/A# The path of the userns network configuration file
951N/AAC_ARG_WITH([usernic-conf],
951N/A [AC_HELP_STRING(
951N/A [--with-usernic-conf],
951N/A [user network interface configuration file]
951N/A )], [], [with_usernic_conf=['${sysconfdir}/lxc/lxc-usernet']])
951N/A
951N/A# The path of the runtime usernic database
951N/AAC_ARG_WITH([usernic-db],
951N/A [AC_HELP_STRING(
951N/A [--with-usernic-db],
951N/A [lxc user nic database]
951N/A )], [], [with_usernic_db=['${with_runtime_path}/lxc/nics']])
951N/A
951N/A# Rootfs path, where the container mount structure is assembled
951N/AAC_ARG_WITH([rootfs-path],
951N/A [AC_HELP_STRING(
951N/A [--with-rootfs-path=dir],
951N/A [lxc rootfs mount point]
951N/A )], [], [with_rootfs_path=['${libdir}/lxc/rootfs']])
951N/A
951N/A# cgroup pattern specification
951N/AAC_ARG_WITH([cgroup-pattern],
951N/A [AC_HELP_STRING(
951N/A [--with-cgroup-pattern=pattern],
951N/A [pattern for container cgroups]
951N/A )], [], [with_cgroup_pattern=['/lxc/%n']])
951N/A
951N/A# Container log path. By default, use $lxcpath.
951N/AAC_MSG_CHECKING([Whether to place logfiles in container config path])
951N/AAC_ARG_ENABLE([configpath-log],
951N/A [AC_HELP_STRING([--enable-configpath-log], [use logfiles in config path [default=no]])],
951N/A [], [enable_configpath_log=no])
951N/AAC_MSG_RESULT([$enable_configpath_log])
951N/AAM_CONDITIONAL([USE_CONFIGPATH_LOGS], [test "$enable_configpath_log" = "yes"])
951N/A
951N/Aif test "$enable_configpath_log" = "yes"; then
951N/A default_log_path="${with_config_path}"
951N/Aelse
951N/A default_log_path="${localstatedir}/log/lxc"
951N/Afi
951N/A
951N/AAC_ARG_WITH([log-path],
951N/A [AC_HELP_STRING(
951N/A [--with-log-path=dir],
951N/A [per container log path]
951N/A )], [], [with_log_path=['${default_log_path}']])
951N/A
951N/A# Expand some useful variables
951N/AAS_AC_EXPAND(PREFIX, "$prefix")
951N/AAS_AC_EXPAND(LIBDIR, "$libdir")
951N/AAS_AC_EXPAND(BINDIR, "$bindir")
951N/AAS_AC_EXPAND(SBINDIR, "$sbindir")
951N/AAS_AC_EXPAND(LIBEXECDIR, "$libexecdir")
951N/AAS_AC_EXPAND(INCLUDEDIR, "$includedir")
951N/AAS_AC_EXPAND(SYSCONFDIR, "$sysconfdir")
951N/AAS_AC_EXPAND(LXC_DEFAULT_CONFIG, "$sysconfdir/lxc/default.conf")
951N/AAS_AC_EXPAND(DATADIR, "$datadir")
951N/AAS_AC_EXPAND(LOCALSTATEDIR, "$localstatedir")
951N/AAS_AC_EXPAND(DOCDIR, "$docdir")
951N/AAS_AC_EXPAND(LXC_DISTRO_CONF, "$distroconf")
951N/AAS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
951N/AAS_AC_EXPAND(LXCPATH, "$with_config_path")
951N/AAS_AC_EXPAND(LXC_GLOBAL_CONF, "$with_global_conf")
951N/AAS_AC_EXPAND(LXC_USERNIC_CONF, "$with_usernic_conf")
951N/AAS_AC_EXPAND(LXC_USERNIC_DB, "$with_usernic_db")
951N/AAS_AC_EXPAND(LXCROOTFSMOUNT, "$with_rootfs_path")
951N/AAS_AC_EXPAND(LXCTEMPLATEDIR, "$datadir/lxc/templates")
951N/AAS_AC_EXPAND(LXCTEMPLATECONFIG, "$datadir/lxc/config")
951N/AAS_AC_EXPAND(LXCHOOKDIR, "$datadir/lxc/hooks")
951N/AAS_AC_EXPAND(LXCINITDIR, "$libexecdir")
951N/AAS_AC_EXPAND(LOGPATH, "$with_log_path")
951N/AAS_AC_EXPAND(RUNTIME_PATH, "$with_runtime_path")
951N/AAC_SUBST(DEFAULT_CGROUP_PATTERN, ["$with_cgroup_pattern"])
951N/A
951N/A# Check for some standard kernel headers
951N/AAC_CHECK_HEADERS([linux/unistd.h linux/netlink.h linux/genetlink.h],
951N/A [],
951N/A AC_MSG_ERROR([Please install the Linux kernel headers.]),
951N/A [#include <sys/socket.h>])
951N/A
951N/A# Check for alternate C libraries
951N/AAC_MSG_CHECKING(for bionic libc)
951N/AAC_COMPILE_IFELSE([AC_LANG_PROGRAM(
951N/A [[#ifndef __ANDROID__
951N/Aerror: Not bionic!
951N/A#endif]])],
951N/A [is_bionic=yes],
951N/A [is_bionic=no])
951N/Aif test "x$is_bionic" = "xyes"; then
951N/A AC_DEFINE([IS_BIONIC], 1, [bionic libc])
951N/A AC_MSG_RESULT([yes])
951N/Aelse
951N/A AC_MSG_RESULT([no])
951N/Afi
951N/AAM_CONDITIONAL([IS_BIONIC], [test "x$is_bionic" = "xyes"])
951N/A
951N/A# Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP
951N/AAC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
951N/A
951N/A# Check for some headers
951N/AAC_CHECK_HEADERS([sys/signalfd.h pty.h ifaddrs.h sys/capability.h sys/personality.h utmpx.h sys/timerfd.h])
951N/A
951N/A# Check for some syscalls functions
951N/AAC_CHECK_FUNCS([setns pivot_root sethostname unshare rand_r confstr faccessat])
951N/A
951N/A# Check for some functions
951N/AAC_CHECK_LIB(pthread, main)
951N/AAC_CHECK_FUNCS(pthread_atfork)
951N/AAC_CHECK_LIB(util, openpty)
951N/AAC_CHECK_FUNCS([openpty hasmntopt setmntent endmntent utmpxname])
951N/AAC_CHECK_FUNCS([getline],
951N/A AM_CONDITIONAL(HAVE_GETLINE, true)
951N/A AC_DEFINE(HAVE_GETLINE,1,[Have getline]),
951N/A AM_CONDITIONAL(HAVE_GETLINE, false))
951N/AAC_CHECK_FUNCS([fgetln],
951N/A AM_CONDITIONAL(HAVE_FGETLN, true)
951N/A AC_DEFINE(HAVE_FGETLN,1,[Have fgetln]),
951N/A AM_CONDITIONAL(HAVE_FGETLN, false))
951N/A
951N/A# Check for some libraries
951N/AAC_SEARCH_LIBS(sem_open, [rt pthread])
951N/AAC_SEARCH_LIBS(clock_gettime, [rt])
951N/A
951N/A# Check for some standard binaries
951N/AAC_PROG_GCC_TRADITIONAL
951N/AAC_PROG_SED
951N/A
951N/A# See if we support thread-local storage.
951N/ALXC_CHECK_TLS
951N/A
951N/Aif test "x$GCC" = "xyes"; then
951N/A CFLAGS="$CFLAGS -Wall -Werror"
951N/Afi
951N/A
951N/A# Files requiring some variable expansion
951N/AAC_CONFIG_FILES([
951N/A Makefile
951N/A lxc.pc
951N/A lxc.spec
951N/A
951N/A config/Makefile
951N/A config/apparmor/Makefile
951N/A config/selinux/Makefile
951N/A config/bash/Makefile
951N/A config/bash/lxc
951N/A config/init/Makefile
951N/A config/init/sysvinit/Makefile
951N/A config/init/sysvinit/lxc
951N/A config/init/systemd/Makefile
951N/A config/init/systemd/lxc.service
951N/A config/init/systemd/lxc-net.service
951N/A config/init/upstart/Makefile
951N/A config/etc/Makefile
951N/A config/templates/Makefile
951N/A config/templates/archlinux.common.conf
951N/A config/templates/archlinux.userns.conf
951N/A config/templates/centos.common.conf
951N/A config/templates/centos.userns.conf
951N/A config/templates/common.conf
951N/A config/templates/debian.common.conf
951N/A config/templates/debian.userns.conf
951N/A config/templates/fedora.common.conf
951N/A config/templates/fedora.userns.conf
951N/A config/templates/gentoo.common.conf
951N/A config/templates/gentoo.moresecure.conf
951N/A config/templates/gentoo.userns.conf
951N/A config/templates/opensuse.common.conf
951N/A config/templates/opensuse.userns.conf
951N/A config/templates/oracle.common.conf
951N/A config/templates/oracle.userns.conf
951N/A config/templates/plamo.common.conf
951N/A config/templates/plamo.userns.conf
951N/A config/templates/ubuntu-cloud.common.conf
951N/A config/templates/ubuntu-cloud.lucid.conf
951N/A config/templates/ubuntu-cloud.userns.conf
951N/A config/templates/ubuntu.common.conf
951N/A config/templates/ubuntu.lucid.conf
951N/A config/templates/ubuntu.userns.conf
951N/A config/templates/userns.conf
951N/A config/yum/Makefile
951N/A
951N/A doc/Makefile
951N/A doc/api/Makefile
951N/A doc/legacy/lxc-ls.sgml
951N/A doc/lxc-attach.sgml
951N/A doc/lxc-autostart.sgml
951N/A doc/lxc-cgroup.sgml
951N/A doc/lxc-checkconfig.sgml
951N/A doc/lxc-clone.sgml
951N/A doc/lxc-config.sgml
951N/A doc/lxc-console.sgml
951N/A doc/lxc-create.sgml
951N/A doc/lxc-destroy.sgml
951N/A doc/lxc-device.sgml
951N/A doc/lxc-execute.sgml
951N/A doc/lxc-freeze.sgml
951N/A doc/lxc-info.sgml
951N/A doc/lxc-ls.sgml
951N/A doc/lxc-monitor.sgml
951N/A doc/lxc-snapshot.sgml
951N/A doc/lxc-start-ephemeral.sgml
951N/A doc/lxc-start.sgml
951N/A doc/lxc-stop.sgml
951N/A doc/lxc-top.sgml
951N/A doc/lxc-unfreeze.sgml
951N/A doc/lxc-unshare.sgml
951N/A doc/lxc-user-nic.sgml
951N/A doc/lxc-usernsexec.sgml
951N/A doc/lxc-wait.sgml
951N/A
951N/A doc/lxc.conf.sgml
951N/A doc/lxc.container.conf.sgml
951N/A doc/lxc.system.conf.sgml
951N/A doc/lxc-usernet.sgml
951N/A doc/lxc.sgml
951N/A doc/common_options.sgml
951N/A doc/see_also.sgml
951N/A
951N/A doc/rootfs/Makefile
951N/A
951N/A doc/examples/Makefile
951N/A doc/examples/lxc-macvlan.conf
951N/A doc/examples/lxc-vlan.conf
951N/A doc/examples/lxc-no-netns.conf
951N/A doc/examples/lxc-empty-netns.conf
951N/A doc/examples/lxc-phys.conf
951N/A doc/examples/lxc-veth.conf
951N/A doc/examples/lxc-complex.conf
951N/A
951N/A doc/ja/Makefile
951N/A doc/ja/legacy/lxc-ls.sgml
951N/A doc/ja/lxc-attach.sgml
951N/A doc/ja/lxc-autostart.sgml
951N/A doc/ja/lxc-cgroup.sgml
951N/A doc/ja/lxc-checkconfig.sgml
951N/A doc/ja/lxc-clone.sgml
951N/A doc/ja/lxc-config.sgml
951N/A doc/ja/lxc-console.sgml
951N/A doc/ja/lxc-create.sgml
951N/A doc/ja/lxc-destroy.sgml
951N/A doc/ja/lxc-device.sgml
951N/A doc/ja/lxc-execute.sgml
951N/A doc/ja/lxc-freeze.sgml
951N/A doc/ja/lxc-info.sgml
951N/A doc/ja/lxc-ls.sgml
951N/A doc/ja/lxc-monitor.sgml
951N/A doc/ja/lxc-snapshot.sgml
951N/A doc/ja/lxc-start-ephemeral.sgml
951N/A doc/ja/lxc-start.sgml
951N/A doc/ja/lxc-stop.sgml
951N/A doc/ja/lxc-top.sgml
951N/A doc/ja/lxc-unfreeze.sgml
951N/A doc/ja/lxc-unshare.sgml
951N/A doc/ja/lxc-user-nic.sgml
951N/A doc/ja/lxc-usernsexec.sgml
951N/A doc/ja/lxc-wait.sgml
951N/A
951N/A doc/ja/lxc.conf.sgml
951N/A doc/ja/lxc.container.conf.sgml
951N/A doc/ja/lxc.system.conf.sgml
951N/A doc/ja/lxc-usernet.sgml
951N/A doc/ja/lxc.sgml
951N/A doc/ja/common_options.sgml
951N/A doc/ja/see_also.sgml
951N/A
951N/A hooks/Makefile
951N/A
951N/A templates/Makefile
951N/A templates/lxc-alpine
951N/A templates/lxc-altlinux
951N/A templates/lxc-archlinux
951N/A templates/lxc-busybox
951N/A templates/lxc-centos
951N/A templates/lxc-cirros
951N/A templates/lxc-debian
951N/A templates/lxc-download
951N/A templates/lxc-fedora
951N/A templates/lxc-gentoo
951N/A templates/lxc-openmandriva
951N/A templates/lxc-opensuse
951N/A templates/lxc-oracle
951N/A templates/lxc-plamo
951N/A templates/lxc-sshd
951N/A templates/lxc-ubuntu
951N/A templates/lxc-ubuntu-cloud
951N/A
951N/A src/Makefile
951N/A src/lxc/Makefile
951N/A src/lxc/lxc-checkconfig
951N/A src/lxc/lxc-ls
951N/A src/lxc/lxc-start-ephemeral
951N/A src/lxc/legacy/lxc-ls
951N/A src/lxc/lxc.functions
951N/A src/lxc/version.h
951N/A src/python-lxc/Makefile
951N/A
958N/A src/lua-lxc/Makefile
958N/A
951N/A src/tests/Makefile
951N/A src/tests/lxc-test-usernic
951N/A])
951N/AAC_CONFIG_COMMANDS([default],[[]],[[]])
951N/AAC_OUTPUT
951N/A
951N/A# Configuration overview
951N/Acat << EOF
951N/A
951N/A----------------------------
951N/AEnvironment:
951N/A - compiler: $CC
958N/A - distribution: $with_distro
958N/A - init script type(s): $init_script
951N/A - rpath: $enable_rpath
951N/A - GnuTLS: $enable_gnutls
951N/A - Bash integration: $enable_bash
951N/A - Openvswitch: $enable_ovs
951N/A
951N/ASecurity features:
951N/A - Apparmor: $enable_apparmor
951N/A - Linux capabilities: $enable_capabilities
951N/A - seccomp: $enable_seccomp
951N/A - SELinux: $enable_selinux
951N/A - cgmanager: $enable_cgmanager
951N/A
951N/ABindings:
951N/A - lua: $enable_lua
951N/A - python3: $enable_python
951N/A
951N/ADocumentation:
951N/A - examples: $enable_examples
951N/A - API documentation: $enable_api_docs
951N/A - user documentation: $enable_doc
951N/A
951N/ADebugging:
951N/A - tests: $enable_tests
951N/A - mutex debugging: $enable_mutex_debugging
951N/A
951N/APaths:
951N/A - Logs in configpath: $enable_configpath_log
951N/AEOF
951N/A
951N/Aif test "x$ac_cv_func_pthread_atfork" = "xno" ; then
951N/Acat << EOF
951N/A
951N/AWARNING: Threading not supported on your platform
951N/A
951N/A You are compiling LXC for bionic target which lacks certain threading related functionality used by LXC API (like pthread_atfork).
951N/A Please note that, because of the missing functionality, multithreaded usage of LXC API cause some problems.
951N/AEOF
951N/Afi
951N/A