]>
Commit | Line | Data |
---|---|---|
5e97c3fc | 1 | # -*- Autoconf -*- |
2 | # Process this file with autoconf to produce a configure script. | |
3 | ||
4aa7ac35 | 4 | AC_INIT([lxc], [0.8.0]) |
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 | 14 | |
be2e4e54 SG |
15 | if test -f /etc/debian_version; then |
16 | osname="debian" | |
17 | fi | |
18 | AM_CONDITIONAL([HAVE_DEBIAN], [test x"$osname" == xdebian]) | |
19 | ||
1c41ddcb GK |
20 | AC_ARG_ENABLE([rpath], |
21 | [AC_HELP_STRING([--disable-rpath], [do not set rpath in executables])], | |
22 | [], [enable_rpath=yes]) | |
23 | ||
24 | AM_CONDITIONAL([ENABLE_RPATH], [test "x$enable_rpath" = "xyes"]) | |
25 | ||
5c8f9bd8 AN |
26 | AC_ARG_ENABLE([doc], |
27 | [AC_HELP_STRING([--enable-doc], [make mans (require docbook2man installed) [default=auto]])], | |
28 | [], [enable_doc=auto]) | |
29 | ||
30 | if test "x$enable_doc" = "xyes" -o "x$enable_doc" = "xauto"; then | |
31 | AC_CHECK_PROG(have_docbook, [docbook2man], [yes], [no]) | |
32 | ||
33 | test "x$have_docbook" = "xno" -a "x$enable_doc" = "xyes" && \ | |
34 | AC_MSG_ERROR([docbook2man required by man request, but not found]) | |
35 | fi | |
36 | ||
e767dd55 SH |
37 | AC_ARG_ENABLE([apparmor], |
38 | [AC_HELP_STRING([--enable-apparmor], [enable apparmor])], | |
39 | [], [enable_apparmor=check]) | |
40 | ||
41 | if test "$enable_apparmor" = "check" ; then | |
42 | AC_CHECK_LIB([apparmor],[aa_change_profile],[enable_apparmor=yes], [enable_apparmor=no]) | |
43 | fi | |
44 | ||
45 | AM_CONDITIONAL([ENABLE_APPARMOR], [test "x$enable_apparmor" = "xyes"]) | |
46 | ||
e075f5d9 SH |
47 | AM_COND_IF([ENABLE_APPARMOR], |
48 | [AC_CHECK_HEADER([sys/apparmor.h],[],[AC_MSG_ERROR([You must install the AppArmor development package in order to compile lxc])]) | |
49 | AC_CHECK_LIB([apparmor], [aa_change_profile],[],[AC_MSG_ERROR([You must install the AppArmor development package in order to compile lxc])]) | |
50 | AC_SUBST([APPARMOR_LIBS], [-lapparmor])]) | |
51 | ||
e767dd55 SH |
52 | AC_ARG_ENABLE([seccomp], |
53 | [AC_HELP_STRING([--enable-seccomp], [enable seccomp])], | |
54 | [], [enable_seccomp=check]) | |
55 | ||
56 | if test "$enable_seccomp" = "check" ; then | |
57 | AC_CHECK_LIB([seccomp],[seccomp_init],[enable_seccomp=yes],[enable_seccomp=no]) | |
58 | fi | |
59 | ||
60 | AM_CONDITIONAL([ENABLE_SECCOMP], [test "x$enable_seccomp" = "xyes"]) | |
61 | ||
8f2c3a70 SH |
62 | AM_COND_IF([ENABLE_SECCOMP], |
63 | [AC_CHECK_HEADER([seccomp.h],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])]) | |
64 | AC_CHECK_LIB([seccomp], [seccomp_init],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])]) | |
65 | AC_SUBST([SECCOMP_LIBS], [-lseccomp])]) | |
66 | ||
5c8f9bd8 AN |
67 | AM_CONDITIONAL([ENABLE_DOCBOOK], [test "x$have_docbook" = "xyes"]) |
68 | ||
3fb0a9bb AN |
69 | AC_ARG_ENABLE([examples], |
70 | [AC_HELP_STRING([--disable-examples], [do not install configuration examples])], | |
71 | [], [enable_examples=yes]) | |
72 | ||
73 | AM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" = "xyes"]) | |
74 | ||
be2e4e54 SG |
75 | AC_ARG_ENABLE([python], |
76 | [AC_HELP_STRING([--enable-python], [enable python binding])], | |
77 | [enable_python=yes], [enable_python=no]) | |
78 | ||
79 | AM_CONDITIONAL([ENABLE_PYTHON], [test "x$enable_python" = "xyes"]) | |
80 | ||
81 | AM_COND_IF([ENABLE_PYTHON], | |
82 | [AM_PATH_PYTHON([3.2], [], [AC_MSG_ERROR([You must install python3])]) | |
83 | AC_CHECK_HEADER([python$PYTHON_VERSION/Python.h],[],[AC_MSG_ERROR([You must install python3-dev])]) | |
84 | AC_DEFINE_UNQUOTED([ENABLE_PYTHON], 1, [Python3 is available])]) | |
85 | ||
525421c9 SG |
86 | AC_ARG_ENABLE([tests], |
87 | [AC_HELP_STRING([--enable-tests], [build test/example binaries])], | |
88 | [enable_tests=yes], [enable_tests=no]) | |
89 | ||
90 | AM_CONDITIONAL([ENABLE_TESTS], [test "x$enable_tests" = "xyes"]) | |
91 | ||
b6345ba1 DL |
92 | AS_AC_EXPAND(PREFIX, $prefix) |
93 | AS_AC_EXPAND(LIBDIR, $libdir) | |
7ad641d5 | 94 | AS_AC_EXPAND(BINDIR, $bindir) |
00ad19d4 | 95 | AS_AC_EXPAND(LIBEXECDIR, $libexecdir) |
b6345ba1 | 96 | AS_AC_EXPAND(INCLUDEDIR, $includedir) |
7ad641d5 | 97 | AS_AC_EXPAND(SYSCONFDIR, $sysconfdir) |
3eae9733 | 98 | AS_AC_EXPAND(DATADIR, $datadir) |
7ad641d5 | 99 | AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir) |
0f71d073 | 100 | AS_AC_EXPAND(DOCDIR, $docdir) |
805415fc | 101 | |
aef4ebcf AN |
102 | AC_ARG_WITH([config-path], |
103 | [AC_HELP_STRING( | |
104 | [--with-config-path=dir], | |
e892973e | 105 | [lxc configuration repository path] |
1c41ddcb | 106 | )], [], [with_config_path=['${localstatedir}/lib/lxc']]) |
aef4ebcf | 107 | |
196db713 DL |
108 | AC_ARG_WITH([rootfs-path], |
109 | [AC_HELP_STRING( | |
110 | [--with-rootfs-path=dir], | |
111 | [lxc rootfs mount point] | |
1c41ddcb | 112 | )], [], [with_rootfs_path=['${libdir}/lxc/rootfs']]) |
196db713 | 113 | |
aef4ebcf | 114 | AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)") |
d595c68a DE |
115 | AS_AC_EXPAND(LXCPATH, "${with_config_path}") |
116 | AS_AC_EXPAND(LXCROOTFSMOUNT, "${with_rootfs_path}") | |
117 | AS_AC_EXPAND(LXCTEMPLATEDIR, ['${datadir}/lxc/templates']) | |
d674be08 | 118 | |
814463cf | 119 | AC_SUBST(LXCINITDIR, ['${libexecdir}']) |
881450bb | 120 | |
910bb4fa | 121 | AC_CHECK_HEADERS([linux/unistd.h linux/netlink.h linux/genetlink.h], |
288063bd | 122 | [], |
910bb4fa | 123 | AC_MSG_ERROR([Please install the Linux kernel headers.]), |
288063bd | 124 | [#include <sys/socket.h> |
90e0a869 | 125 | ]) |
35f549fe | 126 | |
910bb4fa | 127 | AC_CHECK_HEADERS([sys/capability.h], [], AC_MSG_ERROR([Please install the libcap development files.]), |
ddceb1f9 DL |
128 | [#include <sys/types.h> |
129 | #include <sys/capability.h>]) | |
0af683cf | 130 | AC_CHECK_LIB(cap,cap_set_proc,caplib=yes,caplib=no) |
131 | AC_MSG_CHECKING([linux capabilities]) | |
132 | if test "x$caplib" = "xyes" ; then | |
133 | CAP_LIBS="-lcap" | |
134 | AC_MSG_RESULT([$CAP_LIBS]) | |
135 | else | |
136 | AC_MSG_ERROR([not found]) | |
137 | fi | |
138 | AC_SUBST([CAP_LIBS]) | |
35f549fe | 139 | |
656994bb MH |
140 | # Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP |
141 | AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>]) | |
142 | ||
ff218c25 | 143 | AC_CHECK_HEADERS([sys/signalfd.h]) |
144 | ||
5e97c3fc | 145 | AC_PROG_GCC_TRADITIONAL |
95a717e9 | 146 | AC_PROG_SED |
5e97c3fc | 147 | |
148 | if test "x$GCC" = "xyes"; then | |
8642237a | 149 | CFLAGS="$CFLAGS -Wall" |
5e97c3fc | 150 | fi |
151 | ||
152 | AC_CONFIG_FILES([ | |
288063bd | 153 | Makefile |
b6345ba1 | 154 | lxc.pc |
5e97c3fc | 155 | lxc.spec |
288063bd | 156 | config/Makefile |
d823d5b9 | 157 | |
288063bd | 158 | doc/Makefile |
d823d5b9 | 159 | doc/lxc-create.sgml |
160 | doc/lxc-destroy.sgml | |
161 | doc/lxc-execute.sgml | |
162 | doc/lxc-start.sgml | |
396639d4 DL |
163 | doc/lxc-checkpoint.sgml |
164 | doc/lxc-restart.sgml | |
d823d5b9 | 165 | doc/lxc-stop.sgml |
b0a33c1e | 166 | doc/lxc-console.sgml |
d823d5b9 | 167 | doc/lxc-freeze.sgml |
168 | doc/lxc-unfreeze.sgml | |
169 | doc/lxc-monitor.sgml | |
170 | doc/lxc-wait.sgml | |
171 | doc/lxc-ls.sgml | |
172 | doc/lxc-ps.sgml | |
b0e505c9 | 173 | doc/lxc-cgroup.sgml |
e4b3fe58 | 174 | doc/lxc-kill.sgml |
49ee6cdc | 175 | doc/lxc-attach.sgml |
8a67a2b2 | 176 | doc/lxc.conf.sgml |
8b8b04f8 | 177 | doc/lxc.sgml |
10fba81b | 178 | doc/common_options.sgml |
99e4008c | 179 | doc/see_also.sgml |
d823d5b9 | 180 | |
baf6671f DL |
181 | doc/rootfs/Makefile |
182 | ||
0f71d073 DL |
183 | doc/examples/Makefile |
184 | doc/examples/lxc-macvlan.conf | |
26c39028 | 185 | doc/examples/lxc-vlan.conf |
0f71d073 DL |
186 | doc/examples/lxc-no-netns.conf |
187 | doc/examples/lxc-empty-netns.conf | |
188 | doc/examples/lxc-phys.conf | |
189 | doc/examples/lxc-veth.conf | |
c553a9c2 | 190 | doc/examples/lxc-complex.conf |
0f71d073 | 191 | |
c01d62f2 | 192 | templates/Makefile |
03d56dff | 193 | templates/lxc-lenny |
c01d62f2 | 194 | templates/lxc-debian |
e2b4064f | 195 | templates/lxc-ubuntu |
d1458ac8 | 196 | templates/lxc-ubuntu-cloud |
c840b37d | 197 | templates/lxc-opensuse |
c01d62f2 DL |
198 | templates/lxc-busybox |
199 | templates/lxc-fedora | |
262f4e48 | 200 | templates/lxc-altlinux |
c01d62f2 | 201 | templates/lxc-sshd |
f6267d90 | 202 | templates/lxc-archlinux |
c9844b87 | 203 | |
288063bd | 204 | src/Makefile |
5e97c3fc | 205 | src/lxc/Makefile |
206 | src/lxc/lxc-ps | |
d823d5b9 | 207 | src/lxc/lxc-ls |
9d0195cb | 208 | src/lxc/lxc-netstat |
237315ff DL |
209 | src/lxc/lxc-checkconfig |
210 | src/lxc/lxc-setcap | |
7a82e923 | 211 | src/lxc/lxc-setuid |
bcd952a1 | 212 | src/lxc/lxc-version |
ab2d32f8 | 213 | src/lxc/lxc-create |
be8b5972 | 214 | src/lxc/lxc-clone |
72be4f89 | 215 | src/lxc/lxc-shutdown |
5b12984b | 216 | src/lxc/lxc-start-ephemeral |
ab2d32f8 | 217 | src/lxc/lxc-destroy |
c9844b87 | 218 | |
be2e4e54 SG |
219 | src/python-lxc/Makefile |
220 | ||
72d0e1cb SG |
221 | src/tests/Makefile |
222 | ||
5e97c3fc | 223 | ]) |
224 | AC_CONFIG_COMMANDS([default],[[]],[[]]) | |
225 | AC_OUTPUT | |
805415fc | 226 | |
227 | if test "x$SETCAP" = "xno"; then | |
f8dafdbb | 228 | AC_MSG_NOTICE([ |
805415fc | 229 | |
230 | Warning: | |
231 | -------- | |
232 | ||
87476557 FG |
233 | The setcap binary was not found. This means the tools to set the |
234 | privilege for the lxc commands are not available, that's ok, but you | |
235 | will need to run these commands as root or install libcap-2. | |
805415fc | 236 | |
237 | ]) | |
238 | ||
239 | else | |
240 | ||
f8dafdbb | 241 | AC_MSG_NOTICE([ |
805415fc | 242 | |
243 | Advice: | |
244 | ------- | |
245 | ||
87476557 | 246 | If you wish to have a non root user to use the lxc tools, |
237315ff DL |
247 | you can add the needed capabilities to the tools by invoking |
248 | the 'lxc-setcap' script. To remove the capabilities, use | |
87476557 | 249 | 'lxc-setcap -d'. |
805415fc | 250 | ]) |
251 | ||
252 | fi |