]> git.proxmox.com Git - mirror_lxc.git/blobdiff - configure.ac
doc: fix regex-typo in Japanese and Korean lxc-monitor(1)
[mirror_lxc.git] / configure.ac
index 8c07d9791d8f81e1fb4877b3a2d4d6048282032b..fcfec39cdeacdc466337cf15a0ebd5f57cc27faa 100644 (file)
@@ -1,11 +1,16 @@
 #                                               -*- Autoconf -*-
 # Process this file with autoconf to produce a configure script.
 
+m4_define([lxc_devel], 0)
 m4_define([lxc_version_major], 2)
-m4_define([lxc_version_minor], 0)
+m4_define([lxc_version_minor], 1)
 m4_define([lxc_version_micro], 0)
 m4_define([lxc_version_beta], [])
-m4_define([lxc_version_abi], 1.2.0)
+
+m4_define([lxc_abi_major], 1)
+m4_define([lxc_abi_minor], 3)
+m4_define([lxc_abi_micro], 0)
+m4_define([lxc_abi], [lxc_abi_major.lxc_abi_minor.lxc_abi_micro])
 
 m4_define([lxc_version_base], [lxc_version_major.lxc_version_minor.lxc_version_micro])
 m4_define([lxc_version],
@@ -22,8 +27,13 @@ AC_SUBST(LXC_VERSION_BETA, lxc_version_beta)
 AC_SUBST([LXC_VERSION_MAJOR], [lxc_version_major])
 AC_SUBST([LXC_VERSION_MINOR], [lxc_version_minor])
 AC_SUBST([LXC_VERSION_MICRO], [lxc_version_micro])
-AC_SUBST([LXC_VERSION_ABI], [lxc_version_abi])
 AC_SUBST([LXC_VERSION], [lxc_version])
+AC_SUBST([LXC_DEVEL], [lxc_devel])
+
+AC_SUBST([LXC_ABI_MAJOR], [lxc_abi_major])
+AC_SUBST([LXC_ABI_MINOR], [lxc_abi_minor])
+AC_SUBST([LXC_ABI_MICRO], [lxc_abi_micro])
+AC_SUBST([LXC_ABI], [lxc_abi])
 
 AC_CONFIG_SRCDIR([configure.ac])
 AC_CONFIG_AUX_DIR([config])
@@ -33,6 +43,10 @@ AC_CANONICAL_HOST
 AM_PROG_CC_C_O
 AC_GNU_SOURCE
 
+# libtool
+LT_INIT
+AC_SUBST([LIBTOOL_DEPS])
+
 # Detect the distribution. This is used for the default configuration and
 # for some distro-specific build options.
 AC_MSG_CHECKING([host distribution])
@@ -100,13 +114,13 @@ case "$with_init_script" in
                        fedora|altlinux|opensuse*)
                                init_script=systemd
                                ;;
-                       redhat|centos|oracle|oracleserver|sparclinux|plamo)
+                       redhat|oracle|oracleserver|sparclinux|plamo)
                                init_script=sysvinit
                                ;;
-                       debian|raspbian)
-                               init_script=upstart,systemd
+                       centos)
+                               init_script=sysvinit,systemd
                                ;;
-                       ubuntu)
+                       debian|raspbian|ubuntu)
                                init_script=upstart,systemd
                                ;;
                        pld)
@@ -242,13 +256,26 @@ if test "$enable_apparmor" = "auto" ; then
 fi
 AM_CONDITIONAL([ENABLE_APPARMOR], [test "x$enable_apparmor" = "xyes"])
 
-AC_CHECK_LIB([gnutls], [gnutls_hash_fast], [enable_gnutls=yes], [enable_gnutls=no])
-
 AM_COND_IF([ENABLE_APPARMOR],
        [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_SUBST([APPARMOR_LIBS], [-lapparmor])])
 
+# GnuTLS
+AC_ARG_ENABLE([gnutls],
+       [AC_HELP_STRING([--enable-gnutls], [enable GnuTLS support [default=auto]])],
+       [], [enable_gnutls=auto])
+
+if test "$enable_gnutls" = "auto" ; then
+       AC_CHECK_LIB([gnutls], [gnutls_hash_fast], [enable_gnutls=yes], [enable_gnutls=no])
+fi
+AM_CONDITIONAL([ENABLE_GNUTLS], [test "x$enable_gnutls" = "xyes"])
+
+AM_COND_IF([ENABLE_GNUTLS],
+       [AC_CHECK_HEADER([gnutls/gnutls.h],[],[AC_MSG_ERROR([You must install the GnuTLS development package in order to compile lxc])])
+       AC_CHECK_LIB([gnutls], [gnutls_hash_fast],[],[AC_MSG_ERROR([You must install the GnuTLS development package in order to compile lxc])])
+       AC_SUBST([GNUTLS_LIBS], [-lgnutls])])
+
 # SELinux
 AC_ARG_ENABLE([selinux],
        [AC_HELP_STRING([--enable-selinux], [enable SELinux support [default=auto]])],
@@ -343,8 +370,11 @@ fi
 AM_CONDITIONAL([ENABLE_CAP], [test "x$enable_capabilities" = "xyes"])
 
 AM_COND_IF([ENABLE_CAP],
-       [AC_CHECK_LIB(cap,cap_set_proc,[true],[AC_MSG_ERROR([You are missing libcap support.])])
-       AC_SUBST([CAP_LIBS], [-lcap])])
+       [AC_CHECK_HEADER([sys/capability.h],[],[AC_MSG_ERROR([You must install the libcap development package in order to compile lxc])])
+       AC_CHECK_LIB(cap,cap_set_proc,[],[AC_MSG_ERROR([You must install the libcap development package in order to compile lxc])])
+        # Test whether we support getting file capabilities via cap_get_file().
+        AC_CHECK_LIB(cap,cap_get_file, AC_DEFINE(LIBCAP_SUPPORTS_FILE_CAPABILITIES,1,[Have cap_get_file]),[],[])
+        AC_SUBST([CAP_LIBS], [-lcap])])
 
 # HAVE_SCMP_FILTER_CTX=1 will tell us we have libseccomp api >= 1.0.0
 OLD_CFLAGS="$CFLAGS"
