]> git.proxmox.com Git - mirror_lxc.git/blob - configure.ac
lxc-kill man update about SIGSTOP and SIGKILL
[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 AC_ARG_WITH([rootfs-path],
51 [AC_HELP_STRING(
52 [--with-rootfs-path=dir],
53 [lxc rootfs mount point]
54 )], [], [with_rootfs_path="${libdir}/lxc"])
55
56 AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
57 AS_AC_EXPAND(LXCPATH, "${with_config_path}")
58 AS_AC_EXPAND(LXCROOTFSMOUNT, "${with_rootfs_path}")
59 AH_TEMPLATE([LXCPATH], [lxc configuration repository])
60 AH_TEMPLATE([LXCLIBEXECDIR], [lxc executable library path])
61 AH_TEMPLATE([LXCROOTFSMOUNT], [lxc default rootfs mount point])
62 AC_DEFINE_UNQUOTED(LXCPATH, "$LXCPATH")
63 AC_DEFINE_UNQUOTED(LXCLIBEXECDIR, "$LIBEXECDIR")
64 AC_DEFINE_UNQUOTED(LXCROOTFSMOUNT, "$LXCROOTFSMOUNT")
65
66 AC_CHECK_HEADERS([linux/netlink.h linux/genetlink.h],
67 [],
68 AC_MSG_ERROR([netlink headers not found. Please install the linux kernel headers.]),
69 [#include <sys/socket.h>
70 ])
71
72 AC_CHECK_HEADERS([sys/capability.h], [], AC_MSG_ERROR([please install libcap-devel.]),
73 [#include <sys/types.h>
74 #include <sys/capability.h>])
75 AC_CHECK_LIB(cap,cap_set_proc,caplib=yes,caplib=no)
76 AC_MSG_CHECKING([linux capabilities])
77 if test "x$caplib" = "xyes" ; then
78 CAP_LIBS="-lcap"
79 AC_MSG_RESULT([$CAP_LIBS])
80 else
81 AC_MSG_ERROR([not found])
82 fi
83 AC_SUBST([CAP_LIBS])
84
85 # Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP
86 AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
87
88 AC_CHECK_HEADERS([sys/signalfd.h])
89
90 AC_PROG_GCC_TRADITIONAL
91
92 if test "x$GCC" = "xyes"; then
93 CFLAGS="$CFLAGS -Wall"
94 fi
95
96 AC_CONFIG_FILES([
97 Makefile
98 lxc.pc
99 lxc.spec
100 config/Makefile
101
102 doc/Makefile
103 doc/lxc-create.sgml
104 doc/lxc-destroy.sgml
105 doc/lxc-execute.sgml
106 doc/lxc-start.sgml
107 doc/lxc-stop.sgml
108 doc/lxc-console.sgml
109 doc/lxc-freeze.sgml
110 doc/lxc-unfreeze.sgml
111 doc/lxc-monitor.sgml
112 doc/lxc-wait.sgml
113 doc/lxc-ls.sgml
114 doc/lxc-ps.sgml
115 doc/lxc-cgroup.sgml
116 doc/lxc-kill.sgml
117 doc/lxc.conf.sgml
118 doc/lxc.sgml
119 doc/common_options.sgml
120 doc/see_also.sgml
121
122 doc/examples/Makefile
123 doc/examples/lxc-macvlan.conf
124 doc/examples/lxc-vlan.conf
125 doc/examples/lxc-no-netns.conf
126 doc/examples/lxc-empty-netns.conf
127 doc/examples/lxc-phys.conf
128 doc/examples/lxc-veth.conf
129 doc/examples/lxc-complex.conf
130
131 scripts/Makefile
132 scripts/lxc-debian
133 scripts/lxc-busybox
134 scripts/lxc-fedora
135 scripts/lxc-sshd
136
137 src/Makefile
138 src/lxc/Makefile
139 src/lxc/lxc-ps
140 src/lxc/lxc-ls
141 src/lxc/lxc-netstat
142 src/lxc/lxc-checkconfig
143 src/lxc/lxc-setcap
144 src/lxc/lxc-version
145 src/lxc/lxc-create
146 src/lxc/lxc-destroy
147
148 ])
149 AC_CONFIG_COMMANDS([default],[[]],[[]])
150 AC_OUTPUT
151
152 if test "x$SETCAP" = "xno"; then
153 AC_MSG_NOTICE([
154
155 Warning:
156 --------
157
158 The setcap binary was not found. This means the tools to set the
159 privilege for the lxc commands are not available, that's ok, but you
160 will need to run these commands as root or install libcap-2.
161
162 ])
163
164 else
165
166 AC_MSG_NOTICE([
167
168 Advice:
169 -------
170
171 If you wish to have a non root user to use the lxc tools,
172 you can add the needed capabilities to the tools by invoking
173 the 'lxc-setcap' script. To remove the capabilities, use
174 'lxc-setcap -d'.
175 ])
176
177 fi