]> git.proxmox.com Git - mirror_lxc.git/blame - configure.ac
fix git location
[mirror_lxc.git] / configure.ac
CommitLineData
5e97c3fc 1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
0b531758 4AC_INIT([lxc], [0.8.0.rc2])
5e97c3fc 5
f8dafdbb 6AC_CONFIG_SRCDIR([configure.ac])
5e97c3fc 7AC_CONFIG_AUX_DIR([config])
8AM_CONFIG_HEADER([src/config.h])
9AM_INIT_AUTOMAKE([-Wno-portability])
10AC_CANONICAL_HOST
5e97c3fc 11AM_PROG_CC_C_O
12AC_GNU_SOURCE
e90b6974 13AC_CHECK_PROG(SETCAP, setcap, yes, no, $PATH$PATH_SEPARATOR/sbin)
5c8f9bd8 14
1c41ddcb
GK
15AC_ARG_ENABLE([rpath],
16 [AC_HELP_STRING([--disable-rpath], [do not set rpath in executables])],
17 [], [enable_rpath=yes])
18
19AM_CONDITIONAL([ENABLE_RPATH], [test "x$enable_rpath" = "xyes"])
20
e075f5d9
SH
21AC_ARG_ENABLE([apparmor],
22 [AC_HELP_STRING([--enable-apparmor], [enable apparmor])],
23 [], [enable_apparmor=yes])
24AM_CONDITIONAL([ENABLE_APPARMOR], [test "x$enable_apparmor" = "xyes"])
25
5c8f9bd8
AN
26AC_ARG_ENABLE([doc],
27 [AC_HELP_STRING([--enable-doc], [make mans (require docbook2man installed) [default=auto]])],
28 [], [enable_doc=auto])
29
30if 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])
35fi
36
e075f5d9
SH
37AM_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
5c8f9bd8
AN
42AM_CONDITIONAL([ENABLE_DOCBOOK], [test "x$have_docbook" = "xyes"])
43
3fb0a9bb
AN
44AC_ARG_ENABLE([examples],
45 [AC_HELP_STRING([--disable-examples], [do not install configuration examples])],
46 [], [enable_examples=yes])
47
48AM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" = "xyes"])
49
b6345ba1
DL
50AS_AC_EXPAND(PREFIX, $prefix)
51AS_AC_EXPAND(LIBDIR, $libdir)
7ad641d5 52AS_AC_EXPAND(BINDIR, $bindir)
00ad19d4 53AS_AC_EXPAND(LIBEXECDIR, $libexecdir)
b6345ba1 54AS_AC_EXPAND(INCLUDEDIR, $includedir)
7ad641d5 55AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
3eae9733 56AS_AC_EXPAND(DATADIR, $datadir)
7ad641d5 57AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir)
0f71d073 58AS_AC_EXPAND(DOCDIR, $docdir)
805415fc 59
aef4ebcf
AN
60AC_ARG_WITH([config-path],
61 [AC_HELP_STRING(
62 [--with-config-path=dir],
e892973e 63 [lxc configuration repository path]
1c41ddcb 64 )], [], [with_config_path=['${localstatedir}/lib/lxc']])
aef4ebcf 65
196db713
DL
66AC_ARG_WITH([rootfs-path],
67 [AC_HELP_STRING(
68 [--with-rootfs-path=dir],
69 [lxc rootfs mount point]
1c41ddcb 70 )], [], [with_rootfs_path=['${libdir}/lxc/rootfs']])
196db713 71
aef4ebcf 72AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
d595c68a
DE
73AS_AC_EXPAND(LXCPATH, "${with_config_path}")
74AS_AC_EXPAND(LXCROOTFSMOUNT, "${with_rootfs_path}")
75AS_AC_EXPAND(LXCTEMPLATEDIR, ['${datadir}/lxc/templates'])
d674be08 76
814463cf 77AC_SUBST(LXCINITDIR, ['${libexecdir}'])
881450bb 78
910bb4fa 79AC_CHECK_HEADERS([linux/unistd.h linux/netlink.h linux/genetlink.h],
288063bd 80 [],
910bb4fa 81 AC_MSG_ERROR([Please install the Linux kernel headers.]),
288063bd 82 [#include <sys/socket.h>
90e0a869 83 ])
35f549fe 84
910bb4fa 85AC_CHECK_HEADERS([sys/capability.h], [], AC_MSG_ERROR([Please install the libcap development files.]),
ddceb1f9
DL
86[#include <sys/types.h>
87#include <sys/capability.h>])
0af683cf 88AC_CHECK_LIB(cap,cap_set_proc,caplib=yes,caplib=no)
89AC_MSG_CHECKING([linux capabilities])
90if test "x$caplib" = "xyes" ; then
91 CAP_LIBS="-lcap"
92 AC_MSG_RESULT([$CAP_LIBS])
93else
94 AC_MSG_ERROR([not found])
95fi
96AC_SUBST([CAP_LIBS])
35f549fe 97
656994bb
MH
98# Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP
99AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
100
ff218c25 101AC_CHECK_HEADERS([sys/signalfd.h])
102
5e97c3fc 103AC_PROG_GCC_TRADITIONAL
104
105if test "x$GCC" = "xyes"; then
8642237a 106 CFLAGS="$CFLAGS -Wall"
5e97c3fc 107fi
108
109AC_CONFIG_FILES([
288063bd 110 Makefile
b6345ba1 111 lxc.pc
5e97c3fc 112 lxc.spec
288063bd 113 config/Makefile
d823d5b9 114
288063bd 115 doc/Makefile
d823d5b9 116 doc/lxc-create.sgml
117 doc/lxc-destroy.sgml
118 doc/lxc-execute.sgml
119 doc/lxc-start.sgml
396639d4
DL
120 doc/lxc-checkpoint.sgml
121 doc/lxc-restart.sgml
d823d5b9 122 doc/lxc-stop.sgml
b0a33c1e 123 doc/lxc-console.sgml
d823d5b9 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
b0e505c9 130 doc/lxc-cgroup.sgml
e4b3fe58 131 doc/lxc-kill.sgml
49ee6cdc 132 doc/lxc-attach.sgml
8a67a2b2 133 doc/lxc.conf.sgml
8b8b04f8 134 doc/lxc.sgml
10fba81b 135 doc/common_options.sgml
99e4008c 136 doc/see_also.sgml
d823d5b9 137
baf6671f
DL
138 doc/rootfs/Makefile
139
0f71d073
DL
140 doc/examples/Makefile
141 doc/examples/lxc-macvlan.conf
26c39028 142 doc/examples/lxc-vlan.conf
0f71d073
DL
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
c553a9c2 147 doc/examples/lxc-complex.conf
0f71d073 148
c01d62f2 149 templates/Makefile
03d56dff 150 templates/lxc-lenny
c01d62f2 151 templates/lxc-debian
e2b4064f 152 templates/lxc-ubuntu
d1458ac8 153 templates/lxc-ubuntu-cloud
c840b37d 154 templates/lxc-opensuse
c01d62f2
DL
155 templates/lxc-busybox
156 templates/lxc-fedora
262f4e48 157 templates/lxc-altlinux
c01d62f2 158 templates/lxc-sshd
f6267d90 159 templates/lxc-archlinux
c9844b87 160
288063bd 161 src/Makefile
5e97c3fc 162 src/lxc/Makefile
163 src/lxc/lxc-ps
d823d5b9 164 src/lxc/lxc-ls
9d0195cb 165 src/lxc/lxc-netstat
237315ff
DL
166 src/lxc/lxc-checkconfig
167 src/lxc/lxc-setcap
7a82e923 168 src/lxc/lxc-setuid
bcd952a1 169 src/lxc/lxc-version
ab2d32f8 170 src/lxc/lxc-create
be8b5972 171 src/lxc/lxc-clone
72be4f89 172 src/lxc/lxc-shutdown
ab2d32f8 173 src/lxc/lxc-destroy
c9844b87 174
5e97c3fc 175])
176AC_CONFIG_COMMANDS([default],[[]],[[]])
177AC_OUTPUT
805415fc 178
179if test "x$SETCAP" = "xno"; then
f8dafdbb 180 AC_MSG_NOTICE([
805415fc 181
182Warning:
183--------
184
87476557
FG
185The setcap binary was not found. This means the tools to set the
186privilege for the lxc commands are not available, that's ok, but you
187will need to run these commands as root or install libcap-2.
805415fc 188
189])
190
191else
192
f8dafdbb 193 AC_MSG_NOTICE([
805415fc 194
195Advice:
196-------
197
87476557 198If you wish to have a non root user to use the lxc tools,
237315ff
DL
199you can add the needed capabilities to the tools by invoking
200the 'lxc-setcap' script. To remove the capabilities, use
87476557 201'lxc-setcap -d'.
805415fc 202])
203
204fi