]> git.proxmox.com Git - mirror_lxc.git/blame - configure.ac
use config.h to define the lxcpath and co
[mirror_lxc.git] / configure.ac
CommitLineData
5e97c3fc 1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
f49d83e9 4AC_INIT([lxc], [0.6.3])
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
c2cc9f0a 13AC_PROG_LIBTOOL
e90b6974 14AC_CHECK_PROG(SETCAP, setcap, yes, no, $PATH$PATH_SEPARATOR/sbin)
d1de19ab 15AC_CHECK_PROG(DOCBOOK, docbook2man, yes, no)
16AM_CONDITIONAL(ENABLE_DOCBOOK, test x$DOCBOOK = xyes)
b6345ba1
DL
17AS_AC_EXPAND(PREFIX, $prefix)
18AS_AC_EXPAND(LIBDIR, $libdir)
7ad641d5 19AS_AC_EXPAND(BINDIR, $bindir)
b6345ba1 20AS_AC_EXPAND(INCLUDEDIR, $includedir)
a25ba7aa 21AS_AC_EXPAND(LIBEXECDIR, $libexecdir)
7ad641d5 22AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
3eae9733 23AS_AC_EXPAND(DATADIR, $datadir)
7ad641d5 24AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir)
abf424cf 25AS_AC_EXPAND(LXCPATH, "${localstatedir}/lib/lxc")
be43f17e 26AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
805415fc 27
881450bb
DL
28AH_TEMPLATE([LXCPATH], [lxc configuration repository])
29AH_TEMPLATE([LXCLIBEXECDIR], [lxc executable library path])
30AC_DEFINE_UNQUOTED(LXCPATH, "$LXCPATH")
31AC_DEFINE_UNQUOTED(LXCLIBEXECDIR, "$LIBEXECDIR")
32
90e0a869
GT
33AC_CHECK_HEADERS([linux/netlink.h linux/genetlink.h],
34 [],
35 AC_MSG_ERROR([netlink headers not found. Please install the linux kernel headers.]),
36 [#include <sys/socket.h>
37 ])
35f549fe 38
39AC_CHECK_HEADERS([sys/capability.h], [], AC_MSG_ERROR([please install libcap-devel.]),
ddceb1f9
DL
40[#include <sys/types.h>
41#include <sys/capability.h>])
35f549fe 42
656994bb
MH
43# Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP
44AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
45
ff218c25 46AC_CHECK_HEADERS([sys/signalfd.h])
47
5e97c3fc 48AC_PROG_GCC_TRADITIONAL
49
50if test "x$GCC" = "xyes"; then
8642237a 51 CFLAGS="$CFLAGS -Wall"
5e97c3fc 52fi
53
65c46aef 54LXC_MAJOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f1)
55LXC_MINOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f2)
56LXC_MICRO_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f3)
57
58AC_SUBST(LXC_MAJOR_VERSION)
59AC_SUBST(LXC_MINOR_VERSION)
60AC_SUBST(LXC_MICRO_VERSION)
61
5e97c3fc 62AC_CONFIG_FILES([
63 Makefile
b6345ba1 64 lxc.pc
5e97c3fc 65 lxc.spec
66 config/Makefile
d823d5b9 67
68 doc/Makefile
69 doc/lxc-create.sgml
70 doc/lxc-destroy.sgml
71 doc/lxc-execute.sgml
72 doc/lxc-start.sgml
73 doc/lxc-stop.sgml
b0a33c1e 74 doc/lxc-console.sgml
d823d5b9 75 doc/lxc-freeze.sgml
76 doc/lxc-unfreeze.sgml
77 doc/lxc-monitor.sgml
78 doc/lxc-wait.sgml
79 doc/lxc-ls.sgml
80 doc/lxc-ps.sgml
b0e505c9 81 doc/lxc-cgroup.sgml
8a67a2b2 82 doc/lxc.conf.sgml
8b8b04f8 83 doc/lxc.sgml
10fba81b 84 doc/common_options.sgml
99e4008c 85 doc/see_also.sgml
d823d5b9 86
c9844b87 87 scripts/Makefile
88 scripts/lxc-debian
54b1eb68 89 scripts/lxc-fedora
c9844b87 90 scripts/lxc-sshd
91
5e97c3fc 92 src/Makefile
5e97c3fc 93 src/lxc/Makefile
94 src/lxc/lxc-ps
d823d5b9 95 src/lxc/lxc-ls
9d0195cb 96 src/lxc/lxc-netstat
237315ff
DL
97 src/lxc/lxc-checkconfig
98 src/lxc/lxc-setcap
bcd952a1 99 src/lxc/lxc-version
c9844b87 100
5e97c3fc 101 etc/Makefile
102 etc/lxc-macvlan.conf
103 etc/lxc-no-netns.conf
5f58350a 104 etc/lxc-empty-netns.conf
5e97c3fc 105 etc/lxc-phys.conf
106 etc/lxc-veth.conf
107 etc/lxc-complex-config
5e97c3fc 108])
109AC_CONFIG_COMMANDS([default],[[]],[[]])
110AC_OUTPUT
805415fc 111
d1de19ab 112if test "x$DOCBOOK" = "xno"; then
f8dafdbb 113 AC_MSG_NOTICE([
d1de19ab 114
115Warning:
116--------
5c320b76
GT
117The docbook tool is not installed, the man pages won't be regenerated.
118If you need to update the manpages, install docbook and rerun 'configure'.
d1de19ab 119
120])
121
122fi
123
805415fc 124if test "x$SETCAP" = "xno"; then
f8dafdbb 125 AC_MSG_NOTICE([
805415fc 126
127Warning:
128--------
129
87476557
FG
130The setcap binary was not found. This means the tools to set the
131privilege for the lxc commands are not available, that's ok, but you
132will need to run these commands as root or install libcap-2.
805415fc 133
134])
135
136else
137
f8dafdbb 138 AC_MSG_NOTICE([
805415fc 139
140Advice:
141-------
142
87476557 143If you wish to have a non root user to use the lxc tools,
237315ff
DL
144you can add the needed capabilities to the tools by invoking
145the 'lxc-setcap' script. To remove the capabilities, use
87476557 146'lxc-setcap -d'.
805415fc 147])
148
149fi