]>
Commit | Line | Data |
---|---|---|
5e97c3fc | 1 | # -*- Autoconf -*- |
2 | # Process this file with autoconf to produce a configure script. | |
3 | ||
8f0a524d | 4 | AC_INIT([lxc], [0.6.4]) |
5e97c3fc | 5 | |
f8dafdbb | 6 | AC_CONFIG_SRCDIR([configure.ac]) |
5e97c3fc | 7 | AC_CONFIG_AUX_DIR([config]) |
8 | AM_CONFIG_HEADER([src/config.h]) | |
9 | AM_INIT_AUTOMAKE([-Wno-portability]) | |
10 | AC_CANONICAL_HOST | |
5e97c3fc | 11 | AM_PROG_CC_C_O |
12 | AC_GNU_SOURCE | |
e90b6974 | 13 | AC_CHECK_PROG(SETCAP, setcap, yes, no, $PATH$PATH_SEPARATOR/sbin) |
5c8f9bd8 AN |
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 | ||
3fb0a9bb AN |
28 | AC_ARG_ENABLE([examples], |
29 | [AC_HELP_STRING([--disable-examples], [do not install configuration examples])], | |
30 | [], [enable_examples=yes]) | |
31 | ||
32 | AM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" = "xyes"]) | |
33 | ||
b6345ba1 DL |
34 | AS_AC_EXPAND(PREFIX, $prefix) |
35 | AS_AC_EXPAND(LIBDIR, $libdir) | |
7ad641d5 | 36 | AS_AC_EXPAND(BINDIR, $bindir) |
b6345ba1 | 37 | AS_AC_EXPAND(INCLUDEDIR, $includedir) |
a25ba7aa | 38 | AS_AC_EXPAND(LIBEXECDIR, $libexecdir) |
7ad641d5 | 39 | AS_AC_EXPAND(SYSCONFDIR, $sysconfdir) |
3eae9733 | 40 | AS_AC_EXPAND(DATADIR, $datadir) |
7ad641d5 | 41 | AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir) |
0f71d073 | 42 | AS_AC_EXPAND(DOCDIR, $docdir) |
805415fc | 43 | |
aef4ebcf AN |
44 | AC_ARG_WITH([config-path], |
45 | [AC_HELP_STRING( | |
46 | [--with-config-path=dir], | |
e892973e | 47 | [lxc configuration repository path] |
aef4ebcf AN |
48 | )], [], [with_config_path="${localstatedir}/lib/lxc"]) |
49 | ||
50 | AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)") | |
51 | AS_AC_EXPAND(LXCPATH, "${with_config_path}") | |
881450bb DL |
52 | AH_TEMPLATE([LXCPATH], [lxc configuration repository]) |
53 | AH_TEMPLATE([LXCLIBEXECDIR], [lxc executable library path]) | |
54 | AC_DEFINE_UNQUOTED(LXCPATH, "$LXCPATH") | |
55 | AC_DEFINE_UNQUOTED(LXCLIBEXECDIR, "$LIBEXECDIR") | |
56 | ||
90e0a869 GT |
57 | AC_CHECK_HEADERS([linux/netlink.h linux/genetlink.h], |
58 | [], | |
59 | AC_MSG_ERROR([netlink headers not found. Please install the linux kernel headers.]), | |
60 | [#include <sys/socket.h> | |
61 | ]) | |
35f549fe | 62 | |
63 | AC_CHECK_HEADERS([sys/capability.h], [], AC_MSG_ERROR([please install libcap-devel.]), | |
ddceb1f9 DL |
64 | [#include <sys/types.h> |
65 | #include <sys/capability.h>]) | |
35f549fe | 66 | |
656994bb MH |
67 | # Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP |
68 | AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>]) | |
69 | ||
ff218c25 | 70 | AC_CHECK_HEADERS([sys/signalfd.h]) |
71 | ||
5e97c3fc | 72 | AC_PROG_GCC_TRADITIONAL |
73 | ||
74 | if test "x$GCC" = "xyes"; then | |
8642237a | 75 | CFLAGS="$CFLAGS -Wall" |
5e97c3fc | 76 | fi |
77 | ||
78 | AC_CONFIG_FILES([ | |
79 | Makefile | |
b6345ba1 | 80 | lxc.pc |
5e97c3fc | 81 | lxc.spec |
82 | config/Makefile | |
d823d5b9 | 83 | |
84 | doc/Makefile | |
85 | doc/lxc-create.sgml | |
86 | doc/lxc-destroy.sgml | |
87 | doc/lxc-execute.sgml | |
88 | doc/lxc-start.sgml | |
89 | doc/lxc-stop.sgml | |
b0a33c1e | 90 | doc/lxc-console.sgml |
d823d5b9 | 91 | doc/lxc-freeze.sgml |
92 | doc/lxc-unfreeze.sgml | |
93 | doc/lxc-monitor.sgml | |
94 | doc/lxc-wait.sgml | |
95 | doc/lxc-ls.sgml | |
96 | doc/lxc-ps.sgml | |
b0e505c9 | 97 | doc/lxc-cgroup.sgml |
8a67a2b2 | 98 | doc/lxc.conf.sgml |
8b8b04f8 | 99 | doc/lxc.sgml |
10fba81b | 100 | doc/common_options.sgml |
99e4008c | 101 | doc/see_also.sgml |
d823d5b9 | 102 | |
0f71d073 DL |
103 | doc/examples/Makefile |
104 | doc/examples/lxc-macvlan.conf | |
26c39028 | 105 | doc/examples/lxc-vlan.conf |
0f71d073 DL |
106 | doc/examples/lxc-no-netns.conf |
107 | doc/examples/lxc-empty-netns.conf | |
108 | doc/examples/lxc-phys.conf | |
109 | doc/examples/lxc-veth.conf | |
110 | doc/examples/lxc-complex-config | |
111 | ||
c9844b87 | 112 | scripts/Makefile |
113 | scripts/lxc-debian | |
eb960fea | 114 | scripts/lxc-busybox |
54b1eb68 | 115 | scripts/lxc-fedora |
c9844b87 | 116 | scripts/lxc-sshd |
117 | ||
5e97c3fc | 118 | src/Makefile |
5e97c3fc | 119 | src/lxc/Makefile |
120 | src/lxc/lxc-ps | |
d823d5b9 | 121 | src/lxc/lxc-ls |
9d0195cb | 122 | src/lxc/lxc-netstat |
237315ff DL |
123 | src/lxc/lxc-checkconfig |
124 | src/lxc/lxc-setcap | |
bcd952a1 | 125 | src/lxc/lxc-version |
ab2d32f8 DL |
126 | src/lxc/lxc-create |
127 | src/lxc/lxc-destroy | |
c9844b87 | 128 | |
5e97c3fc | 129 | ]) |
130 | AC_CONFIG_COMMANDS([default],[[]],[[]]) | |
131 | AC_OUTPUT | |
805415fc | 132 | |
133 | if test "x$SETCAP" = "xno"; then | |
f8dafdbb | 134 | AC_MSG_NOTICE([ |
805415fc | 135 | |
136 | Warning: | |
137 | -------- | |
138 | ||
87476557 FG |
139 | The setcap binary was not found. This means the tools to set the |
140 | privilege for the lxc commands are not available, that's ok, but you | |
141 | will need to run these commands as root or install libcap-2. | |
805415fc | 142 | |
143 | ]) | |
144 | ||
145 | else | |
146 | ||
f8dafdbb | 147 | AC_MSG_NOTICE([ |
805415fc | 148 | |
149 | Advice: | |
150 | ------- | |
151 | ||
87476557 | 152 | If you wish to have a non root user to use the lxc tools, |
237315ff DL |
153 | you can add the needed capabilities to the tools by invoking |
154 | the 'lxc-setcap' script. To remove the capabilities, use | |
87476557 | 155 | 'lxc-setcap -d'. |
805415fc | 156 | ]) |
157 | ||
158 | fi |