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