]> git.proxmox.com Git - mirror_lxc.git/blobdiff - configure.ac
doc: Update Korean lxc-snapshot(1) for newname option
[mirror_lxc.git] / configure.ac
index b07ac143b28a7c0c3f606addcb03b672ab02e93c..5e9538e4706be321007f2da821406ce79652e455 100644 (file)
@@ -2,9 +2,9 @@
 # Process this file with autoconf to produce a configure script.
 
 m4_define([lxc_version_major], 1)
-m4_define([lxc_version_minor], 0)
+m4_define([lxc_version_minor], 1)
 m4_define([lxc_version_micro], 0)
-m4_define([lxc_version_beta], [beta4])
+m4_define([lxc_version_beta], [])
 
 m4_define([lxc_version_base], [lxc_version_major.lxc_version_minor.lxc_version_micro])
 m4_define([lxc_version],
@@ -35,7 +35,7 @@ AC_GNU_SOURCE
 # for some distro-specific build options.
 AC_MSG_CHECKING([host distribution])
 AC_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.]))
-if test "z$with_distro" = "z"; then
+if type lsb_release >/dev/null 2>&1 && test "z$with_distro" = "z"; then
        with_distro=`lsb_release -is`
 fi
 if test "z$with_distro" = "z"; then
@@ -59,21 +59,25 @@ if test "z$with_distro" = "z"; then
        with_distro="unknown"
 fi
 case $with_distro in
-       ubuntu)
-               distroconf=default.conf.ubuntu
+       ubuntu|raspbian)
+               distroconf=default.conf.lxcbr
+               distrosysconf="$sysconfdir/default"
                ;;
-       redhat|centos|fedora|oracle|oracleserver)
-               distroconf=default.conf.libvirt
+       redhat|centos|fedora|oracle|oracleserver|suse|opensuse*)
+               distroconf=default.conf.lxcbr
+               distrosysconf="$sysconfdir/sysconfig"
                ;;
        *)
-               echo -n "Linux distribution network config unknown, defaulting to lxc.network.type = empty"
                distroconf=default.conf.unknown
+               distrosysconf="$sysconfdir/default"
                ;;
 esac
 AC_MSG_RESULT([$with_distro])
-AM_CONDITIONAL([HAVE_DEBIAN], [test x"$with_distro" = "xdebian" -o x"$with_distro" = "xubuntu"])
+AM_CONDITIONAL([HAVE_DEBIAN], [test x"$with_distro" = "xdebian" -o x"$with_distro" = "xubuntu" -o x"$with_distro" = "xraspbian"])
 AM_CONDITIONAL([DISTRO_UBUNTU], [test "x$with_distro" = "xubuntu"])
 
+AC_CONFIG_LINKS([config/etc/default.conf:config/etc/${distroconf}])
+
 # Check for init system type
 AC_MSG_CHECKING([for init system type])
 AC_ARG_WITH([init-script],
@@ -83,17 +87,17 @@ AC_ARG_WITH([init-script],
 case "$with_init_script" in
        distro)
                case $with_distro in
-                       fedora)
+                       fedora|opensuse*)
                                init_script=systemd
                                ;;
                        redhat|centos|oracle|oracleserver)
                                init_script=sysvinit
                                ;;
-                       debian)
+                       debian|raspbian)
                                init_script=upstart,systemd
                                ;;
                        ubuntu)
-                               init_script=upstart
+                               init_script=upstart,systemd
                                ;;
                        *)
                                echo -n "Linux distribution init system unknown."
@@ -123,6 +127,18 @@ 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)
 
