]> git.proxmox.com Git - mirror_lxc.git/blob - configure.ac
add --statefd option to lxc-checkpoint/restart
[mirror_lxc.git] / configure.ac
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_INIT([lxc], [0.6.5])
5
6 AC_CONFIG_SRCDIR([configure.ac])
7 AC_CONFIG_AUX_DIR([config])
8 AM_CONFIG_HEADER([src/config.h])
9 AM_INIT_AUTOMAKE([-Wno-portability])
10 AC_CANONICAL_HOST
11 AM_PROG_CC_C_O
12 AC_GNU_SOURCE
13 AC_CHECK_PROG(SETCAP, setcap, yes, no, $PATH$PATH_SEPARATOR/sbin)
14
15 AC_ARG_ENABLE([doc],
16 [AC_HELP_STRING([--enable-doc], [make mans (require docbook2man installed) [default=auto]])],
17 [], [enable_doc=auto])
18
19 if 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])
24 fi
25
26 AM_CONDITIONAL([ENABLE_DOCBOOK], [test "x$have_docbook" = "xyes"])
27
28 AC_ARG_ENABLE([examples],
29 [AC_HELP_STRING([--disable-examples], [do not install configuration examples])],
30 [], [enable_examples=yes])
31
32 AM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" = "xyes"])
33
34 AS_AC_EXPAND(PREFIX, $prefix)
35 AS_AC_EXPAND(LIBDIR, $libdir)
36 AS_AC_EXPAND(BINDIR, $bindir)
37 AS_AC_EXPAND(INCLUDEDIR, $includedir)
38 AS_AC_EXPAND(LIBEXECDIR, $libexecdir)
39 AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
40 AS_AC_EXPAND(DATADIR, $datadir)
41 AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir)
42 AS_AC_EXPAND(DOCDIR, $docdir)
43
44 AC_ARG_WITH([config-path],
45 [AC_HELP_STRING(
46 [--with-config-path=dir],
47 [lxc configuration repository path]
48 )], [], [with_config_path="${localstatedir}/lib/lxc"])
49
50 AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
51 AS_AC_EXPAND(LXCPATH, "${with_config_path}")
52 AH_TEMPLATE([LXCPATH], [lxc configuration repository])
53 AH_TEMPLATE([LXCLIBEXECDIR], [lxc executable library path])
54 AC_DEFINE_UNQUOTED(LXCPATH, "$LXCPATH")
55 AC_DEFINE_UNQUOTED(LXCLIBEXECDIR, "$LIBEXECDIR")
56
57 AC_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 ])
62
63 AC_CHECK_HEADERS([sys/capability.h], [], AC_MSG_ERROR([please install libcap-devel.]),
64 [#include <sys/types.h>
65 #include <sys/capability.h>])
66
67 # Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP
68 AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
69
70 AC_CHECK_HEADERS([sys/signalfd.h])
71
72 AC_PROG_GCC_TRADITIONAL
73
74 if test "x$GCC" = "xyes"; then
75 CFLAGS="$CFLAGS -Wall"
76 fi
77
78 AC_CONFIG_FILES([
79 Makefile
80 lxc.pc
81 lxc.spec
82 config/Makefile
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
90 doc/lxc-console.sgml
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
97 doc/lxc-cgroup.sgml
98 doc/lxc.conf.sgml
99 doc/lxc.sgml
100 doc/common_options.sgml
101 doc/see_also.sgml
102
103 doc/examples/Makefile
104 doc/examples/lxc-macvlan.conf
105 doc/examples/lxc-vlan.conf
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
110 doc/examples/lxc-complex.conf
111
112 scripts/Makefile
113 scripts/lxc-debian
114 scripts/lxc-busybox
115 scripts/lxc-fedora
116 scripts/lxc-sshd
117
118 src/Makefile
119 src/lxc/Makefile
120 src/lxc/lxc-ps
121 src/lxc/lxc-ls
122 src/lxc/lxc-netstat
123 src/lxc/lxc-checkconfig
124 src/lxc/lxc-setcap
125 src/lxc/lxc-version
126 src/lxc/lxc-create
127 src/lxc/lxc-destroy
128
129 ])
130 AC_CONFIG_COMMANDS([default],[[]],[[]])
131 AC_OUTPUT
132
133 if test "x$SETCAP" = "xno"; then
134 AC_MSG_NOTICE([
135
136 Warning:
137 --------
138
139 The setcap binary was not found. This means the tools to set the
140 privilege for the lxc commands are not available, that's ok, but you
141 will need to run these commands as root or install libcap-2.
142
143 ])
144
145 else
146
147 AC_MSG_NOTICE([
148
149 Advice:
150 -------
151
152 If you wish to have a non root user to use the lxc tools,
153 you can add the needed capabilities to the tools by invoking
154 the 'lxc-setcap' script. To remove the capabilities, use
155 'lxc-setcap -d'.
156 ])
157
158 fi