]> git.proxmox.com Git - mirror_lxc.git/blame - configure.in
remove m4 dir usage
[mirror_lxc.git] / configure.in
CommitLineData
5e97c3fc 1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
5b2b6e7e 4AC_INIT([lxc], [0.6.2])
5e97c3fc 5
6AC_CONFIG_SRCDIR([configure.in])
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
693dcea5 14AC_CHECK_PROG(SETCAP, setcap, yes, no)
d1de19ab 15AC_CHECK_PROG(DOCBOOK, docbook2man, yes, no)
16AM_CONDITIONAL(ENABLE_DOCBOOK, test x$DOCBOOK = xyes)
7ad641d5 17AS_AC_EXPAND(BINDIR, $bindir)
a25ba7aa 18AS_AC_EXPAND(LIBEXECDIR, $libexecdir)
7ad641d5 19AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
20AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir)
abf424cf 21AS_AC_EXPAND(LXCPATH, "${localstatedir}/lib/lxc")
805415fc 22
86f7d054 23AC_CHECK_HEADERS([linux/netlink.h linux/genetlink.h], [], AC_MSG_ERROR([netlink headers not found]),
69437d52 24[#include <linux/types.h>
25#include <bits/sockaddr.h>
26#include <linux/socket.h>])
35f549fe 27
28AC_CHECK_HEADERS([sys/capability.h], [], AC_MSG_ERROR([please install libcap-devel.]),
29[#include <sys/capability.h>])
30
656994bb
MH
31# Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP
32AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
33
ff218c25 34AC_CHECK_HEADERS([sys/signalfd.h])
35
5e97c3fc 36AC_PROG_GCC_TRADITIONAL
37
38if test "x$GCC" = "xyes"; then
8642237a 39 CFLAGS="$CFLAGS -Wall"
5e97c3fc 40fi
41
65c46aef 42LXC_MAJOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f1)
43LXC_MINOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f2)
44LXC_MICRO_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f3)
45
cf445de3 46AC_ARG_WITH([kernel-release],
47 [AC_HELP_STRING([--with-kernel-release=RELEASE],
48 [specify the "uname -r"-value to build for])],
49 [KERNEL_RELEASE="${withval}"],
50 [KERNEL_RELEASE=`uname -r`])
51
52AX_COMPARE_VERSION([$KERNEL_RELEASE], [ge], [2.6.29],
53 AC_MSG_NOTICE([network autodestroy: yes]),
54 AC_MSG_NOTICE([network autodestroy: no]))
55
56if test ${ax_compare_version} != "true"; then
b7c9b199 57 CFLAGS="$CFLAGS -DNETWORK_DESTROY"
58fi
35f549fe 59
abd4a3b3 60AC_ARG_ENABLE(test, [ --enable-test compile test program [default=no]],, enable_test=no)
61AM_CONDITIONAL(ENABLE_TEST, test x$enable_test = xyes)
b7c9b199 62
65c46aef 63AC_SUBST(LXC_MAJOR_VERSION)
64AC_SUBST(LXC_MINOR_VERSION)
65AC_SUBST(LXC_MICRO_VERSION)
66
5e97c3fc 67AC_CONFIG_FILES([
68 Makefile
69 lxc.spec
70 config/Makefile
d823d5b9 71
72 doc/Makefile
73 doc/lxc-create.sgml
74 doc/lxc-destroy.sgml
75 doc/lxc-execute.sgml
76 doc/lxc-start.sgml
77 doc/lxc-stop.sgml
b0a33c1e 78 doc/lxc-console.sgml
d823d5b9 79 doc/lxc-freeze.sgml
80 doc/lxc-unfreeze.sgml
81 doc/lxc-monitor.sgml
82 doc/lxc-wait.sgml
83 doc/lxc-ls.sgml
84 doc/lxc-ps.sgml
b0e505c9 85 doc/lxc-cgroup.sgml
8a67a2b2 86 doc/lxc.conf.sgml
8b8b04f8 87 doc/lxc.sgml
d823d5b9 88
c9844b87 89 scripts/Makefile
90 scripts/lxc-debian
54b1eb68 91 scripts/lxc-fedora
c9844b87 92 scripts/lxc-sshd
93
5e97c3fc 94 src/Makefile
5e97c3fc 95 src/lxc/Makefile
96 src/lxc/lxc-ps
d823d5b9 97 src/lxc/lxc-ls
9d0195cb 98 src/lxc/lxc-netstat
237315ff
DL
99 src/lxc/lxc-checkconfig
100 src/lxc/lxc-setcap
c9844b87 101
5e97c3fc 102 etc/Makefile
103 etc/lxc-macvlan.conf
104 etc/lxc-no-netns.conf
5f58350a 105 etc/lxc-empty-netns.conf
5e97c3fc 106 etc/lxc-phys.conf
107 etc/lxc-veth.conf
108 etc/lxc-complex-config
c9844b87 109
5e97c3fc 110 test/Makefile
111])
112AC_CONFIG_COMMANDS([default],[[]],[[]])
113AC_OUTPUT
805415fc 114
d1de19ab 115if test "x$DOCBOOK" = "xno"; then
116 AC_MSG_NOTICE([
117
118Warning:
119--------
120The docbook tool is not installed, the man pages won't be generated.
8b8b04f8 121If you want the man pages, install docbook and rerun 'configure'.
d1de19ab 122
123])
124
125fi
126
805415fc 127if test "x$SETCAP" = "xno"; then
128 AC_MSG_NOTICE([
129
130Warning:
131--------
132
133The libcap-2 is not installed. That means the tools to
693dcea5 134set the privilege for the lxc commands are not available,
135that's ok, but you will need to run these commands as root
805415fc 136
137])
138
139else
140
141 AC_MSG_NOTICE([
142
143Advice:
144-------
145
237315ff
DL
146If you which to have a non root user to use the lxc tools,
147you can add the needed capabilities to the tools by invoking
148the 'lxc-setcap' script. To remove the capabilities, use
149'lxc-setcap -d'
805415fc 150])
151
152fi