]> git.proxmox.com Git - mirror_lxc.git/blame - configure.ac
whitespace cleanup in configure.ac
[mirror_lxc.git] / configure.ac
CommitLineData
5e97c3fc 1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
9eb09f87 4AC_INIT([lxc], [0.6.5])
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 57AC_CHECK_HEADERS([linux/netlink.h linux/genetlink.h],
288063bd
DL
58 [],
59 AC_MSG_ERROR([netlink headers not found. Please install the linux kernel headers.]),
60 [#include <sys/socket.h>
90e0a869 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([
288063bd 79 Makefile
b6345ba1 80 lxc.pc
5e97c3fc 81 lxc.spec
288063bd 82 config/Makefile
d823d5b9 83
288063bd 84 doc/Makefile
d823d5b9 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
e4b3fe58 98 doc/lxc-kill.sgml
8a67a2b2 99 doc/lxc.conf.sgml
8b8b04f8 100 doc/lxc.sgml
10fba81b 101 doc/common_options.sgml
99e4008c 102 doc/see_also.sgml
d823d5b9 103
0f71d073
DL
104 doc/examples/Makefile
105 doc/examples/lxc-macvlan.conf
26c39028 106 doc/examples/lxc-vlan.conf
0f71d073
DL
107 doc/examples/lxc-no-netns.conf
108 doc/examples/lxc-empty-netns.conf
109 doc/examples/lxc-phys.conf
110 doc/examples/lxc-veth.conf
c553a9c2 111 doc/examples/lxc-complex.conf
0f71d073 112
c9844b87 113 scripts/Makefile
114 scripts/lxc-debian
eb960fea 115 scripts/lxc-busybox
54b1eb68 116 scripts/lxc-fedora
c9844b87 117 scripts/lxc-sshd
118
288063bd 119 src/Makefile
5e97c3fc 120 src/lxc/Makefile
121 src/lxc/lxc-ps
d823d5b9 122 src/lxc/lxc-ls
9d0195cb 123 src/lxc/lxc-netstat
237315ff
DL
124 src/lxc/lxc-checkconfig
125 src/lxc/lxc-setcap
bcd952a1 126 src/lxc/lxc-version
ab2d32f8
DL
127 src/lxc/lxc-create
128 src/lxc/lxc-destroy
c9844b87 129
5e97c3fc 130])
131AC_CONFIG_COMMANDS([default],[[]],[[]])
132AC_OUTPUT
805415fc 133
134if test "x$SETCAP" = "xno"; then
f8dafdbb 135 AC_MSG_NOTICE([
805415fc 136
137Warning:
138--------
139
87476557
FG
140The setcap binary was not found. This means the tools to set the
141privilege for the lxc commands are not available, that's ok, but you
142will need to run these commands as root or install libcap-2.
805415fc 143
144])
145
146else
147
f8dafdbb 148 AC_MSG_NOTICE([
805415fc 149
150Advice:
151-------
152
87476557 153If you wish to have a non root user to use the lxc tools,
237315ff
DL
154you can add the needed capabilities to the tools by invoking
155the 'lxc-setcap' script. To remove the capabilities, use
87476557 156'lxc-setcap -d'.
805415fc 157])
158
159fi