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