]> git.proxmox.com Git - mirror_lxc.git/blob - configure.ac
allow multiple types of init scripts to be configured
[mirror_lxc.git] / configure.ac
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], [beta1])
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 # Check for init system type
74 AC_MSG_CHECKING([for init system type])
75 AC_ARG_WITH([init-script],
76 [AC_HELP_STRING([--with-init-script@<:@=TYPE@<:@,TYPE,...@:>@@:>@],
77 [Type(s) of init script to install: sysv, systemd, upstart,
78 distro @<:@default=distro@:>@])],[],[with_init_script=distro])
79 case "$with_init_script" in
80 distro)
81 case $with_distro in
82 fedora)
83 init_script=systemd
84 ;;
85 redhat|centos|oracle|oracleserver)
86 init_script=sysv
87 ;;
88 debian)
89 init_script=sysv,upstart,systemd
90 ;;
91 ubuntu)
92 init_script=upstart
93 ;;
94 *)
95 echo -n "Linux distribution init system unknown, defaulting to sysv"
96 init_script=sysv
97 ;;
98 esac
99 ;;
100 *)
101 init_script=$with_init_script
102 ;;
103 esac
104
105 # Check valid init systems were given, run in subshell so we don't mess up IFS
106 (IFS="," ; for init_sys in $init_script;
107 do
108 case "$init_sys" in
109 none|sysv|systemd|upstart)
110 ;;
111 *)
112 exit 1
113 ;;
114 esac
115 done) || AC_MSG_ERROR([Unknown init system type in $init_script])
116
117 AM_CONDITIONAL([INIT_SCRIPT_SYSV], [echo "$init_script" |grep -q "sysv"])
118 AM_CONDITIONAL([INIT_SCRIPT_SYSTEMD], [echo "$init_script" |grep -q "systemd"])
119 AM_CONDITIONAL([INIT_SCRIPT_UPSTART], [echo "$init_script" |grep -q "upstart"])
120 AC_MSG_RESULT($init_script)
121
122 # Allow disabling rpath
123 AC_ARG_ENABLE([rpath],
124 [AC_HELP_STRING([--enable-rpath], [set rpath in executables [default=no]])],
125 [], [enable_rpath=no])
126 AM_CONDITIONAL([ENABLE_RPATH], [test "x$enable_rpath" = "xyes"])
127
128 # Documentation (manpages)
129 AC_ARG_ENABLE([doc],
130 [AC_HELP_STRING([--enable-doc], [make man pages [default=auto]])],
131 [], [enable_doc=auto])
132
133 if test "x$enable_doc" = "xyes" -o "x$enable_doc" = "xauto"; then
134 db2xman=""
135 dbparsers="docbook2x-man db2x_docbook2man docbook2man docbook-to-man"
136
137 AC_MSG_CHECKING(for docbook2x-man)
138 for name in ${dbparsers}; do
139 if "$name" --help >/dev/null 2>&1; then
140 db2xman="$name"
141 break;
142 fi
143 done
144
145 if test -n "${db2xman}"; then
146 AC_MSG_RESULT([${db2xman}])
147 enable_doc="yes"
148 else
149 AC_MSG_RESULT([no])
150 if test "x$enable_doc" = "xyes"; then
151 AC_MSG_ERROR([docbook2x-man is required, but could not be found])
152 fi
153 enable_doc="no"
154 fi
155
156 AC_SUBST(db2xman)
157 fi
158 AM_CONDITIONAL([ENABLE_DOCBOOK], [test "x$db2xman" != "x"])
159 AM_CONDITIONAL([USE_DOCBOOK2X], [test "x$db2xman" != "xdocbook2man"])
160
161 if test "x$db2xman" = "xdocbook2man"; then
162 docdtd="\"-//Davenport//DTD DocBook V3.0//EN\""
163 else
164 docdtd="\"-//OASIS//DTD DocBook XML\" \"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd\""
165 fi
166 AC_SUBST(docdtd)
167
168 # Documentation (API)
169 AC_ARG_ENABLE([api-docs],
170 [AC_HELP_STRING([--enable-api-docs],
171 [make API documentation [default=auto]])],
172 [], [enable_api_docs=auto])
173
174 if test "x$enable_api_docs" = "xyes" -o "x$enable_api_docs" = "xauto"; then
175 AC_CHECK_PROGS([HAVE_DOXYGEN],[doxygen])
176 AC_SUBST([HAVE_DOXYGEN])
177
178 if test "x$HAVE_DOXYGEN" != "x"; then
179 enable_api_docs="yes"
180 else
181 if test "x$enable_api_docs" = "xyes"; then
182 AC_MSG_ERROR([doxygen is required, but could not be found])
183 fi
184 enable_api_docs="no"
185 fi
186 fi
187
188 AM_CONDITIONAL([ENABLE_API_DOCS], [test "x$HAVE_DOXYGEN" != "x"])
189
190 # Apparmor
191 AC_ARG_ENABLE([apparmor],
192 [AC_HELP_STRING([--enable-apparmor], [enable apparmor support [default=auto]])],
193 [], [enable_apparmor=auto])
194
195 if test "$enable_apparmor" = "auto" ; then
196 AC_CHECK_LIB([apparmor],[aa_change_profile],[enable_apparmor=yes], [enable_apparmor=no])
197 fi
198 AM_CONDITIONAL([ENABLE_APPARMOR], [test "x$enable_apparmor" = "xyes"])
199
200 AC_CHECK_LIB([gnutls], [gnutls_hash_fast], [enable_gnutls=yes], [enable_gnutls=no])
201
202 AM_COND_IF([ENABLE_APPARMOR],
203 [AC_CHECK_HEADER([sys/apparmor.h],[],[AC_MSG_ERROR([You must install the AppArmor development package in order to compile lxc])])
204 AC_CHECK_LIB([apparmor], [aa_change_profile],[],[AC_MSG_ERROR([You must install the AppArmor development package in order to compile lxc])])
205 AC_SUBST([APPARMOR_LIBS], [-lapparmor])])
206
207 # SELinux
208 AC_ARG_ENABLE([selinux],
209 [AC_HELP_STRING([--enable-selinux], [enable SELinux support [default=auto]])],
210 [], [enable_selinux=auto])
211
212 if test "x$enable_selinux" = xauto; then
213 AC_CHECK_LIB([selinux],[setexeccon_raw],[enable_selinux=yes],[enable_selinux=no])
214 fi
215 AM_CONDITIONAL([ENABLE_SELINUX], [test "x$enable_selinux" = "xyes"])
216 AM_COND_IF([ENABLE_SELINUX],
217 [AC_CHECK_HEADER([selinux/selinux.h],[],[AC_MSG_ERROR([You must install the SELinux development package in order to compile lxc])])
218 AC_CHECK_LIB([selinux], [setexeccon_raw],[],[AC_MSG_ERROR([You must install the SELinux development package in order to compile lxc])])
219 AC_SUBST([SELINUX_LIBS])])
220
221 # Seccomp syscall filter
222 AC_ARG_ENABLE([seccomp],
223 [AC_HELP_STRING([--enable-seccomp], [enable seccomp support [default=auto]])],
224 [], [enable_seccomp=auto])
225
226 if test "x$enable_seccomp" = "xauto" ; then
227 AC_CHECK_LIB([seccomp],[seccomp_init],[enable_seccomp=yes],[enable_seccomp=no])
228 fi
229 AM_CONDITIONAL([ENABLE_SECCOMP], [test "x$enable_seccomp" = "xyes"])
230
231 AM_COND_IF([ENABLE_SECCOMP],
232 [AC_CHECK_HEADER([seccomp.h],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])])
233 AC_CHECK_LIB([seccomp], [seccomp_init],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])])
234 AC_SUBST([SECCOMP_LIBS], [-lseccomp])])
235
236 # Linux capabilities
237 AC_ARG_ENABLE([capabilities],
238 [AC_HELP_STRING([--enable-capabilities], [enable kernel capabilities support [default=auto]])],
239 [], [enable_capabilities=auto])
240
241 if test "x$enable_capabilities" = "xauto"; then
242 AC_CHECK_LIB([cap],[cap_set_proc],[enable_capabilities=yes],[enable_capabilities=no])
243 fi
244 AM_CONDITIONAL([ENABLE_CAP], [test "x$enable_capabilities" = "xyes"])
245
246 AM_COND_IF([ENABLE_CAP],
247 [AC_CHECK_LIB(cap,cap_set_proc,[],[AC_MSG_ERROR([You are missing libcap support.])])
248 AC_SUBST([CAP_LIBS], [-lcap])])
249
250 # HAVE_SCMP_FILTER_CTX=1 will tell us we have libseccomp api >= 1.0.0
251 AC_CHECK_TYPES([scmp_filter_ctx], [], [], [[#include <seccomp.h>]])
252
253 # Configuration examples
254 AC_ARG_ENABLE([examples],
255 [AC_HELP_STRING([--enable-examples], [install examples [default=yes]])],
256 [], [enable_examples=yes])
257 AM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" = "xyes"])
258
259 # We need pkg-config
260 PKG_PROG_PKG_CONFIG
261
262 # Python3 module and scripts
263 AC_ARG_ENABLE([python],
264 [AC_HELP_STRING([--enable-python], [enable python binding [default=auto]])],
265 [], [enable_python=auto])
266
267 if test "x$enable_python" = "xauto"; then
268 PKG_CHECK_MODULES([PYTHONDEV], [python3 >= 3.2],[enable_python=yes],[enable_python=no])
269 if test "$CC" = "clang"; then
270 enable_python=no
271 fi
272 fi
273
274 if test "x$enable_python" = "xyes" && test "$CC" = "clang"; then
275 AC_MSG_ERROR([Python3 is incompatible with the clang compiler])
276 fi
277
278 AM_CONDITIONAL([ENABLE_PYTHON], [test "x$enable_python" = "xyes"])
279
280 AM_COND_IF([ENABLE_PYTHON],
281 [AM_PATH_PYTHON([3.2], [], [AC_MSG_ERROR([You must install python3])])
282 PKG_CHECK_MODULES([PYTHONDEV], [python3 >= 3.2],[],[AC_MSG_ERROR([You must install python3-dev])])
283 AC_DEFINE_UNQUOTED([ENABLE_PYTHON], 1, [Python3 is available])])
284
285 # Enable dumping stack traces
286 AC_ARG_ENABLE([mutex-debugging],
287 [AC_HELP_STRING([--enable-mutex-debugging], [Makes mutexes to report error and provide stack trace [default=no]])],
288 [], [enable_mutex_debugging=no])
289 AM_CONDITIONAL([MUTEX_DEBUGGING], [test "x$enable_mutex_debugging" = "xyes"])
290
291 AM_COND_IF([MUTEX_DEBUGGING],
292 AC_DEFINE_UNQUOTED([MUTEX_DEBUGGING], 1, [Enabling mutex debugging]))
293
294 # Not in older autoconf versions
295 # AS_VAR_COPY(DEST, SOURCE)
296 # -------------------------
297 # Set the polymorphic shell variable DEST to the contents of the polymorphic
298 # shell variable SOURCE.
299 m4_ifdef([AS_VAR_COPY], [],
300 [AC_DEFUN([AS_VAR_COPY],
301 [AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])])
302 ])
303
304 dnl PKG_CHECK_VAR was introduced with pkg-config 0.28
305 m4_ifdef([PKG_CHECK_VAR], [],
306 [AC_DEFUN([PKG_CHECK_VAR],
307 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
308 AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
309 _PKG_CONFIG([$1], [variable="][$3]["], [$2])
310 AS_VAR_COPY([$1], [pkg_cv_][$1])
311 AS_VAR_IF([$1], [""], [$5], [$4])dnl
312 ])# PKG_CHECK_VAR
313 ])
314
315 # Lua module and scripts
316 AC_ARG_ENABLE([lua],
317 [AC_HELP_STRING([--enable-lua], [enable lua binding [default=auto]])],
318 [], [enable_lua=auto])
319
320 AC_ARG_WITH([lua-pc],
321 [AS_HELP_STRING(
322 [--with-lua-pc=PKG],
323 [Specify pkg-config package name for lua]
324 )], [], [with_lua_pc=no])
325
326 if test "x$enable_lua" = "xyes" -a "x$with_lua_pc" != "xno"; then
327 # exit with error if not found
328 PKG_CHECK_MODULES([LUA], [$with_lua_pc], [LUAPKGCONFIG=$with_lua_pc])
329 fi
330
331 if test "x$enable_lua" = "xauto" -a "x$with_lua_pc" != "xno"; then
332 PKG_CHECK_MODULES([LUA], [$with_lua_pc],
333 [LUAPKGCONFIG=$with_lua_pc
334 enable_lua=yes],
335 [enable_lua=no])
336 fi
337
338 if test "x$enable_lua" != "xno"; then
339 PKG_CHECK_MODULES([LUA], [lua], [LUAPKGCONFIG=lua],
340 [PKG_CHECK_MODULES([LUA], [lua5.2], [LUAPKGCONFIG=lua5.2],
341 [PKG_CHECK_MODULES([LUA], [lua5.1], [LUAPKGCONFIG=lua5.1],
342 [AS_IF([test "x$enable_lua" = "xyes"],
343 [AC_MSG_ERROR([Lua not found. Please use --with-lua-pc=PKG])],
344 [enable_lua=no])]
345 )]
346 )])
347 AS_IF([test "x$LUAPKGCONFIG" != "x"], [enable_lua=yes])
348 fi
349
350 AM_CONDITIONAL([ENABLE_LUA],
351 [test "x$enable_lua" = "xyes"])
352
353 AM_COND_IF([ENABLE_LUA],
354 [AC_MSG_CHECKING([Lua version])
355 PKG_CHECK_VAR([LUA_VERSION], [$LUAPKGCONFIG], [V],,
356 [PKG_CHECK_VAR([LUA_VERSION], [$LUAPKGCONFIG], [major_version])])
357 AC_MSG_RESULT([$LUA_VERSION])
358 PKG_CHECK_VAR([LUA_INSTALL_CMOD], [$LUAPKGCONFIG], [INSTALL_CMOD],,
359 [LUA_INSTALL_CMOD=$libdir/lua/$LUA_VERSION])
360 PKG_CHECK_VAR([LUA_INSTALL_LMOD], [$LUAPKGCONFIG], [INSTALL_LMOD],,
361 [LUA_INSTALL_LMOD=$datadir/lua/$LUA_VERSION])
362 ])
363
364 # Optional test binaries
365 AC_ARG_ENABLE([tests],
366 [AC_HELP_STRING([--enable-tests], [build test/example binaries [default=no]])],
367 [], [enable_tests=no])
368 AM_CONDITIONAL([ENABLE_TESTS], [test "x$enable_tests" = "xyes"])
369
370 # LXC container path, where the containers are actually stored
371 # This is overridden by an entry in the file called LXCCONF
372 # (i.e. /etc/lxc/lxc.conf)
373 AC_ARG_WITH([config-path],
374 [AC_HELP_STRING(
375 [--with-config-path=dir],
376 [lxc configuration repository path]
377 )], [], [with_config_path=['${localstatedir}/lib/lxc']])
378
379 # The path of the global lxc configuration file.
380 AC_ARG_WITH([global-conf],
381 [AC_HELP_STRING(
382 [--with-global-conf=dir],
383 [global lxc configuration file]
384 )], [], [with_global_conf=['${sysconfdir}/lxc/lxc.conf']])
385
386 # The path of the userns network configuration file
387 AC_ARG_WITH([usernic-conf],
388 [AC_HELP_STRING(
389 [--with-usernic-conf],
390 [user network interface configuration file]
391 )], [], [with_usernic_conf=['${sysconfdir}/lxc/lxc-usernet']])
392
393 # The path of the runtime usernic database
394 AC_ARG_WITH([usernic-db],
395 [AC_HELP_STRING(
396 [--with-usernic-db],
397 [lxc user nic database]
398 )], [], [with_usernic_db=['/run/lxc/nics']])
399
400 # Rootfs path, where the container mount structure is assembled
401 AC_ARG_WITH([rootfs-path],
402 [AC_HELP_STRING(
403 [--with-rootfs-path=dir],
404 [lxc rootfs mount point]
405 )], [], [with_rootfs_path=['${libdir}/lxc/rootfs']])
406
407 # cgroup pattern specification
408 AC_ARG_WITH([cgroup-pattern],
409 [AC_HELP_STRING(
410 [--with-cgroup-pattern=pattern],
411 [pattern for container cgroups]
412 )], [], [with_cgroup_pattern=['/lxc/%n']])
413
414 # Container log path. By default, use $lxcpath.
415 AC_MSG_CHECKING([Whether to place logfiles in container config path])
416 AC_ARG_ENABLE([configpath-log],
417 [AC_HELP_STRING([--enable-configpath-log], [use logfiles in config path [default=no]])],
418 [], [enable_configpath_log=no])
419 AC_MSG_RESULT([$enable_configpath_log])
420 AM_CONDITIONAL([USE_CONFIGPATH_LOGS], [test "$enable_configpath_log" = "yes"])
421
422 if test "$enable_configpath_log" = "yes"; then
423 default_log_path="${with_config_path}"
424 else
425 default_log_path="${localstatedir}/log/lxc"
426 fi
427
428 AC_ARG_WITH([log-path],
429 [AC_HELP_STRING(
430 [--with-log-path=dir],
431 [per container log path]
432 )], [], [with_log_path=['${default_log_path}']])
433
434 # Expand some useful variables
435 AS_AC_EXPAND(PREFIX, "$prefix")
436 AS_AC_EXPAND(LIBDIR, "$libdir")
437 AS_AC_EXPAND(BINDIR, "$bindir")
438 AS_AC_EXPAND(LIBEXECDIR, "$libexecdir")
439 AS_AC_EXPAND(INCLUDEDIR, "$includedir")
440 AS_AC_EXPAND(SYSCONFDIR, "$sysconfdir")
441 AS_AC_EXPAND(LXC_DEFAULT_CONFIG, "$sysconfdir/lxc/default.conf")
442 AS_AC_EXPAND(DATADIR, "$datadir")
443 AS_AC_EXPAND(LOCALSTATEDIR, "$localstatedir")
444 AS_AC_EXPAND(DOCDIR, "$docdir")
445 AS_AC_EXPAND(LXC_DISTRO_CONF, "$distroconf")
446 AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
447 AS_AC_EXPAND(LXCPATH, "$with_config_path")
448 AS_AC_EXPAND(LXC_GLOBAL_CONF, "$with_global_conf")
449 AS_AC_EXPAND(LXC_USERNIC_CONF, "$with_usernic_conf")
450 AS_AC_EXPAND(LXC_USERNIC_DB, "$with_usernic_db")
451 AS_AC_EXPAND(LXCROOTFSMOUNT, "$with_rootfs_path")
452 AS_AC_EXPAND(LXCTEMPLATEDIR, "$datadir/lxc/templates")
453 AS_AC_EXPAND(LXCTEMPLATECONFIG, "$datadir/lxc/config")
454 AS_AC_EXPAND(LXCHOOKDIR, "$datadir/lxc/hooks")
455 AS_AC_EXPAND(LXCINITDIR, "$libexecdir")
456 AS_AC_EXPAND(LOGPATH, "$with_log_path")
457 AC_SUBST(DEFAULT_CGROUP_PATTERN, ["$with_cgroup_pattern"])
458
459 # Check for some standard kernel headers
460 AC_CHECK_HEADERS([linux/unistd.h linux/netlink.h linux/genetlink.h],
461 [],
462 AC_MSG_ERROR([Please install the Linux kernel headers.]),
463 [#include <sys/socket.h>])
464
465 # Check for alternate C libraries
466 AC_MSG_CHECKING(for bionic libc)
467 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
468 [[#ifndef __ANDROID__
469 error: Not bionic!
470 #endif]])],
471 [is_bionic=yes],
472 [is_bionic=no])
473 if test "x$is_bionic" = "xyes"; then
474 AC_DEFINE([IS_BIONIC], 1, [bionic libc])
475 AC_MSG_RESULT([yes])
476 else
477 AC_MSG_RESULT([no])
478 fi
479 AM_CONDITIONAL([IS_BIONIC], [test "x$is_bionic" = "xyes"])
480
481 # Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP
482 AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
483
484 # Check for some headers
485 AC_CHECK_HEADERS([sys/signalfd.h pty.h ifaddrs.h sys/capability.h sys/personality.h utmpx.h sys/timerfd.h])
486
487 # Check for some syscalls functions
488 AC_CHECK_FUNCS([setns pivot_root sethostname unshare rand_r confstr])
489
490 # Check for some functions
491 AC_CHECK_LIB(pthread, main)
492 AC_CHECK_FUNCS(pthread_atfork)
493 AC_CHECK_LIB(util, openpty)
494 AC_CHECK_FUNCS([openpty hasmntopt setmntent endmntent])
495 AC_CHECK_FUNCS([getline],
496 AM_CONDITIONAL(HAVE_GETLINE, true)
497 AC_DEFINE(HAVE_GETLINE,1,[Have getline]),
498 AM_CONDITIONAL(HAVE_GETLINE, false))
499 AC_CHECK_FUNCS([fgetln],
500 AM_CONDITIONAL(HAVE_FGETLN, true)
501 AC_DEFINE(HAVE_FGETLN,1,[Have fgetln]),
502 AM_CONDITIONAL(HAVE_FGETLN, false))
503
504 # Check for some libraries
505 AC_SEARCH_LIBS(sem_open, [rt pthread])
506 AC_SEARCH_LIBS(clock_gettime, [rt])
507
508 # Check for some standard binaries
509 AC_PROG_GCC_TRADITIONAL
510 AC_PROG_SED
511
512 # See if we support thread-local storage.
513 LXC_CHECK_TLS
514
515 if test "x$GCC" = "xyes"; then
516 CFLAGS="$CFLAGS -Wall -Werror"
517 fi
518
519 # Files requiring some variable expansion
520 AC_CONFIG_FILES([
521 Makefile
522 lxc.pc
523 lxc.spec
524
525 config/Makefile
526 config/etc/Makefile
527 config/templates/Makefile
528 config/templates/ubuntu-cloud.common.conf
529 config/templates/ubuntu-cloud.lucid.conf
530 config/templates/ubuntu-cloud.userns.conf
531 config/templates/ubuntu.common.conf
532 config/templates/ubuntu.lucid.conf
533
534 doc/Makefile
535 doc/api/Makefile
536 doc/legacy/lxc-ls.sgml
537 doc/lxc-attach.sgml
538 doc/lxc-autostart.sgml
539 doc/lxc-cgroup.sgml
540 doc/lxc-checkconfig.sgml
541 doc/lxc-checkpoint.sgml
542 doc/lxc-clone.sgml
543 doc/lxc-console.sgml
544 doc/lxc-create.sgml
545 doc/lxc-destroy.sgml
546 doc/lxc-device.sgml
547 doc/lxc-execute.sgml
548 doc/lxc-freeze.sgml
549 doc/lxc-info.sgml
550 doc/lxc-kill.sgml
551 doc/lxc-ls.sgml
552 doc/lxc-monitor.sgml
553 doc/lxc-netstat.sgml
554 doc/lxc-ps.sgml
555 doc/lxc-restart.sgml
556 doc/lxc-snapshot.sgml
557 doc/lxc-start-ephemeral.sgml
558 doc/lxc-start.sgml
559 doc/lxc-stop.sgml
560 doc/lxc-top.sgml
561 doc/lxc-unfreeze.sgml
562 doc/lxc-unshare.sgml
563 doc/lxc-user-nic.sgml
564 doc/lxc-version.sgml
565 doc/lxc-wait.sgml
566
567 doc/lxc.conf.sgml
568 doc/lxc-usernet.sgml
569 doc/lxc.sgml
570 doc/common_options.sgml
571 doc/see_also.sgml
572
573 doc/rootfs/Makefile
574
575 doc/examples/Makefile
576 doc/examples/lxc-macvlan.conf
577 doc/examples/lxc-vlan.conf
578 doc/examples/lxc-no-netns.conf
579 doc/examples/lxc-empty-netns.conf
580 doc/examples/lxc-phys.conf
581 doc/examples/lxc-veth.conf
582 doc/examples/lxc-complex.conf
583
584 doc/ja/Makefile
585 doc/ja/legacy/lxc-ls.sgml
586 doc/ja/lxc-attach.sgml
587 doc/ja/lxc-autostart.sgml
588 doc/ja/lxc-cgroup.sgml
589 doc/ja/lxc-checkconfig.sgml
590 doc/ja/lxc-checkpoint.sgml
591 doc/ja/lxc-clone.sgml
592 doc/ja/lxc-console.sgml
593 doc/ja/lxc-create.sgml
594 doc/ja/lxc-destroy.sgml
595 doc/ja/lxc-device.sgml
596 doc/ja/lxc-execute.sgml
597 doc/ja/lxc-freeze.sgml
598 doc/ja/lxc-info.sgml
599 doc/ja/lxc-kill.sgml
600 doc/ja/lxc-ls.sgml
601 doc/ja/lxc-monitor.sgml
602 doc/ja/lxc-netstat.sgml
603 doc/ja/lxc-ps.sgml
604 doc/ja/lxc-restart.sgml
605 doc/ja/lxc-snapshot.sgml
606 doc/ja/lxc-start-ephemeral.sgml
607 doc/ja/lxc-start.sgml
608 doc/ja/lxc-stop.sgml
609 doc/ja/lxc-top.sgml
610 doc/ja/lxc-unfreeze.sgml
611 doc/ja/lxc-unshare.sgml
612 doc/ja/lxc-user-nic.sgml
613 doc/ja/lxc-version.sgml
614 doc/ja/lxc-wait.sgml
615
616 doc/ja/lxc.conf.sgml
617 doc/ja/lxc-usernet.sgml
618 doc/ja/lxc.sgml
619 doc/ja/common_options.sgml
620 doc/ja/see_also.sgml
621
622 hooks/Makefile
623
624 templates/Makefile
625 templates/lxc-cirros
626 templates/lxc-debian
627 templates/lxc-ubuntu
628 templates/lxc-ubuntu-cloud
629 templates/lxc-opensuse
630 templates/lxc-busybox
631 templates/lxc-centos
632 templates/lxc-fedora
633 templates/lxc-openmandriva
634 templates/lxc-oracle
635 templates/lxc-altlinux
636 templates/lxc-sshd
637 templates/lxc-archlinux
638 templates/lxc-alpine
639 templates/lxc-plamo
640
641 src/Makefile
642 src/lxc/Makefile
643 src/lxc/lxc-ps
644 src/lxc/lxc-netstat
645 src/lxc/lxc-checkconfig
646 src/lxc/lxc-version
647 src/lxc/lxc-start-ephemeral
648 src/lxc/legacy/lxc-ls
649 src/lxc/lxc.functions
650 src/lxc/version.h
651 src/python-lxc/Makefile
652
653 src/lua-lxc/Makefile
654
655 src/tests/Makefile
656 ])
657 AC_CONFIG_COMMANDS([default],[[]],[[]])
658 AC_OUTPUT
659
660 # Configuration overview
661 cat << EOF
662
663 ----------------------------
664 Environment:
665 - compiler: $CC
666 - distribution: $with_distro
667 - init script type(s): $init_script
668 - rpath: $enable_rpath
669 - GnuTLS: $enable_gnutls
670
671 Security features:
672 - Apparmor: $enable_apparmor
673 - Linux capabilities: $enable_capabilities
674 - seccomp: $enable_seccomp
675 - SELinux: $enable_selinux
676
677 Bindings:
678 - lua: $enable_lua
679 - python3: $enable_python
680
681 Documentation:
682 - examples: $enable_examples
683 - API documentation: $enable_api_docs
684 - user documentation: $enable_doc
685
686 Debugging:
687 - tests: $enable_tests
688 - mutex debugging: $enable_mutex_debugging
689
690 Paths:
691 - Logs in configpath: $enable_configpath_log
692 EOF
693
694 if test "x$ac_cv_func_pthread_atfork" = "xno" ; then
695 cat << EOF
696
697 WARNING: Threading not supported on your platform
698
699 You are compiling LXC for bionic target which lacks certain threading related functionality used by LXC API (like pthread_atfork).
700 Please note that, because of the missing functionality, multithreaded usage of LXC API cause some problems.
701 EOF
702 fi