]> git.proxmox.com Git - mirror_lxc.git/blob - configure.ac
update lxc-checkpoint / lxc-restart man
[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.5])
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_CHECK_PROG(SETCAP, setcap, yes, no, $PATH$PATH_SEPARATOR/sbin)
14
15 AC_ARG_ENABLE([doc],
16 [AC_HELP_STRING([--enable-doc], [make mans (require docbook2man installed) [default=auto]])],
17 [], [enable_doc=auto])
18
19 if test "x$enable_doc" = "xyes" -o "x$enable_doc" = "xauto"; then
20 AC_CHECK_PROG(have_docbook, [docbook2man], [yes], [no])
21
22 test "x$have_docbook" = "xno" -a "x$enable_doc" = "xyes" && \
23 AC_MSG_ERROR([docbook2man required by man request, but not found])
24 fi
25
26 AM_CONDITIONAL([ENABLE_DOCBOOK], [test "x$have_docbook" = "xyes"])
27
28 AC_ARG_ENABLE([examples],
29 [AC_HELP_STRING([--disable-examples], [do not install configuration examples])],
30 [], [enable_examples=yes])
31
32 AM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" = "xyes"])
33
34 AS_AC_EXPAND(PREFIX, $prefix)
35 AS_AC_EXPAND(LIBDIR, $libdir)
36 AS_AC_EXPAND(BINDIR, $bindir)
37 AS_AC_EXPAND(INCLUDEDIR, $includedir)
38 AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
39 AS_AC_EXPAND(DATADIR, $datadir)
40 AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir)
41 AS_AC_EXPAND(DOCDIR, $docdir)
42
43 AC_ARG_WITH([config-path],
44 [AC_HELP_STRING(
45 [--with-config-path=dir],
46 [lxc configuration repository path]
47 )], [], [with_config_path="${localstatedir}/lib/lxc"])
48
49 AC_ARG_WITH([rootfs-path],
50 [AC_HELP_STRING(
51 [--with-rootfs-path=dir],
52 [lxc rootfs mount point]
53 )], [], [with_rootfs_path="${libdir}/lxc/rootfs"])
54
55 AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
56
57 AS_AC_EXPAND(LXCPATH, "${with_config_path}")
58 AS_AC_EXPAND(LXCROOTFSMOUNT, "${with_rootfs_path}")
59 AS_AC_EXPAND(LXCINITDIR, $libdir/lxc)
60 AH_TEMPLATE([LXCPATH], [lxc configuration repository])
61 AH_TEMPLATE([LXCINITDIR], [lxc-init directory location])
62 AH_TEMPLATE([LXCROOTFSMOUNT], [lxc default rootfs mount point])
63 AC_DEFINE_UNQUOTED(LXCPATH, "$LXCPATH")
64 AC_DEFINE_UNQUOTED(LXCINITDIR, "$LXCINITDIR")
65 AC_DEFINE_UNQUOTED(LXCROOTFSMOUNT, "$LXCROOTFSMOUNT")
66
67 AC_CHECK_HEADERS([linux/netlink.h linux/genetlink.h],
68 [],
69 AC_MSG_ERROR([netlink headers not found. Please install the linux kernel headers.]),
70 [#include <sys/socket.h>
71 ])
72
73 AC_CHECK_HEADERS([sys/capability.h], [], AC_MSG_ERROR([please install libcap-devel.]),
74 [#include <sys/types.h>
75 #include <sys/capability.h>])
76 AC_CHECK_LIB(cap,cap_set_proc,caplib=yes,caplib=no)
77 AC_MSG_CHECKING([linux capabilities])
78 if test "x$caplib" = "xyes" ; then
79 CAP_LIBS="-lcap"
80 AC_MSG_RESULT([$CAP_LIBS])
81 else
82 AC_MSG_ERROR([not found])
83 fi
84 AC_SUBST([CAP_LIBS])
85
86 # Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP
87 AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
88
89 AC_CHECK_HEADERS([sys/signalfd.h])
90
91 AC_PROG_GCC_TRADITIONAL
92
93 if test "x$GCC" = "xyes"; then
94 CFLAGS="$CFLAGS -Wall"
95 fi
96
97 AC_CONFIG_FILES([
98 Makefile
99 lxc.pc
100 lxc.spec
101 config/Makefile
102
103 doc/Makefile
104 doc/lxc-create.sgml
105 doc/lxc-destroy.sgml
106 doc/lxc-execute.sgml
107 doc/lxc-start.sgml
108 doc/lxc-checkpoint.sgml
109 doc/lxc-restart.sgml
110 doc/lxc-stop.sgml
111 doc/lxc-console.sgml
112 doc/lxc-freeze.sgml
113 doc/lxc-unfreeze.sgml
114 doc/lxc-monitor.sgml
115 doc/lxc-wait.sgml
116 doc/lxc-ls.sgml
117 doc/lxc-ps.sgml
118 doc/lxc-cgroup.sgml
119 doc/lxc-kill.sgml
120 doc/lxc.conf.sgml
121 doc/lxc.sgml
122 doc/common_options.sgml
123 doc/see_also.sgml
124
125 doc/rootfs/Makefile
126
127 doc/examples/Makefile
128 doc/examples/lxc-macvlan.conf
129 doc/examples/lxc-vlan.conf
130 doc/examples/lxc-no-netns.conf
131 doc/examples/lxc-empty-netns.conf
132 doc/examples/lxc-phys.conf
133 doc/examples/lxc-veth.conf
134 doc/examples/lxc-complex.conf
135
136 scripts/Makefile
137 scripts/lxc-debian
138 scripts/lxc-busybox
139 scripts/lxc-fedora
140 scripts/lxc-sshd
141
142 src/Makefile
143 src/lxc/Makefile
144 src/lxc/lxc-ps
145 src/lxc/lxc-ls
146 src/lxc/lxc-netstat
147 src/lxc/lxc-checkconfig
148 src/lxc/lxc-setcap
149 src/lxc/lxc-version
150 src/lxc/lxc-create
151 src/lxc/lxc-destroy
152
153 ])
154 AC_CONFIG_COMMANDS([default],[[]],[[]])
155 AC_OUTPUT
156
157 if test "x$SETCAP" = "xno"; then
158 AC_MSG_NOTICE([
159
160 Warning:
161 --------
162
163 The setcap binary was not found. This means the tools to set the
164 privilege for the lxc commands are not available, that's ok, but you
165 will need to run these commands as root or install libcap-2.
166
167 ])
168
169 else
170
171 AC_MSG_NOTICE([
172
173 Advice:
174 -------
175
176 If you wish to have a non root user to use the lxc tools,
177 you can add the needed capabilities to the tools by invoking
178 the 'lxc-setcap' script. To remove the capabilities, use
179 'lxc-setcap -d'.
180 ])
181
182 fi