2 # Process this file with autoconf to produce a configure script.
4 AC_INIT([lxc], [0.8.0-rc2])
6 AC_CONFIG_SRCDIR([configure.ac])
7 AC_CONFIG_AUX_DIR([config])
8 AM_CONFIG_HEADER([src/config.h])
9 AM_INIT_AUTOMAKE([-Wno-portability])
13 AC_CHECK_PROG(SETCAP, setcap, yes, no, $PATH$PATH_SEPARATOR/sbin)
15 AC_ARG_ENABLE([rpath],
16 [AC_HELP_STRING([--disable-rpath], [do not set rpath in executables])],
17 [], [enable_rpath=yes])
19 AM_CONDITIONAL([ENABLE_RPATH], [test "x$enable_rpath" = "xyes"])
21 AC_ARG_ENABLE([apparmor],
22 [AC_HELP_STRING([--enable-apparmor], [enable apparmor])],
23 [], [enable_apparmor=yes])
24 AM_CONDITIONAL([ENABLE_APPARMOR], [test "x$enable_apparmor" = "xyes"])
27 [AC_HELP_STRING([--enable-doc], [make mans (require docbook2man installed) [default=auto]])],
28 [], [enable_doc=auto])
30 if test "x$enable_doc" = "xyes" -o "x$enable_doc" = "xauto"; then
31 AC_CHECK_PROG(have_docbook, [docbook2man], [yes], [no])
33 test "x$have_docbook" = "xno" -a "x$enable_doc" = "xyes" && \
34 AC_MSG_ERROR([docbook2man required by man request, but not found])
37 AM_COND_IF([ENABLE_APPARMOR],
38 [AC_CHECK_HEADER([sys/apparmor.h],[],[AC_MSG_ERROR([You must install the AppArmor development package in order to compile lxc])])
39 AC_CHECK_LIB([apparmor], [aa_change_profile],[],[AC_MSG_ERROR([You must install the AppArmor development package in order to compile lxc])])
40 AC_SUBST([APPARMOR_LIBS], [-lapparmor])])
42 AM_CONDITIONAL([ENABLE_DOCBOOK], [test "x$have_docbook" = "xyes"])
44 AC_ARG_ENABLE([examples],
45 [AC_HELP_STRING([--disable-examples], [do not install configuration examples])],
46 [], [enable_examples=yes])
48 AM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" = "xyes"])
50 AS_AC_EXPAND(PREFIX, $prefix)
51 AS_AC_EXPAND(LIBDIR, $libdir)
52 AS_AC_EXPAND(BINDIR, $bindir)
53 AS_AC_EXPAND(LIBEXECDIR, $libexecdir)
54 AS_AC_EXPAND(INCLUDEDIR, $includedir)
55 AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
56 AS_AC_EXPAND(DATADIR, $datadir)
57 AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir)
58 AS_AC_EXPAND(DOCDIR, $docdir)
60 AC_ARG_WITH([config-path],
62 [--with-config-path=dir],
63 [lxc configuration repository path]
64 )], [], [with_config_path=['${localstatedir}/lib/lxc']])
66 AC_ARG_WITH([rootfs-path],
68 [--with-rootfs-path=dir],
69 [lxc rootfs mount point]
70 )], [], [with_rootfs_path=['${libdir}/lxc/rootfs']])
72 AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
73 AS_AC_EXPAND(LXCPATH, "${with_config_path}")
74 AS_AC_EXPAND(LXCROOTFSMOUNT, "${with_rootfs_path}")
75 AS_AC_EXPAND(LXCTEMPLATEDIR, ['${datadir}/lxc/templates'])
77 AC_SUBST(LXCINITDIR, ['${libexecdir}'])
79 AC_CHECK_HEADERS([linux/unistd.h linux/netlink.h linux/genetlink.h],
81 AC_MSG_ERROR([Please install the Linux kernel headers.]),
82 [#include <sys/socket.h>
85 AC_CHECK_HEADERS([sys/capability.h], [], AC_MSG_ERROR([Please install the libcap development files.]),
86 [#include <sys/types.h>
87 #include <sys/capability.h>])
88 AC_CHECK_LIB(cap,cap_set_proc,caplib=yes,caplib=no)
89 AC_MSG_CHECKING([linux capabilities])
90 if test "x$caplib" = "xyes" ; then
92 AC_MSG_RESULT([$CAP_LIBS])
94 AC_MSG_ERROR([not found])
98 # Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP
99 AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
101 AC_CHECK_HEADERS([sys/signalfd.h])
103 AC_PROG_GCC_TRADITIONAL
105 if test "x$GCC" = "xyes"; then
106 CFLAGS="$CFLAGS -Wall"
120 doc/lxc-checkpoint.sgml
125 doc/lxc-unfreeze.sgml
135 doc/common_options.sgml
140 doc/examples/Makefile
141 doc/examples/lxc-macvlan.conf
142 doc/examples/lxc-vlan.conf
143 doc/examples/lxc-no-netns.conf
144 doc/examples/lxc-empty-netns.conf
145 doc/examples/lxc-phys.conf
146 doc/examples/lxc-veth.conf
147 doc/examples/lxc-complex.conf
153 templates/lxc-ubuntu-cloud
154 templates/lxc-opensuse
155 templates/lxc-busybox
157 templates/lxc-altlinux
159 templates/lxc-archlinux
166 src/lxc/lxc-checkconfig
173 src/lxc/lxc-start-ephemeral
177 AC_CONFIG_COMMANDS([default],[[]],[[]])
180 if test "x$SETCAP" = "xno"; then
186 The setcap binary was not found. This means the tools to set the
187 privilege for the lxc commands are not available, that's ok, but you
188 will need to run these commands as root or install libcap-2.
199 If you wish to have a non root user to use the lxc tools,
200 you can add the needed capabilities to the tools by invoking
201 the 'lxc-setcap' script. To remove the capabilities, use