]> git.proxmox.com Git - mirror_lxc.git/blob - configure.ac
configure.ac - allow user to switch off/on documentation generation
[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.3])
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_CHECK_PROG(SETCAP, setcap, yes, no, $PATH$PATH_SEPARATOR/sbin)
14
15 AC_ARG_ENABLE([doc],
16 [AC_HELP_STRING([--enable-doc], [make mans (require docbook2man installed) [default=auto]])],
17 [], [enable_doc=auto])
18
19 if test "x$enable_doc" = "xyes" -o "x$enable_doc" = "xauto"; then
20 AC_CHECK_PROG(have_docbook, [docbook2man], [yes], [no])
21
22 test "x$have_docbook" = "xno" -a "x$enable_doc" = "xyes" && \
23 AC_MSG_ERROR([docbook2man required by man request, but not found])
24 fi
25
26 AM_CONDITIONAL([ENABLE_DOCBOOK], [test "x$have_docbook" = "xyes"])
27
28 AS_AC_EXPAND(PREFIX, $prefix)
29 AS_AC_EXPAND(LIBDIR, $libdir)
30 AS_AC_EXPAND(BINDIR, $bindir)
31 AS_AC_EXPAND(INCLUDEDIR, $includedir)
32 AS_AC_EXPAND(LIBEXECDIR, $libexecdir)
33 AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
34 AS_AC_EXPAND(DATADIR, $datadir)
35 AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir)
36 AS_AC_EXPAND(LXCPATH, "${localstatedir}/lib/lxc")
37 AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
38
39 AH_TEMPLATE([LXCPATH], [lxc configuration repository])
40 AH_TEMPLATE([LXCLIBEXECDIR], [lxc executable library path])
41 AC_DEFINE_UNQUOTED(LXCPATH, "$LXCPATH")
42 AC_DEFINE_UNQUOTED(LXCLIBEXECDIR, "$LIBEXECDIR")
43
44 AC_CHECK_HEADERS([linux/netlink.h linux/genetlink.h],
45 [],
46 AC_MSG_ERROR([netlink headers not found. Please install the linux kernel headers.]),
47 [#include <sys/socket.h>
48 ])
49
50 AC_CHECK_HEADERS([sys/capability.h], [], AC_MSG_ERROR([please install libcap-devel.]),
51 [#include <sys/types.h>
52 #include <sys/capability.h>])
53
54 # Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP
55 AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
56
57 AC_CHECK_HEADERS([sys/signalfd.h])
58
59 AC_PROG_GCC_TRADITIONAL
60
61 if test "x$GCC" = "xyes"; then
62 CFLAGS="$CFLAGS -Wall"
63 fi
64
65 LXC_MAJOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f1)
66 LXC_MINOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f2)
67 LXC_MICRO_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f3)
68
69 AC_SUBST(LXC_MAJOR_VERSION)
70 AC_SUBST(LXC_MINOR_VERSION)
71 AC_SUBST(LXC_MICRO_VERSION)
72
73 AC_CONFIG_FILES([
74 Makefile
75 lxc.pc
76 lxc.spec
77 config/Makefile
78
79 doc/Makefile
80 doc/lxc-create.sgml
81 doc/lxc-destroy.sgml
82 doc/lxc-execute.sgml
83 doc/lxc-start.sgml
84 doc/lxc-stop.sgml
85 doc/lxc-console.sgml
86 doc/lxc-freeze.sgml
87 doc/lxc-unfreeze.sgml
88 doc/lxc-monitor.sgml
89 doc/lxc-wait.sgml
90 doc/lxc-ls.sgml
91 doc/lxc-ps.sgml
92 doc/lxc-cgroup.sgml
93 doc/lxc.conf.sgml
94 doc/lxc.sgml
95 doc/common_options.sgml
96 doc/see_also.sgml
97
98 scripts/Makefile
99 scripts/lxc-debian
100 scripts/lxc-fedora
101 scripts/lxc-sshd
102
103 src/Makefile
104 src/lxc/Makefile
105 src/lxc/lxc-ps
106 src/lxc/lxc-ls
107 src/lxc/lxc-netstat
108 src/lxc/lxc-checkconfig
109 src/lxc/lxc-setcap
110 src/lxc/lxc-version
111
112 etc/Makefile
113 etc/lxc-macvlan.conf
114 etc/lxc-no-netns.conf
115 etc/lxc-empty-netns.conf
116 etc/lxc-phys.conf
117 etc/lxc-veth.conf
118 etc/lxc-complex-config
119 ])
120 AC_CONFIG_COMMANDS([default],[[]],[[]])
121 AC_OUTPUT
122
123 if test "x$SETCAP" = "xno"; then
124 AC_MSG_NOTICE([
125
126 Warning:
127 --------
128
129 The setcap binary was not found. This means the tools to set the
130 privilege for the lxc commands are not available, that's ok, but you
131 will need to run these commands as root or install libcap-2.
132
133 ])
134
135 else
136
137 AC_MSG_NOTICE([
138
139 Advice:
140 -------
141
142 If you wish to have a non root user to use the lxc tools,
143 you can add the needed capabilities to the tools by invoking
144 the 'lxc-setcap' script. To remove the capabilities, use
145 'lxc-setcap -d'.
146 ])
147
148 fi