+# systemd unit dir
+AC_ARG_WITH([systemdsystemunitdir],
+            AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
+            [],
+            [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
+if test -z "$with_systemdsystemunitdir"; then
+  with_systemdsystemunitdir=/lib/systemd/system
+fi
+if test "x$with_systemdsystemunitdir" != "xno"; then
+  AC_SUBST([SYSTEMD_UNIT_DIR], [$with_systemdsystemunitdir])
+fi
+
 # Allow disabling rpath
 AC_ARG_ENABLE([rpath],
        [AC_HELP_STRING([--enable-rpath], [set rpath in executables [default=no]])],
@@ -219,8 +235,8 @@ fi
 AM_CONDITIONAL([ENABLE_SELINUX], [test "x$enable_selinux" = "xyes"])
 AM_COND_IF([ENABLE_SELINUX],
        [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],[],[AC_MSG_ERROR([You must install the SELinux development package in order to compile lxc])])
-       AC_SUBST([SELINUX_LIBS])])
+       AC_CHECK_LIB([selinux], [setexeccon_raw],[true],[AC_MSG_ERROR([You must install the SELinux development package in order to compile lxc])])
+       AC_SUBST([SELINUX_LIBS], [-lselinux])])
 
 # Seccomp syscall filter
 AC_ARG_ENABLE([seccomp],
@@ -246,7 +262,7 @@ AC_ARG_ENABLE([cgmanager],
        [], [enable_cgmanager=auto])
 
 if test "x$enable_cgmanager" = "xauto" ; then
-       AC_CHECK_LIB([cgmanager],[cgmanager_create],[enable_cgmanager=yes],[enable_cgmanager=no],[-lnih -lnih-dbus])
+       AC_CHECK_LIB([cgmanager],[cgmanager_create],[enable_cgmanager=yes],[enable_cgmanager=no],[-lnih -lnih-dbus -ldbus-1])
 fi
 AM_CONDITIONAL([ENABLE_CGMANAGER], [test "x$enable_cgmanager" = "xyes"])
 
@@ -257,6 +273,40 @@ AM_COND_IF([ENABLE_CGMANAGER],
        PKG_CHECK_MODULES([DBUS], [dbus-1 >= 1.2.16])
        ])
 
