]> git.proxmox.com Git - mirror_lxc.git/blame - configure.ac
lxc-attach: Add -R option to remount /sys and /proc when only partially attaching
[mirror_lxc.git] / configure.ac
CommitLineData
5e97c3fc 1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4aa7ac35 4AC_INIT([lxc], [0.8.0])
5e97c3fc 5
f8dafdbb 6AC_CONFIG_SRCDIR([configure.ac])
5e97c3fc 7AC_CONFIG_AUX_DIR([config])
8AM_CONFIG_HEADER([src/config.h])
9AM_INIT_AUTOMAKE([-Wno-portability])
10AC_CANONICAL_HOST
5e97c3fc 11AM_PROG_CC_C_O
12AC_GNU_SOURCE
e90b6974 13AC_CHECK_PROG(SETCAP, setcap, yes, no, $PATH$PATH_SEPARATOR/sbin)
5c8f9bd8 14
1c41ddcb
GK
15AC_ARG_ENABLE([rpath],
16 [AC_HELP_STRING([--disable-rpath], [do not set rpath in executables])],
17 [], [enable_rpath=yes])
18
19AM_CONDITIONAL([ENABLE_RPATH], [test "x$enable_rpath" = "xyes"])
20
5c8f9bd8
AN
21AC_ARG_ENABLE([doc],
22 [AC_HELP_STRING([--enable-doc], [make mans (require docbook2man installed) [default=auto]])],
23 [], [enable_doc=auto])
24
25if test "x$enable_doc" = "xyes" -o "x$enable_doc" = "xauto"; then
26 AC_CHECK_PROG(have_docbook, [docbook2man], [yes], [no])
27
28 test "x$have_docbook" = "xno" -a "x$enable_doc" = "xyes" && \
29 AC_MSG_ERROR([docbook2man required by man request, but not found])
30fi
31
e767dd55
SH
32AC_ARG_ENABLE([apparmor],
33 [AC_HELP_STRING([--enable-apparmor], [enable apparmor])],
34 [], [enable_apparmor=check])
35
36if test "$enable_apparmor" = "check" ; then
37 AC_CHECK_LIB([apparmor],[aa_change_profile],[enable_apparmor=yes], [enable_apparmor=no])
38fi
39
40AM_CONDITIONAL([ENABLE_APPARMOR], [test "x$enable_apparmor" = "xyes"])
41
e075f5d9
SH
42AM_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])])
46
e767dd55
SH
47AC_ARG_ENABLE([seccomp],
48 [AC_HELP_STRING([--enable-seccomp], [enable seccomp])],
49 [], [enable_seccomp=check])
50
51if test "$enable_seccomp" = "check" ; then
52 AC_CHECK_LIB([seccomp],[seccomp_init],[enable_seccomp=yes],[enable_seccomp=no])
53fi
54
55AM_CONDITIONAL([ENABLE_SECCOMP], [test "x$enable_seccomp" = "xyes"])
56
8f2c3a70
SH
57AM_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])])
61
5c8f9bd8
AN
62AM_CONDITIONAL([ENABLE_DOCBOOK], [test "x$have_docbook" = "xyes"])
63
3fb0a9bb
AN
64AC_ARG_ENABLE([examples],
65 [AC_HELP_STRING([--disable-examples], [do not install configuration examples])],
66 [], [enable_examples=yes])
67
68AM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" = "xyes"])
69
b6345ba1
DL
70AS_AC_EXPAND(PREFIX, $prefix)
71AS_AC_EXPAND(LIBDIR, $libdir)
7ad641d5 72AS_AC_EXPAND(BINDIR, $bindir)
00ad19d4 73AS_AC_EXPAND(LIBEXECDIR, $libexecdir)
b6345ba1 74AS_AC_EXPAND(INCLUDEDIR, $includedir)
7ad641d5 75AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
3eae9733 76AS_AC_EXPAND(DATADIR, $datadir)
7ad641d5 77AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir)
0f71d073 78AS_AC_EXPAND(DOCDIR, $docdir)
805415fc 79
aef4ebcf
AN
80AC_ARG_WITH([config-path],
81 [AC_HELP_STRING(
82 [--with-config-path=dir],
e892973e 83 [lxc configuration repository path]
1c41ddcb 84 )], [], [with_config_path=['${localstatedir}/lib/lxc']])
aef4ebcf 85
196db713
DL
86AC_ARG_WITH([rootfs-path],
87 [AC_HELP_STRING(
88 [--with-rootfs-path=dir],
89 [lxc rootfs mount point]
1c41ddcb 90 )], [], [with_rootfs_path=['${libdir}/lxc/rootfs']])
196db713 91
aef4ebcf 92AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
d595c68a
DE
93AS_AC_EXPAND(LXCPATH, "${with_config_path}")
94AS_AC_EXPAND(LXCROOTFSMOUNT, "${with_rootfs_path}")
95AS_AC_EXPAND(LXCTEMPLATEDIR, ['${datadir}/lxc/templates'])
d674be08 96
814463cf 97AC_SUBST(LXCINITDIR, ['${libexecdir}'])
881450bb 98
910bb4fa 99AC_CHECK_HEADERS([linux/unistd.h linux/netlink.h linux/genetlink.h],
288063bd 100 [],
910bb4fa 101 AC_MSG_ERROR([Please install the Linux kernel headers.]),
288063bd 102 [#include <sys/socket.h>
90e0a869 103 ])
35f549fe 104
910bb4fa 105AC_CHECK_HEADERS([sys/capability.h], [], AC_MSG_ERROR([Please install the libcap development files.]),
ddceb1f9
DL
106[#include <sys/types.h>
107#include <sys/capability.h>])
0af683cf 108AC_CHECK_LIB(cap,cap_set_proc,caplib=yes,caplib=no)
109AC_MSG_CHECKING([linux capabilities])
110if test "x$caplib" = "xyes" ; then
111 CAP_LIBS="-lcap"
112 AC_MSG_RESULT([$CAP_LIBS])
113else
114 AC_MSG_ERROR([not found])
115fi
116AC_SUBST([CAP_LIBS])
35f549fe 117
656994bb
MH
118# Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP
119AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
120
ff218c25 121AC_CHECK_HEADERS([sys/signalfd.h])
122
5e97c3fc 123AC_PROG_GCC_TRADITIONAL
124
125if test "x$GCC" = "xyes"; then
8642237a 126 CFLAGS="$CFLAGS -Wall"
5e97c3fc 127fi
128
129AC_CONFIG_FILES([
288063bd 130 Makefile
b6345ba1 131 lxc.pc
5e97c3fc 132 lxc.spec
288063bd 133 config/Makefile
d823d5b9 134
288063bd 135 doc/Makefile
d823d5b9 136 doc/lxc-create.sgml
137 doc/lxc-destroy.sgml
138 doc/lxc-execute.sgml
139 doc/lxc-start.sgml
396639d4
DL
140 doc/lxc-checkpoint.sgml
141 doc/lxc-restart.sgml
d823d5b9 142 doc/lxc-stop.sgml
b0a33c1e 143 doc/lxc-console.sgml
d823d5b9 144 doc/lxc-freeze.sgml
145 doc/lxc-unfreeze.sgml
146 doc/lxc-monitor.sgml
147 doc/lxc-wait.sgml
148 doc/lxc-ls.sgml
149 doc/lxc-ps.sgml
b0e505c9 150 doc/lxc-cgroup.sgml
e4b3fe58 151 doc/lxc-kill.sgml
49ee6cdc 152 doc/lxc-attach.sgml
8a67a2b2 153 doc/lxc.conf.sgml
8b8b04f8 154 doc/lxc.sgml
10fba81b 155 doc/common_options.sgml
99e4008c 156 doc/see_also.sgml
d823d5b9 157
baf6671f
DL
158 doc/rootfs/Makefile
159
0f71d073
DL
160 doc/examples/Makefile
161 doc/examples/lxc-macvlan.conf
26c39028 162 doc/examples/lxc-vlan.conf
0f71d073
DL
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
c553a9c2 167 doc/examples/lxc-complex.conf
0f71d073 168
c01d62f2 169 templates/Makefile
03d56dff 170 templates/lxc-lenny
c01d62f2 171 templates/lxc-debian
e2b4064f 172 templates/lxc-ubuntu
d1458ac8 173 templates/lxc-ubuntu-cloud
c840b37d 174 templates/lxc-opensuse
c01d62f2
DL
175 templates/lxc-busybox
176 templates/lxc-fedora
262f4e48 177 templates/lxc-altlinux
c01d62f2 178 templates/lxc-sshd
f6267d90 179 templates/lxc-archlinux
c9844b87 180
288063bd 181 src/Makefile
5e97c3fc 182 src/lxc/Makefile
183 src/lxc/lxc-ps
d823d5b9 184 src/lxc/lxc-ls
9d0195cb 185 src/lxc/lxc-netstat
237315ff
DL
186 src/lxc/lxc-checkconfig
187 src/lxc/lxc-setcap
7a82e923 188 src/lxc/lxc-setuid
bcd952a1 189 src/lxc/lxc-version
ab2d32f8 190 src/lxc/lxc-create
be8b5972 191 src/lxc/lxc-clone
72be4f89 192 src/lxc/lxc-shutdown
ab2d32f8 193 src/lxc/lxc-destroy
c9844b87 194
5e97c3fc 195])
196AC_CONFIG_COMMANDS([default],[[]],[[]])
197AC_OUTPUT
805415fc 198
199if test "x$SETCAP" = "xno"; then
f8dafdbb 200 AC_MSG_NOTICE([
805415fc 201
202Warning:
203--------
204
87476557
FG
205The setcap binary was not found. This means the tools to set the
206privilege for the lxc commands are not available, that's ok, but you
207will need to run these commands as root or install libcap-2.
805415fc 208
209])
210
211else
212
f8dafdbb 213 AC_MSG_NOTICE([
805415fc 214
215Advice:
216-------
217
87476557 218If you wish to have a non root user to use the lxc tools,
237315ff
DL
219you can add the needed capabilities to the tools by invoking
220the 'lxc-setcap' script. To remove the capabilities, use
87476557 221'lxc-setcap -d'.
805415fc 222])
223
224fi