]> git.proxmox.com Git - mirror_lxc.git/blame - configure.ac
Merge pull request #2940 from brauner/master
[mirror_lxc.git] / configure.ac
CommitLineData
5e97c3fc 1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
8465a7f4 4m4_define([lxc_devel], 1)
282753c6 5m4_define([lxc_version_major], 3)
4dcd858b 6m4_define([lxc_version_minor], 1)
9588a6ce 7m4_define([lxc_version_micro], 0)
5b66b6ee 8m4_define([lxc_version_beta], [])
26419a7a
SG
9
10m4_define([lxc_abi_major], 1)
4dcd858b 11m4_define([lxc_abi_minor], 5)
26419a7a
SG
12m4_define([lxc_abi_micro], 0)
13m4_define([lxc_abi], [lxc_abi_major.lxc_abi_minor.lxc_abi_micro])
9588a6ce
SH
14
15m4_define([lxc_version_base], [lxc_version_major.lxc_version_minor.lxc_version_micro])
16m4_define([lxc_version],
8465a7f4 17 [ifelse(lxc_devel, 1,
5f98011c
SG
18 ifelse(lxc_version_beta, [], [lxc_version_base], [lxc_version_base.lxc_version_beta])-devel,
19 ifelse(lxc_version_beta, [], [lxc_version_base], [lxc_version_base.lxc_version_beta]))])
9588a6ce
SH
20
21AC_INIT([lxc], [lxc_version])
ddb93593
SG
22
23# We need pkg-config
24PKG_PROG_PKG_CONFIG
25
9588a6ce
SH
26AC_SUBST(LXC_VERSION_BASE, lxc_version_base)
27AC_SUBST(LXC_VERSION_BETA, lxc_version_beta)
5e97c3fc 28
a22185dd
ÇO
29AC_SUBST([LXC_VERSION_MAJOR], [lxc_version_major])
30AC_SUBST([LXC_VERSION_MINOR], [lxc_version_minor])
31AC_SUBST([LXC_VERSION_MICRO], [lxc_version_micro])
32AC_SUBST([LXC_VERSION], [lxc_version])
d2d6b991 33AC_SUBST([LXC_DEVEL], [lxc_devel])
a22185dd 34
26419a7a
SG
35AC_SUBST([LXC_ABI_MAJOR], [lxc_abi_major])
36AC_SUBST([LXC_ABI_MINOR], [lxc_abi_minor])
37AC_SUBST([LXC_ABI_MICRO], [lxc_abi_micro])
38AC_SUBST([LXC_ABI], [lxc_abi])
39
f8dafdbb 40AC_CONFIG_SRCDIR([configure.ac])
5e97c3fc 41AC_CONFIG_AUX_DIR([config])
067cfaeb 42AC_CONFIG_HEADERS([src/config.h])
d007f8ab 43AM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability subdir-objects])
5e97c3fc 44AC_CANONICAL_HOST
5e97c3fc 45AM_PROG_CC_C_O
46AC_GNU_SOURCE
5c8f9bd8 47
9b5724cd
CB
48# Test if we have a new enough compiler.
49AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
50#define GCC_VERSION \
51 (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
52
53#define CLANG_VERSION \
54 (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
55
218e8144 56#if GCC_VERSION < 40700 && CLANG_VERSION < 10000
9b5724cd
CB
57#error Sorry, your compiler is too old - please upgrade it
58#endif
59 ]])], [valid_compiler=yes], [valid_compiler=no])
60if test "x$valid_compiler" = "xno"; then
61 AC_MSG_ERROR([Sorry, your compiler is too old - please upgrade it])
62fi
63
26419a7a
SG
64# libtool
65LT_INIT
66AC_SUBST([LIBTOOL_DEPS])
67
8aa4885c
SG
68# Detect the distribution. This is used for the default configuration and
69# for some distro-specific build options.
6f75ba0b 70AC_MSG_CHECKING([host distribution])
b195038d 71AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, redhatenterpriseserver, oracle, centos, fedora, suse, gentoo, debian, arch, slackware, plamo, paldo, openmandriva, pardus, sparclinux, altlinux.]))
5a15791e 72if type lsb_release >/dev/null 2>&1 && test "z$with_distro" = "z"; then
6f75ba0b 73 with_distro=`lsb_release -is`
be2e4e54 74fi
6f75ba0b
DE
75if test "z$with_distro" = "z"; then
76 AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat")
77 AC_CHECK_FILE(/etc/oracle-release,with_distro="oracle")
beabd0a2 78 AC_CHECK_FILE(/etc/sparclinux-release,with_distro="sparclinux")
164105f6 79 AC_CHECK_FILE(/etc/centos-release,with_distro="centos")
6f75ba0b
DE
80 AC_CHECK_FILE(/etc/fedora-release,with_distro="fedora")
81 AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
82 AC_CHECK_FILE(/etc/gentoo-release,with_distro="gentoo")
83 AC_CHECK_FILE(/etc/debian_version,with_distro="debian")
84 AC_CHECK_FILE(/etc/arch-release,with_distro="arch")
85 AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware")
af2d9fad 86 AC_CHECK_FILE(/etc/plamo-version,with_distro="plamo")
6f75ba0b 87 AC_CHECK_FILE(/etc/frugalware-release,with_distro="frugalware")
6e7e54d9
AK
88 AC_CHECK_FILE(/etc/mandrakelinux-release, with_distro="openmandriva")
89 AC_CHECK_FILE(/etc/mandriva-release,with_distro="openmandriva")
6f75ba0b 90 AC_CHECK_FILE(/etc/pardus-release,with_distro="pardus")
5c60f990 91 AC_CHECK_FILE(/etc/altlinux-release,with_distro="altlinux")
487ea5f6 92 AC_CHECK_FILE(/etc/pld-release,with_distro="pld")
6f75ba0b
DE
93fi
94with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]'`
95
beabd0a2
WC
96if test "z$with_distro" = "zforsparc"; then
97 with_distro="sparclinux"
98fi
99
6f75ba0b
DE
100if test "z$with_distro" = "z"; then
101 with_distro="unknown"
102fi
103case $with_distro in
1c1bb85a 104 ubuntu|raspbian)
0af99319
MW
105 distroconf=default.conf.lxcbr
106 distrosysconf="$sysconfdir/default"
6f75ba0b 107 ;;
b195038d 108 redhat|redhatenterpriseserver|centos|fedora|oracle|oracleserver|sparclinux|altlinux|suse|opensuse*|plamo|pld)
0af99319
MW
109 distroconf=default.conf.lxcbr
110 distrosysconf="$sysconfdir/sysconfig"
6f75ba0b
DE
111 ;;
112 *)
3a647d58 113 distroconf=default.conf.unknown
0af99319 114 distrosysconf="$sysconfdir/default"
6f75ba0b
DE
115 ;;
116esac
117AC_MSG_RESULT([$with_distro])
1c1bb85a 118AM_CONDITIONAL([HAVE_DEBIAN], [test x"$with_distro" = "xdebian" -o x"$with_distro" = "xubuntu" -o x"$with_distro" = "xraspbian"])
025f59ab 119AM_CONDITIONAL([DISTRO_UBUNTU], [test "x$with_distro" = "xubuntu"])
be2e4e54 120
d79067a7
DM
121AC_CONFIG_LINKS([config/etc/default.conf:config/etc/${distroconf}])
122
420dfb59
DE
123# Check for init system type
124AC_MSG_CHECKING([for init system type])
125AC_ARG_WITH([init-script],
89f79f6b 126 [AC_HELP_STRING([--with-init-script@<:@=TYPE@<:@,TYPE,...@:>@@:>@],
dc068290 127 [Type(s) of init script to install: sysvinit, systemd, upstart,
89f79f6b 128 distro @<:@default=distro@:>@])],[],[with_init_script=distro])
420dfb59 129case "$with_init_script" in
420dfb59
DE
130 distro)
131 case $with_distro in
5c60f990 132 fedora|altlinux|opensuse*)
420dfb59
DE
133 init_script=systemd
134 ;;
b195038d 135 redhat|redhatenterpriseserver|oracle|oracleserver|sparclinux|plamo)
dc068290 136 init_script=sysvinit
420dfb59 137 ;;
234f9815 138 centos)
139 init_script=sysvinit,systemd
140 ;;
82b47911 141 debian|raspbian|ubuntu)
882ab607 142 init_script=upstart,systemd
420dfb59 143 ;;
487ea5f6
ER
144 pld)
145 init_script=sysvinit,upstart,systemd
146 ;;
420dfb59 147 *)
dc068290
SG
148 echo -n "Linux distribution init system unknown."
149 init_script=
420dfb59
DE
150 ;;
151 esac
152 ;;
153 *)
89f79f6b 154 init_script=$with_init_script
420dfb59
DE
155 ;;
156esac
89f79f6b
DE
157
158# Check valid init systems were given, run in subshell so we don't mess up IFS
159(IFS="," ; for init_sys in $init_script;
160do
161 case "$init_sys" in
dc068290 162 none|sysvinit|systemd|upstart)
89f79f6b
DE
163 ;;
164 *)
165 exit 1
166 ;;
167 esac
168done) || AC_MSG_ERROR([Unknown init system type in $init_script])
169
dc068290 170AM_CONDITIONAL([INIT_SCRIPT_SYSV], [echo "$init_script" |grep -q "sysvinit"])
89f79f6b
DE
171AM_CONDITIONAL([INIT_SCRIPT_SYSTEMD], [echo "$init_script" |grep -q "systemd"])
172AM_CONDITIONAL([INIT_SCRIPT_UPSTART], [echo "$init_script" |grep -q "upstart"])
420dfb59
DE
173AC_MSG_RESULT($init_script)
174
213b0fe0
MP
175# systemd unit dir
176AC_ARG_WITH([systemdsystemunitdir],
177 AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
178 [],
179 [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
180if test -z "$with_systemdsystemunitdir"; then
181 with_systemdsystemunitdir=/lib/systemd/system
182fi
183if test "x$with_systemdsystemunitdir" != "xno"; then
184 AC_SUBST([SYSTEMD_UNIT_DIR], [$with_systemdsystemunitdir])
185fi
186
e9f34eb4
JP
187AC_ARG_ENABLE([werror],
188 [AC_HELP_STRING([--disable-werror],
189 [do not treat warnings as errors])],
190 [], [enable_werror=yes])
191
8aa4885c 192# Allow disabling rpath
1c41ddcb 193AC_ARG_ENABLE([rpath],
f91d5e4e
SG
194 [AC_HELP_STRING([--enable-rpath], [set rpath in executables [default=no]])],
195 [], [enable_rpath=no])
1c41ddcb
GK
196AM_CONDITIONAL([ENABLE_RPATH], [test "x$enable_rpath" = "xyes"])
197
8aa4885c 198# Documentation (manpages)
5c8f9bd8 199AC_ARG_ENABLE([doc],
f91d5e4e 200 [AC_HELP_STRING([--enable-doc], [make man pages [default=auto]])],
5c8f9bd8
AN
201 [], [enable_doc=auto])
202
203if test "x$enable_doc" = "xyes" -o "x$enable_doc" = "xauto"; then
7822022c 204 db2xman=""
487ea5f6 205 dbparsers="docbook2X2man docbook2x-man db2x_docbook2man docbook2man docbook-to-man"
69fe23ff 206
7822022c 207 AC_MSG_CHECKING(for docbook2x-man)
69fe23ff 208 for name in ${dbparsers}; do
7822022c
SG
209 if "$name" --help >/dev/null 2>&1; then
210 db2xman="$name"
211 break;
212 fi
213 done
214
215 if test -n "${db2xman}"; then
8aa4885c 216 AC_MSG_RESULT([${db2xman}])
f91d5e4e 217 enable_doc="yes"
7822022c 218 else
8aa4885c 219 AC_MSG_RESULT([no])
7822022c 220 if test "x$enable_doc" = "xyes"; then
f91d5e4e 221 AC_MSG_ERROR([docbook2x-man is required, but could not be found])
7822022c 222 fi
f91d5e4e 223 enable_doc="no"
7822022c
SG
224 fi
225
226 AC_SUBST(db2xman)
5c8f9bd8 227fi
8aa4885c 228AM_CONDITIONAL([ENABLE_DOCBOOK], [test "x$db2xman" != "x"])
7cb14f34 229AM_CONDITIONAL([USE_DOCBOOK2X], [test "x$db2xman" != "xdocbook2man"])
5c8f9bd8 230
7f951458
DE
231if test "x$db2xman" = "xdocbook2man"; then
232 docdtd="\"-//Davenport//DTD DocBook V3.0//EN\""
233else
234 docdtd="\"-//OASIS//DTD DocBook XML\" \"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd\""
235fi
236AC_SUBST(docdtd)
237
953e611c
JH
238# Documentation (API)
239AC_ARG_ENABLE([api-docs],
240 [AC_HELP_STRING([--enable-api-docs],
f91d5e4e 241 [make API documentation [default=auto]])],
953e611c
JH
242 [], [enable_api_docs=auto])
243
244if test "x$enable_api_docs" = "xyes" -o "x$enable_api_docs" = "xauto"; then
f91d5e4e
SG
245 AC_CHECK_PROGS([HAVE_DOXYGEN],[doxygen])
246 AC_SUBST([HAVE_DOXYGEN])
247
248 if test "x$HAVE_DOXYGEN" != "x"; then
249 enable_api_docs="yes"
250 else
251 if test "x$enable_api_docs" = "xyes"; then
252 AC_MSG_ERROR([doxygen is required, but could not be found])
253 fi
254 enable_api_docs="no"
255 fi
953e611c
JH
256fi
257
f91d5e4e 258AM_CONDITIONAL([ENABLE_API_DOCS], [test "x$HAVE_DOXYGEN" != "x"])
953e611c 259
8aa4885c 260# Apparmor
e767dd55 261AC_ARG_ENABLE([apparmor],
f91d5e4e
SG
262 [AC_HELP_STRING([--enable-apparmor], [enable apparmor support [default=auto]])],
263 [], [enable_apparmor=auto])
e767dd55 264
f91d5e4e 265if test "$enable_apparmor" = "auto" ; then
e767dd55
SH
266 AC_CHECK_LIB([apparmor],[aa_change_profile],[enable_apparmor=yes], [enable_apparmor=no])
267fi
e767dd55
SH
268AM_CONDITIONAL([ENABLE_APPARMOR], [test "x$enable_apparmor" = "xyes"])
269
c8601571
FF
270# GnuTLS
271AC_ARG_ENABLE([gnutls],
272 [AC_HELP_STRING([--enable-gnutls], [enable GnuTLS support [default=auto]])],
273 [], [enable_gnutls=auto])
274
275if test "$enable_gnutls" = "auto" ; then
276 AC_CHECK_LIB([gnutls], [gnutls_hash_fast], [enable_gnutls=yes], [enable_gnutls=no])
277fi
278AM_CONDITIONAL([ENABLE_GNUTLS], [test "x$enable_gnutls" = "xyes"])
279
280AM_COND_IF([ENABLE_GNUTLS],
281 [AC_CHECK_HEADER([gnutls/gnutls.h],[],[AC_MSG_ERROR([You must install the GnuTLS development package in order to compile lxc])])
49bc916b 282 AC_CHECK_LIB([gnutls], [gnutls_hash_fast],[true],[AC_MSG_ERROR([You must install the GnuTLS development package in order to compile lxc])])
c8601571
FF
283 AC_SUBST([GNUTLS_LIBS], [-lgnutls])])
284
fe4de9a6
DE
285# SELinux
286AC_ARG_ENABLE([selinux],
f91d5e4e
SG
287 [AC_HELP_STRING([--enable-selinux], [enable SELinux support [default=auto]])],
288 [], [enable_selinux=auto])
fe4de9a6 289
f91d5e4e 290if test "x$enable_selinux" = xauto; then
fe4de9a6
DE
291 AC_CHECK_LIB([selinux],[setexeccon_raw],[enable_selinux=yes],[enable_selinux=no])
292fi
293AM_CONDITIONAL([ENABLE_SELINUX], [test "x$enable_selinux" = "xyes"])
294AM_COND_IF([ENABLE_SELINUX],
295 [AC_CHECK_HEADER([selinux/selinux.h],[],[AC_MSG_ERROR([You must install the SELinux development package in order to compile lxc])])
e9aeeade
DE
296 AC_CHECK_LIB([selinux], [setexeccon_raw],[true],[AC_MSG_ERROR([You must install the SELinux development package in order to compile lxc])])
297 AC_SUBST([SELINUX_LIBS], [-lselinux])])
fe4de9a6 298
8aa4885c 299# Seccomp syscall filter
e767dd55 300AC_ARG_ENABLE([seccomp],
f91d5e4e
SG
301 [AC_HELP_STRING([--enable-seccomp], [enable seccomp support [default=auto]])],
302 [], [enable_seccomp=auto])
e767dd55 303
f91d5e4e 304if test "x$enable_seccomp" = "xauto" ; then
e767dd55
SH
305 AC_CHECK_LIB([seccomp],[seccomp_init],[enable_seccomp=yes],[enable_seccomp=no])
306fi
e767dd55
SH
307AM_CONDITIONAL([ENABLE_SECCOMP], [test "x$enable_seccomp" = "xyes"])
308
8f2c3a70 309AM_COND_IF([ENABLE_SECCOMP],
12dcc892
JS
310 [PKG_CHECK_MODULES([SECCOMP],[libseccomp],[],[
311 AC_CHECK_HEADER([seccomp.h],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])])
312 AC_CHECK_LIB([seccomp], [seccomp_init],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])])
313 AC_SUBST([SECCOMP_LIBS], [-lseccomp])
314 ])
315 ])
8f2c3a70 316
c06ed219 317AC_MSG_CHECKING(for static libcap)
e78884c9
DE
318# Check for static libcap, make sure the function checked for differs from the
319# the one checked below so the cache doesn't give a wrong answer
320OLD_CFLAGS="$CFLAGS"
c06ed219
SH
321OLD_CPPFLAGS="$CPPFLAGS"
322OLD_LDFLAGS="$LDFLAGS"
323OLD_LIBS="$LIBS"
324CFLAGS=""
325CPPFLAGS=""
326LDFLAGS="-static"
327LIBS="-lcap"
328AC_LINK_IFELSE([
329 AC_LANG_SOURCE(
330 [[int main() { return 0; }]]
331 )],[have_static_libcap=yes],[have_static_libcap=no])
e78884c9
DE
332AM_CONDITIONAL([HAVE_STATIC_LIBCAP], [test "x$have_static_libcap" = "xyes"])
333if test "x$have_static_libcap" = "xyes"; then
334 AC_DEFINE([HAVE_STATIC_LIBCAP], 1, [Have static libcap])
c06ed219
SH
335 AC_MSG_RESULT([yes])
336else
337 AC_MSG_RESULT([no])
e78884c9 338fi
c06ed219 339CPPFLAGS="$OLD_CPPFLAGS"
e78884c9 340CFLAGS="$OLD_CFLAGS"
c06ed219
SH
341LDFLAGS="$OLD_LDFLAGS"
342LIBS="$OLD_LIBS"
e78884c9
DE
343
344
f91d5e4e
SG
345# Linux capabilities
346AC_ARG_ENABLE([capabilities],
347 [AC_HELP_STRING([--enable-capabilities], [enable kernel capabilities support [default=auto]])],
348 [], [enable_capabilities=auto])
349
350if test "x$enable_capabilities" = "xauto"; then
351 AC_CHECK_LIB([cap],[cap_set_proc],[enable_capabilities=yes],[enable_capabilities=no])
352fi
353AM_CONDITIONAL([ENABLE_CAP], [test "x$enable_capabilities" = "xyes"])
354
355AM_COND_IF([ENABLE_CAP],
e37dda71
FF
356 [AC_CHECK_HEADER([sys/capability.h],[],[AC_MSG_ERROR([You must install the libcap development package in order to compile lxc])])
357 AC_CHECK_LIB(cap,cap_set_proc,[],[AC_MSG_ERROR([You must install the libcap development package in order to compile lxc])])
69924fff
CB
358 # Test whether we support getting file capabilities via cap_get_file().
359 AC_CHECK_LIB(cap,cap_get_file, AC_DEFINE(LIBCAP_SUPPORTS_FILE_CAPABILITIES,1,[Have cap_get_file]),[],[])
360 AC_SUBST([CAP_LIBS], [-lcap])])
f91d5e4e 361
769872f9 362# HAVE_SCMP_FILTER_CTX=1 will tell us we have libseccomp api >= 1.0.0
12dcc892
JS
363OLD_CFLAGS="$CFLAGS"
364CFLAGS="$CFLAGS $SECCOMP_CFLAGS"
f91d5e4e 365AC_CHECK_TYPES([scmp_filter_ctx], [], [], [[#include <seccomp.h>]])
2b0ae718 366AC_CHECK_DECLS([seccomp_syscall_resolve_name_arch], [], [], [[#include <seccomp.h>]])
12dcc892 367CFLAGS="$OLD_CFLAGS"
769872f9 368
8aa4885c 369# Configuration examples
3fb0a9bb 370AC_ARG_ENABLE([examples],
f91d5e4e 371 [AC_HELP_STRING([--enable-examples], [install examples [default=yes]])],
3fb0a9bb 372 [], [enable_examples=yes])
3fb0a9bb
AN
373AM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" = "xyes"])
374
052616eb
ÇO
375# Enable dumping stack traces
376AC_ARG_ENABLE([mutex-debugging],
f91d5e4e
SG
377 [AC_HELP_STRING([--enable-mutex-debugging], [Makes mutexes to report error and provide stack trace [default=no]])],
378 [], [enable_mutex_debugging=no])
052616eb
ÇO
379AM_CONDITIONAL([MUTEX_DEBUGGING], [test "x$enable_mutex_debugging" = "xyes"])
380
381AM_COND_IF([MUTEX_DEBUGGING],
382 AC_DEFINE_UNQUOTED([MUTEX_DEBUGGING], 1, [Enabling mutex debugging]))
383
3a1675bf
DE
384# Not in older autoconf versions
385# AS_VAR_COPY(DEST, SOURCE)
386# -------------------------
387# Set the polymorphic shell variable DEST to the contents of the polymorphic
388# shell variable SOURCE.
389m4_ifdef([AS_VAR_COPY], [],
390[AC_DEFUN([AS_VAR_COPY],
391 [AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])])
392])
393
12e93188
NC
394dnl PKG_CHECK_VAR was introduced with pkg-config 0.28
395m4_ifdef([PKG_CHECK_VAR], [],
396[AC_DEFUN([PKG_CHECK_VAR],
397 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
398 AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
399 _PKG_CONFIG([$1], [variable="][$3]["], [$2])
400 AS_VAR_COPY([$1], [pkg_cv_][$1])
401 AS_VAR_IF([$1], [""], [$5], [$4])dnl
402 ])# PKG_CHECK_VAR
403])
f080ffd7 404
0306de4f
SG
405# Optional bash integration
406AC_ARG_ENABLE([bash],
407 [AC_HELP_STRING([--enable-bash], [build bash integration [default=yes]])],
408 [], [enable_bash=yes])
409AM_CONDITIONAL([ENABLE_BASH], [test "x$enable_bash" = "xyes"])
410
23f4c8a0
EG
411AM_COND_IF([ENABLE_BASH],
412 [AC_MSG_CHECKING([bash completion directory])
413 PKG_CHECK_VAR(bashcompdir, [bash-completion], [completionsdir], ,
414 bashcompdir="${sysconfdir}/bash_completion.d")
415 AC_MSG_RESULT([$bashcompdir])
416 AC_SUBST(bashcompdir)
417 ])
418
8d060937
CB
419# Build the command line tools
420AC_ARG_ENABLE([tools],
421 [AC_HELP_STRING([--enable-tools], [build the command line tools [default=yes]])],
422 [], [enable_tools=yes])
423AM_CONDITIONAL([ENABLE_TOOLS], [test "x$enable_tools" = "xyes"])
424
425# Build the liblxc commands
426AC_ARG_ENABLE([commands],
427 [AC_HELP_STRING([--enable-commands], [build the liblxc commands [default=yes]])],
428 [], [enable_commands=yes])
429AM_CONDITIONAL([ENABLE_COMMANDS], [test "x$enable_commands" = "xyes"])
430
565c4427
CB
431# Build with ASAN commands
432AC_ARG_ENABLE([asan],
433 [AC_HELP_STRING([--enable-asan], [build with address sanitizer enabled [default=no]])],
434 [], [enable_asan=no])
435AM_CONDITIONAL([ENABLE_ASAN], [test "x$enable_asan" = "xyes"])
436
8aa4885c 437# Optional test binaries
525421c9 438AC_ARG_ENABLE([tests],
f91d5e4e
SG
439 [AC_HELP_STRING([--enable-tests], [build test/example binaries [default=no]])],
440 [], [enable_tests=no])
525421c9
SG
441AM_CONDITIONAL([ENABLE_TESTS], [test "x$enable_tests" = "xyes"])
442
061ba5d0
SG
443# Allow overriding the default runtime dir (/run)
444AC_ARG_WITH([runtime-path],
445 [AC_HELP_STRING(
446 [--with-runtime-path=dir],
447 [runtime directory (default: /run)]
448 )], [], [with_runtime_path=['/run']])
449
8aa4885c 450# LXC container path, where the containers are actually stored
fbf5de31 451# This is overridden by an entry in the file called LXCCONF
2a59a681 452# (i.e. /etc/lxc/lxc.conf)
aef4ebcf
AN
453AC_ARG_WITH([config-path],
454 [AC_HELP_STRING(
455 [--with-config-path=dir],
e892973e 456 [lxc configuration repository path]
1c41ddcb 457 )], [], [with_config_path=['${localstatedir}/lib/lxc']])
aef4ebcf 458
2a59a681
SH
459# The path of the global lxc configuration file.
460AC_ARG_WITH([global-conf],
461 [AC_HELP_STRING(
462 [--with-global-conf=dir],
463 [global lxc configuration file]
464 )], [], [with_global_conf=['${sysconfdir}/lxc/lxc.conf']])
465
c75c30ec 466# The path of the userns network configuration file
070a4b8e
SH
467AC_ARG_WITH([usernic-conf],
468 [AC_HELP_STRING(
469 [--with-usernic-conf],
470 [user network interface configuration file]
471 )], [], [with_usernic_conf=['${sysconfdir}/lxc/lxc-usernet']])
472
c75c30ec 473# The path of the runtime usernic database
070a4b8e
SH
474AC_ARG_WITH([usernic-db],
475 [AC_HELP_STRING(
476 [--with-usernic-db],
477 [lxc user nic database]
5a15791e 478 )], [], [with_usernic_db=['${with_runtime_path}/lxc/nics']])
070a4b8e 479
8aa4885c 480# Rootfs path, where the container mount structure is assembled
196db713
DL
481AC_ARG_WITH([rootfs-path],
482 [AC_HELP_STRING(
483 [--with-rootfs-path=dir],
484 [lxc rootfs mount point]
1c41ddcb 485 )], [], [with_rootfs_path=['${libdir}/lxc/rootfs']])
c75c30ec 486
6e16552d
CS
487# cgroup pattern specification
488AC_ARG_WITH([cgroup-pattern],
489 [AC_HELP_STRING(
490 [--with-cgroup-pattern=pattern],
491 [pattern for container cgroups]
292b3910 492 )], [], [with_cgroup_pattern=['lxc.payload/%n']])
196db713 493
1800f924
WB
494# The path for the apparmor_parser's cache for generated apparmor profiles
495AC_ARG_WITH([apparmor-cache-dir],
496 [AC_HELP_STRING(
497 [--with-apparmor-cache-dir=dir],
498 [path for apparmor_parser cache]
499 )], [], [with_apparmor_cache_dir=['${localstatedir}/cache/lxc/apparmor']])
500
5e1e7aaf
SH
501# Container log path. By default, use $lxcpath.
502AC_MSG_CHECKING([Whether to place logfiles in container config path])
503AC_ARG_ENABLE([configpath-log],
f91d5e4e
SG
504 [AC_HELP_STRING([--enable-configpath-log], [use logfiles in config path [default=no]])],
505 [], [enable_configpath_log=no])
506AC_MSG_RESULT([$enable_configpath_log])
507AM_CONDITIONAL([USE_CONFIGPATH_LOGS], [test "$enable_configpath_log" = "yes"])
5e1e7aaf 508
f91d5e4e 509if test "$enable_configpath_log" = "yes"; then
5e1e7aaf
SH
510 default_log_path="${with_config_path}"
511else
89d556d8 512 default_log_path="${localstatedir}/log/lxc"
5e1e7aaf
SH
513fi
514
515AC_ARG_WITH([log-path],
516 [AC_HELP_STRING(
517 [--with-log-path=dir],
518 [per container log path]
519 )], [], [with_log_path=['${default_log_path}']])
520
8aa4885c
SG
521# Expand some useful variables
522AS_AC_EXPAND(PREFIX, "$prefix")
523AS_AC_EXPAND(LIBDIR, "$libdir")
524AS_AC_EXPAND(BINDIR, "$bindir")
718e4f48 525AS_AC_EXPAND(SBINDIR, "$sbindir")
8aa4885c
SG
526AS_AC_EXPAND(LIBEXECDIR, "$libexecdir")
527AS_AC_EXPAND(INCLUDEDIR, "$includedir")
528AS_AC_EXPAND(SYSCONFDIR, "$sysconfdir")
0a18b545 529AS_AC_EXPAND(LXC_DEFAULT_CONFIG, "$sysconfdir/lxc/default.conf")
8aa4885c
SG
530AS_AC_EXPAND(DATADIR, "$datadir")
531AS_AC_EXPAND(LOCALSTATEDIR, "$localstatedir")
532AS_AC_EXPAND(DOCDIR, "$docdir")
8d256e4d 533AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date --utc --date=@${SOURCE_DATE_EPOCH:-$(date +%s)} '+%Y-%m-%d')")
8aa4885c 534AS_AC_EXPAND(LXCPATH, "$with_config_path")
2a59a681 535AS_AC_EXPAND(LXC_GLOBAL_CONF, "$with_global_conf")
070a4b8e
SH
536AS_AC_EXPAND(LXC_USERNIC_CONF, "$with_usernic_conf")
537AS_AC_EXPAND(LXC_USERNIC_DB, "$with_usernic_db")
0af99319 538AS_AC_EXPAND(LXC_DISTRO_SYSCONF, "$distrosysconf")
8aa4885c
SG
539AS_AC_EXPAND(LXCROOTFSMOUNT, "$with_rootfs_path")
540AS_AC_EXPAND(LXCTEMPLATEDIR, "$datadir/lxc/templates")
f2a95ee1 541AS_AC_EXPAND(LXCTEMPLATECONFIG, "$datadir/lxc/config")
906f8c4d 542AS_AC_EXPAND(LXCHOOKDIR, "$datadir/lxc/hooks")
16d08ae7 543AS_AC_EXPAND(LXCBINHOOKDIR, "$libexecdir/lxc/hooks")
8aa4885c 544AS_AC_EXPAND(LXCINITDIR, "$libexecdir")
5e1e7aaf 545AS_AC_EXPAND(LOGPATH, "$with_log_path")
061ba5d0 546AS_AC_EXPAND(RUNTIME_PATH, "$with_runtime_path")
1800f924 547AS_AC_EXPAND(APPARMOR_CACHE_DIR, "$with_apparmor_cache_dir")
6e16552d 548AC_SUBST(DEFAULT_CGROUP_PATTERN, ["$with_cgroup_pattern"])
881450bb 549
0080bebf
TA
550# We need the install path so criu knows where to reference the hook scripts.
551AC_DEFINE_UNQUOTED([DATADIR], "$DATADIR", ["Prefix for shared files."])
552
8aa4885c 553# Check for some standard kernel headers
910bb4fa 554AC_CHECK_HEADERS([linux/unistd.h linux/netlink.h linux/genetlink.h],
8aa4885c
SG
555 [],
556 AC_MSG_ERROR([Please install the Linux kernel headers.]),
557 [#include <sys/socket.h>])
35f549fe 558
a6168a17
SG
559# Check for alternate C libraries
560AC_MSG_CHECKING(for bionic libc)
561AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
8aa4885c 562 [[#ifndef __ANDROID__
a6168a17
SG
563error: Not bionic!
564#endif]])],
8aa4885c
SG
565 [is_bionic=yes],
566 [is_bionic=no])
a6168a17 567if test "x$is_bionic" = "xyes"; then
8aa4885c
SG
568 AC_DEFINE([IS_BIONIC], 1, [bionic libc])
569 AC_MSG_RESULT([yes])
a6168a17 570else
8aa4885c 571 AC_MSG_RESULT([no])
a6168a17
SG
572fi
573AM_CONDITIONAL([IS_BIONIC], [test "x$is_bionic" = "xyes"])
574
f7a8609f
CB
575# Configuration examples
576AC_ARG_ENABLE([pam],
577 [AC_HELP_STRING([--enable-pam], [enable pam module [default=no]])],
578 [], [enable_pam=no])
579AM_CONDITIONAL([ENABLE_PAM], [test "x$enable_pam" = "xyes"])
580
581AM_COND_IF([ENABLE_PAM],
582 [AC_ARG_WITH(
583 [pamdir],
584 [AS_HELP_STRING([--with-pamdir=PATH],[Specify the directory where PAM modules are stored,
585 or "none" if PAM modules are not to be built])],
586 [pamdir="${withval}"],
587 [
588 if test "${prefix}" = "/usr"; then
589 pamdir="/lib${libdir##*/lib}/security"
590 else
591 pamdir="\$(libdir)/security"
592 fi
593 ]
594 )])
7ac43d3d
CB
595
596AM_CONDITIONAL([HAVE_PAM], [test x"$pamdir" != "xnone"])
f7a8609f
CB
597AM_COND_IF([ENABLE_PAM],
598 [if test "z$pamdir" != "znone"; then
599 AC_ARG_VAR([PAM_CFLAGS], [C compiler flags for pam])
600 AC_ARG_VAR([PAM_LIBS], [linker flags for pam])
601 AC_CHECK_LIB(
602 [pam],
603 [pam_authenticate],
604 [PAM_LIBS="-lpam"],
605 [AC_MSG_ERROR([*** libpam not found.])
606 ])
607
608 AC_SUBST(PAM_LIBS)
609 AC_SUBST([pamdir])
610 fi])
7ac43d3d 611
656994bb
MH
612# Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP
613AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
614
955e2a02
CB
615# Some systems lack PR_{G,S}ET_NO_NEW_PRIVS definition => HAVE_DECL_PR_{G,S}ET_NO_NEW_PRIVS
616AC_CHECK_DECLS([PR_SET_NO_NEW_PRIVS], [], [], [#include <sys/prctl.h>])
617AC_CHECK_DECLS([PR_GET_NO_NEW_PRIVS], [], [], [#include <sys/prctl.h>])
618
e827ff7e 619# Check for some headers
8bc781b4 620AC_CHECK_HEADERS([pty.h sys/memfd.h sys/personality.h sys/resource.h sys/signalfd.h sys/timerfd.h utmpx.h])
d029e1de
CB
621
622AC_CHECK_HEADER([ifaddrs.h],
623 AM_CONDITIONAL(HAVE_IFADDRS_H, true)
624 AC_DEFINE(HAVE_IFADDRS_H, 1, [Have ifaddrs.h]),
625 AM_CONDITIONAL(HAVE_IFADDRS_H, false))
ff218c25 626
af6824fc
ST
627# lookup major()/minor()/makedev()
628AC_HEADER_MAJOR
629
2d76d1d7 630# Check for some syscalls functions
413c294f 631AC_CHECK_FUNCS([setns pivot_root sethostname unshare rand_r confstr faccessat gettid memfd_create])
2d76d1d7 632
607e3fca
CB
633# Check for strerror_r() support. Defines:
634# - HAVE_STRERROR_R if available
635# - HAVE_DECL_STRERROR_R if defined
636# - STRERROR_R_CHAR_P if it returns char *
637AC_FUNC_STRERROR_R
638
e827ff7e 639# Check for some functions
babbea4b 640AC_CHECK_LIB(pthread, main)
614305f3 641AC_CHECK_FUNCS(statvfs)
740ee8c7 642AC_CHECK_LIB(util, openpty)
8b6d8b71 643AC_CHECK_FUNCS([openpty hasmntopt setmntent endmntent utmpxname])
477e62b6
CB
644AC_CHECK_FUNCS([getgrgid_r],
645 AM_CONDITIONAL(HAVE_GETGRGID_R, true)
646 AC_DEFINE(HAVE_GETGRGID_R,1,[Have getgrgid_r]),
647 AM_CONDITIONAL(HAVE_GETGRGID_R, false))
1ba0013f
SG
648AC_CHECK_FUNCS([getline],
649 AM_CONDITIONAL(HAVE_GETLINE, true)
650 AC_DEFINE(HAVE_GETLINE,1,[Have getline]),
651 AM_CONDITIONAL(HAVE_GETLINE, false))
9dbcd668
SG
652AC_CHECK_FUNCS([getsubopt],
653 AM_CONDITIONAL(HAVE_GETSUBOPT, true)
654 AC_DEFINE(HAVE_GETSUBOPT,1,[Have getsubopt]),
655 AM_CONDITIONAL(HAVE_GETSUBOPT, false))
1ba0013f
SG
656AC_CHECK_FUNCS([fgetln],
657 AM_CONDITIONAL(HAVE_FGETLN, true)
658 AC_DEFINE(HAVE_FGETLN,1,[Have fgetln]),
659 AM_CONDITIONAL(HAVE_FGETLN, false))
b25291da
CB
660AC_CHECK_FUNCS([keyctl],
661 AM_CONDITIONAL(HAVE_KEYCTL, true)
662 AC_DEFINE(HAVE_KEYCTL,1,[Have keyctl]),
663 AM_CONDITIONAL(HAVE_KEYCTL, false))
a04f5407
CB
664AC_CHECK_FUNCS([prlimit],
665 AM_CONDITIONAL(HAVE_PRLIMIT, true)
666 AC_DEFINE(HAVE_PRLIMIT,1,[Have prlimit]),
667 AM_CONDITIONAL(HAVE_PRLIMIT, false))
f48b5fd8
FF
668AC_CHECK_FUNCS([prlimit64],
669 AM_CONDITIONAL(HAVE_PRLIMIT64, true)
670 AC_DEFINE(HAVE_PRLIMIT64,1,[Have prlimit64]),
671 AM_CONDITIONAL(HAVE_PRLIMIT64, false))
477e62b6
CB
672AC_CHECK_FUNCS([pthread_setcancelstate],
673 AM_CONDITIONAL(HAVE_PTHREAD_SETCANCELSTATE, true)
674 AC_DEFINE(HAVE_PTHREAD_SETCANCELSTATE,1,[Have pthread_setcancelstate]),
675 AM_CONDITIONAL(HAVE_PTHREAD_SETCANCELSTATE, false))
91c272a5
CB
676AC_CHECK_FUNCS([strlcpy],
677 AM_CONDITIONAL(HAVE_STRLCPY, true)
678 AC_DEFINE(HAVE_STRLCPY,1,[Have strlcpy]),
679 AM_CONDITIONAL(HAVE_STRLCPY, false))
9a5e7ac4
CB
680AC_CHECK_FUNCS([strlcat],
681 AM_CONDITIONAL(HAVE_STRLCAT, true)
682 AC_DEFINE(HAVE_STRLCAT,1,[Have strlcat]),
683 AM_CONDITIONAL(HAVE_STRLCAT, false))
1ba0013f 684
da5efb6f
CB
685# HAVE_STRUCT_RTNL_LINK_STATS64={0,1}
686AC_CHECK_TYPES([struct rtnl_link_stats64], [], [], [[#include <linux/if_link.h>]])
687
c9a84173 688# Check for some libraries
a81c46e9 689AX_PTHREAD
336d5469 690AC_SEARCH_LIBS(clock_gettime, [rt])
c9a84173 691
8aa4885c 692# Check for some standard binaries
5e97c3fc 693AC_PROG_GCC_TRADITIONAL
95a717e9 694AC_PROG_SED
5e97c3fc 695
babbea4b
ÇO
696# See if we support thread-local storage.
697LXC_CHECK_TLS
698
fb3b3ef4 699# Hardening flags
cf0fd972 700AX_CHECK_COMPILE_FLAG([-fdiagnostics-color], [CFLAGS="$CFLAGS -fdiagnostics-color"],,[-Werror])
55733496 701AX_CHECK_COMPILE_FLAG([-Wimplicit-fallthrough=5], [CFLAGS="$CFLAGS -Wimplicit-fallthrough=5"],,[-Werror])
6ce39620 702AX_CHECK_COMPILE_FLAG([-Wcast-align], [CFLAGS="$CFLAGS -Wcast-align"],,[-Werror])
246736be 703AX_CHECK_COMPILE_FLAG([-Wstrict-prototypes], [CFLAGS="$CFLAGS -Wstrict-prototypes"],,[-Werror])
a3bb6b8e 704AX_CHECK_COMPILE_FLAG([-fno-strict-aliasing], [CFLAGS="$CFLAGS -fno-strict-aliasing"],,[-Werror])
2268c277 705AX_CHECK_COMPILE_FLAG([-fstack-clash-protection], [CFLAGS="$CFLAGS -fstack-clash-protection"],,[-Werror])
3b5a0eeb
CB
706AX_CHECK_COMPILE_FLAG([-fstack-protector-strong], [CFLAGS="$CFLAGS -fstack-protector-strong"],,[-Werror])
707AX_CHECK_COMPILE_FLAG([--param=ssp-buffer-size=4], [CFLAGS="$CFLAGS --param=ssp-buffer-size=4"],,[-Werror])
2268c277
CB
708AX_CHECK_COMPILE_FLAG([-g], [CFLAGS="$CFLAGS -g"],,[-Werror])
709AX_CHECK_COMPILE_FLAG([--mcet -fcf-protection], [CFLAGS="$CFLAGS --mcet -fcf-protection"],,[-Werror])
710AX_CHECK_COMPILE_FLAG([-Werror=implicit-function-declaration], [CFLAGS="$CFLAGS -Werror=implicit-function-declaration"],,[-Werror])
fb3b3ef4 711AX_CHECK_COMPILE_FLAG([-Wlogical-op], [CFLAGS="$CFLAGS -Wlogical-op"],,[-Werror])
cc0c3a06 712AX_CHECK_COMPILE_FLAG([-Wmissing-include-dirs], [CFLAGS="$CFLAGS -Wmissing-include-dirs"],,[-Werror])
11af5f2b 713AX_CHECK_COMPILE_FLAG([-Wold-style-definition], [CFLAGS="$CFLAGS -Wold-style-definition"],,[-Werror])
f03f7b5c 714AX_CHECK_COMPILE_FLAG([-Winit-self], [CFLAGS="$CFLAGS -Winit-self"],,[-Werror])
30462b91 715AX_CHECK_COMPILE_FLAG([-Wfloat-equal], [CFLAGS="$CFLAGS -Wfloat-equal"],,[-Werror])
e3b4674d 716AX_CHECK_COMPILE_FLAG([-Wsuggest-attribute=noreturn], [CFLAGS="$CFLAGS -Wsuggest-attribute=noreturn"],,[-Werror])
13311d70 717AX_CHECK_COMPILE_FLAG([-Werror=return-type], [CFLAGS="$CFLAGS -Werror=return-type"],,[-Werror])
42a2ab35 718AX_CHECK_COMPILE_FLAG([-Werror=incompatible-pointer-types], [CFLAGS="$CFLAGS -Werror=incompatible-pointer-types"],,[-Werror])
d07545c7
CB
719AX_CHECK_COMPILE_FLAG([-Wformat=2], [CFLAGS="$CFLAGS -Wformat=2"],,[-Werror])
720AX_CHECK_COMPILE_FLAG([-Wshadow], [CFLAGS="$CFLAGS -Wshadow"],,[-Werror])
4ccb8878 721AX_CHECK_COMPILE_FLAG([-Wendif-labels], [CFLAGS="$CFLAGS -Wendif-labels"],,[-Werror])
a703da6c 722AX_CHECK_COMPILE_FLAG([-Werror=overflow], [CFLAGS="$CFLAGS -Werror=overflow"],,[-Werror])
64871d41 723AX_CHECK_COMPILE_FLAG([-fdiagnostics-show-option], [CFLAGS="$CFLAGS -fdiagnostics-show-option"],,[-Werror])
463bee7b 724AX_CHECK_COMPILE_FLAG([-Werror=shift-count-overflow], [CFLAGS="$CFLAGS -Werror=shift-count-overflow"],,[-Werror])
fcfce08a 725AX_CHECK_COMPILE_FLAG([-Werror=shift-overflow=2], [CFLAGS="$CFLAGS -Werror=shift-overflow=2"],,[-Werror])
a30c52ac 726AX_CHECK_COMPILE_FLAG([-Wdate-time], [CFLAGS="$CFLAGS -Wdate-time"],,[-Werror])
d0afbad9 727AX_CHECK_COMPILE_FLAG([-Wnested-externs], [CFLAGS="$CFLAGS -Wnested-externs"],,[-Werror])
c9248f71 728AX_CHECK_COMPILE_FLAG([-fasynchronous-unwind-tables], [CFLAGS="$CFLAGS -fasynchronous-unwind-tables"],,[-Werror])
a40093c6 729AX_CHECK_COMPILE_FLAG([-pipe], [CFLAGS="$CFLAGS -pipe"],,[-Werror])
e74d1fd9 730AX_CHECK_COMPILE_FLAG([-fexceptions], [CFLAGS="$CFLAGS -fexceptions"],,[-Werror])
cf0fd972 731
e6fe24e1
CB
732AX_CHECK_LINK_FLAG([-z relro], [LDLAGS="$LDLAGS -z relro"],,[])
733AX_CHECK_LINK_FLAG([-z now], [LDLAGS="$LDLAGS -z now"],,[])
734
218e8144 735CFLAGS="$CFLAGS -Wvla -std=gnu11"
81a56e80 736if test "x$enable_werror" = "xyes"; then
218e8144 737 CFLAGS="$CFLAGS -Werror"
5e97c3fc 738fi
739
81c76cff
CB
740AC_ARG_ENABLE([thread-safety],
741 [AC_HELP_STRING([--enable-thread-safety], [enforce thread-safety otherwise fail the build [default=yes]])],
742 [], [enable_thread_safety=yes])
743AM_CONDITIONAL([ENFORCE_THREAD_SAFETY], [test "x$enable_thread_safety" = "xyes"])
744
5c7bfc02 745AC_ARG_ENABLE([dlog],
746 [AC_HELP_STRING([--enable-dlog], [enable dlog support [default=no]])],
747 [], [enable_dlog=no])
748AM_CONDITIONAL([ENABLE_DLOG], [test "x$enable_dlog" = "xyes"])
749
750AM_COND_IF([ENABLE_DLOG],
751 [PKG_CHECK_MODULES([DLOG],[dlog],[],[
752 AC_CHECK_HEADER([dlog.h],[],[AC_MSG_ERROR([You must install the dlog development package in order to compile lxc])])
753 AC_CHECK_LIB([dlog], [dlog_print],[],[AC_MSG_ERROR([You must install the dlog development package in order to compile lxc])])
754 AC_SUBST([DLOG_LIBS], [-ldlog])
755 ])
756 ])
757
6400238d
CB
758AC_ARG_ENABLE([memfd-rexec],
759 [AC_HELP_STRING([--enable-memfd-rexec], [enforce liblxc as a memfd to protect against certain symlink attacks [default=yes]])],
760 [], [enable_memfd_rexec=yes])
761AM_CONDITIONAL([ENFORCE_MEMFD_REXEC], [test "x$enable_memfd_rexec" = "xyes"])
762if test "x$enable_memfd_rexec" = "xyes"; then
763 AC_DEFINE([ENFORCE_MEMFD_REXEC], 1, [Rexec liblxc as memfd])
764 AC_MSG_RESULT([yes])
765else
766 AC_MSG_RESULT([no])
767fi
768
8aa4885c 769# Files requiring some variable expansion
5e97c3fc 770AC_CONFIG_FILES([
288063bd 771 Makefile
b6345ba1 772 lxc.pc
5e97c3fc 773 lxc.spec
f2a95ee1 774
288063bd 775 config/Makefile
8da250da 776 config/apparmor/Makefile
b19c5d12 777 config/apparmor/abstractions/start-container
719fae07 778 config/selinux/Makefile
0306de4f
SG
779 config/bash/Makefile
780 config/bash/lxc
dc068290 781 config/init/Makefile
0af99319
MW
782 config/init/common/Makefile
783 config/init/common/lxc-containers
784 config/init/common/lxc-net
dc068290 785 config/init/systemd/Makefile
015f0dd7 786 config/init/systemd/lxc.service
de2b7e65 787 config/init/systemd/lxc@.service
65b27d84 788 config/init/systemd/lxc-net.service
0af99319
MW
789 config/init/sysvinit/Makefile
790 config/init/sysvinit/lxc-containers
791 config/init/sysvinit/lxc-net
a8c71063 792 config/init/upstart/lxc.conf
0af99319 793 config/init/upstart/lxc-net.conf
dc068290 794 config/init/upstart/Makefile
f2a95ee1
SG
795 config/etc/Makefile
796 config/templates/Makefile
5b99af00 797 config/templates/common.conf
4662c6de 798 config/templates/common.conf.d/Makefile
108b88ce 799 config/templates/nesting.conf
1689c7cf 800 config/templates/oci.common.conf
5b99af00 801 config/templates/userns.conf
7ceebfd1 802 config/yum/Makefile
0af99319
MW
803 config/sysconfig/Makefile
804 config/sysconfig/lxc
d823d5b9 805
288063bd 806 doc/Makefile
953e611c 807 doc/api/Makefile
4019712d 808 doc/lxc-attach.sgml
a6adab20 809 doc/lxc-autostart.sgml
4019712d
SG
810 doc/lxc-cgroup.sgml
811 doc/lxc-checkconfig.sgml
735f2c6e 812 doc/lxc-checkpoint.sgml
ff5e2751 813 doc/lxc-config.sgml
4019712d 814 doc/lxc-console.sgml
2b47bac3 815 doc/lxc-copy.sgml
d823d5b9 816 doc/lxc-create.sgml
817 doc/lxc-destroy.sgml
4019712d 818 doc/lxc-device.sgml
d823d5b9 819 doc/lxc-execute.sgml
d823d5b9 820 doc/lxc-freeze.sgml
4019712d 821 doc/lxc-info.sgml
d823d5b9 822 doc/lxc-ls.sgml
4019712d 823 doc/lxc-monitor.sgml
813a4837 824 doc/lxc-snapshot.sgml
4019712d
SG
825 doc/lxc-start.sgml
826 doc/lxc-stop.sgml
f080ffd7 827 doc/lxc-top.sgml
4019712d
SG
828 doc/lxc-unfreeze.sgml
829 doc/lxc-unshare.sgml
0a29a3ef 830 doc/lxc-update-config.sgml
df3415e0 831 doc/lxc-user-nic.sgml
adade80c 832 doc/lxc-usernsexec.sgml
4019712d
SG
833 doc/lxc-wait.sgml
834
8a67a2b2 835 doc/lxc.conf.sgml
55fc19a1
SG
836 doc/lxc.container.conf.sgml
837 doc/lxc.system.conf.sgml
df3415e0 838 doc/lxc-usernet.sgml
8b8b04f8 839 doc/lxc.sgml
10fba81b 840 doc/common_options.sgml
99e4008c 841 doc/see_also.sgml
d823d5b9 842
baf6671f
DL
843 doc/rootfs/Makefile
844
0f71d073
DL
845 doc/examples/Makefile
846 doc/examples/lxc-macvlan.conf
26c39028 847 doc/examples/lxc-vlan.conf
0f71d073
DL
848 doc/examples/lxc-no-netns.conf
849 doc/examples/lxc-empty-netns.conf
850 doc/examples/lxc-phys.conf
851 doc/examples/lxc-veth.conf
c553a9c2 852 doc/examples/lxc-complex.conf
0f71d073 853
57da8c32 854 doc/ja/Makefile
57da8c32 855 doc/ja/lxc-attach.sgml
28f2ab26 856 doc/ja/lxc-autostart.sgml
57da8c32
KY
857 doc/ja/lxc-cgroup.sgml
858 doc/ja/lxc-checkconfig.sgml
b0e26ca7 859 doc/ja/lxc-checkpoint.sgml
3220eceb 860 doc/ja/lxc-config.sgml
57da8c32 861 doc/ja/lxc-console.sgml
842948e4 862 doc/ja/lxc-copy.sgml
57da8c32
KY
863 doc/ja/lxc-create.sgml
864 doc/ja/lxc-destroy.sgml
865 doc/ja/lxc-device.sgml
866 doc/ja/lxc-execute.sgml
867 doc/ja/lxc-freeze.sgml
868 doc/ja/lxc-info.sgml
57da8c32
KY
869 doc/ja/lxc-ls.sgml
870 doc/ja/lxc-monitor.sgml
ebe0aeb1 871 doc/ja/lxc-snapshot.sgml
57da8c32
KY
872 doc/ja/lxc-start.sgml
873 doc/ja/lxc-stop.sgml
874 doc/ja/lxc-top.sgml
875 doc/ja/lxc-unfreeze.sgml
876 doc/ja/lxc-unshare.sgml
607a8de5 877 doc/ja/lxc-update-config.sgml
07ece600 878 doc/ja/lxc-user-nic.sgml
755d8d03 879 doc/ja/lxc-usernsexec.sgml
57da8c32
KY
880 doc/ja/lxc-wait.sgml
881
882 doc/ja/lxc.conf.sgml
fb261f53
KY
883 doc/ja/lxc.container.conf.sgml
884 doc/ja/lxc.system.conf.sgml
07ece600 885 doc/ja/lxc-usernet.sgml
57da8c32
KY
886 doc/ja/lxc.sgml
887 doc/ja/common_options.sgml
888 doc/ja/see_also.sgml
889
2b371b26 890 doc/ko/Makefile
2b371b26
SY
891 doc/ko/lxc-attach.sgml
892 doc/ko/lxc-autostart.sgml
893 doc/ko/lxc-cgroup.sgml
894 doc/ko/lxc-checkconfig.sgml
895 doc/ko/lxc-checkpoint.sgml
2b371b26
SY
896 doc/ko/lxc-config.sgml
897 doc/ko/lxc-console.sgml
b035f792 898 doc/ko/lxc-copy.sgml
2b371b26
SY
899 doc/ko/lxc-create.sgml
900 doc/ko/lxc-destroy.sgml
901 doc/ko/lxc-device.sgml
902 doc/ko/lxc-execute.sgml
903 doc/ko/lxc-freeze.sgml
904 doc/ko/lxc-info.sgml
905 doc/ko/lxc-ls.sgml
906 doc/ko/lxc-monitor.sgml
907 doc/ko/lxc-snapshot.sgml
2b371b26
SY
908 doc/ko/lxc-start.sgml
909 doc/ko/lxc-stop.sgml
910 doc/ko/lxc-top.sgml
911 doc/ko/lxc-unfreeze.sgml
912 doc/ko/lxc-unshare.sgml
913 doc/ko/lxc-user-nic.sgml
914 doc/ko/lxc-usernsexec.sgml
915 doc/ko/lxc-wait.sgml
916
917 doc/ko/lxc.conf.sgml
918 doc/ko/lxc.container.conf.sgml
919 doc/ko/lxc.system.conf.sgml
920 doc/ko/lxc-usernet.sgml
921 doc/ko/lxc.sgml
922 doc/ko/common_options.sgml
923 doc/ko/see_also.sgml
924
906f8c4d 925 hooks/Makefile
84bf5645 926 hooks/dhclient
906f8c4d 927
c01d62f2 928 templates/Makefile
f8d0243a 929 templates/lxc-busybox
71d3a659 930 templates/lxc-download
35444f38 931 templates/lxc-local
0ef43a5c 932 templates/lxc-oci
c9844b87 933
288063bd 934 src/Makefile
5e97c3fc 935 src/lxc/Makefile
2a59a681 936 src/lxc/lxc.functions
48b1dc4c 937 src/lxc/cmd/lxc-checkconfig
6a342cab 938 src/lxc/cmd/lxc-update-config
a22185dd 939 src/lxc/version.h
be2e4e54 940
72d0e1cb 941 src/tests/Makefile
8cb8e496 942 src/tests/lxc-test-usernic
5e97c3fc 943])
944AC_CONFIG_COMMANDS([default],[[]],[[]])
945AC_OUTPUT
f91d5e4e
SG
946
947# Configuration overview
948cat << EOF
949
950----------------------------
8d060937
CB
951Binaries
952 - Command Line Tools:
953 - lxc-attach: $enable_tools
954 - lxc-autostart: $enable_tools
955 - lxc-cgroup: $enable_tools
956 - lxc-checkpoint: $enable_tools
957 - lxc-config: $enable_tools
958 - lxc-console: $enable_tools
959 - lxc-copy: $enable_tools
960 - lxc-create: $enable_tools
961 - lxc-destroy: $enable_tools
962 - lxc-device: $enable_tools
963 - lxc-execute: $enable_tools
964 - lxc-freeze: $enable_tools
965 - lxc-info: $enable_tools
966 - lxc-ls: $enable_tools
967 - lxc-monitor: $enable_tools
968 - lxc-snapshot: $enable_tools
969 - lxc-start: $enable_tools
970 - lxc-stop: $enable_tools
971 - lxc-top: $enable_tools
972 - lxc-unfreeze: $enable_tools
973 - lxc-unshare: $enable_tools
974 - lxc-wait: $enable_tools
975
976 - liblxc Commands:
977 - lxc-checkconfig: $enable_commands
978 - lxc-update-config: $enable_commands
979 - lxc-init: $enable_commands
980 - lxc-monitord: $enable_commands
981 - lxc-user-nic: $enable_commands
982 - lxc-usernsexec: $enable_commands
983
f91d5e4e
SG
984Environment:
985 - compiler: $CC
986 - distribution: $with_distro
89f79f6b 987 - init script type(s): $init_script
f91d5e4e 988 - rpath: $enable_rpath
d8d44659 989 - GnuTLS: $enable_gnutls
0306de4f 990 - Bash integration: $enable_bash
f91d5e4e
SG
991
992Security features:
993 - Apparmor: $enable_apparmor
994 - Linux capabilities: $enable_capabilities
995 - seccomp: $enable_seccomp
996 - SELinux: $enable_selinux
6400238d 997 - memfd rexec: $enable_memfd_rexec
f91d5e4e 998
7ac43d3d 999PAM:
f7a8609f 1000 - PAM module: $enable_pam
7ac43d3d
CB
1001 - cgroup PAM module: $pamdir
1002
f91d5e4e
SG
1003Documentation:
1004 - examples: $enable_examples
1005 - API documentation: $enable_api_docs
1006 - user documentation: $enable_doc
1007
1008Debugging:
1009 - tests: $enable_tests
565c4427 1010 - ASAN: $enable_asan
f91d5e4e
SG
1011 - mutex debugging: $enable_mutex_debugging
1012
1013Paths:
1014 - Logs in configpath: $enable_configpath_log
81c76cff
CB
1015
1016Thread-safety:
1017 - enforce: $enable_thread_safety
5c7bfc02 1018
1019Dlog:
1020 - enable: $enable_dlog
f91d5e4e 1021EOF