+AC_MSG_CHECKING(for get_pid_cgroup_abs_sync)
+save_LIBS=$LIBS
+AC_SEARCH_LIBS([cgmanager_get_pid_cgroup_abs_sync], [cgmanager], [have_abs_cgroups=yes], [have_abs_cgroups=no], [-lnih -lnih-dbus -ldbus-1])
+LIBS=$save_LIBS
+if test "x$have_abs_cgroups" = "xyes"; then
+       AC_DEFINE([HAVE_CGMANAGER_GET_PID_CGROUP_ABS_SYNC], 1, [Have cgmanager_get_pid_cgroup_abs_sync])
+       AC_MSG_RESULT([yes])
+else
+       AC_MSG_RESULT([no])
+fi
+
+AC_MSG_CHECKING(for cgmanager_list_controllers)
+save_LIBS=$LIBS
+AC_SEARCH_LIBS([cgmanager_list_controllers_sync], [cgmanager], [have_list_controllers=yes], [have_list_controllers=no], [-lnih -lnih-dbus -ldbus-1])
+LIBS=$save_LIBS
+if test "x$have_list_controllers" = "xyes"; then
+       AC_DEFINE([HAVE_CGMANAGER_LIST_CONTROLLERS], 1, [Have cgmanager_list_controllers])
+       AC_MSG_RESULT([yes])
+else
+       AC_MSG_RESULT([no])
+fi
+
+# Check for static libcap, make sure the function checked for differs from the
+# the one checked below so the cache doesn't give a wrong answer
+OLD_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -static"
+AC_CHECK_LIB([cap],[cap_init],[have_static_libcap=yes],[have_static_libcap=no])
+AM_CONDITIONAL([HAVE_STATIC_LIBCAP], [test "x$have_static_libcap" = "xyes"])
+if test "x$have_static_libcap" = "xyes"; then
+       AC_DEFINE([HAVE_STATIC_LIBCAP], 1, [Have static libcap])
+fi
+CFLAGS="$OLD_CFLAGS"
+
+
 # Linux capabilities
 AC_ARG_ENABLE([capabilities],
        [AC_HELP_STRING([--enable-capabilities], [enable kernel capabilities support [default=auto]])],
@@ -268,13 +318,14 @@ fi
 AM_CONDITIONAL([ENABLE_CAP], [test "x$enable_capabilities" = "xyes"])
 
 AM_COND_IF([ENABLE_CAP],
-       [AC_CHECK_LIB(cap,cap_set_proc,[],[AC_MSG_ERROR([You are missing libcap support.])])
+       [AC_CHECK_LIB(cap,cap_set_proc,[true],[AC_MSG_ERROR([You are missing libcap support.])])
        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>]])
+AC_CHECK_DECLS([seccomp_syscall_resolve_name_arch], [], [], [[#include <seccomp.h>]])
 CFLAGS="$OLD_CFLAGS"
 
 # Configuration examples
@@ -379,10 +430,8 @@ AM_COND_IF([ENABLE_LUA],
        PKG_CHECK_VAR([LUA_VERSION], [$LUAPKGCONFIG], [V],,
                [PKG_CHECK_VAR([LUA_VERSION], [$LUAPKGCONFIG], [major_version])])
        AC_MSG_RESULT([$LUA_VERSION])
-       PKG_CHECK_VAR([LUA_INSTALL_CMOD], [$LUAPKGCONFIG], [INSTALL_CMOD],,
-               [LUA_INSTALL_CMOD=$libdir/lua/$LUA_VERSION])
-       PKG_CHECK_VAR([LUA_INSTALL_LMOD], [$LUAPKGCONFIG], [INSTALL_LMOD],,
-               [LUA_INSTALL_LMOD=$datadir/lua/$LUA_VERSION])
+       AC_SUBST([LUA_LIBDIR], [$libdir/lua/$LUA_VERSION])
+       AC_SUBST([LUA_SHAREDIR], [$datadir/lua/$LUA_VERSION])
        ])
 
 # Optional bash integration
@@ -397,6 +446,13 @@ AC_ARG_ENABLE([tests],
        [], [enable_tests=no])
 AM_CONDITIONAL([ENABLE_TESTS], [test "x$enable_tests" = "xyes"])
 
+# Allow overriding the default runtime dir (/run)
+AC_ARG_WITH([runtime-path],
+       [AC_HELP_STRING(
+               [--with-runtime-path=dir],
+               [runtime directory (default: /run)]
+       )], [], [with_runtime_path=['/run']])
+
 # LXC container path, where the containers are actually stored
 # This is overridden by an entry in the file called LXCCONF
 # (i.e. /etc/lxc/lxc.conf)
@@ -425,7 +481,7 @@ AC_ARG_WITH([usernic-db],
        [AC_HELP_STRING(
                [--with-usernic-db],
                [lxc user nic database]
-       )], [], [with_usernic_db=['/run/lxc/nics']])
+       )], [], [with_usernic_db=['${with_runtime_path}/lxc/nics']])
 
 # Rootfs path, where the container mount structure is assembled
 AC_ARG_WITH([rootfs-path],
@@ -465,6 +521,7 @@ AC_ARG_WITH([log-path],
 AS_AC_EXPAND(PREFIX, "$prefix")
 AS_AC_EXPAND(LIBDIR, "$libdir")
 AS_AC_EXPAND(BINDIR, "$bindir")
+AS_AC_EXPAND(SBINDIR, "$sbindir")
 AS_AC_EXPAND(LIBEXECDIR, "$libexecdir")
 AS_AC_EXPAND(INCLUDEDIR, "$includedir")
 AS_AC_EXPAND(SYSCONFDIR, "$sysconfdir")
@@ -472,20 +529,24 @@ AS_AC_EXPAND(LXC_DEFAULT_CONFIG, "$sysconfdir/lxc/default.conf")
 AS_AC_EXPAND(DATADIR, "$datadir")
 AS_AC_EXPAND(LOCALSTATEDIR, "$localstatedir")
 AS_AC_EXPAND(DOCDIR, "$docdir")
-AS_AC_EXPAND(LXC_DISTRO_CONF, "$distroconf")
 AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
 AS_AC_EXPAND(LXCPATH, "$with_config_path")
 AS_AC_EXPAND(LXC_GLOBAL_CONF, "$with_global_conf")
 AS_AC_EXPAND(LXC_USERNIC_CONF, "$with_usernic_conf")
 AS_AC_EXPAND(LXC_USERNIC_DB, "$with_usernic_db")
+AS_AC_EXPAND(LXC_DISTRO_SYSCONF, "$distrosysconf")
 AS_AC_EXPAND(LXCROOTFSMOUNT, "$with_rootfs_path")
 AS_AC_EXPAND(LXCTEMPLATEDIR, "$datadir/lxc/templates")
 AS_AC_EXPAND(LXCTEMPLATECONFIG, "$datadir/lxc/config")
 AS_AC_EXPAND(LXCHOOKDIR, "$datadir/lxc/hooks")
 AS_AC_EXPAND(LXCINITDIR, "$libexecdir")
 AS_AC_EXPAND(LOGPATH, "$with_log_path")
+AS_AC_EXPAND(RUNTIME_PATH, "$with_runtime_path")
 AC_SUBST(DEFAULT_CGROUP_PATTERN, ["$with_cgroup_pattern"])
 
+# We need the install path so criu knows where to reference the hook scripts.
+AC_DEFINE_UNQUOTED([DATADIR], "$DATADIR", ["Prefix for shared files."])
+
 # Check for some standard kernel headers
 AC_CHECK_HEADERS([linux/unistd.h linux/netlink.h linux/genetlink.h],
                                [],
@@ -520,6 +581,7 @@ AC_CHECK_FUNCS([setns pivot_root sethostname unshare rand_r confstr faccessat])
 # Check for some functions
 AC_CHECK_LIB(pthread, main)
 AC_CHECK_FUNCS(pthread_atfork)
+AC_CHECK_FUNCS(statvfs)
 AC_CHECK_LIB(util, openpty)
 AC_CHECK_FUNCS([openpty hasmntopt setmntent endmntent utmpxname])
 AC_CHECK_FUNCS([getline],
@@ -554,16 +616,30 @@ AC_CONFIG_FILES([
 
        config/Makefile
        config/apparmor/Makefile
+       config/selinux/Makefile
        config/bash/Makefile
        config/bash/lxc
        config/init/Makefile
-       config/init/sysvinit/Makefile
+       config/init/common/Makefile
+       config/init/common/lxc-containers
+       config/init/common/lxc-net
        config/init/systemd/Makefile
+       config/init/systemd/lxc.service
+       config/init/systemd/lxc@.service
+       config/init/systemd/lxc-net.service
+       config/init/sysvinit/Makefile
+       config/init/sysvinit/lxc-containers
+       config/init/sysvinit/lxc-net
+       config/init/upstart/lxc-net.conf
        config/init/upstart/Makefile
        config/etc/Makefile
        config/templates/Makefile
+       config/templates/archlinux.common.conf
+       config/templates/archlinux.userns.conf
        config/templates/centos.common.conf
        config/templates/centos.userns.conf
+       config/templates/common.conf
+       config/templates/common.conf.d/Makefile
        config/templates/debian.common.conf
        config/templates/debian.userns.conf
        config/templates/fedora.common.conf
@@ -571,6 +647,8 @@ AC_CONFIG_FILES([
        config/templates/gentoo.common.conf
        config/templates/gentoo.moresecure.conf
        config/templates/gentoo.userns.conf
+       config/templates/opensuse.common.conf
+       config/templates/opensuse.userns.conf
        config/templates/oracle.common.conf
        config/templates/oracle.userns.conf
        config/templates/plamo.common.conf
@@ -581,6 +659,11 @@ AC_CONFIG_FILES([
        config/templates/ubuntu.common.conf
        config/templates/ubuntu.lucid.conf
        config/templates/ubuntu.userns.conf
+       config/templates/openwrt.common.conf
+       config/templates/userns.conf
+       config/yum/Makefile
+       config/sysconfig/Makefile
+       config/sysconfig/lxc
 
        doc/Makefile
        doc/api/Makefile
@@ -589,6 +672,7 @@ 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
@@ -636,6 +720,7 @@ 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
@@ -666,6 +751,43 @@ AC_CONFIG_FILES([
        doc/ja/common_options.sgml
        doc/ja/see_also.sgml
 
+       doc/ko/Makefile
+       doc/ko/legacy/lxc-ls.sgml
+       doc/ko/lxc-attach.sgml
+       doc/ko/lxc-autostart.sgml
+       doc/ko/lxc-cgroup.sgml
+       doc/ko/lxc-checkconfig.sgml
+       doc/ko/lxc-checkpoint.sgml
+       doc/ko/lxc-clone.sgml
+       doc/ko/lxc-config.sgml
+       doc/ko/lxc-console.sgml
+       doc/ko/lxc-create.sgml
+       doc/ko/lxc-destroy.sgml
+       doc/ko/lxc-device.sgml
+       doc/ko/lxc-execute.sgml
+       doc/ko/lxc-freeze.sgml
+       doc/ko/lxc-info.sgml
+       doc/ko/lxc-ls.sgml
+       doc/ko/lxc-monitor.sgml
+       doc/ko/lxc-snapshot.sgml
+       doc/ko/lxc-start-ephemeral.sgml
+       doc/ko/lxc-start.sgml
+       doc/ko/lxc-stop.sgml
+       doc/ko/lxc-top.sgml
+       doc/ko/lxc-unfreeze.sgml
+       doc/ko/lxc-unshare.sgml
+       doc/ko/lxc-user-nic.sgml
+       doc/ko/lxc-usernsexec.sgml
+       doc/ko/lxc-wait.sgml
+
+       doc/ko/lxc.conf.sgml
+       doc/ko/lxc.container.conf.sgml
+       doc/ko/lxc.system.conf.sgml
+       doc/ko/lxc-usernet.sgml
+       doc/ko/lxc.sgml
+       doc/ko/common_options.sgml
+       doc/ko/see_also.sgml
+
        hooks/Makefile
 
        templates/Makefile
@@ -690,11 +812,13 @@ AC_CONFIG_FILES([
        src/Makefile
        src/lxc/Makefile
        src/lxc/lxc-checkconfig
+       src/lxc/lxc-ls
        src/lxc/lxc-start-ephemeral
        src/lxc/legacy/lxc-ls
        src/lxc/lxc.functions
        src/lxc/version.h
        src/python-lxc/Makefile
+       src/python-lxc/setup.py
 
        src/lua-lxc/Makefile