]> git.proxmox.com Git - mirror_lxc.git/blob - configure.in
liblxc: create a fedore template container
[mirror_lxc.git] / configure.in
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_INIT([lxc], [0.6.0])
5
6 AC_CONFIG_SRCDIR([configure.in])
7 AC_CONFIG_MACRO_DIR([m4])
8 AC_CONFIG_AUX_DIR([config])
9 AM_CONFIG_HEADER([src/config.h])
10 AM_INIT_AUTOMAKE([-Wno-portability])
11 AC_CANONICAL_HOST
12 AM_PROG_CC_C_O
13 AC_GNU_SOURCE
14 AC_PROG_LIBTOOL
15 AC_CHECK_PROG(SETCAP, setcap, yes, no)
16 AC_CHECK_PROG(DOCBOOK, docbook2man, yes, no)
17 AM_CONDITIONAL(ENABLE_DOCBOOK, test x$DOCBOOK = xyes)
18 AS_AC_EXPAND(BINDIR, $bindir)
19 AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
20 AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir)
21
22 AC_CHECK_HEADERS([linux/netlink.h linux/genetlink.h], [], AC_MSG_ERROR([netlink headers not found]),
23 [#include <linux/types.h>
24 #include <bits/sockaddr.h>
25 #include <linux/socket.h>])
26
27 AC_CHECK_HEADERS([sys/capability.h], [], AC_MSG_ERROR([please install libcap-devel.]),
28 [#include <sys/capability.h>])
29
30 AC_CHECK_HEADERS([sys/signalfd.h])
31
32 AC_PROG_GCC_TRADITIONAL
33
34 if test "x$GCC" = "xyes"; then
35 CFLAGS="$CFLAGS -Wall"
36 fi
37
38 LXC_MAJOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f1)
39 LXC_MINOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f2)
40 LXC_MICRO_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f3)
41
42 AC_ARG_WITH([kernel-release],
43 [AC_HELP_STRING([--with-kernel-release=RELEASE],
44 [specify the "uname -r"-value to build for])],
45 [KERNEL_RELEASE="${withval}"],
46 [KERNEL_RELEASE=`uname -r`])
47
48 AX_COMPARE_VERSION([$KERNEL_RELEASE], [ge], [2.6.29],
49 AC_MSG_NOTICE([network autodestroy: yes]),
50 AC_MSG_NOTICE([network autodestroy: no]))
51
52 if test ${ax_compare_version} != "true"; then
53 CFLAGS="$CFLAGS -DNETWORK_DESTROY"
54 fi
55
56 AC_ARG_ENABLE(test, [ --enable-test compile test program [default=no]],, enable_test=no)
57 AM_CONDITIONAL(ENABLE_TEST, test x$enable_test = xyes)
58
59 AC_SUBST(LXC_MAJOR_VERSION)
60 AC_SUBST(LXC_MINOR_VERSION)
61 AC_SUBST(LXC_MICRO_VERSION)
62
63 AC_CONFIG_FILES([
64 Makefile
65 lxc.spec
66 config/Makefile
67
68 doc/Makefile
69 doc/lxc-create.sgml
70 doc/lxc-destroy.sgml
71 doc/lxc-execute.sgml
72 doc/lxc-start.sgml
73 doc/lxc-stop.sgml
74 doc/lxc-console.sgml
75 doc/lxc-freeze.sgml
76 doc/lxc-unfreeze.sgml
77 doc/lxc-monitor.sgml
78 doc/lxc-wait.sgml
79 doc/lxc-ls.sgml
80 doc/lxc-ps.sgml
81 doc/lxc-cgroup.sgml
82 doc/lxc.conf.sgml
83 doc/lxc.sgml
84
85 scripts/Makefile
86 scripts/lxc-debian
87 scripts/lxc-fedora
88 scripts/lxc-sshd
89
90 src/Makefile
91 src/lxc/Makefile
92 src/lxc/lxc-ps
93 src/lxc/lxc-ls
94 src/lxc/lxc-netstat
95 src/lxc/lxc-checkconfig
96
97 etc/Makefile
98 etc/lxc-macvlan.conf
99 etc/lxc-no-netns.conf
100 etc/lxc-empty-netns.conf
101 etc/lxc-phys.conf
102 etc/lxc-veth.conf
103 etc/lxc-complex-config
104
105 test/Makefile
106 ])
107 AC_CONFIG_COMMANDS([default],[[]],[[]])
108 AC_OUTPUT
109
110 if test "x$DOCBOOK" = "xno"; then
111 AC_MSG_NOTICE([
112
113 Warning:
114 --------
115 The docbook tool is not installed, the man pages won't be generated.
116 If you want the man pages, install docbook and rerun 'configure'.
117
118 ])
119
120 fi
121
122 if test "x$SETCAP" = "xno"; then
123 AC_MSG_NOTICE([
124
125 Warning:
126 --------
127
128 The libcap-2 is not installed. That means the tools to
129 set the privilege for the lxc commands are not available,
130 that's ok, but you will need to run these commands as root
131
132 ])
133
134 else
135
136 AC_MSG_NOTICE([
137
138 Advice:
139 -------
140
141 When installing the tools, it is adviced to install as
142 root, so the privilege for the commands will be set and
143 they will be usable by non-root user
144
145 make && sudo make install
146
147 ])
148
149 fi