2 # Process this file with autoconf to produce a configure script.
4 AC_INIT([lxc], [0.8.0])
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"])
22 [AC_HELP_STRING([--enable-doc], [make mans (require docbook2man installed) [default=auto]])],
23 [], [enable_doc=auto])
25 if test "x$enable_doc" = "xyes" -o "x$enable_doc" = "xauto"; then
26 AC_CHECK_PROG(have_docbook, [docbook2man], [yes], [no])
28 test "x$have_docbook" = "xno" -a "x$enable_doc" = "xyes" && \
29 AC_MSG_ERROR([docbook2man required by man request, but not found])
32 AC_ARG_ENABLE([apparmor],
33 [AC_HELP_STRING([--enable-apparmor], [enable apparmor])],
34 [], [enable_apparmor=check])
36 if test "$enable_apparmor" = "check" ; then
37 AC_CHECK_LIB([apparmor],[aa_change_profile],[enable_apparmor=yes], [enable_apparmor=no])
40 AM_CONDITIONAL([ENABLE_APPARMOR], [test "x$enable_apparmor" = "xyes"])
42 AM_COND_IF([ENABLE_APPARMOR],
43 [AC_CHECK_HEADER([sys/apparmor.h],[],[AC_MSG_ERROR([You must install the AppArmor development package in order to compile lxc])])
44 AC_CHECK_LIB([apparmor], [aa_change_profile],[],[AC_MSG_ERROR([You must install the AppArmor development package in order to compile lxc])])
45 AC_SUBST([APPARMOR_LIBS], [-lapparmor])])
47 AC_ARG_ENABLE([seccomp],
48 [AC_HELP_STRING([--enable-seccomp], [enable seccomp])],
49 [], [enable_seccomp=check])
51 if test "$enable_seccomp" = "check" ; then
52 AC_CHECK_LIB([seccomp],[seccomp_init],[enable_seccomp=yes],[enable_seccomp=no])
55 AM_CONDITIONAL([ENABLE_SECCOMP], [test "x$enable_seccomp" = "xyes"])
57 AM_COND_IF([ENABLE_SECCOMP],
58 [AC_CHECK_HEADER([seccomp.h],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])])
59 AC_CHECK_LIB([seccomp], [seccomp_init],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])])
60 AC_SUBST([SECCOMP_LIBS], [-lseccomp])])
62 AM_CONDITIONAL([ENABLE_DOCBOOK], [test "x$have_docbook" = "xyes"])
64 AC_ARG_ENABLE([examples],
65 [AC_HELP_STRING([--disable-examples], [do not install configuration examples])],
66 [], [enable_examples=yes])
68 AM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" = "xyes"])
70 AS_AC_EXPAND(PREFIX, $prefix)
71 AS_AC_EXPAND(LIBDIR, $libdir)
72 AS_AC_EXPAND(BINDIR, $bindir)
73 AS_AC_EXPAND(LIBEXECDIR, $libexecdir)
74 AS_AC_EXPAND(INCLUDEDIR, $includedir)
75 AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
76 AS_AC_EXPAND(DATADIR, $datadir)
77 AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir)
78 AS_AC_EXPAND(DOCDIR, $docdir)
80 AC_ARG_WITH([config-path],
82 [--with-config-path=dir],
83 [lxc configuration repository path]
84 )], [], [with_config_path=['${localstatedir}/lib/lxc']])
86 AC_ARG_WITH([rootfs-path],
88 [--with-rootfs-path=dir],
89 [lxc rootfs mount point]
90 )], [], [with_rootfs_path=['${libdir}/lxc/rootfs']])
92 AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
93 AS_AC_EXPAND(LXCPATH, "${with_config_path}")
94 AS_AC_EXPAND(LXCROOTFSMOUNT, "${with_rootfs_path}")
95 AS_AC_EXPAND(LXCTEMPLATEDIR, ['${datadir}/lxc/templates'])
97 AC_SUBST(LXCINITDIR, ['${libexecdir}'])
99 AC_CHECK_HEADERS([linux/unistd.h linux/netlink.h linux/genetlink.h],
101 AC_MSG_ERROR([Please install the Linux kernel headers.]),
102 [#include <sys/socket.h>
105 AC_CHECK_HEADERS([sys/capability.h], [], AC_MSG_ERROR([Please install the libcap development files.]),
106 [#include <sys/types.h>
107 #include <sys/capability.h>])
108 AC_CHECK_LIB(cap,cap_set_proc,caplib=yes,caplib=no)
109 AC_MSG_CHECKING([linux capabilities])
110 if test "x$caplib" = "xyes" ; then
112 AC_MSG_RESULT([$CAP_LIBS])
114 AC_MSG_ERROR([not found])
118 # Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP
119 AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
121 AC_CHECK_HEADERS([sys/signalfd.h])
123 AC_PROG_GCC_TRADITIONAL
125 if test "x$GCC" = "xyes"; then
126 CFLAGS="$CFLAGS -Wall"
140 doc/lxc-checkpoint.sgml
145 doc/lxc-unfreeze.sgml
155 doc/common_options.sgml
160 doc/examples/Makefile
161 doc/examples/lxc-macvlan.conf
162 doc/examples/lxc-vlan.conf
163 doc/examples/lxc-no-netns.conf
164 doc/examples/lxc-empty-netns.conf
165 doc/examples/lxc-phys.conf
166 doc/examples/lxc-veth.conf
167 doc/examples/lxc-complex.conf
173 templates/lxc-ubuntu-cloud
174 templates/lxc-opensuse
175 templates/lxc-busybox
177 templates/lxc-altlinux
179 templates/lxc-archlinux
186 src/lxc/lxc-checkconfig
198 AC_CONFIG_COMMANDS([default],[[]],[[]])
201 if test "x$SETCAP" = "xno"; then
207 The setcap binary was not found. This means the tools to set the
208 privilege for the lxc commands are not available, that's ok, but you
209 will need to run these commands as root or install libcap-2.
220 If you wish to have a non root user to use the lxc tools,
221 you can add the needed capabilities to the tools by invoking
222 the 'lxc-setcap' script. To remove the capabilities, use