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