]>
Commit | Line | Data |
---|---|---|
1 | # -*- Autoconf -*- | |
2 | # Process this file with autoconf to produce a configure script. | |
3 | ||
4 | m4_define([lxc_version_major], 1) | |
5 | m4_define([lxc_version_minor], 0) | |
6 | m4_define([lxc_version_micro], 0) | |
7 | m4_define([lxc_version_beta], [alpha3]) | |
8 | ||
9 | m4_define([lxc_version_base], [lxc_version_major.lxc_version_minor.lxc_version_micro]) | |
10 | m4_define([lxc_version], | |
11 | [ifelse(lxc_version_beta, [], [lxc_version_base], [lxc_version_base.lxc_version_beta])]) | |
12 | ||
13 | AC_INIT([lxc], [lxc_version]) | |
14 | AC_SUBST(LXC_VERSION_BASE, lxc_version_base) | |
15 | AC_SUBST(LXC_VERSION_BETA, lxc_version_beta) | |
16 | ||
17 | AC_SUBST([LXC_VERSION_MAJOR], [lxc_version_major]) | |
18 | AC_SUBST([LXC_VERSION_MINOR], [lxc_version_minor]) | |
19 | AC_SUBST([LXC_VERSION_MICRO], [lxc_version_micro]) | |
20 | AC_SUBST([LXC_VERSION], [lxc_version]) | |
21 | ||
22 | AC_CONFIG_SRCDIR([configure.ac]) | |
23 | AC_CONFIG_AUX_DIR([config]) | |
24 | AC_CONFIG_HEADERS([src/config.h]) | |
25 | AM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability subdir-objects]) | |
26 | AC_CANONICAL_HOST | |
27 | AM_PROG_CC_C_O | |
28 | AC_GNU_SOURCE | |
29 | ||
30 | # Detect the distribution. This is used for the default configuration and | |
31 | # for some distro-specific build options. | |
32 | AC_MSG_CHECKING([host distribution]) | |
33 | AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, oracle, centos, fedora, suse, gentoo, debian, arch, slackware, paldo, openmandriva or pardus.])) | |
34 | if test "z$with_distro" = "z"; then | |
35 | with_distro=`lsb_release -is` | |
36 | fi | |
37 | if test "z$with_distro" = "z"; then | |
38 | AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat") | |
39 | AC_CHECK_FILE(/etc/oracle-release,with_distro="oracle") | |
40 | AC_CHECK_FILE(/etc/centos-release,with_distro="centos") | |
41 | AC_CHECK_FILE(/etc/fedora-release,with_distro="fedora") | |
42 | AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse") | |
43 | AC_CHECK_FILE(/etc/gentoo-release,with_distro="gentoo") | |
44 | AC_CHECK_FILE(/etc/debian_version,with_distro="debian") | |
45 | AC_CHECK_FILE(/etc/arch-release,with_distro="arch") | |
46 | AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware") | |
47 | AC_CHECK_FILE(/etc/frugalware-release,with_distro="frugalware") | |
48 | AC_CHECK_FILE(/etc/mandrakelinux-release, with_distro="openmandriva") | |
49 | AC_CHECK_FILE(/etc/mandriva-release,with_distro="openmandriva") | |
50 | AC_CHECK_FILE(/etc/pardus-release,with_distro="pardus") | |
51 | fi | |
52 | with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]'` | |
53 | ||
54 | if test "z$with_distro" = "z"; then | |
55 | with_distro="unknown" | |
56 | fi | |
57 | case $with_distro in | |
58 | ubuntu) | |
59 | distroconf=default.conf.ubuntu | |
60 | ;; | |
61 | redhat|centos|fedora|oracle|oracleserver) | |
62 | distroconf=default.conf.libvirt | |
63 | ;; | |
64 | *) | |
65 | echo -n "Linux distribution network config unknown, defaulting to lxc.network.type = empty" | |
66 | distroconf=default.conf.unknown | |
67 | ;; | |
68 | esac | |
69 | AC_MSG_RESULT([$with_distro]) | |
70 | AM_CONDITIONAL([HAVE_DEBIAN], [test x"$with_distro" = "xdebian" -o x"$with_distro" = "xubuntu"]) | |
71 | AM_CONDITIONAL([DISTRO_UBUNTU], [test "x$with_distro" = "xubuntu"]) | |
72 | ||
73 | # Allow disabling rpath | |
74 | AC_ARG_ENABLE([rpath], | |
75 | [AC_HELP_STRING([--enable-rpath], [set rpath in executables [default=no]])], | |
76 | [], [enable_rpath=no]) | |
77 | AM_CONDITIONAL([ENABLE_RPATH], [test "x$enable_rpath" = "xyes"]) | |
78 | ||
79 | # Documentation (manpages) | |
80 | AC_ARG_ENABLE([doc], | |
81 | [AC_HELP_STRING([--enable-doc], [make man pages [default=auto]])], | |
82 | [], [enable_doc=auto]) | |
83 | ||
84 | if test "x$enable_doc" = "xyes" -o "x$enable_doc" = "xauto"; then | |
85 | db2xman="" | |
86 | dbparsers="docbook2x-man db2x_docbook2man docbook2man" | |
87 | ||
88 | AC_MSG_CHECKING(for docbook2x-man) | |
89 | for name in ${dbparsers}; do | |
90 | if "$name" --help >/dev/null 2>&1; then | |
91 | db2xman="$name" | |
92 | break; | |
93 | fi | |
94 | done | |
95 | ||
96 | if test -n "${db2xman}"; then | |
97 | AC_MSG_RESULT([${db2xman}]) | |
98 | enable_doc="yes" | |
99 | else | |
100 | AC_MSG_RESULT([no]) | |
101 | if test "x$enable_doc" = "xyes"; then | |
102 | AC_MSG_ERROR([docbook2x-man is required, but could not be found]) | |
103 | fi | |
104 | enable_doc="no" | |
105 | fi | |
106 | ||
107 | AC_SUBST(db2xman) | |
108 | fi | |
109 | AM_CONDITIONAL([ENABLE_DOCBOOK], [test "x$db2xman" != "x"]) | |
110 | AM_CONDITIONAL([USE_DOCBOOK2X], [test "x$db2xman" != "xdocbook2man"]) | |
111 | ||
112 | if test "x$db2xman" = "xdocbook2man"; then | |
113 | docdtd="\"-//Davenport//DTD DocBook V3.0//EN\"" | |
114 | else | |
115 | docdtd="\"-//OASIS//DTD DocBook XML\" \"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd\"" | |
116 | fi | |
117 | AC_SUBST(docdtd) | |
118 | ||
119 | # Documentation (API) | |
120 | AC_ARG_ENABLE([api-docs], | |
121 | [AC_HELP_STRING([--enable-api-docs], | |
122 | [make API documentation [default=auto]])], | |
123 | [], [enable_api_docs=auto]) | |
124 | ||
125 | if test "x$enable_api_docs" = "xyes" -o "x$enable_api_docs" = "xauto"; then | |
126 | AC_CHECK_PROGS([HAVE_DOXYGEN],[doxygen]) | |
127 | AC_SUBST([HAVE_DOXYGEN]) | |
128 | ||
129 | if test "x$HAVE_DOXYGEN" != "x"; then | |
130 | enable_api_docs="yes" | |
131 | else | |
132 | if test "x$enable_api_docs" = "xyes"; then | |
133 | AC_MSG_ERROR([doxygen is required, but could not be found]) | |
134 | fi | |
135 | enable_api_docs="no" | |
136 | fi | |
137 | fi | |
138 | ||
139 | AM_CONDITIONAL([ENABLE_API_DOCS], [test "x$HAVE_DOXYGEN" != "x"]) | |
140 | ||
141 | # Apparmor | |
142 | AC_ARG_ENABLE([apparmor], | |
143 | [AC_HELP_STRING([--enable-apparmor], [enable apparmor support [default=auto]])], | |
144 | [], [enable_apparmor=auto]) | |
145 | ||
146 | if test "$enable_apparmor" = "auto" ; then | |
147 | AC_CHECK_LIB([apparmor],[aa_change_profile],[enable_apparmor=yes], [enable_apparmor=no]) | |
148 | fi | |
149 | AM_CONDITIONAL([ENABLE_APPARMOR], [test "x$enable_apparmor" = "xyes"]) | |
150 | ||
151 | AC_CHECK_LIB([gnutls], [gnutls_hash_fast]) | |
152 | ||
153 | AM_COND_IF([ENABLE_APPARMOR], | |
154 | [AC_CHECK_HEADER([sys/apparmor.h],[],[AC_MSG_ERROR([You must install the AppArmor development package in order to compile lxc])]) | |
155 | AC_CHECK_LIB([apparmor], [aa_change_profile],[],[AC_MSG_ERROR([You must install the AppArmor development package in order to compile lxc])]) | |
156 | AC_SUBST([APPARMOR_LIBS], [-lapparmor])]) | |
157 | ||
158 | # SELinux | |
159 | AC_ARG_ENABLE([selinux], | |
160 | [AC_HELP_STRING([--enable-selinux], [enable SELinux support [default=auto]])], | |
161 | [], [enable_selinux=auto]) | |
162 | ||
163 | if test "x$enable_selinux" = xauto; then | |
164 | AC_CHECK_LIB([selinux],[setexeccon_raw],[enable_selinux=yes],[enable_selinux=no]) | |
165 | fi | |
166 | AM_CONDITIONAL([ENABLE_SELINUX], [test "x$enable_selinux" = "xyes"]) | |
167 | AM_COND_IF([ENABLE_SELINUX], | |
168 | [AC_CHECK_HEADER([selinux/selinux.h],[],[AC_MSG_ERROR([You must install the SELinux development package in order to compile lxc])]) | |
169 | AC_CHECK_LIB([selinux], [setexeccon_raw],[],[AC_MSG_ERROR([You must install the SELinux development package in order to compile lxc])]) | |
170 | AC_SUBST([SELINUX_LIBS])]) | |
171 | ||
172 | # Seccomp syscall filter | |
173 | AC_ARG_ENABLE([seccomp], | |
174 | [AC_HELP_STRING([--enable-seccomp], [enable seccomp support [default=auto]])], | |
175 | [], [enable_seccomp=auto]) | |
176 | ||
177 | if test "x$enable_seccomp" = "xauto" ; then | |
178 | AC_CHECK_LIB([seccomp],[seccomp_init],[enable_seccomp=yes],[enable_seccomp=no]) | |
179 | fi | |
180 | AM_CONDITIONAL([ENABLE_SECCOMP], [test "x$enable_seccomp" = "xyes"]) | |
181 | ||
182 | AM_COND_IF([ENABLE_SECCOMP], | |
183 | [AC_CHECK_HEADER([seccomp.h],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])]) | |
184 | AC_CHECK_LIB([seccomp], [seccomp_init],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])]) | |
185 | AC_SUBST([SECCOMP_LIBS], [-lseccomp])]) | |
186 | ||
187 | # Linux capabilities | |
188 | AC_ARG_ENABLE([capabilities], | |
189 | [AC_HELP_STRING([--enable-capabilities], [enable kernel capabilities support [default=auto]])], | |
190 | [], [enable_capabilities=auto]) | |
191 | ||
192 | if test "x$enable_capabilities" = "xauto"; then | |
193 | AC_CHECK_LIB([cap],[cap_set_proc],[enable_capabilities=yes],[enable_capabilities=no]) | |
194 | fi | |
195 | AM_CONDITIONAL([ENABLE_CAP], [test "x$enable_capabilities" = "xyes"]) | |
196 | ||
197 | AM_COND_IF([ENABLE_CAP], | |
198 | [AC_CHECK_LIB(cap,cap_set_proc,[],[AC_MSG_ERROR([You are missing libcap support.])]) | |
199 | AC_SUBST([CAP_LIBS], [-lcap])]) | |
200 | ||
201 | # HAVE_SCMP_FILTER_CTX=1 will tell us we have libseccomp api >= 1.0.0 | |
202 | AC_CHECK_TYPES([scmp_filter_ctx], [], [], [[#include <seccomp.h>]]) | |
203 | ||
204 | # Configuration examples | |
205 | AC_ARG_ENABLE([examples], | |
206 | [AC_HELP_STRING([--enable-examples], [install examples [default=yes]])], | |
207 | [], [enable_examples=yes]) | |
208 | AM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" = "xyes"]) | |
209 | ||
210 | # We need pkg-config | |
211 | PKG_PROG_PKG_CONFIG | |
212 | ||
213 | # Python3 module and scripts | |
214 | AC_ARG_ENABLE([python], | |
215 | [AC_HELP_STRING([--enable-python], [enable python binding [default=auto]])], | |
216 | [], [enable_python=auto]) | |
217 | ||
218 | if test "x$enable_python" = "xauto"; then | |
219 | PKG_CHECK_MODULES([PYTHONDEV], [python3 >= 3.2],[enable_python=yes],[enable_python=no]) | |
220 | fi | |
221 | ||
222 | AM_CONDITIONAL([ENABLE_PYTHON], [test "x$enable_python" = "xyes"]) | |
223 | ||
224 | AM_COND_IF([ENABLE_PYTHON], | |
225 | [AM_PATH_PYTHON([3.2], [], [AC_MSG_ERROR([You must install python3])]) | |
226 | PKG_CHECK_MODULES([PYTHONDEV], [python3 >= 3.2],[],[AC_MSG_ERROR([You must install python3-dev])]) | |
227 | AC_DEFINE_UNQUOTED([ENABLE_PYTHON], 1, [Python3 is available])]) | |
228 | ||
229 | # Enable dumping stack traces | |
230 | AC_ARG_ENABLE([mutex-debugging], | |
231 | [AC_HELP_STRING([--enable-mutex-debugging], [Makes mutexes to report error and provide stack trace [default=no]])], | |
232 | [], [enable_mutex_debugging=no]) | |
233 | AM_CONDITIONAL([MUTEX_DEBUGGING], [test "x$enable_mutex_debugging" = "xyes"]) | |
234 | ||
235 | AM_COND_IF([MUTEX_DEBUGGING], | |
236 | AC_DEFINE_UNQUOTED([MUTEX_DEBUGGING], 1, [Enabling mutex debugging])) | |
237 | ||
238 | # Not in older autoconf versions | |
239 | # AS_VAR_COPY(DEST, SOURCE) | |
240 | # ------------------------- | |
241 | # Set the polymorphic shell variable DEST to the contents of the polymorphic | |
242 | # shell variable SOURCE. | |
243 | m4_ifdef([AS_VAR_COPY], [], | |
244 | [AC_DEFUN([AS_VAR_COPY], | |
245 | [AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])]) | |
246 | ]) | |
247 | ||
248 | dnl PKG_CHECK_VAR was introduced with pkg-config 0.28 | |
249 | m4_ifdef([PKG_CHECK_VAR], [], | |
250 | [AC_DEFUN([PKG_CHECK_VAR], | |
251 | [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl | |
252 | AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl | |
253 | _PKG_CONFIG([$1], [variable="][$3]["], [$2]) | |
254 | AS_VAR_COPY([$1], [pkg_cv_][$1]) | |
255 | AS_VAR_IF([$1], [""], [$5], [$4])dnl | |
256 | ])# PKG_CHECK_VAR | |
257 | ]) | |
258 | ||
259 | # Lua module and scripts | |
260 | AC_ARG_ENABLE([lua], | |
261 | [AC_HELP_STRING([--enable-lua], [enable lua binding [default=auto]])], | |
262 | [], [enable_lua=auto]) | |
263 | ||
264 | AC_ARG_WITH([lua-pc], | |
265 | [AS_HELP_STRING( | |
266 | [--with-lua-pc=PKG], | |
267 | [Specify pkg-config package name for lua] | |
268 | )], [], [with_lua_pc=no]) | |
269 | ||
270 | if test "x$enable_lua" = "xyes" -a "x$with_lua_pc" != "xno"; then | |
271 | # exit with error if not found | |
272 | PKG_CHECK_MODULES([LUA], [$with_lua_pc], [LUAPKGCONFIG=$with_lua_pc]) | |
273 | fi | |
274 | ||
275 | if test "x$enable_lua" = "xauto" -a "x$with_lua_pc" != "xno"; then | |
276 | PKG_CHECK_MODULES([LUA], [$with_lua_pc], | |
277 | [LUAPKGCONFIG=$with_lua_pc | |
278 | enable_lua=yes], | |
279 | [enable_lua=no]) | |
280 | fi | |
281 | ||
282 | if test "x$enable_lua" != "xno"; then | |
283 | PKG_CHECK_MODULES([LUA], [lua], [LUAPKGCONFIG=lua], | |
284 | [PKG_CHECK_MODULES([LUA], [lua5.2], [LUAPKGCONFIG=lua5.2], | |
285 | [PKG_CHECK_MODULES([LUA], [lua5.1], [LUAPKGCONFIG=lua5.1], | |
286 | [AS_IF([test "x$enable_lua" = "xyes"], | |
287 | [AC_MSG_ERROR([Lua not found. Please use --with-lua-pc=PKG])], | |
288 | [enable_lua=no])] | |
289 | )] | |
290 | )]) | |
291 | AS_IF([test "x$LUAPKGCONFIG" != "x"], [enable_lua=yes]) | |
292 | fi | |
293 | ||
294 | AM_CONDITIONAL([ENABLE_LUA], | |
295 | [test "x$enable_lua" = "xyes"]) | |
296 | ||
297 | AM_COND_IF([ENABLE_LUA], | |
298 | [AC_MSG_CHECKING([Lua version]) | |
299 | PKG_CHECK_VAR([LUA_VERSION], [$LUAPKGCONFIG], [V],, | |
300 | [PKG_CHECK_VAR([LUA_VERSION], [$LUAPKGCONFIG], [major_version])]) | |
301 | AC_MSG_RESULT([$LUA_VERSION]) | |
302 | PKG_CHECK_VAR([LUA_INSTALL_CMOD], [$LUAPKGCONFIG], [INSTALL_CMOD],, | |
303 | [LUA_INSTALL_CMOD=$libdir/lua/$LUA_VERSION]) | |
304 | PKG_CHECK_VAR([LUA_INSTALL_LMOD], [$LUAPKGCONFIG], [INSTALL_LMOD],, | |
305 | [LUA_INSTALL_LMOD=$datadir/lua/$LUA_VERSION]) | |
306 | ]) | |
307 | ||
308 | # Optional test binaries | |
309 | AC_ARG_ENABLE([tests], | |
310 | [AC_HELP_STRING([--enable-tests], [build test/example binaries [default=no]])], | |
311 | [], [enable_tests=no]) | |
312 | AM_CONDITIONAL([ENABLE_TESTS], [test "x$enable_tests" = "xyes"]) | |
313 | ||
314 | # LXC container path, where the containers are actually stored | |
315 | # This is overridden by an entry in the file called LXCCONF | |
316 | # (i.e. /etc/lxc/lxc.conf) | |
317 | AC_ARG_WITH([config-path], | |
318 | [AC_HELP_STRING( | |
319 | [--with-config-path=dir], | |
320 | [lxc configuration repository path] | |
321 | )], [], [with_config_path=['${localstatedir}/lib/lxc']]) | |
322 | ||
323 | # The path of the global lxc configuration file. | |
324 | AC_ARG_WITH([global-conf], | |
325 | [AC_HELP_STRING( | |
326 | [--with-global-conf=dir], | |
327 | [global lxc configuration file] | |
328 | )], [], [with_global_conf=['${sysconfdir}/lxc/lxc.conf']]) | |
329 | ||
330 | # The path of the userns network configuration file | |
331 | AC_ARG_WITH([usernic-conf], | |
332 | [AC_HELP_STRING( | |
333 | [--with-usernic-conf], | |
334 | [user network interface configuration file] | |
335 | )], [], [with_usernic_conf=['${sysconfdir}/lxc/lxc-usernet']]) | |
336 | ||
337 | # The path of the runtime usernic database | |
338 | AC_ARG_WITH([usernic-db], | |
339 | [AC_HELP_STRING( | |
340 | [--with-usernic-db], | |
341 | [lxc user nic database] | |
342 | )], [], [with_usernic_db=['/run/lxc/nics']]) | |
343 | ||
344 | # Rootfs path, where the container mount structure is assembled | |
345 | AC_ARG_WITH([rootfs-path], | |
346 | [AC_HELP_STRING( | |
347 | [--with-rootfs-path=dir], | |
348 | [lxc rootfs mount point] | |
349 | )], [], [with_rootfs_path=['${libdir}/lxc/rootfs']]) | |
350 | ||
351 | # cgroup pattern specification | |
352 | AC_ARG_WITH([cgroup-pattern], | |
353 | [AC_HELP_STRING( | |
354 | [--with-cgroup-pattern=pattern], | |
355 | [pattern for container cgroups] | |
356 | )], [], [with_cgroup_pattern=['/lxc/%n']]) | |
357 | ||
358 | # Container log path. By default, use $lxcpath. | |
359 | AC_MSG_CHECKING([Whether to place logfiles in container config path]) | |
360 | AC_ARG_ENABLE([configpath-log], | |
361 | [AC_HELP_STRING([--enable-configpath-log], [use logfiles in config path [default=no]])], | |
362 | [], [enable_configpath_log=no]) | |
363 | AC_MSG_RESULT([$enable_configpath_log]) | |
364 | AM_CONDITIONAL([USE_CONFIGPATH_LOGS], [test "$enable_configpath_log" = "yes"]) | |
365 | ||
366 | if test "$enable_configpath_log" = "yes"; then | |
367 | default_log_path="${with_config_path}" | |
368 | else | |
369 | default_log_path="${localstatedir}/log/lxc" | |
370 | fi | |
371 | ||
372 | AC_ARG_WITH([log-path], | |
373 | [AC_HELP_STRING( | |
374 | [--with-log-path=dir], | |
375 | [per container log path] | |
376 | )], [], [with_log_path=['${default_log_path}']]) | |
377 | ||
378 | # Expand some useful variables | |
379 | AS_AC_EXPAND(PREFIX, "$prefix") | |
380 | AS_AC_EXPAND(LIBDIR, "$libdir") | |
381 | AS_AC_EXPAND(BINDIR, "$bindir") | |
382 | AS_AC_EXPAND(LIBEXECDIR, "$libexecdir") | |
383 | AS_AC_EXPAND(INCLUDEDIR, "$includedir") | |
384 | AS_AC_EXPAND(SYSCONFDIR, "$sysconfdir") | |
385 | AS_AC_EXPAND(LXC_DEFAULT_CONFIG, "$sysconfdir/lxc/default.conf") | |
386 | AS_AC_EXPAND(DATADIR, "$datadir") | |
387 | AS_AC_EXPAND(LOCALSTATEDIR, "$localstatedir") | |
388 | AS_AC_EXPAND(DOCDIR, "$docdir") | |
389 | AS_AC_EXPAND(LXC_DISTRO_CONF, "$distroconf") | |
390 | AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)") | |
391 | AS_AC_EXPAND(LXCPATH, "$with_config_path") | |
392 | AS_AC_EXPAND(LXC_GLOBAL_CONF, "$with_global_conf") | |
393 | AS_AC_EXPAND(LXC_USERNIC_CONF, "$with_usernic_conf") | |
394 | AS_AC_EXPAND(LXC_USERNIC_DB, "$with_usernic_db") | |
395 | AS_AC_EXPAND(LXCROOTFSMOUNT, "$with_rootfs_path") | |
396 | AS_AC_EXPAND(LXCTEMPLATEDIR, "$datadir/lxc/templates") | |
397 | AS_AC_EXPAND(LXCTEMPLATECONFIG, "$datadir/lxc/config") | |
398 | AS_AC_EXPAND(LXCHOOKDIR, "$datadir/lxc/hooks") | |
399 | AS_AC_EXPAND(LXCINITDIR, "$libexecdir") | |
400 | AS_AC_EXPAND(LOGPATH, "$with_log_path") | |
401 | AC_SUBST(DEFAULT_CGROUP_PATTERN, ["$with_cgroup_pattern"]) | |
402 | ||
403 | # Check for some standard kernel headers | |
404 | AC_CHECK_HEADERS([linux/unistd.h linux/netlink.h linux/genetlink.h], | |
405 | [], | |
406 | AC_MSG_ERROR([Please install the Linux kernel headers.]), | |
407 | [#include <sys/socket.h>]) | |
408 | ||
409 | # Check for alternate C libraries | |
410 | AC_MSG_CHECKING(for bionic libc) | |
411 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM( | |
412 | [[#ifndef __ANDROID__ | |
413 | error: Not bionic! | |
414 | #endif]])], | |
415 | [is_bionic=yes], | |
416 | [is_bionic=no]) | |
417 | if test "x$is_bionic" = "xyes"; then | |
418 | AC_DEFINE([IS_BIONIC], 1, [bionic libc]) | |
419 | AC_MSG_RESULT([yes]) | |
420 | else | |
421 | AC_MSG_RESULT([no]) | |
422 | fi | |
423 | AM_CONDITIONAL([IS_BIONIC], [test "x$is_bionic" = "xyes"]) | |
424 | ||
425 | # Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP | |
426 | AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>]) | |
427 | ||
428 | # Check for some headers | |
429 | AC_CHECK_HEADERS([sys/signalfd.h pty.h ifaddrs.h sys/capability.h sys/personality.h utmpx.h sys/timerfd.h]) | |
430 | ||
431 | # Check for some syscalls functions | |
432 | AC_CHECK_FUNCS([setns pivot_root sethostname unshare rand_r confstr]) | |
433 | ||
434 | # Check for some functions | |
435 | AC_CHECK_LIB(util, openpty) | |
436 | AC_CHECK_FUNCS([openpty hasmntopt setmntent endmntent]) | |
437 | AC_CHECK_FUNCS([getline], | |
438 | AM_CONDITIONAL(HAVE_GETLINE, true) | |
439 | AC_DEFINE(HAVE_GETLINE,1,[Have getline]), | |
440 | AM_CONDITIONAL(HAVE_GETLINE, false)) | |
441 | AC_CHECK_FUNCS([fgetln], | |
442 | AM_CONDITIONAL(HAVE_FGETLN, true) | |
443 | AC_DEFINE(HAVE_FGETLN,1,[Have fgetln]), | |
444 | AM_CONDITIONAL(HAVE_FGETLN, false)) | |
445 | ||
446 | # Check for some libraries | |
447 | AC_SEARCH_LIBS(sem_open, [rt pthread]) | |
448 | AC_SEARCH_LIBS(clock_gettime, [rt]) | |
449 | ||
450 | # Check for some standard binaries | |
451 | AC_PROG_GCC_TRADITIONAL | |
452 | AC_PROG_SED | |
453 | ||
454 | if test "x$GCC" = "xyes"; then | |
455 | CFLAGS="$CFLAGS -Wall -Werror" | |
456 | fi | |
457 | ||
458 | # Files requiring some variable expansion | |
459 | AC_CONFIG_FILES([ | |
460 | Makefile | |
461 | lxc.pc | |
462 | lxc.spec | |
463 | ||
464 | config/Makefile | |
465 | config/etc/Makefile | |
466 | config/templates/Makefile | |
467 | config/templates/ubuntu-cloud.common.conf | |
468 | config/templates/ubuntu-cloud.lucid.conf | |
469 | config/templates/ubuntu-cloud.userns.conf | |
470 | config/templates/ubuntu.common.conf | |
471 | config/templates/ubuntu.lucid.conf | |
472 | ||
473 | doc/Makefile | |
474 | doc/api/Makefile | |
475 | doc/legacy/lxc-ls.sgml | |
476 | doc/lxc-attach.sgml | |
477 | doc/lxc-cgroup.sgml | |
478 | doc/lxc-checkconfig.sgml | |
479 | doc/lxc-checkpoint.sgml | |
480 | doc/lxc-clone.sgml | |
481 | doc/lxc-console.sgml | |
482 | doc/lxc-create.sgml | |
483 | doc/lxc-destroy.sgml | |
484 | doc/lxc-device.sgml | |
485 | doc/lxc-execute.sgml | |
486 | doc/lxc-freeze.sgml | |
487 | doc/lxc-info.sgml | |
488 | doc/lxc-kill.sgml | |
489 | doc/lxc-ls.sgml | |
490 | doc/lxc-monitor.sgml | |
491 | doc/lxc-netstat.sgml | |
492 | doc/lxc-ps.sgml | |
493 | doc/lxc-restart.sgml | |
494 | doc/lxc-snapshot.sgml | |
495 | doc/lxc-start-ephemeral.sgml | |
496 | doc/lxc-start.sgml | |
497 | doc/lxc-stop.sgml | |
498 | doc/lxc-top.sgml | |
499 | doc/lxc-unfreeze.sgml | |
500 | doc/lxc-unshare.sgml | |
501 | doc/lxc-user-nic.sgml | |
502 | doc/lxc-version.sgml | |
503 | doc/lxc-wait.sgml | |
504 | ||
505 | doc/lxc.conf.sgml | |
506 | doc/lxc-usernet.sgml | |
507 | doc/lxc.sgml | |
508 | doc/common_options.sgml | |
509 | doc/see_also.sgml | |
510 | ||
511 | doc/rootfs/Makefile | |
512 | ||
513 | doc/examples/Makefile | |
514 | doc/examples/lxc-macvlan.conf | |
515 | doc/examples/lxc-vlan.conf | |
516 | doc/examples/lxc-no-netns.conf | |
517 | doc/examples/lxc-empty-netns.conf | |
518 | doc/examples/lxc-phys.conf | |
519 | doc/examples/lxc-veth.conf | |
520 | doc/examples/lxc-complex.conf | |
521 | ||
522 | doc/ja/Makefile | |
523 | doc/ja/legacy/lxc-ls.sgml | |
524 | doc/ja/lxc-attach.sgml | |
525 | doc/ja/lxc-cgroup.sgml | |
526 | doc/ja/lxc-checkconfig.sgml | |
527 | doc/ja/lxc-checkpoint.sgml | |
528 | doc/ja/lxc-clone.sgml | |
529 | doc/ja/lxc-console.sgml | |
530 | doc/ja/lxc-create.sgml | |
531 | doc/ja/lxc-destroy.sgml | |
532 | doc/ja/lxc-device.sgml | |
533 | doc/ja/lxc-execute.sgml | |
534 | doc/ja/lxc-freeze.sgml | |
535 | doc/ja/lxc-info.sgml | |
536 | doc/ja/lxc-kill.sgml | |
537 | doc/ja/lxc-ls.sgml | |
538 | doc/ja/lxc-monitor.sgml | |
539 | doc/ja/lxc-netstat.sgml | |
540 | doc/ja/lxc-ps.sgml | |
541 | doc/ja/lxc-restart.sgml | |
542 | doc/ja/lxc-snapshot.sgml | |
543 | doc/ja/lxc-start-ephemeral.sgml | |
544 | doc/ja/lxc-start.sgml | |
545 | doc/ja/lxc-stop.sgml | |
546 | doc/ja/lxc-top.sgml | |
547 | doc/ja/lxc-unfreeze.sgml | |
548 | doc/ja/lxc-unshare.sgml | |
549 | doc/ja/lxc-version.sgml | |
550 | doc/ja/lxc-wait.sgml | |
551 | ||
552 | doc/ja/lxc.conf.sgml | |
553 | doc/ja/lxc.sgml | |
554 | doc/ja/common_options.sgml | |
555 | doc/ja/see_also.sgml | |
556 | ||
557 | hooks/Makefile | |
558 | ||
559 | templates/Makefile | |
560 | templates/lxc-cirros | |
561 | templates/lxc-debian | |
562 | templates/lxc-ubuntu | |
563 | templates/lxc-ubuntu-cloud | |
564 | templates/lxc-opensuse | |
565 | templates/lxc-busybox | |
566 | templates/lxc-centos | |
567 | templates/lxc-fedora | |
568 | templates/lxc-openmandriva | |
569 | templates/lxc-oracle | |
570 | templates/lxc-altlinux | |
571 | templates/lxc-sshd | |
572 | templates/lxc-archlinux | |
573 | templates/lxc-alpine | |
574 | templates/lxc-plamo | |
575 | ||
576 | src/Makefile | |
577 | src/lxc/Makefile | |
578 | src/lxc/lxc-ps | |
579 | src/lxc/lxc-netstat | |
580 | src/lxc/lxc-checkconfig | |
581 | src/lxc/lxc-version | |
582 | src/lxc/lxc-start-ephemeral | |
583 | src/lxc/legacy/lxc-ls | |
584 | src/lxc/lxc.functions | |
585 | src/lxc/version.h | |
586 | src/python-lxc/Makefile | |
587 | ||
588 | src/lua-lxc/Makefile | |
589 | ||
590 | src/tests/Makefile | |
591 | ]) | |
592 | AC_CONFIG_COMMANDS([default],[[]],[[]]) | |
593 | AC_OUTPUT | |
594 | ||
595 | # Configuration overview | |
596 | cat << EOF | |
597 | ||
598 | ---------------------------- | |
599 | Environment: | |
600 | - compiler: $CC | |
601 | - distribution: $with_distro | |
602 | - rpath: $enable_rpath | |
603 | ||
604 | Security features: | |
605 | - Apparmor: $enable_apparmor | |
606 | - Linux capabilities: $enable_capabilities | |
607 | - seccomp: $enable_seccomp | |
608 | - SELinux: $enable_selinux | |
609 | ||
610 | Bindings: | |
611 | - lua: $enable_lua | |
612 | - python3: $enable_python | |
613 | ||
614 | Documentation: | |
615 | - examples: $enable_examples | |
616 | - API documentation: $enable_api_docs | |
617 | - user documentation: $enable_doc | |
618 | ||
619 | Debugging: | |
620 | - tests: $enable_tests | |
621 | - mutex debugging: $enable_mutex_debugging | |
622 | ||
623 | Paths: | |
624 | - Logs in configpath: $enable_configpath_log | |
625 | EOF |