configure.ac revision 7a82e9236d94619a1ad7aa6df9e2f10c81dbc344
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore# -*- Autoconf -*-
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore# Process this file with autoconf to produce a configure script.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_INIT([lxc], [0.7.1])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_CONFIG_SRCDIR([configure.ac])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_CONFIG_AUX_DIR([config])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAM_CONFIG_HEADER([src/config.h])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAM_INIT_AUTOMAKE([-Wno-portability])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_CANONICAL_HOST
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAM_PROG_CC_C_O
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_GNU_SOURCE
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_CHECK_PROG(SETCAP, setcap, yes, no, $PATH$PATH_SEPARATOR/sbin)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_ARG_ENABLE([doc],
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore [AC_HELP_STRING([--enable-doc], [make mans (require docbook2man installed) [default=auto]])],
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore [], [enable_doc=auto])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amoreif test "x$enable_doc" = "xyes" -o "x$enable_doc" = "xauto"; then
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore AC_CHECK_PROG(have_docbook, [docbook2man], [yes], [no])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore test "x$have_docbook" = "xno" -a "x$enable_doc" = "xyes" && \
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore AC_MSG_ERROR([docbook2man required by man request, but not found])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amorefi
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAM_CONDITIONAL([ENABLE_DOCBOOK], [test "x$have_docbook" = "xyes"])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_ARG_ENABLE([examples],
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore [AC_HELP_STRING([--disable-examples], [do not install configuration examples])],
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore [], [enable_examples=yes])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" = "xyes"])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAS_AC_EXPAND(PREFIX, $prefix)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAS_AC_EXPAND(LIBDIR, $libdir)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAS_AC_EXPAND(BINDIR, $bindir)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAS_AC_EXPAND(INCLUDEDIR, $includedir)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAS_AC_EXPAND(DATADIR, $datadir)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAS_AC_EXPAND(LOCALSTATEDIR, $localstatedir)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAS_AC_EXPAND(DOCDIR, $docdir)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_ARG_WITH([config-path],
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore [AC_HELP_STRING(
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore [--with-config-path=dir],
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore [lxc configuration repository path]
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore )], [], [with_config_path="${localstatedir}/lib/lxc"])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_ARG_WITH([rootfs-path],
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore [AC_HELP_STRING(
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore [--with-rootfs-path=dir],
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore [lxc rootfs mount point]
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore )], [], [with_rootfs_path="${libdir}/lxc/rootfs"])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAS_AC_EXPAND(LXCPATH, "${with_config_path}")
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAS_AC_EXPAND(LXCROOTFSMOUNT, "${with_rootfs_path}")
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAS_AC_EXPAND(LXCINITDIR, $libdir/lxc)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAS_AC_EXPAND(LXCTEMPLATEDIR, $libdir/lxc/templates)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAH_TEMPLATE([LXCPATH], [lxc configuration repository])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAH_TEMPLATE([LXCINITDIR], [lxc-init directory location])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAH_TEMPLATE([LXCROOTFSMOUNT], [lxc default rootfs mount point])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_DEFINE_UNQUOTED(LXCPATH, "$LXCPATH")
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_DEFINE_UNQUOTED(LXCINITDIR, "$LXCINITDIR")
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_DEFINE_UNQUOTED(LXCROOTFSMOUNT, "$LXCROOTFSMOUNT")
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_CHECK_HEADERS([linux/netlink.h linux/genetlink.h],
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore [],
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore AC_MSG_ERROR([netlink headers not found. Please install the linux kernel headers.]),
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore [#include <sys/socket.h>
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore ])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_CHECK_HEADERS([sys/capability.h], [], AC_MSG_ERROR([please install libcap-devel.]),
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore[#include <sys/types.h>
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#include <sys/capability.h>])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_CHECK_LIB(cap,cap_set_proc,caplib=yes,caplib=no)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_MSG_CHECKING([linux capabilities])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amoreif test "x$caplib" = "xyes" ; then
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore CAP_LIBS="-lcap"
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore AC_MSG_RESULT([$CAP_LIBS])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amoreelse
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore AC_MSG_ERROR([not found])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amorefi
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_SUBST([CAP_LIBS])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore# Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_CHECK_HEADERS([sys/signalfd.h])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_PROG_GCC_TRADITIONAL
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amoreif test "x$GCC" = "xyes"; then
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore CFLAGS="$CFLAGS -Wall"
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amorefi
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_CONFIG_FILES([
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore Makefile
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore lxc.pc
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore lxc.spec
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore config/Makefile
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/Makefile
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/lxc-create.sgml
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/lxc-destroy.sgml
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/lxc-execute.sgml
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/lxc-start.sgml
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/lxc-checkpoint.sgml
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/lxc-restart.sgml
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/lxc-stop.sgml
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/lxc-console.sgml
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/lxc-freeze.sgml
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/lxc-unfreeze.sgml
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/lxc-monitor.sgml
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/lxc-wait.sgml
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/lxc-ls.sgml
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/lxc-ps.sgml
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/lxc-cgroup.sgml
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/lxc-kill.sgml
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/lxc.conf.sgml
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/lxc.sgml
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/common_options.sgml
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/see_also.sgml
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/rootfs/Makefile
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/examples/Makefile
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/examples/lxc-macvlan.conf
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/examples/lxc-vlan.conf
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/examples/lxc-no-netns.conf
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/examples/lxc-empty-netns.conf
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/examples/lxc-phys.conf
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/examples/lxc-veth.conf
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore doc/examples/lxc-complex.conf
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore templates/Makefile
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore templates/lxc-debian
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore templates/lxc-ubuntu
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore templates/lxc-busybox
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore templates/lxc-fedora
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore templates/lxc-sshd
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore src/Makefile
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore src/lxc/Makefile
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore src/lxc/lxc-ps
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore src/lxc/lxc-ls
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore src/lxc/lxc-netstat
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore src/lxc/lxc-checkconfig
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore src/lxc/lxc-setcap
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore src/lxc/lxc-setuid
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore src/lxc/lxc-version
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore src/lxc/lxc-create
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore src/lxc/lxc-destroy
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_CONFIG_COMMANDS([default],[[]],[[]])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_OUTPUT
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amoreif test "x$SETCAP" = "xno"; then
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore AC_MSG_NOTICE([
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreWarning:
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore--------
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreThe setcap binary was not found. This means the tools to set the
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amoreprivilege for the lxc commands are not available, that's ok, but you
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amorewill need to run these commands as root or install libcap-2.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amoreelse
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore AC_MSG_NOTICE([
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAdvice:
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore-------
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreIf you wish to have a non root user to use the lxc tools,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amoreyou can add the needed capabilities to the tools by invoking
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amorethe 'lxc-setcap' script. To remove the capabilities, use
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore'lxc-setcap -d'.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amorefi
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore