]>
Commit | Line | Data |
---|---|---|
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(LIBEXECDIR, $libexecdir) | |
20 | AS_AC_EXPAND(SYSCONFDIR, $sysconfdir) | |
21 | AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir) | |
22 | ||
23 | AC_CHECK_HEADERS([linux/netlink.h linux/genetlink.h], [], AC_MSG_ERROR([netlink headers not found]), | |
24 | [#include <linux/types.h> | |
25 | #include <bits/sockaddr.h> | |
26 | #include <linux/socket.h>]) | |
27 | ||
28 | AC_CHECK_HEADERS([sys/capability.h], [], AC_MSG_ERROR([please install libcap-devel.]), | |
29 | [#include <sys/capability.h>]) | |
30 | ||
31 | # Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP | |
32 | AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>]) | |
33 | ||
34 | AC_CHECK_HEADERS([sys/signalfd.h]) | |
35 | ||
36 | AC_PROG_GCC_TRADITIONAL | |
37 | ||
38 | if test "x$GCC" = "xyes"; then | |
39 | CFLAGS="$CFLAGS -Wall" | |
40 | fi | |
41 | ||
42 | LXC_MAJOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f1) | |
43 | LXC_MINOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f2) | |
44 | LXC_MICRO_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f3) | |
45 | ||
46 | AC_ARG_WITH([kernel-release], | |
47 | [AC_HELP_STRING([--with-kernel-release=RELEASE], | |
48 | [specify the "uname -r"-value to build for])], | |
49 | [KERNEL_RELEASE="${withval}"], | |
50 | [KERNEL_RELEASE=`uname -r`]) | |
51 | ||
52 | AX_COMPARE_VERSION([$KERNEL_RELEASE], [ge], [2.6.29], | |
53 | AC_MSG_NOTICE([network autodestroy: yes]), | |
54 | AC_MSG_NOTICE([network autodestroy: no])) | |
55 | ||
56 | if test ${ax_compare_version} != "true"; then | |
57 | CFLAGS="$CFLAGS -DNETWORK_DESTROY" | |
58 | fi | |
59 | ||
60 | AC_ARG_ENABLE(test, [ --enable-test compile test program [default=no]],, enable_test=no) | |
61 | AM_CONDITIONAL(ENABLE_TEST, test x$enable_test = xyes) | |
62 | ||
63 | AC_SUBST(LXC_MAJOR_VERSION) | |
64 | AC_SUBST(LXC_MINOR_VERSION) | |
65 | AC_SUBST(LXC_MICRO_VERSION) | |
66 | ||
67 | AC_CONFIG_FILES([ | |
68 | Makefile | |
69 | lxc.spec | |
70 | config/Makefile | |
71 | ||
72 | doc/Makefile | |
73 | doc/lxc-create.sgml | |
74 | doc/lxc-destroy.sgml | |
75 | doc/lxc-execute.sgml | |
76 | doc/lxc-start.sgml | |
77 | doc/lxc-stop.sgml | |
78 | doc/lxc-console.sgml | |
79 | doc/lxc-freeze.sgml | |
80 | doc/lxc-unfreeze.sgml | |
81 | doc/lxc-monitor.sgml | |
82 | doc/lxc-wait.sgml | |
83 | doc/lxc-ls.sgml | |
84 | doc/lxc-ps.sgml | |
85 | doc/lxc-cgroup.sgml | |
86 | doc/lxc.conf.sgml | |
87 | doc/lxc.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 | ||
101 | etc/Makefile | |
102 | etc/lxc-macvlan.conf | |
103 | etc/lxc-no-netns.conf | |
104 | etc/lxc-empty-netns.conf | |
105 | etc/lxc-phys.conf | |
106 | etc/lxc-veth.conf | |
107 | etc/lxc-complex-config | |
108 | ||
109 | test/Makefile | |
110 | ]) | |
111 | AC_CONFIG_COMMANDS([default],[[]],[[]]) | |
112 | AC_OUTPUT | |
113 | ||
114 | if test "x$DOCBOOK" = "xno"; then | |
115 | AC_MSG_NOTICE([ | |
116 | ||
117 | Warning: | |
118 | -------- | |
119 | The docbook tool is not installed, the man pages won't be generated. | |
120 | If you want the man pages, install docbook and rerun 'configure'. | |
121 | ||
122 | ]) | |
123 | ||
124 | fi | |
125 | ||
126 | if test "x$SETCAP" = "xno"; then | |
127 | AC_MSG_NOTICE([ | |
128 | ||
129 | Warning: | |
130 | -------- | |
131 | ||
132 | The libcap-2 is not installed. That means the tools to | |
133 | set the privilege for the lxc commands are not available, | |
134 | that's ok, but you will need to run these commands as root | |
135 | ||
136 | ]) | |
137 | ||
138 | else | |
139 | ||
140 | AC_MSG_NOTICE([ | |
141 | ||
142 | Advice: | |
143 | ------- | |
144 | ||
145 | When installing the tools, it is adviced to install as | |
146 | root, so the privilege for the commands will be set and | |
147 | they will be usable by non-root user | |
148 | ||
149 | make && sudo make install | |
150 | ||
151 | ]) | |
152 | ||
153 | fi |