]> git.proxmox.com Git - mirror_lxc.git/blobdiff - configure.ac
Don't include linux/if_bridge.h
[mirror_lxc.git] / configure.ac
index af0991df2e3cb901f252e5128bf2ca7b892246d4..f6c95c1e6c5ce1b8d76c2dcfcefc33d36fabe3ca 100644 (file)
@@ -4,13 +4,17 @@
 m4_define([lxc_version_major], 1)
 m4_define([lxc_version_minor], 0)
 m4_define([lxc_version_micro], 0)
-m4_define([lxc_version_beta], [beta1])
+m4_define([lxc_version_beta], [beta3])
 
 m4_define([lxc_version_base], [lxc_version_major.lxc_version_minor.lxc_version_micro])
 m4_define([lxc_version],
          [ifelse(lxc_version_beta, [], [lxc_version_base], [lxc_version_base.lxc_version_beta])])
 
 AC_INIT([lxc], [lxc_version])
+
+# We need pkg-config
+PKG_PROG_PKG_CONFIG
+
 AC_SUBST(LXC_VERSION_BASE, lxc_version_base)
 AC_SUBST(LXC_VERSION_BETA, lxc_version_beta)
 
@@ -73,45 +77,50 @@ AM_CONDITIONAL([DISTRO_UBUNTU], [test "x$with_distro" = "xubuntu"])
 # Check for init system type
 AC_MSG_CHECKING([for init system type])
 AC_ARG_WITH([init-script],
-           [AC_HELP_STRING([--with-init-script@<:@=TYPE@:>@],
-                           [Type of init script to install: sysv, systemd, upstart,
-                            distro, none @<:@default=distro@:>@])],[],[with_init_script=distro])
+           [AC_HELP_STRING([--with-init-script@<:@=TYPE@<:@,TYPE,...@:>@@:>@],
+                           [Type(s) of init script to install: sysvinit, systemd, upstart,
+                            distro @<:@default=distro@:>@])],[],[with_init_script=distro])
 case "$with_init_script" in
-       sysv)
-               init_script=sysv
-               ;;
-       systemd)
-               init_script=systemd
-               ;;
-       upstart)
-               init_script=upstart
-               ;;
-       none)
-               ;;
        distro)
                case $with_distro in
                        fedora)
                                init_script=systemd
                                ;;
                        redhat|centos|oracle|oracleserver)
-                               init_script=sysv
+                               init_script=sysvinit
+                               ;;
+                       debian)
+                               init_script=upstart,systemd
                                ;;
                        ubuntu)
                                init_script=upstart
                                ;;
                        *)
-                               echo -n "Linux distribution init system unknown, defaulting to sysv"
-                               init_script=sysv
+                               echo -n "Linux distribution init system unknown."
+                               init_script=
                                ;;
                esac
                ;;
        *)
-               AC_MSG_ERROR([Unknown init system type $with_init_script])
+               init_script=$with_init_script
                ;;
 esac
-AM_CONDITIONAL([INIT_SCRIPT_SYSV], test "$init_script" = "sysv")
-AM_CONDITIONAL([INIT_SCRIPT_SYSTEMD], test "$init_script" = "systemd")
-AM_CONDITIONAL([INIT_SCRIPT_UPSTART], test "$init_script" = "upstart")
+
+# Check valid init systems were given, run in subshell so we don't mess up IFS
+(IFS="," ; for init_sys in $init_script;
+do
+       case "$init_sys" in
+               none|sysvinit|systemd|upstart)
+                       ;;
+               *)
+                       exit 1
+                       ;;
+       esac
+done) || AC_MSG_ERROR([Unknown init system type in $init_script])
+
+AM_CONDITIONAL([INIT_SCRIPT_SYSV], [echo "$init_script" |grep -q "sysvinit"])
+AM_CONDITIONAL([INIT_SCRIPT_SYSTEMD], [echo "$init_script" |grep -q "systemd"])
+AM_CONDITIONAL([INIT_SCRIPT_UPSTART], [echo "$init_script" |grep -q "upstart"])
 AC_MSG_RESULT($init_script)
 
 # Allow disabling rpath