@@ -465,6 +495,14 @@ AC_ARG_ENABLE([bash],
        [], [enable_bash=yes])
 AM_CONDITIONAL([ENABLE_BASH], [test "x$enable_bash" = "xyes"])
 
+AM_COND_IF([ENABLE_BASH],
+       [AC_MSG_CHECKING([bash completion directory])
+       PKG_CHECK_VAR(bashcompdir, [bash-completion], [completionsdir], ,
+               bashcompdir="${sysconfdir}/bash_completion.d")
+       AC_MSG_RESULT([$bashcompdir])
+       AC_SUBST(bashcompdir)
+       ])
+
 # Optional test binaries
 AC_ARG_ENABLE([tests],
        [AC_HELP_STRING([--enable-tests], [build test/example binaries [default=no]])],
@@ -520,7 +558,7 @@ AC_ARG_WITH([cgroup-pattern],
        [AC_HELP_STRING(
                [--with-cgroup-pattern=pattern],
                [pattern for container cgroups]
-       )], [], [with_cgroup_pattern=['/lxc/%n']])
+       )], [], [with_cgroup_pattern=['lxc/%n']])
 
 # Container log path.  By default, use $lxcpath.
 AC_MSG_CHECKING([Whether to place logfiles in container config path])
@@ -603,10 +641,13 @@ AC_CHECK_DECLS([PR_SET_NO_NEW_PRIVS], [], [], [#include <sys/prctl.h>])
 AC_CHECK_DECLS([PR_GET_NO_NEW_PRIVS], [], [], [#include <sys/prctl.h>])
 
 # Check for some headers
-AC_CHECK_HEADERS([sys/signalfd.h pty.h ifaddrs.h sys/capability.h sys/personality.h utmpx.h sys/timerfd.h])
+AC_CHECK_HEADERS([sys/signalfd.h pty.h ifaddrs.h sys/memfd.h sys/personality.h utmpx.h sys/timerfd.h sys/resource.h])
+
+# lookup major()/minor()/makedev()
+AC_HEADER_MAJOR
 
 # Check for some syscalls functions
-AC_CHECK_FUNCS([setns pivot_root sethostname unshare rand_r confstr faccessat])
+AC_CHECK_FUNCS([setns pivot_root sethostname unshare rand_r confstr faccessat gettid memfd_create])
 
 # Check for some functions
 AC_CHECK_LIB(pthread, main)
@@ -626,6 +667,10 @@ AC_CHECK_FUNCS([fgetln],
        AM_CONDITIONAL(HAVE_FGETLN, true)
        AC_DEFINE(HAVE_FGETLN,1,[Have fgetln]),
        AM_CONDITIONAL(HAVE_FGETLN, false))
+AC_CHECK_FUNCS([prlimit],
+       AM_CONDITIONAL(HAVE_PRLIMIT, true)
+       AC_DEFINE(HAVE_PRLIMIT,1,[Have prlimit]),
+       AM_CONDITIONAL(HAVE_PRLIMIT, false))
 
 # Check for some libraries
 AC_SEARCH_LIBS(sem_open, [rt pthread])
@@ -705,6 +750,10 @@ AC_CONFIG_FILES([
        config/templates/openwrt.common.conf
        config/templates/sparclinux.common.conf
        config/templates/sparclinux.userns.conf
+       config/templates/voidlinux.common.conf
+       config/templates/voidlinux.userns.conf
+       config/templates/sabayon.common.conf
+       config/templates/sabayon.userns.conf
        config/templates/userns.conf
        config/yum/Makefile
        config/sysconfig/Makefile
@@ -736,6 +785,7 @@ AC_CONFIG_FILES([
        doc/lxc-top.sgml
        doc/lxc-unfreeze.sgml
        doc/lxc-unshare.sgml
+       doc/lxc-update-config.sgml
        doc/lxc-user-nic.sgml
        doc/lxc-usernsexec.sgml
        doc/lxc-wait.sgml
@@ -845,6 +895,7 @@ AC_CONFIG_FILES([
        templates/lxc-debian
        templates/lxc-download
        templates/lxc-fedora
+       templates/lxc-fedora-legacy
        templates/lxc-gentoo
        templates/lxc-openmandriva
        templates/lxc-opensuse
@@ -856,12 +907,15 @@ AC_CONFIG_FILES([
        templates/lxc-ubuntu
        templates/lxc-ubuntu-cloud
        templates/lxc-sparclinux
+       templates/lxc-voidlinux
+       templates/lxc-sabayon
 
        src/Makefile
        src/lxc/Makefile
        src/lxc/lxc.functions
        src/lxc/tools/lxc-checkconfig
        src/lxc/tools/lxc-start-ephemeral
+       src/lxc/tools/lxc-update-config
        src/lxc/version.h
        src/python-lxc/Makefile