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