@@ -127,7 +136,7 @@ AC_ARG_ENABLE([doc],
 
 if test "x$enable_doc" = "xyes" -o "x$enable_doc" = "xauto"; then
        db2xman=""
-       dbparsers="docbook2x-man db2x_docbook2man docbook2man"
+       dbparsers="docbook2x-man db2x_docbook2man docbook2man docbook-to-man"
 
        AC_MSG_CHECKING(for docbook2x-man)
        for name in ${dbparsers}; do
@@ -224,9 +233,29 @@ fi
 AM_CONDITIONAL([ENABLE_SECCOMP], [test "x$enable_seccomp" = "xyes"])
 
 AM_COND_IF([ENABLE_SECCOMP],
-       [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_SUBST([SECCOMP_LIBS], [-lseccomp])])
+       [PKG_CHECK_MODULES([SECCOMP],[libseccomp],[],[
+               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_SUBST([SECCOMP_LIBS], [-lseccomp])
+               ])
+       ])
+
+# cgmanager
+AC_ARG_ENABLE([cgmanager],
+       [AC_HELP_STRING([--enable-cgmanager], [enable cgmanager support [default=auto]])],
+       [], [enable_cgmanager=auto])
+
+if test "x$enable_cgmanager" = "xauto" ; then
+       AC_CHECK_LIB([cgmanager],[cgmanager_create],[enable_cgmanager=yes],[enable_cgmanager=no])
+fi
+AM_CONDITIONAL([ENABLE_CGMANAGER], [test "x$enable_cgmanager" = "xyes"])
+
+AM_COND_IF([ENABLE_CGMANAGER],
+       [PKG_CHECK_MODULES([CGMANAGER], [libcgmanager])
+       PKG_CHECK_MODULES([NIH], [libnih >= 1.0.2])
+       PKG_CHECK_MODULES([NIH_DBUS], [libnih-dbus >= 1.0.0])
+       PKG_CHECK_MODULES([DBUS], [dbus-1 >= 1.2.16])
+       ])
 
 # Linux capabilities
 AC_ARG_ENABLE([capabilities],
@@ -243,7 +272,10 @@ AM_COND_IF([ENABLE_CAP],
        AC_SUBST([CAP_LIBS], [-lcap])])
 
 # HAVE_SCMP_FILTER_CTX=1 will tell us we have libseccomp api >= 1.0.0
