]> git.proxmox.com Git - mirror_lxc.git/blame - configure.ac
add capabilities for lxc-checkpoint
[mirror_lxc.git] / configure.ac
CommitLineData
5e97c3fc 1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
f49d83e9 4AC_INIT([lxc], [0.6.3])
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
AN
14
15AC_ARG_ENABLE([doc],
16 [AC_HELP_STRING([--enable-doc], [make mans (require docbook2man installed) [default=auto]])],
17 [], [enable_doc=auto])
18
19if test "x$enable_doc" = "xyes" -o "x$enable_doc" = "xauto"; then
20 AC_CHECK_PROG(have_docbook, [docbook2man], [yes], [no])
21
22 test "x$have_docbook" = "xno" -a "x$enable_doc" = "xyes" && \
23 AC_MSG_ERROR([docbook2man required by man request, but not found])
24fi
25
26AM_CONDITIONAL([ENABLE_DOCBOOK], [test "x$have_docbook" = "xyes"])
27
3fb0a9bb
AN
28AC_ARG_ENABLE([examples],
29 [AC_HELP_STRING([--disable-examples], [do not install configuration examples])],
30 [], [enable_examples=yes])
31
32AM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" = "xyes"])
33
b6345ba1
DL
34AS_AC_EXPAND(PREFIX, $prefix)
35AS_AC_EXPAND(LIBDIR, $libdir)
7ad641d5 36AS_AC_EXPAND(BINDIR, $bindir)
b6345ba1 37AS_AC_EXPAND(INCLUDEDIR, $includedir)
a25ba7aa 38AS_AC_EXPAND(LIBEXECDIR, $libexecdir)
7ad641d5 39AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
3eae9733 40AS_AC_EXPAND(DATADIR, $datadir)
7ad641d5 41AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir)
805415fc 42
aef4ebcf
AN
43AC_ARG_WITH([config-path],
44 [AC_HELP_STRING(
45 [--with-config-path=dir],
46 [lxc configuration repository]
47 )], [], [with_config_path="${localstatedir}/lib/lxc"])
48
49AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
50AS_AC_EXPAND(LXCPATH, "${with_config_path}")
881450bb
DL
51AH_TEMPLATE([LXCPATH], [lxc configuration repository])
52AH_TEMPLATE([LXCLIBEXECDIR], [lxc executable library path])
53AC_DEFINE_UNQUOTED(LXCPATH, "$LXCPATH")
54AC_DEFINE_UNQUOTED(LXCLIBEXECDIR, "$LIBEXECDIR")
55
90e0a869
GT
56AC_CHECK_HEADERS([linux/netlink.h linux/genetlink.h],
57 [],
58 AC_MSG_ERROR([netlink headers not found. Please install the linux kernel headers.]),
59 [#include <sys/socket.h>
60 ])
35f549fe 61
62AC_CHECK_HEADERS([sys/capability.h], [], AC_MSG_ERROR([please install libcap-devel.]),
ddceb1f9
DL
63[#include <sys/types.h>
64#include <sys/capability.h>])
35f549fe 65
656994bb
MH
66# Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP
67AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
68
ff218c25 69AC_CHECK_HEADERS([sys/signalfd.h])
70
5e97c3fc 71AC_PROG_GCC_TRADITIONAL
72
73if test "x$GCC" = "xyes"; then
8642237a 74 CFLAGS="$CFLAGS -Wall"
5e97c3fc 75fi
76
77AC_CONFIG_FILES([
78 Makefile
b6345ba1 79 lxc.pc
5e97c3fc 80 lxc.spec
81 config/Makefile
d823d5b9 82
83 doc/Makefile
84 doc/lxc-create.sgml
85 doc/lxc-destroy.sgml
86 doc/lxc-execute.sgml
87 doc/lxc-start.sgml
88 doc/lxc-stop.sgml
b0a33c1e 89 doc/lxc-console.sgml
d823d5b9 90 doc/lxc-freeze.sgml
91 doc/lxc-unfreeze.sgml
92 doc/lxc-monitor.sgml
93 doc/lxc-wait.sgml
94 doc/lxc-ls.sgml
95 doc/lxc-ps.sgml
b0e505c9 96 doc/lxc-cgroup.sgml
8a67a2b2 97 doc/lxc.conf.sgml
8b8b04f8 98 doc/lxc.sgml
10fba81b 99 doc/common_options.sgml
99e4008c 100 doc/see_also.sgml
d823d5b9 101
c9844b87 102 scripts/Makefile
103 scripts/lxc-debian
54b1eb68 104 scripts/lxc-fedora
c9844b87 105 scripts/lxc-sshd
106
5e97c3fc 107 src/Makefile
5e97c3fc 108 src/lxc/Makefile
109 src/lxc/lxc-ps
d823d5b9 110 src/lxc/lxc-ls
9d0195cb 111 src/lxc/lxc-netstat
237315ff
DL
112 src/lxc/lxc-checkconfig
113 src/lxc/lxc-setcap
bcd952a1 114 src/lxc/lxc-version
ab2d32f8
DL
115 src/lxc/lxc-create
116 src/lxc/lxc-destroy
c9844b87 117
3fb0a9bb
AN
118 doc/examples/Makefile
119 doc/examples/lxc-macvlan.conf
120 doc/examples/lxc-no-netns.conf
121 doc/examples/lxc-empty-netns.conf
122 doc/examples/lxc-phys.conf
123 doc/examples/lxc-veth.conf
124 doc/examples/lxc-complex-config
5e97c3fc 125])
126AC_CONFIG_COMMANDS([default],[[]],[[]])
127AC_OUTPUT
805415fc 128
129if test "x$SETCAP" = "xno"; then
f8dafdbb 130 AC_MSG_NOTICE([
805415fc 131
132Warning:
133--------
134
87476557
FG
135The setcap binary was not found. This means the tools to set the
136privilege for the lxc commands are not available, that's ok, but you
137will need to run these commands as root or install libcap-2.
805415fc 138
139])
140
141else
142
f8dafdbb 143 AC_MSG_NOTICE([
805415fc 144
145Advice:
146-------
147
87476557 148If you wish to have a non root user to use the lxc tools,
237315ff
DL
149you can add the needed capabilities to the tools by invoking
150the 'lxc-setcap' script. To remove the capabilities, use
87476557 151'lxc-setcap -d'.
805415fc 152])
153
154fi