]> git.proxmox.com Git - mirror_lxc.git/blame - configure.ac
compilation warning in confile.c
[mirror_lxc.git] / configure.ac
CommitLineData
5e97c3fc 1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
8f0a524d 4AC_INIT([lxc], [0.6.4])
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)
0f71d073 42AS_AC_EXPAND(DOCDIR, $docdir)
805415fc 43
aef4ebcf
AN
44AC_ARG_WITH([config-path],
45 [AC_HELP_STRING(
46 [--with-config-path=dir],
e892973e 47 [lxc configuration repository path]
aef4ebcf
AN
48 )], [], [with_config_path="${localstatedir}/lib/lxc"])
49
50AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
51AS_AC_EXPAND(LXCPATH, "${with_config_path}")
881450bb
DL
52AH_TEMPLATE([LXCPATH], [lxc configuration repository])
53AH_TEMPLATE([LXCLIBEXECDIR], [lxc executable library path])
54AC_DEFINE_UNQUOTED(LXCPATH, "$LXCPATH")
55AC_DEFINE_UNQUOTED(LXCLIBEXECDIR, "$LIBEXECDIR")
56
90e0a869
GT
57AC_CHECK_HEADERS([linux/netlink.h linux/genetlink.h],
58 [],
59 AC_MSG_ERROR([netlink headers not found. Please install the linux kernel headers.]),
60 [#include <sys/socket.h>
61 ])
35f549fe 62
63AC_CHECK_HEADERS([sys/capability.h], [], AC_MSG_ERROR([please install libcap-devel.]),
ddceb1f9
DL
64[#include <sys/types.h>
65#include <sys/capability.h>])
35f549fe 66
656994bb
MH
67# Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP
68AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
69
ff218c25 70AC_CHECK_HEADERS([sys/signalfd.h])
71
5e97c3fc 72AC_PROG_GCC_TRADITIONAL
73
74if test "x$GCC" = "xyes"; then
8642237a 75 CFLAGS="$CFLAGS -Wall"
5e97c3fc 76fi
77
78AC_CONFIG_FILES([
79 Makefile
b6345ba1 80 lxc.pc
5e97c3fc 81 lxc.spec
82 config/Makefile
d823d5b9 83
84 doc/Makefile
85 doc/lxc-create.sgml
86 doc/lxc-destroy.sgml
87 doc/lxc-execute.sgml
88 doc/lxc-start.sgml
89 doc/lxc-stop.sgml
b0a33c1e 90 doc/lxc-console.sgml
d823d5b9 91 doc/lxc-freeze.sgml
92 doc/lxc-unfreeze.sgml
93 doc/lxc-monitor.sgml
94 doc/lxc-wait.sgml
95 doc/lxc-ls.sgml
96 doc/lxc-ps.sgml
b0e505c9 97 doc/lxc-cgroup.sgml
8a67a2b2 98 doc/lxc.conf.sgml
8b8b04f8 99 doc/lxc.sgml
10fba81b 100 doc/common_options.sgml
99e4008c 101 doc/see_also.sgml
d823d5b9 102
0f71d073
DL
103 doc/examples/Makefile
104 doc/examples/lxc-macvlan.conf
26c39028 105 doc/examples/lxc-vlan.conf
0f71d073
DL
106 doc/examples/lxc-no-netns.conf
107 doc/examples/lxc-empty-netns.conf
108 doc/examples/lxc-phys.conf
109 doc/examples/lxc-veth.conf
c553a9c2 110 doc/examples/lxc-complex.conf
0f71d073 111
c9844b87 112 scripts/Makefile
113 scripts/lxc-debian
eb960fea 114 scripts/lxc-busybox
54b1eb68 115 scripts/lxc-fedora
c9844b87 116 scripts/lxc-sshd
117
5e97c3fc 118 src/Makefile
5e97c3fc 119 src/lxc/Makefile
120 src/lxc/lxc-ps
d823d5b9 121 src/lxc/lxc-ls
9d0195cb 122 src/lxc/lxc-netstat
237315ff
DL
123 src/lxc/lxc-checkconfig
124 src/lxc/lxc-setcap
bcd952a1 125 src/lxc/lxc-version
ab2d32f8
DL
126 src/lxc/lxc-create
127 src/lxc/lxc-destroy
c9844b87 128
5e97c3fc 129])
130AC_CONFIG_COMMANDS([default],[[]],[[]])
131AC_OUTPUT
805415fc 132
133if test "x$SETCAP" = "xno"; then
f8dafdbb 134 AC_MSG_NOTICE([
805415fc 135
136Warning:
137--------
138
87476557
FG
139The setcap binary was not found. This means the tools to set the
140privilege for the lxc commands are not available, that's ok, but you
141will need to run these commands as root or install libcap-2.
805415fc 142
143])
144
145else
146
f8dafdbb 147 AC_MSG_NOTICE([
805415fc 148
149Advice:
150-------
151
87476557 152If you wish to have a non root user to use the lxc tools,
237315ff
DL
153you can add the needed capabilities to the tools by invoking
154the 'lxc-setcap' script. To remove the capabilities, use
87476557 155'lxc-setcap -d'.
805415fc 156])
157
158fi