]> git.proxmox.com Git - mirror_lxc.git/blame_incremental - configure.ac
Add lxc.hook.pre-mount
[mirror_lxc.git] / configure.ac
... / ...
CommitLineData
1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_INIT([lxc], [0.8.0])
5
6AC_CONFIG_SRCDIR([configure.ac])
7AC_CONFIG_AUX_DIR([config])
8AM_CONFIG_HEADER([src/config.h])
9AM_INIT_AUTOMAKE([-Wno-portability])
10AC_CANONICAL_HOST
11AM_PROG_CC_C_O
12AC_GNU_SOURCE
13AC_CHECK_PROG(SETCAP, setcap, yes, no, $PATH$PATH_SEPARATOR/sbin)
14
15if test -f /etc/debian_version; then
16 osname="debian"
17fi
18AM_CONDITIONAL([HAVE_DEBIAN], [test x"$osname" == xdebian])
19
20AC_ARG_ENABLE([rpath],
21 [AC_HELP_STRING([--disable-rpath], [do not set rpath in executables])],
22 [], [enable_rpath=yes])
23
24AM_CONDITIONAL([ENABLE_RPATH], [test "x$enable_rpath" = "xyes"])
25
26AC_ARG_ENABLE([doc],
27 [AC_HELP_STRING([--enable-doc], [make mans (require docbook2man installed) [default=auto]])],
28 [], [enable_doc=auto])
29
30if test "x$enable_doc" = "xyes" -o "x$enable_doc" = "xauto"; then
31 AC_CHECK_PROG(have_docbook, [docbook2man], [yes], [no])
32
33 test "x$have_docbook" = "xno" -a "x$enable_doc" = "xyes" && \
34 AC_MSG_ERROR([docbook2man required by man request, but not found])
35fi
36
37AC_ARG_ENABLE([apparmor],
38 [AC_HELP_STRING([--enable-apparmor], [enable apparmor])],
39 [], [enable_apparmor=check])
40
41if test "$enable_apparmor" = "check" ; then
42 AC_CHECK_LIB([apparmor],[aa_change_profile],[enable_apparmor=yes], [enable_apparmor=no])
43fi
44
45AM_CONDITIONAL([ENABLE_APPARMOR], [test "x$enable_apparmor" = "xyes"])
46
47AM_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])])
51
52AC_ARG_ENABLE([seccomp],
53 [AC_HELP_STRING([--enable-seccomp], [enable seccomp])],
54 [], [enable_seccomp=check])
55
56if test "$enable_seccomp" = "check" ; then
57 AC_CHECK_LIB([seccomp],[seccomp_init],[enable_seccomp=yes],[enable_seccomp=no])
58fi
59
60AM_CONDITIONAL([ENABLE_SECCOMP], [test "x$enable_seccomp" = "xyes"])
61
62AM_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])])
66
67AM_CONDITIONAL([ENABLE_DOCBOOK], [test "x$have_docbook" = "xyes"])
68
69AC_ARG_ENABLE([examples],
70 [AC_HELP_STRING([--disable-examples], [do not install configuration examples])],
71 [], [enable_examples=yes])
72
73AM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" = "xyes"])
74
75AC_ARG_ENABLE([python],
76 [AC_HELP_STRING([--enable-python], [enable python binding])],
77 [enable_python=yes], [enable_python=no])
78
79AM_CONDITIONAL([ENABLE_PYTHON], [test "x$enable_python" = "xyes"])
80
81AM_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])])
85
86AS_AC_EXPAND(PREFIX, $prefix)
87AS_AC_EXPAND(LIBDIR, $libdir)
88AS_AC_EXPAND(BINDIR, $bindir)
89AS_AC_EXPAND(LIBEXECDIR, $libexecdir)
90AS_AC_EXPAND(INCLUDEDIR, $includedir)
91AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
92AS_AC_EXPAND(DATADIR, $datadir)
93AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir)
94AS_AC_EXPAND(DOCDIR, $docdir)
95
96AC_ARG_WITH([config-path],
97 [AC_HELP_STRING(
98 [--with-config-path=dir],
99 [lxc configuration repository path]
100 )], [], [with_config_path=['${localstatedir}/lib/lxc']])
101
102AC_ARG_WITH([rootfs-path],
103 [AC_HELP_STRING(
104 [--with-rootfs-path=dir],
105 [lxc rootfs mount point]
106 )], [], [with_rootfs_path=['${libdir}/lxc/rootfs']])
107
108AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
109AS_AC_EXPAND(LXCPATH, "${with_config_path}")
110AS_AC_EXPAND(LXCROOTFSMOUNT, "${with_rootfs_path}")
111AS_AC_EXPAND(LXCTEMPLATEDIR, ['${datadir}/lxc/templates'])
112
113AC_SUBST(LXCINITDIR, ['${libexecdir}'])
114
115AC_CHECK_HEADERS([linux/unistd.h linux/netlink.h linux/genetlink.h],
116 [],
117 AC_MSG_ERROR([Please install the Linux kernel headers.]),
118 [#include <sys/socket.h>
119 ])
120
121AC_CHECK_HEADERS([sys/capability.h], [], AC_MSG_ERROR([Please install the libcap development files.]),
122[#include <sys/types.h>
123#include <sys/capability.h>])
124AC_CHECK_LIB(cap,cap_set_proc,caplib=yes,caplib=no)
125AC_MSG_CHECKING([linux capabilities])
126if test "x$caplib" = "xyes" ; then
127 CAP_LIBS="-lcap"
128 AC_MSG_RESULT([$CAP_LIBS])
129else
130 AC_MSG_ERROR([not found])
131fi
132AC_SUBST([CAP_LIBS])
133
134# Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP
135AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
136
137AC_CHECK_HEADERS([sys/signalfd.h])
138
139AC_PROG_GCC_TRADITIONAL
140
141if test "x$GCC" = "xyes"; then
142 CFLAGS="$CFLAGS -Wall"
143fi
144
145AC_CONFIG_FILES([
146 Makefile
147 lxc.pc
148 lxc.spec
149 config/Makefile
150
151 doc/Makefile
152 doc/lxc-create.sgml
153 doc/lxc-destroy.sgml
154 doc/lxc-execute.sgml
155 doc/lxc-start.sgml
156 doc/lxc-checkpoint.sgml
157 doc/lxc-restart.sgml
158 doc/lxc-stop.sgml
159 doc/lxc-console.sgml
160 doc/lxc-freeze.sgml
161 doc/lxc-unfreeze.sgml
162 doc/lxc-monitor.sgml
163 doc/lxc-wait.sgml
164 doc/lxc-ls.sgml
165 doc/lxc-ps.sgml
166 doc/lxc-cgroup.sgml
167 doc/lxc-kill.sgml
168 doc/lxc-attach.sgml
169 doc/lxc.conf.sgml
170 doc/lxc.sgml
171 doc/common_options.sgml
172 doc/see_also.sgml
173
174 doc/rootfs/Makefile
175
176 doc/examples/Makefile
177 doc/examples/lxc-macvlan.conf
178 doc/examples/lxc-vlan.conf
179 doc/examples/lxc-no-netns.conf
180 doc/examples/lxc-empty-netns.conf
181 doc/examples/lxc-phys.conf
182 doc/examples/lxc-veth.conf
183 doc/examples/lxc-complex.conf
184
185 templates/Makefile
186 templates/lxc-lenny
187 templates/lxc-debian
188 templates/lxc-ubuntu
189 templates/lxc-ubuntu-cloud
190 templates/lxc-opensuse
191 templates/lxc-busybox
192 templates/lxc-fedora
193 templates/lxc-altlinux
194 templates/lxc-sshd
195 templates/lxc-archlinux
196
197 src/Makefile
198 src/lxc/Makefile
199 src/lxc/lxc-ps
200 src/lxc/lxc-ls
201 src/lxc/lxc-netstat
202 src/lxc/lxc-checkconfig
203 src/lxc/lxc-setcap
204 src/lxc/lxc-setuid
205 src/lxc/lxc-version
206 src/lxc/lxc-create
207 src/lxc/lxc-clone
208 src/lxc/lxc-shutdown
209 src/lxc/lxc-destroy
210
211 src/python-lxc/Makefile
212
213 src/tests/Makefile
214
215])
216AC_CONFIG_COMMANDS([default],[[]],[[]])
217AC_OUTPUT
218
219if test "x$SETCAP" = "xno"; then
220 AC_MSG_NOTICE([
221
222Warning:
223--------
224
225The setcap binary was not found. This means the tools to set the
226privilege for the lxc commands are not available, that's ok, but you
227will need to run these commands as root or install libcap-2.
228
229])
230
231else
232
233 AC_MSG_NOTICE([
234
235Advice:
236-------
237
238If you wish to have a non root user to use the lxc tools,
239you can add the needed capabilities to the tools by invoking
240the 'lxc-setcap' script. To remove the capabilities, use
241'lxc-setcap -d'.
242])
243
244fi