]>
Commit | Line | Data |
---|---|---|
5e97c3fc | 1 | # -*- Autoconf -*- |
2 | # Process this file with autoconf to produce a configure script. | |
3 | ||
9588a6ce SH |
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], [alpha2]) | |
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) | |
5e97c3fc | 16 | |
f8dafdbb | 17 | AC_CONFIG_SRCDIR([configure.ac]) |
5e97c3fc | 18 | AC_CONFIG_AUX_DIR([config]) |
067cfaeb | 19 | AC_CONFIG_HEADERS([src/config.h]) |
d007f8ab | 20 | AM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability subdir-objects]) |
5e97c3fc | 21 | AC_CANONICAL_HOST |
5e97c3fc | 22 | AM_PROG_CC_C_O |
23 | AC_GNU_SOURCE | |
5c8f9bd8 | 24 | |
8aa4885c SG |
25 | # Detect the distribution. This is used for the default configuration and |
26 | # for some distro-specific build options. | |
6f75ba0b | 27 | AC_MSG_CHECKING([host distribution]) |
6e7e54d9 | 28 | AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, oracle, fedora, suse, gentoo, debian, arch, slackware, paldo, openmandriva or pardus.])) |
6f75ba0b DE |
29 | if test "z$with_distro" = "z"; then |
30 | with_distro=`lsb_release -is` | |
be2e4e54 | 31 | fi |
6f75ba0b DE |
32 | if test "z$with_distro" = "z"; then |
33 | AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat") | |
34 | AC_CHECK_FILE(/etc/oracle-release,with_distro="oracle") | |
35 | AC_CHECK_FILE(/etc/fedora-release,with_distro="fedora") | |
36 | AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse") | |
37 | AC_CHECK_FILE(/etc/gentoo-release,with_distro="gentoo") | |
38 | AC_CHECK_FILE(/etc/debian_version,with_distro="debian") | |
39 | AC_CHECK_FILE(/etc/arch-release,with_distro="arch") | |
40 | AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware") | |
41 | AC_CHECK_FILE(/etc/frugalware-release,with_distro="frugalware") | |
6e7e54d9 AK |
42 | AC_CHECK_FILE(/etc/mandrakelinux-release, with_distro="openmandriva") |
43 | AC_CHECK_FILE(/etc/mandriva-release,with_distro="openmandriva") | |
6f75ba0b DE |
44 | AC_CHECK_FILE(/etc/pardus-release,with_distro="pardus") |
45 | fi | |
46 | with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]'` | |
47 | ||
48 | if test "z$with_distro" = "z"; then | |
49 | with_distro="unknown" | |
50 | fi | |
51 | case $with_distro in | |
52 | ubuntu) | |
3a647d58 | 53 | distroconf=default.conf.ubuntu |
6f75ba0b DE |
54 | ;; |
55 | redhat|fedora|oracle|oracleserver) | |
3a647d58 | 56 | distroconf=default.conf.libvirt |
6f75ba0b DE |
57 | ;; |
58 | *) | |
59 | echo -n "Linux distribution network config unknown, defaulting to lxc.network.type = empty" | |
3a647d58 | 60 | distroconf=default.conf.unknown |
6f75ba0b DE |
61 | ;; |
62 | esac | |
63 | AC_MSG_RESULT([$with_distro]) | |
6f75ba0b | 64 | AM_CONDITIONAL([HAVE_DEBIAN], [test x"$with_distro" = "xdebian" -o x"$with_distro" = "xubuntu"]) |
025f59ab | 65 | AM_CONDITIONAL([DISTRO_UBUNTU], [test "x$with_distro" = "xubuntu"]) |
be2e4e54 | 66 | |
c75c30ec | 67 | # Detect the newuidmap tool (required for userns) |
d155b47d SH |
68 | AC_CHECK_PROG([NEWUIDMAP], [newuidmap], [newuidmap]) |
69 | AM_CONDITIONAL([HAVE_NEWUIDMAP], [test -n "$NEWUIDMAP"]) | |
70 | ||
8aa4885c | 71 | # Allow disabling rpath |
1c41ddcb GK |
72 | AC_ARG_ENABLE([rpath], |
73 | [AC_HELP_STRING([--disable-rpath], [do not set rpath in executables])], | |
74 | [], [enable_rpath=yes]) | |
1c41ddcb GK |
75 | AM_CONDITIONAL([ENABLE_RPATH], [test "x$enable_rpath" = "xyes"]) |
76 | ||
8aa4885c | 77 | # Documentation (manpages) |
5c8f9bd8 | 78 | AC_ARG_ENABLE([doc], |
7f951458 | 79 | [AC_HELP_STRING([--enable-doc], [make mans (requires docbook2man or docbook2x-man to be installed) [default=auto]])], |
5c8f9bd8 AN |
80 | [], [enable_doc=auto]) |
81 | ||
82 | if test "x$enable_doc" = "xyes" -o "x$enable_doc" = "xauto"; then | |
7822022c | 83 | db2xman="" |
7f951458 | 84 | dbparsers="docbook2x-man db2x_docbook2man docbook2man" |
69fe23ff | 85 | |
7822022c | 86 | AC_MSG_CHECKING(for docbook2x-man) |
69fe23ff | 87 | for name in ${dbparsers}; do |
7822022c SG |
88 | if "$name" --help >/dev/null 2>&1; then |
89 | db2xman="$name" | |
90 | break; | |
91 | fi | |
92 | done | |
93 | ||
94 | if test -n "${db2xman}"; then | |
8aa4885c | 95 | AC_MSG_RESULT([${db2xman}]) |
7822022c | 96 | else |
8aa4885c | 97 | AC_MSG_RESULT([no]) |
7822022c SG |
98 | if test "x$enable_doc" = "xyes"; then |
99 | AC_MSG_ERROR([docbook2x-man required by man request, but not found]) | |
100 | fi | |
101 | fi | |
102 | ||
103 | AC_SUBST(db2xman) | |
5c8f9bd8 | 104 | fi |
8aa4885c | 105 | AM_CONDITIONAL([ENABLE_DOCBOOK], [test "x$db2xman" != "x"]) |
7cb14f34 | 106 | AM_CONDITIONAL([USE_DOCBOOK2X], [test "x$db2xman" != "xdocbook2man"]) |
5c8f9bd8 | 107 | |
7f951458 DE |
108 | if test "x$db2xman" = "xdocbook2man"; then |
109 | docdtd="\"-//Davenport//DTD DocBook V3.0//EN\"" | |
110 | else | |
111 | docdtd="\"-//OASIS//DTD DocBook XML\" \"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd\"" | |
112 | fi | |
113 | AC_SUBST(docdtd) | |
114 | ||
8aa4885c | 115 | # Apparmor |
e767dd55 SH |
116 | AC_ARG_ENABLE([apparmor], |
117 | [AC_HELP_STRING([--enable-apparmor], [enable apparmor])], | |
118 | [], [enable_apparmor=check]) | |
119 | ||
120 | if test "$enable_apparmor" = "check" ; then | |
121 | AC_CHECK_LIB([apparmor],[aa_change_profile],[enable_apparmor=yes], [enable_apparmor=no]) | |
122 | fi | |
e767dd55 SH |
123 | AM_CONDITIONAL([ENABLE_APPARMOR], [test "x$enable_apparmor" = "xyes"]) |
124 | ||
3ce74686 SH |
125 | AC_CHECK_LIB([gnutls], [gnutls_hash_fast]) |
126 | ||
e075f5d9 | 127 | AM_COND_IF([ENABLE_APPARMOR], |
8aa4885c SG |
128 | [AC_CHECK_HEADER([sys/apparmor.h],[],[AC_MSG_ERROR([You must install the AppArmor development package in order to compile lxc])]) |
129 | AC_CHECK_LIB([apparmor], [aa_change_profile],[],[AC_MSG_ERROR([You must install the AppArmor development package in order to compile lxc])]) | |
130 | AC_SUBST([APPARMOR_LIBS], [-lapparmor])]) | |
e075f5d9 | 131 | |
fe4de9a6 DE |
132 | # SELinux |
133 | AC_ARG_ENABLE([selinux], | |
134 | [AC_HELP_STRING([--enable-selinux], [enable SELinux support])], | |
135 | [], [enable_selinux=check]) | |
136 | ||
137 | if test "x$enable_selinux" = xcheck; then | |
138 | AC_CHECK_LIB([selinux],[setexeccon_raw],[enable_selinux=yes],[enable_selinux=no]) | |
139 | fi | |
140 | AM_CONDITIONAL([ENABLE_SELINUX], [test "x$enable_selinux" = "xyes"]) | |
141 | AM_COND_IF([ENABLE_SELINUX], | |
142 | [AC_CHECK_HEADER([selinux/selinux.h],[],[AC_MSG_ERROR([You must install the SELinux development package in order to compile lxc])]) | |
143 | AC_CHECK_LIB([selinux], [setexeccon_raw],[],[AC_MSG_ERROR([You must install the SELinux development package in order to compile lxc])]) | |
144 | AC_SUBST([SELINUX_LIBS])]) | |
145 | ||
8aa4885c | 146 | # Seccomp syscall filter |
e767dd55 SH |
147 | AC_ARG_ENABLE([seccomp], |
148 | [AC_HELP_STRING([--enable-seccomp], [enable seccomp])], | |
149 | [], [enable_seccomp=check]) | |
150 | ||
151 | if test "$enable_seccomp" = "check" ; then | |
152 | AC_CHECK_LIB([seccomp],[seccomp_init],[enable_seccomp=yes],[enable_seccomp=no]) | |
153 | fi | |
e767dd55 SH |
154 | AM_CONDITIONAL([ENABLE_SECCOMP], [test "x$enable_seccomp" = "xyes"]) |
155 | ||
8f2c3a70 | 156 | AM_COND_IF([ENABLE_SECCOMP], |
8aa4885c SG |
157 | [AC_CHECK_HEADER([seccomp.h],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])]) |
158 | AC_CHECK_LIB([seccomp], [seccomp_init],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])]) | |
159 | AC_SUBST([SECCOMP_LIBS], [-lseccomp])]) | |
8f2c3a70 | 160 | |
769872f9 SH |
161 | # HAVE_SCMP_FILTER_CTX=1 will tell us we have libseccomp api >= 1.0.0 |
162 | AC_CHECK_TYPES([scmp_filter_ctx], [], [], [#include <seccomp.h>]) | |
163 | ||
8aa4885c | 164 | # Configuration examples |
3fb0a9bb AN |
165 | AC_ARG_ENABLE([examples], |
166 | [AC_HELP_STRING([--disable-examples], [do not install configuration examples])], | |
167 | [], [enable_examples=yes]) | |
3fb0a9bb AN |
168 | AM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" = "xyes"]) |
169 | ||
8aa4885c | 170 | # Python3 module and scripts |
be2e4e54 SG |
171 | AC_ARG_ENABLE([python], |
172 | [AC_HELP_STRING([--enable-python], [enable python binding])], | |
173 | [enable_python=yes], [enable_python=no]) | |
be2e4e54 SG |
174 | AM_CONDITIONAL([ENABLE_PYTHON], [test "x$enable_python" = "xyes"]) |
175 | ||
176 | AM_COND_IF([ENABLE_PYTHON], | |
8aa4885c | 177 | [AM_PATH_PYTHON([3.2], [], [AC_MSG_ERROR([You must install python3])]) |
59ec0a36 | 178 | PKG_CHECK_MODULES([PYTHONDEV], [python3 >= 3.2],[],[AC_MSG_ERROR([You must install python3-dev])]) |
8aa4885c | 179 | AC_DEFINE_UNQUOTED([ENABLE_PYTHON], 1, [Python3 is available])]) |
be2e4e54 | 180 | |
3a1675bf DE |
181 | # Not in older autoconf versions |
182 | # AS_VAR_COPY(DEST, SOURCE) | |
183 | # ------------------------- | |
184 | # Set the polymorphic shell variable DEST to the contents of the polymorphic | |
185 | # shell variable SOURCE. | |
186 | m4_ifdef([AS_VAR_COPY], [], | |
187 | [AC_DEFUN([AS_VAR_COPY], | |
188 | [AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])]) | |
189 | ]) | |
190 | ||
12e93188 NC |
191 | dnl PKG_CHECK_VAR was introduced with pkg-config 0.28 |
192 | m4_ifdef([PKG_CHECK_VAR], [], | |
193 | [AC_DEFUN([PKG_CHECK_VAR], | |
194 | [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl | |
195 | AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl | |
196 | _PKG_CONFIG([$1], [variable="][$3]["], [$2]) | |
197 | AS_VAR_COPY([$1], [pkg_cv_][$1]) | |
198 | AS_VAR_IF([$1], [""], [$5], [$4])dnl | |
199 | ])# PKG_CHECK_VAR | |
200 | ]) | |
f080ffd7 | 201 | |
12e93188 | 202 | # Lua module and scripts |
f080ffd7 DE |
203 | AC_ARG_ENABLE([lua], |
204 | [AC_HELP_STRING([--enable-lua], [enable lua binding])], | |
f756cda0 | 205 | [], [enable_lua=check]) |
f080ffd7 | 206 | |
12e93188 NC |
207 | AC_ARG_WITH([lua-pc], |
208 | [AS_HELP_STRING( | |
209 | [--with-lua-pc=PKG], | |
210 | [Specify pkg-config package name for lua] | |
f756cda0 NC |
211 | )], [], [with_lua_pc=no]) |
212 | ||
213 | if test "x$enable_lua" = "xyes" -a "x$with_lua_pc" != "xno"; then | |
214 | # exit with error if not found | |
215 | PKG_CHECK_MODULES([LUA], [$with_lua_pc], [LUAPKGCONFIG=$with_lua_pc]) | |
216 | fi | |
217 | ||
218 | if test "x$enable_lua" = "xcheck" -a "x$with_lua_pc" != "xno"; then | |
219 | PKG_CHECK_MODULES([LUA], [$with_lua_pc], | |
220 | [LUAPKGCONFIG=$with_lua_pc | |
221 | enable_lua=yes], | |
222 | [enable_lua=no]) | |
223 | fi | |
224 | ||
225 | if test "x$enable_lua" != "xno"; then | |
226 | PKG_CHECK_MODULES([LUA], [lua], [LUAPKGCONFIG=lua], | |
227 | [PKG_CHECK_MODULES([LUA], [lua5.2], [LUAPKGCONFIG=lua5.2], | |
228 | [PKG_CHECK_MODULES([LUA], [lua5.1], [LUAPKGCONFIG=lua5.1], | |
229 | [AS_IF([test "x$enable_lua" = "xyes"], | |
230 | [AC_MSG_ERROR([Lua not found. Please use --with-lua-pc=PKG])], | |
231 | [enable_lua=no])] | |
232 | )] | |
233 | )]) | |
234 | AS_IF([test "x$LUAPKGCONFIG" != "x"], [enable_lua=yes]) | |
235 | fi | |
12e93188 NC |
236 | |
237 | AM_CONDITIONAL([ENABLE_LUA], | |
69c757b3 | 238 | [test "x$enable_lua" = "xyes"]) |
f080ffd7 DE |
239 | |
240 | AM_COND_IF([ENABLE_LUA], | |
f756cda0 | 241 | [AC_MSG_CHECKING([Lua version]) |
12e93188 NC |
242 | PKG_CHECK_VAR([LUA_VERSION], [$LUAPKGCONFIG], [V],, |
243 | [PKG_CHECK_VAR([LUA_VERSION], [$LUAPKGCONFIG], [major_version])]) | |
244 | AC_MSG_RESULT([$LUA_VERSION]) | |
245 | PKG_CHECK_VAR([LUA_INSTALL_CMOD], [$LUAPKGCONFIG], [INSTALL_CMOD],, | |
246 | [LUA_INSTALL_CMOD=$libdir/lua/$LUA_VERSION]) | |
247 | PKG_CHECK_VAR([LUA_INSTALL_LMOD], [$LUAPKGCONFIG], [INSTALL_LMOD],, | |
248 | [LUA_INSTALL_LMOD=$datadir/lua/$LUA_VERSION]) | |
249 | ]) | |
f080ffd7 | 250 | |
8aa4885c | 251 | # Optional test binaries |
525421c9 SG |
252 | AC_ARG_ENABLE([tests], |
253 | [AC_HELP_STRING([--enable-tests], [build test/example binaries])], | |
254 | [enable_tests=yes], [enable_tests=no]) | |
525421c9 SG |
255 | AM_CONDITIONAL([ENABLE_TESTS], [test "x$enable_tests" = "xyes"]) |
256 | ||
8aa4885c | 257 | # LXC container path, where the containers are actually stored |
fbf5de31 | 258 | # This is overridden by an entry in the file called LXCCONF |
2a59a681 | 259 | # (i.e. /etc/lxc/lxc.conf) |
aef4ebcf AN |
260 | AC_ARG_WITH([config-path], |
261 | [AC_HELP_STRING( | |
262 | [--with-config-path=dir], | |
e892973e | 263 | [lxc configuration repository path] |
1c41ddcb | 264 | )], [], [with_config_path=['${localstatedir}/lib/lxc']]) |
aef4ebcf | 265 | |
2a59a681 SH |
266 | # The path of the global lxc configuration file. |
267 | AC_ARG_WITH([global-conf], | |
268 | [AC_HELP_STRING( | |
269 | [--with-global-conf=dir], | |
270 | [global lxc configuration file] | |
271 | )], [], [with_global_conf=['${sysconfdir}/lxc/lxc.conf']]) | |
272 | ||
c75c30ec | 273 | # The path of the userns network configuration file |
070a4b8e SH |
274 | AC_ARG_WITH([usernic-conf], |
275 | [AC_HELP_STRING( | |
276 | [--with-usernic-conf], | |
277 | [user network interface configuration file] | |
278 | )], [], [with_usernic_conf=['${sysconfdir}/lxc/lxc-usernet']]) | |
279 | ||
c75c30ec | 280 | # The path of the runtime usernic database |
070a4b8e SH |
281 | AC_ARG_WITH([usernic-db], |
282 | [AC_HELP_STRING( | |
283 | [--with-usernic-db], | |
284 | [lxc user nic database] | |
285 | )], [], [with_usernic_db=['/run/lxc/nics']]) | |
286 | ||
8aa4885c | 287 | # Rootfs path, where the container mount structure is assembled |
196db713 DL |
288 | AC_ARG_WITH([rootfs-path], |
289 | [AC_HELP_STRING( | |
290 | [--with-rootfs-path=dir], | |
291 | [lxc rootfs mount point] | |
1c41ddcb | 292 | )], [], [with_rootfs_path=['${libdir}/lxc/rootfs']]) |
c75c30ec | 293 | |
6e16552d CS |
294 | # cgroup pattern specification |
295 | AC_ARG_WITH([cgroup-pattern], | |
296 | [AC_HELP_STRING( | |
297 | [--with-cgroup-pattern=pattern], | |
298 | [pattern for container cgroups] | |
299 | )], [], [with_cgroup_pattern=['/lxc/%n']]) | |
196db713 | 300 | |
5e1e7aaf SH |
301 | # Container log path. By default, use $lxcpath. |
302 | AC_MSG_CHECKING([Whether to place logfiles in container config path]) | |
303 | AC_ARG_ENABLE([configpath-log], | |
304 | [AC_HELP_STRING([--enable-configpath-log], [use logfiles in config path])], | |
305 | [use_configpath_logs=yes], [use_configpath_logs=no]) | |
306 | AC_MSG_RESULT([$use_configpath_logs]) | |
307 | AM_CONDITIONAL([USE_CONFIGPATH_LOGS], [test "$use_configpath_logs" = "yes"]) | |
308 | ||
309 | if test "$use_configpath_logs" = "yes"; then | |
310 | default_log_path="${with_config_path}" | |
311 | else | |
89d556d8 | 312 | default_log_path="${localstatedir}/log/lxc" |
5e1e7aaf SH |
313 | fi |
314 | ||
315 | AC_ARG_WITH([log-path], | |
316 | [AC_HELP_STRING( | |
317 | [--with-log-path=dir], | |
318 | [per container log path] | |
319 | )], [], [with_log_path=['${default_log_path}']]) | |
320 | ||
8aa4885c SG |
321 | # Expand some useful variables |
322 | AS_AC_EXPAND(PREFIX, "$prefix") | |
323 | AS_AC_EXPAND(LIBDIR, "$libdir") | |
324 | AS_AC_EXPAND(BINDIR, "$bindir") | |
325 | AS_AC_EXPAND(LIBEXECDIR, "$libexecdir") | |
326 | AS_AC_EXPAND(INCLUDEDIR, "$includedir") | |
327 | AS_AC_EXPAND(SYSCONFDIR, "$sysconfdir") | |
0a18b545 | 328 | AS_AC_EXPAND(LXC_DEFAULT_CONFIG, "$sysconfdir/lxc/default.conf") |
8aa4885c SG |
329 | AS_AC_EXPAND(DATADIR, "$datadir") |
330 | AS_AC_EXPAND(LOCALSTATEDIR, "$localstatedir") | |
331 | AS_AC_EXPAND(DOCDIR, "$docdir") | |
3a647d58 | 332 | AS_AC_EXPAND(LXC_DISTRO_CONF, "$distroconf") |
aef4ebcf | 333 | AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)") |
8aa4885c | 334 | AS_AC_EXPAND(LXCPATH, "$with_config_path") |
2a59a681 | 335 | AS_AC_EXPAND(LXC_GLOBAL_CONF, "$with_global_conf") |
070a4b8e SH |
336 | AS_AC_EXPAND(LXC_USERNIC_CONF, "$with_usernic_conf") |
337 | AS_AC_EXPAND(LXC_USERNIC_DB, "$with_usernic_db") | |
8aa4885c SG |
338 | AS_AC_EXPAND(LXCROOTFSMOUNT, "$with_rootfs_path") |
339 | AS_AC_EXPAND(LXCTEMPLATEDIR, "$datadir/lxc/templates") | |
906f8c4d | 340 | AS_AC_EXPAND(LXCHOOKDIR, "$datadir/lxc/hooks") |
8aa4885c | 341 | AS_AC_EXPAND(LXCINITDIR, "$libexecdir") |
5e1e7aaf | 342 | AS_AC_EXPAND(LOGPATH, "$with_log_path") |
6e16552d | 343 | AC_SUBST(DEFAULT_CGROUP_PATTERN, ["$with_cgroup_pattern"]) |
881450bb | 344 | |
8aa4885c | 345 | # Check for some standard kernel headers |
910bb4fa | 346 | AC_CHECK_HEADERS([linux/unistd.h linux/netlink.h linux/genetlink.h], |
8aa4885c SG |
347 | [], |
348 | AC_MSG_ERROR([Please install the Linux kernel headers.]), | |
349 | [#include <sys/socket.h>]) | |
35f549fe | 350 | |
495d2046 SG |
351 | # Allow disabling libcap support |
352 | AC_ARG_ENABLE([capabilities], | |
353 | [AC_HELP_STRING([--disable-capabilities], [disable kernel capabilities])], | |
354 | [], [enable_capabilities=yes]) | |
355 | ||
8aa4885c | 356 | # Check for libcap support |
495d2046 SG |
357 | if test "x$enable_capabilities" = "xyes"; then |
358 | AC_CHECK_LIB(cap,cap_set_proc,caplib=yes,caplib=no) | |
359 | AC_MSG_CHECKING([linux capabilities]) | |
360 | if test "x$caplib" = "xyes" ; then | |
361 | CAP_LIBS="-lcap" | |
362 | AC_MSG_RESULT([$CAP_LIBS]) | |
363 | else | |
364 | AC_MSG_RESULT([no]) | |
365 | AC_MSG_ERROR([You are missing libcap support. If you really want to build without kernel capabilities, use --disable-capabilities]) | |
366 | fi | |
0af683cf | 367 | else |
495d2046 | 368 | CAP_LIBS="" |
0af683cf | 369 | fi |
370 | AC_SUBST([CAP_LIBS]) | |
35f549fe | 371 | |
a6168a17 SG |
372 | # Check for alternate C libraries |
373 | AC_MSG_CHECKING(for bionic libc) | |
374 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM( | |
8aa4885c | 375 | [[#ifndef __ANDROID__ |
a6168a17 SG |
376 | error: Not bionic! |
377 | #endif]])], | |
8aa4885c SG |
378 | [is_bionic=yes], |
379 | [is_bionic=no]) | |
a6168a17 | 380 | if test "x$is_bionic" = "xyes"; then |
8aa4885c SG |
381 | AC_DEFINE([IS_BIONIC], 1, [bionic libc]) |
382 | AC_MSG_RESULT([yes]) | |
a6168a17 | 383 | else |
8aa4885c | 384 | AC_MSG_RESULT([no]) |
a6168a17 SG |
385 | fi |
386 | AM_CONDITIONAL([IS_BIONIC], [test "x$is_bionic" = "xyes"]) | |
387 | ||
656994bb MH |
388 | # Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP |
389 | AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>]) | |
390 | ||
e827ff7e | 391 | # Check for some headers |
4ba0d9af | 392 | AC_CHECK_HEADERS([sys/signalfd.h pty.h ifaddrs.h sys/capability.h sys/personality.h utmpx.h sys/timerfd.h]) |
ff218c25 | 393 | |
2d76d1d7 | 394 | # Check for some syscalls functions |
511a6936 | 395 | AC_CHECK_FUNCS([setns pivot_root sethostname unshare rand_r confstr]) |
2d76d1d7 | 396 | |
e827ff7e | 397 | # Check for some functions |
740ee8c7 | 398 | AC_CHECK_LIB(util, openpty) |
edaf8b1b | 399 | AC_CHECK_FUNCS([openpty hasmntopt setmntent endmntent]) |
1ba0013f SG |
400 | AC_CHECK_FUNCS([getline], |
401 | AM_CONDITIONAL(HAVE_GETLINE, true) | |
402 | AC_DEFINE(HAVE_GETLINE,1,[Have getline]), | |
403 | AM_CONDITIONAL(HAVE_GETLINE, false)) | |
404 | AC_CHECK_FUNCS([fgetln], | |
405 | AM_CONDITIONAL(HAVE_FGETLN, true) | |
406 | AC_DEFINE(HAVE_FGETLN,1,[Have fgetln]), | |
407 | AM_CONDITIONAL(HAVE_FGETLN, false)) | |
408 | ||
c9a84173 SG |
409 | # Check for some libraries |
410 | AC_SEARCH_LIBS(sem_open, [rt pthread]) | |
336d5469 | 411 | AC_SEARCH_LIBS(clock_gettime, [rt]) |
c9a84173 | 412 | |
8aa4885c | 413 | # Check for some standard binaries |
5e97c3fc | 414 | AC_PROG_GCC_TRADITIONAL |
95a717e9 | 415 | AC_PROG_SED |
5e97c3fc | 416 | |
417 | if test "x$GCC" = "xyes"; then | |
8aa4885c | 418 | CFLAGS="$CFLAGS -Wall -Werror" |
5e97c3fc | 419 | fi |
420 | ||
8aa4885c | 421 | # Files requiring some variable expansion |
5e97c3fc | 422 | AC_CONFIG_FILES([ |
288063bd | 423 | Makefile |
b6345ba1 | 424 | lxc.pc |
5e97c3fc | 425 | lxc.spec |
288063bd | 426 | config/Makefile |
d823d5b9 | 427 | |
288063bd | 428 | doc/Makefile |
4019712d SG |
429 | doc/legacy/lxc-ls.sgml |
430 | doc/lxc-attach.sgml | |
431 | doc/lxc-cgroup.sgml | |
432 | doc/lxc-checkconfig.sgml | |
433 | doc/lxc-checkpoint.sgml | |
11cddd70 | 434 | doc/lxc-clone.sgml |
4019712d | 435 | doc/lxc-console.sgml |
d823d5b9 | 436 | doc/lxc-create.sgml |
437 | doc/lxc-destroy.sgml | |
4019712d | 438 | doc/lxc-device.sgml |
d823d5b9 | 439 | doc/lxc-execute.sgml |
d823d5b9 | 440 | doc/lxc-freeze.sgml |
4019712d SG |
441 | doc/lxc-info.sgml |
442 | doc/lxc-kill.sgml | |
d823d5b9 | 443 | doc/lxc-ls.sgml |
4019712d SG |
444 | doc/lxc-monitor.sgml |
445 | doc/lxc-netstat.sgml | |
d823d5b9 | 446 | doc/lxc-ps.sgml |
4019712d | 447 | doc/lxc-restart.sgml |
813a4837 | 448 | doc/lxc-snapshot.sgml |
4019712d SG |
449 | doc/lxc-start-ephemeral.sgml |
450 | doc/lxc-start.sgml | |
451 | doc/lxc-stop.sgml | |
f080ffd7 | 452 | doc/lxc-top.sgml |
4019712d SG |
453 | doc/lxc-unfreeze.sgml |
454 | doc/lxc-unshare.sgml | |
455 | doc/lxc-version.sgml | |
456 | doc/lxc-wait.sgml | |
457 | ||
8a67a2b2 | 458 | doc/lxc.conf.sgml |
8b8b04f8 | 459 | doc/lxc.sgml |
10fba81b | 460 | doc/common_options.sgml |
99e4008c | 461 | doc/see_also.sgml |
d823d5b9 | 462 | |
baf6671f DL |
463 | doc/rootfs/Makefile |
464 | ||
0f71d073 DL |
465 | doc/examples/Makefile |
466 | doc/examples/lxc-macvlan.conf | |
26c39028 | 467 | doc/examples/lxc-vlan.conf |
0f71d073 DL |
468 | doc/examples/lxc-no-netns.conf |
469 | doc/examples/lxc-empty-netns.conf | |
470 | doc/examples/lxc-phys.conf | |
471 | doc/examples/lxc-veth.conf | |
c553a9c2 | 472 | doc/examples/lxc-complex.conf |
0f71d073 | 473 | |
57da8c32 KY |
474 | doc/ja/Makefile |
475 | doc/ja/legacy/lxc-ls.sgml | |
476 | doc/ja/lxc-attach.sgml | |
477 | doc/ja/lxc-cgroup.sgml | |
478 | doc/ja/lxc-checkconfig.sgml | |
479 | doc/ja/lxc-checkpoint.sgml | |
480 | doc/ja/lxc-clone.sgml | |
481 | doc/ja/lxc-console.sgml | |
482 | doc/ja/lxc-create.sgml | |
483 | doc/ja/lxc-destroy.sgml | |
484 | doc/ja/lxc-device.sgml | |
485 | doc/ja/lxc-execute.sgml | |
486 | doc/ja/lxc-freeze.sgml | |
487 | doc/ja/lxc-info.sgml | |
488 | doc/ja/lxc-kill.sgml | |
489 | doc/ja/lxc-ls.sgml | |
490 | doc/ja/lxc-monitor.sgml | |
491 | doc/ja/lxc-netstat.sgml | |
492 | doc/ja/lxc-ps.sgml | |
493 | doc/ja/lxc-restart.sgml | |
ebe0aeb1 | 494 | doc/ja/lxc-snapshot.sgml |
57da8c32 KY |
495 | doc/ja/lxc-start-ephemeral.sgml |
496 | doc/ja/lxc-start.sgml | |
497 | doc/ja/lxc-stop.sgml | |
498 | doc/ja/lxc-top.sgml | |
499 | doc/ja/lxc-unfreeze.sgml | |
500 | doc/ja/lxc-unshare.sgml | |
501 | doc/ja/lxc-version.sgml | |
502 | doc/ja/lxc-wait.sgml | |
503 | ||
504 | doc/ja/lxc.conf.sgml | |
505 | doc/ja/lxc.sgml | |
506 | doc/ja/common_options.sgml | |
507 | doc/ja/see_also.sgml | |
508 | ||
906f8c4d SG |
509 | hooks/Makefile |
510 | ||
c01d62f2 | 511 | templates/Makefile |
58a46e06 | 512 | templates/lxc-cirros |
c01d62f2 | 513 | templates/lxc-debian |
7c382572 | 514 | templates/lxc-ubuntu |
d1458ac8 | 515 | templates/lxc-ubuntu-cloud |
c840b37d | 516 | templates/lxc-opensuse |
c01d62f2 DL |
517 | templates/lxc-busybox |
518 | templates/lxc-fedora | |
9aad9d12 | 519 | templates/lxc-openmandriva |
708f4a80 | 520 | templates/lxc-oracle |
262f4e48 | 521 | templates/lxc-altlinux |
c01d62f2 | 522 | templates/lxc-sshd |
f6267d90 | 523 | templates/lxc-archlinux |
2a9a0a08 | 524 | templates/lxc-alpine |
cab79123 | 525 | templates/lxc-plamo |
c9844b87 | 526 | |
288063bd | 527 | src/Makefile |
5e97c3fc | 528 | src/lxc/Makefile |
529 | src/lxc/lxc-ps | |
9d0195cb | 530 | src/lxc/lxc-netstat |
237315ff | 531 | src/lxc/lxc-checkconfig |
bcd952a1 | 532 | src/lxc/lxc-version |
5b12984b | 533 | src/lxc/lxc-start-ephemeral |
6a85cf91 | 534 | src/lxc/legacy/lxc-ls |
2a59a681 | 535 | src/lxc/lxc.functions |
c9844b87 | 536 | |
be2e4e54 SG |
537 | src/python-lxc/Makefile |
538 | ||
f080ffd7 DE |
539 | src/lua-lxc/Makefile |
540 | ||
72d0e1cb | 541 | src/tests/Makefile |
5e97c3fc | 542 | ]) |
543 | AC_CONFIG_COMMANDS([default],[[]],[[]]) | |
544 | AC_OUTPUT |