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([-Wall -Werror -Wno-portability])
13 AC_CHECK_PROG(SETCAP, setcap, yes, no, $PATH$PATH_SEPARATOR/sbin)
15 AC_MSG_CHECKING([host distribution])
16 AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, oracle, fedora, suse, gentoo, debian, arch, slackware, paldo, mandriva or pardus]))
17 if test "z$with_distro" = "z"; then
18 with_distro=`lsb_release -is`
20 if test "z$with_distro" = "z"; then
21 AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat")
22 AC_CHECK_FILE(/etc/oracle-release,with_distro="oracle")
23 AC_CHECK_FILE(/etc/fedora-release,with_distro="fedora")
24 AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
25 AC_CHECK_FILE(/etc/gentoo-release,with_distro="gentoo")
26 AC_CHECK_FILE(/etc/debian_version,with_distro="debian")
27 AC_CHECK_FILE(/etc/arch-release,with_distro="arch")
28 AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware")
29 AC_CHECK_FILE(/etc/frugalware-release,with_distro="frugalware")
30 AC_CHECK_FILE(/etc/mandrakelinux-release, with_distro="mandriva")
31 AC_CHECK_FILE(/etc/mandriva-release,with_distro="mandriva")
32 AC_CHECK_FILE(/etc/pardus-release,with_distro="pardus")
34 with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]'`
36 if test "z$with_distro" = "z"; then
41 conffile=lxc.conf.ubuntu
43 redhat|fedora|oracle|oracleserver)
44 conffile=lxc.conf.libvirt
47 echo -n "Linux distribution network config unknown, defaulting to lxc.network.type = empty"
48 conffile=lxc.conf.unknown
51 AC_MSG_RESULT([$with_distro])
53 AM_CONDITIONAL([HAVE_DEBIAN], [test x"$with_distro" = "xdebian" -o x"$with_distro" = "xubuntu"])
55 AC_ARG_ENABLE([rpath],
56 [AC_HELP_STRING([--disable-rpath], [do not set rpath in executables])],
57 [], [enable_rpath=yes])
59 AM_CONDITIONAL([ENABLE_RPATH], [test "x$enable_rpath" = "xyes"])
62 [AC_HELP_STRING([--enable-doc], [make mans (require docbook2x-man installed) [default=auto]])],
63 [], [enable_doc=auto])
65 if test "x$enable_doc" = "xyes" -o "x$enable_doc" = "xauto"; then
68 AC_MSG_CHECKING(for docbook2x-man)
69 for name in docbook2x-man db2x_docbook2man; do
70 if "$name" --help >/dev/null 2>&1; then
76 if test -n "${db2xman}"; then
77 AC_MSG_RESULT(${db2xman})
80 if test "x$enable_doc" = "xyes"; then
81 AC_MSG_ERROR([docbook2x-man required by man request, but not found])
88 AC_ARG_ENABLE([apparmor],
89 [AC_HELP_STRING([--enable-apparmor], [enable apparmor])],
90 [], [enable_apparmor=check])
92 if test "$enable_apparmor" = "check" ; then
93 AC_CHECK_LIB([apparmor],[aa_change_profile],[enable_apparmor=yes], [enable_apparmor=no])
96 AM_CONDITIONAL([ENABLE_APPARMOR], [test "x$enable_apparmor" = "xyes"])
98 AM_COND_IF([ENABLE_APPARMOR],
99 [AC_CHECK_HEADER([sys/apparmor.h],[],[AC_MSG_ERROR([You must install the AppArmor development package in order to compile lxc])])
100 AC_CHECK_LIB([apparmor], [aa_change_profile],[],[AC_MSG_ERROR([You must install the AppArmor development package in order to compile lxc])])
101 AC_SUBST([APPARMOR_LIBS], [-lapparmor])])
103 AC_ARG_ENABLE([seccomp],
104 [AC_HELP_STRING([--enable-seccomp], [enable seccomp])],
105 [], [enable_seccomp=check])
107 if test "$enable_seccomp" = "check" ; then
108 AC_CHECK_LIB([seccomp],[seccomp_init],[enable_seccomp=yes],[enable_seccomp=no])
111 AM_CONDITIONAL([ENABLE_SECCOMP], [test "x$enable_seccomp" = "xyes"])
113 AM_COND_IF([ENABLE_SECCOMP],
114 [AC_CHECK_HEADER([seccomp.h],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])])
115 AC_CHECK_LIB([seccomp], [seccomp_init],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])])
116 AC_SUBST([SECCOMP_LIBS], [-lseccomp])])
118 AM_CONDITIONAL([ENABLE_DOCBOOK], [test "x$db2xman" != "x"])
120 AC_ARG_ENABLE([examples],
121 [AC_HELP_STRING([--disable-examples], [do not install configuration examples])],
122 [], [enable_examples=yes])
124 AM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" = "xyes"])
126 AC_ARG_ENABLE([python],
127 [AC_HELP_STRING([--enable-python], [enable python binding])],
128 [enable_python=yes], [enable_python=no])
130 AM_CONDITIONAL([ENABLE_PYTHON], [test "x$enable_python" = "xyes"])
132 AM_COND_IF([ENABLE_PYTHON],
133 [AM_PATH_PYTHON([3.2], [], [AC_MSG_ERROR([You must install python3])])
134 AC_CHECK_HEADER([python$PYTHON_VERSION/Python.h],[],[AC_MSG_ERROR([You must install python3-dev])])
135 AC_DEFINE_UNQUOTED([ENABLE_PYTHON], 1, [Python3 is available])])
137 AC_ARG_ENABLE([tests],
138 [AC_HELP_STRING([--enable-tests], [build test/example binaries])],
139 [enable_tests=yes], [enable_tests=no])
141 AM_CONDITIONAL([ENABLE_TESTS], [test "x$enable_tests" = "xyes"])
143 AS_AC_EXPAND(PREFIX, $prefix)
144 AS_AC_EXPAND(LIBDIR, $libdir)
145 AS_AC_EXPAND(BINDIR, $bindir)
146 AS_AC_EXPAND(LIBEXECDIR, $libexecdir)
147 AS_AC_EXPAND(INCLUDEDIR, $includedir)
148 AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
149 AS_AC_EXPAND(DATADIR, $datadir)
150 AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir)
151 AS_AC_EXPAND(DOCDIR, $docdir)
153 AC_ARG_WITH([config-path],
155 [--with-config-path=dir],
156 [lxc configuration repository path]
157 )], [], [with_config_path=['${localstatedir}/lib/lxc']])
159 AC_ARG_WITH([rootfs-path],
161 [--with-rootfs-path=dir],
162 [lxc rootfs mount point]
163 )], [], [with_rootfs_path=['${libdir}/lxc/rootfs']])
165 AS_AC_EXPAND(LXC_CONFFILE, $conffile)
166 AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
167 AS_AC_EXPAND(LXCPATH, "${with_config_path}")
168 AS_AC_EXPAND(LXCROOTFSMOUNT, "${with_rootfs_path}")
169 AS_AC_EXPAND(LXCTEMPLATEDIR, ['${datadir}/lxc/templates'])
171 AS_AC_EXPAND(LXCINITDIR, ['${libexecdir}'])
173 AC_CHECK_HEADERS([linux/unistd.h linux/netlink.h linux/genetlink.h],
175 AC_MSG_ERROR([Please install the Linux kernel headers.]),
176 [#include <sys/socket.h>
179 AC_CHECK_HEADERS([sys/capability.h], [], AC_MSG_ERROR([Please install the libcap development files.]),
180 [#include <sys/types.h>
181 #include <sys/capability.h>])
182 AC_CHECK_LIB(cap,cap_set_proc,caplib=yes,caplib=no)
183 AC_MSG_CHECKING([linux capabilities])
184 if test "x$caplib" = "xyes" ; then
186 AC_MSG_RESULT([$CAP_LIBS])
188 AC_MSG_ERROR([not found])
192 # Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP
193 AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
195 AC_CHECK_HEADERS([sys/signalfd.h])
197 AC_PROG_GCC_TRADITIONAL
200 if test "x$GCC" = "xyes"; then
201 CFLAGS="$CFLAGS -Wall -Werror"
215 doc/lxc-checkpoint.sgml
220 doc/lxc-unfreeze.sgml
230 doc/common_options.sgml
235 doc/examples/Makefile
236 doc/examples/lxc-macvlan.conf
237 doc/examples/lxc-vlan.conf
238 doc/examples/lxc-no-netns.conf
239 doc/examples/lxc-empty-netns.conf
240 doc/examples/lxc-phys.conf
241 doc/examples/lxc-veth.conf
242 doc/examples/lxc-complex.conf
248 templates/lxc-ubuntu-cloud
249 templates/lxc-opensuse
250 templates/lxc-busybox
253 templates/lxc-altlinux
255 templates/lxc-archlinux
262 src/lxc/lxc-checkconfig
269 src/lxc/lxc-start-ephemeral
272 src/python-lxc/Makefile
277 AC_CONFIG_COMMANDS([default],[[]],[[]])
280 if test "x$SETCAP" = "xno"; then
286 The setcap binary was not found. This means the tools to set the
287 privilege for the lxc commands are not available, that's ok, but you
288 will need to run these commands as root or install libcap-2.
299 If you wish to have a non root user to use the lxc tools,
300 you can add the needed capabilities to the tools by invoking
301 the 'lxc-setcap' script. To remove the capabilities, use