]> git.proxmox.com Git - mirror_lxc.git/blame - configure.ac
rewrite lxc-ps
[mirror_lxc.git] / configure.ac
CommitLineData
5e97c3fc 1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
ed55bf52 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
5c8f9bd8
AN
21AC_ARG_ENABLE([doc],
22 [AC_HELP_STRING([--enable-doc], [make mans (require docbook2man installed) [default=auto]])],
23 [], [enable_doc=auto])
24
25if test "x$enable_doc" = "xyes" -o "x$enable_doc" = "xauto"; then
26 AC_CHECK_PROG(have_docbook, [docbook2man], [yes], [no])
27
28 test "x$have_docbook" = "xno" -a "x$enable_doc" = "xyes" && \
29 AC_MSG_ERROR([docbook2man required by man request, but not found])
30fi
31
32AM_CONDITIONAL([ENABLE_DOCBOOK], [test "x$have_docbook" = "xyes"])
33
3fb0a9bb
AN
34AC_ARG_ENABLE([examples],
35 [AC_HELP_STRING([--disable-examples], [do not install configuration examples])],
36 [], [enable_examples=yes])
37
38AM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" = "xyes"])
39
b6345ba1
DL
40AS_AC_EXPAND(PREFIX, $prefix)
41AS_AC_EXPAND(LIBDIR, $libdir)
7ad641d5 42AS_AC_EXPAND(BINDIR, $bindir)
b6345ba1 43AS_AC_EXPAND(INCLUDEDIR, $includedir)
7ad641d5 44AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
3eae9733 45AS_AC_EXPAND(DATADIR, $datadir)
7ad641d5 46AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir)
0f71d073 47AS_AC_EXPAND(DOCDIR, $docdir)
805415fc 48
aef4ebcf
AN
49AC_ARG_WITH([config-path],
50 [AC_HELP_STRING(
51 [--with-config-path=dir],
e892973e 52 [lxc configuration repository path]
1c41ddcb 53 )], [], [with_config_path=['${localstatedir}/lib/lxc']])
aef4ebcf 54
196db713
DL
55AC_ARG_WITH([rootfs-path],
56 [AC_HELP_STRING(
57 [--with-rootfs-path=dir],
58 [lxc rootfs mount point]
1c41ddcb 59 )], [], [with_rootfs_path=['${libdir}/lxc/rootfs']])
196db713 60
aef4ebcf 61AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
d674be08 62
1c41ddcb
GK
63AC_SUBST(LXCPATH, "${with_config_path}")
64AC_SUBST(LXCROOTFSMOUNT, "${with_rootfs_path}")
ce6ce9d6 65AC_SUBST(LXCINITDIR, ['${libexecdir}/lxc'])
1c41ddcb 66AC_SUBST(LXCTEMPLATEDIR, ['${libdir}/lxc/templates'])
881450bb 67
910bb4fa 68AC_CHECK_HEADERS([linux/unistd.h linux/netlink.h linux/genetlink.h],
288063bd 69 [],
910bb4fa 70 AC_MSG_ERROR([Please install the Linux kernel headers.]),
288063bd 71 [#include <sys/socket.h>
90e0a869 72 ])
35f549fe 73
910bb4fa 74AC_CHECK_HEADERS([sys/capability.h], [], AC_MSG_ERROR([Please install the libcap development files.]),
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
94if test "x$GCC" = "xyes"; then
8642237a 95 CFLAGS="$CFLAGS -Wall"
5e97c3fc 96fi
97
98AC_CONFIG_FILES([
288063bd 99 Makefile
b6345ba1 100 lxc.pc
5e97c3fc 101 lxc.spec
288063bd 102 config/Makefile
d823d5b9 103
288063bd 104 doc/Makefile
d823d5b9 105 doc/lxc-create.sgml
106 doc/lxc-destroy.sgml
107 doc/lxc-execute.sgml
108 doc/lxc-start.sgml
396639d4
DL
109 doc/lxc-checkpoint.sgml
110 doc/lxc-restart.sgml
d823d5b9 111 doc/lxc-stop.sgml
b0a33c1e 112 doc/lxc-console.sgml
d823d5b9 113 doc/lxc-freeze.sgml
114 doc/lxc-unfreeze.sgml
115 doc/lxc-monitor.sgml
116 doc/lxc-wait.sgml
117 doc/lxc-ls.sgml
118 doc/lxc-ps.sgml
b0e505c9 119 doc/lxc-cgroup.sgml
e4b3fe58 120 doc/lxc-kill.sgml
49ee6cdc 121 doc/lxc-attach.sgml
8a67a2b2 122 doc/lxc.conf.sgml
8b8b04f8 123 doc/lxc.sgml
10fba81b 124 doc/common_options.sgml
99e4008c 125 doc/see_also.sgml
d823d5b9 126
baf6671f
DL
127 doc/rootfs/Makefile
128
0f71d073
DL
129 doc/examples/Makefile
130 doc/examples/lxc-macvlan.conf
26c39028 131 doc/examples/lxc-vlan.conf
0f71d073
DL
132 doc/examples/lxc-no-netns.conf
133 doc/examples/lxc-empty-netns.conf
134 doc/examples/lxc-phys.conf
135 doc/examples/lxc-veth.conf
c553a9c2 136 doc/examples/lxc-complex.conf
0f71d073 137
c01d62f2 138 templates/Makefile
03d56dff 139 templates/lxc-lenny
c01d62f2 140 templates/lxc-debian
e2b4064f 141 templates/lxc-ubuntu
d1458ac8 142 templates/lxc-ubuntu-cloud
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
f6267d90 148 templates/lxc-archlinux
c9844b87 149
288063bd 150 src/Makefile
5e97c3fc 151 src/lxc/Makefile
152 src/lxc/lxc-ps
d823d5b9 153 src/lxc/lxc-ls
9d0195cb 154 src/lxc/lxc-netstat
237315ff
DL
155 src/lxc/lxc-checkconfig
156 src/lxc/lxc-setcap
7a82e923 157 src/lxc/lxc-setuid
bcd952a1 158 src/lxc/lxc-version
ab2d32f8 159 src/lxc/lxc-create
be8b5972 160 src/lxc/lxc-clone
ab2d32f8 161 src/lxc/lxc-destroy
c9844b87 162
5e97c3fc 163])
164AC_CONFIG_COMMANDS([default],[[]],[[]])
165AC_OUTPUT
805415fc 166
167if test "x$SETCAP" = "xno"; then
f8dafdbb 168 AC_MSG_NOTICE([
805415fc 169
170Warning:
171--------
172
87476557
FG
173The setcap binary was not found. This means the tools to set the
174privilege for the lxc commands are not available, that's ok, but you
175will need to run these commands as root or install libcap-2.
805415fc 176
177])
178
179else
180
f8dafdbb 181 AC_MSG_NOTICE([
805415fc 182
183Advice:
184-------
185
87476557 186If you wish to have a non root user to use the lxc tools,
237315ff
DL
187you can add the needed capabilities to the tools by invoking
188the 'lxc-setcap' script. To remove the capabilities, use
87476557 189'lxc-setcap -d'.
805415fc 190])
191
192fi