configure.ac revision 7a82e9236d94619a1ad7aa6df9e2f10c81dbc344
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore# -*- Autoconf -*-
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore# Process this file with autoconf to produce a configure script.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_INIT([lxc], [0.7.1])
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_CHECK_PROG(SETCAP, setcap, yes, no, $PATH$PATH_SEPARATOR/sbin)
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'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 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'AmoreAM_CONDITIONAL([ENABLE_DOCBOOK], [test "x$have_docbook" = "xyes"])
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'AmoreAM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" = "xyes"])
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'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'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'AmoreAS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
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'AmoreAC_CHECK_HEADERS([linux/netlink.h linux/genetlink.h],
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore AC_MSG_ERROR([netlink headers not found. Please install the linux kernel headers.]),
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_CHECK_HEADERS([sys/capability.h], [], AC_MSG_ERROR([please install libcap-devel.]),
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'Amore AC_MSG_ERROR([not found])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_SUBST([CAP_LIBS])
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'AmoreAC_CHECK_HEADERS([sys/signalfd.h])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_PROG_GCC_TRADITIONAL
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amoreif test "x$GCC" = "xyes"; then
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore CFLAGS="$CFLAGS -Wall"
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_CONFIG_FILES([
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'AmoreAC_CONFIG_COMMANDS([default],[[]],[[]])
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amoreif test "x$SETCAP" = "xno"; then
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore AC_MSG_NOTICE([
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 AC_MSG_NOTICE([
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'.