]> git.proxmox.com Git - mirror_lxc.git/blob - configure.in
45981e23c2fe9d0ccf7f073355fdae9de68c4181
[mirror_lxc.git] / configure.in
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_INIT([lxc], [0.4.1])
5
6 AC_CONFIG_SRCDIR([configure.in])
7 AC_CONFIG_AUX_DIR([config])
8 AM_CONFIG_HEADER([src/config.h])
9 AM_INIT_AUTOMAKE([-Wno-portability])
10 AC_CANONICAL_HOST
11 AC_PROG_RANLIB
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 AC_PROG_GCC_TRADITIONAL
27
28 if test "x$GCC" = "xyes"; then
29 CFLAGS="$CFLAGS -Wall"
30 fi
31
32 LXC_MAJOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f1)
33 LXC_MINOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f2)
34 LXC_MICRO_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f3)
35
36 AC_ARG_ENABLE(network_destroy, [ --disable-network-destroy disable network destruction at exit [default=no]],, enable_network_destroy=yes)
37 if test "x$enable_network_destroy" = "xyes"; then
38 CFLAGS="$CFLAGS -DNETWORK_DESTROY"
39 fi
40 AC_ARG_ENABLE(test, [ --enable-test compile test program [default=no]],, enable_test=no)
41 AM_CONDITIONAL(ENABLE_TEST, test x$enable_test = xyes)
42
43 AC_SUBST(LXC_MAJOR_VERSION)
44 AC_SUBST(LXC_MINOR_VERSION)
45 AC_SUBST(LXC_MICRO_VERSION)
46
47 AC_CONFIG_FILES([
48 Makefile
49 lxc.spec
50 config/Makefile
51
52 doc/Makefile
53 doc/lxc-create.sgml
54 doc/lxc-destroy.sgml
55 doc/lxc-execute.sgml
56 doc/lxc-start.sgml
57 doc/lxc-stop.sgml
58 doc/lxc-freeze.sgml
59 doc/lxc-unfreeze.sgml
60 doc/lxc-monitor.sgml
61 doc/lxc-wait.sgml
62 doc/lxc-ls.sgml
63 doc/lxc-ps.sgml
64 doc/lxc-cgroup.sgml
65 doc/lxc.conf.sgml
66 doc/lxc.sgml
67
68 scripts/Makefile
69 scripts/lxc-debian
70 scripts/lxc-sshd
71
72 src/Makefile
73 src/lxc/Makefile
74 src/lxc/lxc-ps
75 src/lxc/lxc-ls
76 src/lxc/lxc-netstat
77 src/lxc/lxc-checkconfig
78
79 etc/Makefile
80 etc/lxc-macvlan.conf
81 etc/lxc-no-netns.conf
82 etc/lxc-empty-netns.conf
83 etc/lxc-phys.conf
84 etc/lxc-veth.conf
85 etc/lxc-complex-config
86
87 test/Makefile
88 ])
89 AC_CONFIG_COMMANDS([default],[[]],[[]])
90 AC_OUTPUT
91
92 if test "x$DOCBOOK" = "xno"; then
93 AC_MSG_NOTICE([
94
95 Warning:
96 --------
97 The docbook tool is not installed, the man pages won't be generated.
98 If you want the man pages, install docbook and rerun 'configure'.
99
100 ])
101
102 fi
103
104 if test "x$SETCAP" = "xno"; then
105 AC_MSG_NOTICE([
106
107 Warning:
108 --------
109
110 The libcap-2 is not installed. That means the tools to
111 set the privilege for the lxc commands are not available,
112 that's ok, but you will need to run these commands as root
113
114 ])
115
116 else
117
118 AC_MSG_NOTICE([
119
120 Advice:
121 -------
122
123 When installing the tools, it is adviced to install as
124 root, so the privilege for the commands will be set and
125 they will be usable by non-root user
126
127 make && sudo make install
128
129 ])
130
131 fi