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