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 if test -f /etc/debian_version; then
18 AM_CONDITIONAL([HAVE_DEBIAN], [test x"$osname" == xdebian])
20 AC_ARG_ENABLE([rpath],
21 [AC_HELP_STRING([--disable-rpath], [do not set rpath in executables])],
22 [], [enable_rpath=yes])
24 AM_CONDITIONAL([ENABLE_RPATH], [test "x$enable_rpath" = "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 AC_ARG_ENABLE([apparmor],
38 [AC_HELP_STRING([--enable-apparmor], [enable apparmor])],
39 [], [enable_apparmor=check])
41 if test "$enable_apparmor" = "check" ; then
42 AC_CHECK_LIB([apparmor],[aa_change_profile],[enable_apparmor=yes], [enable_apparmor=no])
45 AM_CONDITIONAL([ENABLE_APPARMOR], [test "x$enable_apparmor" = "xyes"])
47 AM_COND_IF([ENABLE_APPARMOR],
48 [AC_CHECK_HEADER([sys/apparmor.h],[],[AC_MSG_ERROR([You must install the AppArmor development package in order to compile lxc])])
49 AC_CHECK_LIB([apparmor], [aa_change_profile],[],[AC_MSG_ERROR([You must install the AppArmor development package in order to compile lxc])])
50 AC_SUBST([APPARMOR_LIBS], [-lapparmor])])
52 AC_ARG_ENABLE([seccomp],
53 [AC_HELP_STRING([--enable-seccomp], [enable seccomp])],
54 [], [enable_seccomp=check])
56 if test "$enable_seccomp" = "check" ; then
57 AC_CHECK_LIB([seccomp],[seccomp_init],[enable_seccomp=yes],[enable_seccomp=no])
60 AM_CONDITIONAL([ENABLE_SECCOMP], [test "x$enable_seccomp" = "xyes"])
62 AM_COND_IF([ENABLE_SECCOMP],
63 [AC_CHECK_HEADER([seccomp.h],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])])
64 AC_CHECK_LIB([seccomp], [seccomp_init],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])])
65 AC_SUBST([SECCOMP_LIBS], [-lseccomp])])
67 AM_CONDITIONAL([ENABLE_DOCBOOK], [test "x$have_docbook" = "xyes"])
69 AC_ARG_ENABLE([examples],
70 [AC_HELP_STRING([--disable-examples], [do not install configuration examples])],
71 [], [enable_examples=yes])
73 AM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" = "xyes"])
75 AC_ARG_ENABLE([python],
76 [AC_HELP_STRING([--enable-python], [enable python binding])],
77 [enable_python=yes], [enable_python=no])
79 AM_CONDITIONAL([ENABLE_PYTHON], [test "x$enable_python" = "xyes"])
81 AM_COND_IF([ENABLE_PYTHON],
82 [AM_PATH_PYTHON([3.2], [], [AC_MSG_ERROR([You must install python3])])
83 AC_CHECK_HEADER([python$PYTHON_VERSION/Python.h],[],[AC_MSG_ERROR([You must install python3-dev])])
84 AC_DEFINE_UNQUOTED([ENABLE_PYTHON], 1, [Python3 is available])])
86 AC_ARG_ENABLE([tests],
87 [AC_HELP_STRING([--enable-tests], [build test/example binaries])],
88 [enable_tests=yes], [enable_tests=no])
90 AM_CONDITIONAL([ENABLE_TESTS], [test "x$enable_tests" = "xyes"])
92 AS_AC_EXPAND(PREFIX, $prefix)
93 AS_AC_EXPAND(LIBDIR, $libdir)
94 AS_AC_EXPAND(BINDIR, $bindir)
95 AS_AC_EXPAND(LIBEXECDIR, $libexecdir)
96 AS_AC_EXPAND(INCLUDEDIR, $includedir)
97 AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
98 AS_AC_EXPAND(DATADIR, $datadir)
99 AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir)
100 AS_AC_EXPAND(DOCDIR, $docdir)
102 AC_ARG_WITH([config-path],
104 [--with-config-path=dir],
105 [lxc configuration repository path]
106 )], [], [with_config_path=['${localstatedir}/lib/lxc']])
108 AC_ARG_WITH([rootfs-path],
110 [--with-rootfs-path=dir],
111 [lxc rootfs mount point]
112 )], [], [with_rootfs_path=['${libdir}/lxc/rootfs']])
114 AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
115 AS_AC_EXPAND(LXCPATH, "${with_config_path}")
116 AS_AC_EXPAND(LXCROOTFSMOUNT, "${with_rootfs_path}")
117 AS_AC_EXPAND(LXCTEMPLATEDIR, ['${datadir}/lxc/templates'])
119 AC_SUBST(LXCINITDIR, ['${libexecdir}'])
121 AC_CHECK_HEADERS([linux/unistd.h linux/netlink.h linux/genetlink.h],
123 AC_MSG_ERROR([Please install the Linux kernel headers.]),
124 [#include <sys/socket.h>
127 AC_CHECK_HEADERS([sys/capability.h], [], AC_MSG_ERROR([Please install the libcap development files.]),
128 [#include <sys/types.h>
129 #include <sys/capability.h>])
130 AC_CHECK_LIB(cap,cap_set_proc,caplib=yes,caplib=no)
131 AC_MSG_CHECKING([linux capabilities])
132 if test "x$caplib" = "xyes" ; then
134 AC_MSG_RESULT([$CAP_LIBS])
136 AC_MSG_ERROR([not found])
140 # Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP
141 AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
143 AC_CHECK_HEADERS([sys/signalfd.h])
145 AC_PROG_GCC_TRADITIONAL
148 if test "x$GCC" = "xyes"; then
149 CFLAGS="$CFLAGS -Wall"
163 doc/lxc-checkpoint.sgml
168 doc/lxc-unfreeze.sgml
178 doc/common_options.sgml
183 doc/examples/Makefile
184 doc/examples/lxc-macvlan.conf
185 doc/examples/lxc-vlan.conf
186 doc/examples/lxc-no-netns.conf
187 doc/examples/lxc-empty-netns.conf
188 doc/examples/lxc-phys.conf
189 doc/examples/lxc-veth.conf
190 doc/examples/lxc-complex.conf
196 templates/lxc-ubuntu-cloud
197 templates/lxc-opensuse
198 templates/lxc-busybox
200 templates/lxc-altlinux
202 templates/lxc-archlinux
209 src/lxc/lxc-checkconfig
218 src/python-lxc/Makefile
223 AC_CONFIG_COMMANDS([default],[[]],[[]])
226 if test "x$SETCAP" = "xno"; then
232 The setcap binary was not found. This means the tools to set the
233 privilege for the lxc commands are not available, that's ok, but you
234 will need to run these commands as root or install libcap-2.
245 If you wish to have a non root user to use the lxc tools,
246 you can add the needed capabilities to the tools by invoking
247 the 'lxc-setcap' script. To remove the capabilities, use