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