]> git.proxmox.com Git - mirror_lxc.git/blob - configure.ac
add pkg-config for lxc
[mirror_lxc.git] / configure.ac
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_INIT([lxc], [0.6.2])
5
6 AC_CONFIG_SRCDIR([configure.ac])
7 AC_CONFIG_AUX_DIR([config])
8 AM_CONFIG_HEADER([src/config.h])
9 AM_INIT_AUTOMAKE([-Wno-portability])
10 AC_CANONICAL_HOST
11 AM_PROG_CC_C_O
12 AC_GNU_SOURCE
13 AC_PROG_LIBTOOL
14 AC_CHECK_PROG(SETCAP, setcap, yes, no)
15 AC_CHECK_PROG(DOCBOOK, docbook2man, yes, no)
16 AM_CONDITIONAL(ENABLE_DOCBOOK, test x$DOCBOOK = xyes)
17 AS_AC_EXPAND(PREFIX, $prefix)
18 AS_AC_EXPAND(LIBDIR, $libdir)
19 AS_AC_EXPAND(BINDIR, $bindir)
20 AS_AC_EXPAND(INCLUDEDIR, $includedir)
21 AS_AC_EXPAND(LIBEXECDIR, $libexecdir)
22 AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
23 AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir)
24 AS_AC_EXPAND(LXCPATH, "${localstatedir}/lib/lxc")
25 AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
26
27 AC_CHECK_HEADERS([linux/netlink.h linux/genetlink.h], [], AC_MSG_ERROR([netlink headers not found]),
28 [#include <linux/types.h>
29 #include <bits/sockaddr.h>
30 #include <linux/socket.h>])
31
32 AC_CHECK_HEADERS([sys/capability.h], [], AC_MSG_ERROR([please install libcap-devel.]),
33 [#include <sys/capability.h>])
34
35 # Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP
36 AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
37
38 AC_CHECK_HEADERS([sys/signalfd.h])
39
40 AC_PROG_GCC_TRADITIONAL
41
42 if test "x$GCC" = "xyes"; then
43 CFLAGS="$CFLAGS -Wall"
44 fi
45
46 LXC_MAJOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f1)
47 LXC_MINOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f2)
48 LXC_MICRO_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f3)
49
50 AC_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
56 AC_ARG_ENABLE(test, [ --enable-test compile test program [default=no]],, enable_test=no)
57 AM_CONDITIONAL(ENABLE_TEST, test x$enable_test = xyes)
58
59 AC_SUBST(LXC_MAJOR_VERSION)
60 AC_SUBST(LXC_MINOR_VERSION)
61 AC_SUBST(LXC_MICRO_VERSION)
62
63 AC_CONFIG_FILES([
64 Makefile
65 lxc.pc
66 lxc.spec
67 config/Makefile
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
75 doc/lxc-console.sgml
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
82 doc/lxc-cgroup.sgml
83 doc/lxc.conf.sgml
84 doc/lxc.sgml
85 doc/common_options.sgml
86 doc/see_also.sgml
87
88 scripts/Makefile
89 scripts/lxc-debian
90 scripts/lxc-fedora
91 scripts/lxc-sshd
92
93 src/Makefile
94 src/lxc/Makefile
95 src/lxc/lxc-ps
96 src/lxc/lxc-ls
97 src/lxc/lxc-netstat
98 src/lxc/lxc-checkconfig
99 src/lxc/lxc-setcap
100
101 etc/Makefile
102 etc/lxc-macvlan.conf
103 etc/lxc-no-netns.conf
104 etc/lxc-empty-netns.conf
105 etc/lxc-phys.conf
106 etc/lxc-veth.conf
107 etc/lxc-complex-config
108
109 test/Makefile
110 ])
111 AC_CONFIG_COMMANDS([default],[[]],[[]])
112 AC_OUTPUT
113
114 if test "x$DOCBOOK" = "xno"; then
115 AC_MSG_NOTICE([
116
117 Warning:
118 --------
119 The docbook tool is not installed, the man pages won't be generated.
120 If you want the man pages, install docbook and rerun 'configure'.
121
122 ])
123
124 fi
125
126 if test "x$SETCAP" = "xno"; then
127 AC_MSG_NOTICE([
128
129 Warning:
130 --------
131
132 The libcap-2 is not installed. That means the tools to
133 set the privilege for the lxc commands are not available,
134 that's ok, but you will need to run these commands as root
135
136 ])
137
138 else
139
140 AC_MSG_NOTICE([
141
142 Advice:
143 -------
144
145 If you which to have a non root user to use the lxc tools,
146 you can add the needed capabilities to the tools by invoking
147 the 'lxc-setcap' script. To remove the capabilities, use
148 'lxc-setcap -d'
149 ])
150
151 fi