+OLD_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $SECCOMP_CFLAGS"
 AC_CHECK_TYPES([scmp_filter_ctx], [], [], [[#include <seccomp.h>]])
+CFLAGS="$OLD_CFLAGS"
 
 # Configuration examples
 AC_ARG_ENABLE([examples],
@@ -251,9 +283,6 @@ AC_ARG_ENABLE([examples],
        [], [enable_examples=yes])
 AM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" = "xyes"])
 
-# We need pkg-config
-PKG_PROG_PKG_CONFIG
-
 # Python3 module and scripts
 AC_ARG_ENABLE([python],
        [AC_HELP_STRING([--enable-python], [enable python binding [default=auto]])],
@@ -356,6 +385,12 @@ AM_COND_IF([ENABLE_LUA],
                [LUA_INSTALL_LMOD=$datadir/lua/$LUA_VERSION])
        ])
 
+# Optional bash integration
+AC_ARG_ENABLE([bash],
+       [AC_HELP_STRING([--enable-bash], [build bash integration [default=yes]])],
+       [], [enable_bash=yes])
+AM_CONDITIONAL([ENABLE_BASH], [test "x$enable_bash" = "xyes"])
+
 # Optional test binaries
 AC_ARG_ENABLE([tests],
        [AC_HELP_STRING([--enable-tests], [build test/example binaries [default=no]])],
@@ -518,13 +553,34 @@ AC_CONFIG_FILES([
        lxc.spec
 
        config/Makefile
+       config/apparmor/Makefile
+       config/bash/Makefile
+       config/bash/lxc
+       config/init/Makefile
+       config/init/sysvinit/Makefile
+       config/init/systemd/Makefile
+       config/init/upstart/Makefile
        config/etc/Makefile
        config/templates/Makefile
+       config/templates/centos.common.conf
+       config/templates/centos.userns.conf
+       config/templates/debian.common.conf
+       config/templates/debian.userns.conf
+       config/templates/fedora.common.conf
+       config/templates/fedora.userns.conf
+       config/templates/gentoo.common.conf
+       config/templates/gentoo.moresecure.conf
+       config/templates/gentoo.userns.conf
+       config/templates/oracle.common.conf
+       config/templates/oracle.userns.conf
+       config/templates/plamo.common.conf
+       config/templates/plamo.userns.conf
        config/templates/ubuntu-cloud.common.conf
        config/templates/ubuntu-cloud.lucid.conf
        config/templates/ubuntu-cloud.userns.conf
        config/templates/ubuntu.common.conf
        config/templates/ubuntu.lucid.conf
+       config/templates/ubuntu.userns.conf
 
        doc/Makefile
        doc/api/Makefile
@@ -533,8 +589,8 @@ AC_CONFIG_FILES([
        doc/lxc-autostart.sgml
        doc/lxc-cgroup.sgml
        doc/lxc-checkconfig.sgml
-       doc/lxc-checkpoint.sgml
        doc/lxc-clone.sgml
+       doc/lxc-config.sgml
        doc/lxc-console.sgml
        doc/lxc-create.sgml
        doc/lxc-destroy.sgml
@@ -542,12 +598,8 @@ AC_CONFIG_FILES([
        doc/lxc-execute.sgml
        doc/lxc-freeze.sgml
        doc/lxc-info.sgml
-       doc/lxc-kill.sgml
        doc/lxc-ls.sgml
        doc/lxc-monitor.sgml
-       doc/lxc-netstat.sgml
-       doc/lxc-ps.sgml
-       doc/lxc-restart.sgml
        doc/lxc-snapshot.sgml
        doc/lxc-start-ephemeral.sgml
        doc/lxc-start.sgml
@@ -556,10 +608,12 @@ AC_CONFIG_FILES([
        doc/lxc-unfreeze.sgml
        doc/lxc-unshare.sgml
        doc/lxc-user-nic.sgml
-       doc/lxc-version.sgml
+       doc/lxc-usernsexec.sgml
        doc/lxc-wait.sgml
 
        doc/lxc.conf.sgml
+       doc/lxc.container.conf.sgml
+       doc/lxc.system.conf.sgml
        doc/lxc-usernet.sgml
        doc/lxc.sgml
        doc/common_options.sgml
@@ -582,8 +636,8 @@ AC_CONFIG_FILES([
        doc/ja/lxc-autostart.sgml
        doc/ja/lxc-cgroup.sgml
        doc/ja/lxc-checkconfig.sgml
-       doc/ja/lxc-checkpoint.sgml
        doc/ja/lxc-clone.sgml
+       doc/ja/lxc-config.sgml
        doc/ja/lxc-console.sgml
        doc/ja/lxc-create.sgml
        doc/ja/lxc-destroy.sgml
@@ -591,12 +645,8 @@ AC_CONFIG_FILES([
        doc/ja/lxc-execute.sgml
        doc/ja/lxc-freeze.sgml
        doc/ja/lxc-info.sgml
-       doc/ja/lxc-kill.sgml
        doc/ja/lxc-ls.sgml
        doc/ja/lxc-monitor.sgml
-       doc/ja/lxc-netstat.sgml
-       doc/ja/lxc-ps.sgml
-       doc/ja/lxc-restart.sgml
        doc/ja/lxc-snapshot.sgml
        doc/ja/lxc-start-ephemeral.sgml
        doc/ja/lxc-start.sgml
@@ -605,10 +655,12 @@ AC_CONFIG_FILES([
        doc/ja/lxc-unfreeze.sgml
        doc/ja/lxc-unshare.sgml
        doc/ja/lxc-user-nic.sgml
-       doc/ja/lxc-version.sgml
+       doc/ja/lxc-usernsexec.sgml
        doc/ja/lxc-wait.sgml
 
        doc/ja/lxc.conf.sgml
+       doc/ja/lxc.container.conf.sgml
+       doc/ja/lxc.system.conf.sgml
        doc/ja/lxc-usernet.sgml
        doc/ja/lxc.sgml
        doc/ja/common_options.sgml
@@ -617,28 +669,27 @@ AC_CONFIG_FILES([
        hooks/Makefile
 
        templates/Makefile
-       templates/lxc-cirros
-       templates/lxc-debian
-       templates/lxc-ubuntu
-       templates/lxc-ubuntu-cloud
-       templates/lxc-opensuse
+       templates/lxc-alpine
+       templates/lxc-altlinux
+       templates/lxc-archlinux
        templates/lxc-busybox
        templates/lxc-centos
+       templates/lxc-cirros
+       templates/lxc-debian
+       templates/lxc-download
        templates/lxc-fedora
+       templates/lxc-gentoo
        templates/lxc-openmandriva
+       templates/lxc-opensuse
        templates/lxc-oracle
-       templates/lxc-altlinux
-       templates/lxc-sshd
-       templates/lxc-archlinux
-       templates/lxc-alpine
        templates/lxc-plamo
+       templates/lxc-sshd
+       templates/lxc-ubuntu
+       templates/lxc-ubuntu-cloud
 
        src/Makefile
        src/lxc/Makefile
-       src/lxc/lxc-ps
-       src/lxc/lxc-netstat
        src/lxc/lxc-checkconfig
-       src/lxc/lxc-version
        src/lxc/lxc-start-ephemeral
        src/lxc/legacy/lxc-ls
        src/lxc/lxc.functions
@@ -648,6 +699,7 @@ AC_CONFIG_FILES([
        src/lua-lxc/Makefile
 
        src/tests/Makefile
+       src/tests/lxc-test-usernic
 ])
 AC_CONFIG_COMMANDS([default],[[]],[[]])
 AC_OUTPUT
@@ -659,15 +711,17 @@ cat << EOF
 Environment:
  - compiler: $CC
  - distribution: $with_distro
- - init script type: $init_script
+ - init script type(s): $init_script
  - rpath: $enable_rpath
  - GnuTLS: $enable_gnutls
+ - Bash integration: $enable_bash
 
 Security features:
  - Apparmor: $enable_apparmor
  - Linux capabilities: $enable_capabilities
  - seccomp: $enable_seccomp
  - SELinux: $enable_selinux
+ - cgmanager: $enable_cgmanager
 
 Bindings:
  - lua: $enable_lua