]> git.proxmox.com Git - mirror_lxc.git/blob - configure.ac
avoid two times error msg about invalid state
[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.2])
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_PROG_LIBTOOL
14 AC_CHECK_PROG(SETCAP, setcap, yes, no)
15 AC_CHECK_PROG(DOCBOOK, docbook2man, yes, no)
16 AM_CONDITIONAL(ENABLE_DOCBOOK, test x$DOCBOOK = xyes)
17 AS_AC_EXPAND(BINDIR, $bindir)
18 AS_AC_EXPAND(LIBEXECDIR, $libexecdir)
19 AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
20 AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir)
21 AS_AC_EXPAND(LXCPATH, "${localstatedir}/lib/lxc")
22 AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
23
24 AC_CHECK_HEADERS([linux/netlink.h linux/genetlink.h], [], AC_MSG_ERROR([netlink headers not found]),
25 [#include <linux/types.h>
26 #include <bits/sockaddr.h>
27 #include <linux/socket.h>])
28
29 AC_CHECK_HEADERS([sys/capability.h], [], AC_MSG_ERROR([please install libcap-devel.]),
30 [#include <sys/capability.h>])
31
32 # Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP
33 AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
34
35 AC_CHECK_HEADERS([sys/signalfd.h])
36
37 AC_PROG_GCC_TRADITIONAL
38
39 if test "x$GCC" = "xyes"; then
40 CFLAGS="$CFLAGS -Wall"
41 fi
42
43 LXC_MAJOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f1)
44 LXC_MINOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f2)
45 LXC_MICRO_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f3)
46
47 AC_ARG_WITH([kernel-release],
48 [AC_HELP_STRING([--with-kernel-release=RELEASE],
49 [specify the "uname -r"-value to build for])],
50 [KERNEL_RELEASE="${withval}"],
51 [KERNEL_RELEASE=`uname -r`])
52
53 AC_ARG_ENABLE(test, [ --enable-test compile test program [default=no]],, enable_test=no)
54 AM_CONDITIONAL(ENABLE_TEST, test x$enable_test = xyes)
55
56 AC_SUBST(LXC_MAJOR_VERSION)
57 AC_SUBST(LXC_MINOR_VERSION)
58 AC_SUBST(LXC_MICRO_VERSION)
59
60 AC_CONFIG_FILES([
61 Makefile
62 lxc.spec
63 config/Makefile
64
65 doc/Makefile
66 doc/lxc-create.sgml
67 doc/lxc-destroy.sgml
68 doc/lxc-execute.sgml
69 doc/lxc-start.sgml
70 doc/lxc-stop.sgml
71 doc/lxc-console.sgml
72 doc/lxc-freeze.sgml
73 doc/lxc-unfreeze.sgml
74 doc/lxc-monitor.sgml
75 doc/lxc-wait.sgml
76 doc/lxc-ls.sgml
77 doc/lxc-ps.sgml
78 doc/lxc-cgroup.sgml
79 doc/lxc.conf.sgml
80 doc/lxc.sgml
81
82 scripts/Makefile
83 scripts/lxc-debian
84 scripts/lxc-fedora
85 scripts/lxc-sshd
86
87 src/Makefile
88 src/lxc/Makefile
89 src/lxc/lxc-ps
90 src/lxc/lxc-ls
91 src/lxc/lxc-netstat
92 src/lxc/lxc-checkconfig
93 src/lxc/lxc-setcap
94
95 etc/Makefile
96 etc/lxc-macvlan.conf
97 etc/lxc-no-netns.conf
98 etc/lxc-empty-netns.conf
99 etc/lxc-phys.conf
100 etc/lxc-veth.conf
101 etc/lxc-complex-config
102
103 test/Makefile
104 ])
105 AC_CONFIG_COMMANDS([default],[[]],[[]])
106 AC_OUTPUT
107
108 if test "x$DOCBOOK" = "xno"; then
109 AC_MSG_NOTICE([
110
111 Warning:
112 --------
113 The docbook tool is not installed, the man pages won't be generated.
114 If you want the man pages, install docbook and rerun 'configure'.
115
116 ])
117
118 fi
119
120 if test "x$SETCAP" = "xno"; then
121 AC_MSG_NOTICE([
122
123 Warning:
124 --------
125
126 The libcap-2 is not installed. That means the tools to
127 set the privilege for the lxc commands are not available,
128 that's ok, but you will need to run these commands as root
129
130 ])
131
132 else
133
134 AC_MSG_NOTICE([
135
136 Advice:
137 -------
138
139 If you which to have a non root user to use the lxc tools,
140 you can add the needed capabilities to the tools by invoking
141 the 'lxc-setcap' script. To remove the capabilities, use
142 'lxc-setcap -d'
143 ])
144
145 fi