configure.ac revision 89d556d83a2eb9c6bbe424a7bb0556f59bb137dc
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat# -*- Autoconf -*-
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat# Process this file with autoconf to produce a configure script.
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. WarfieldAC_INIT([lxc], [0.9.0.rc1])
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAC_CONFIG_SRCDIR([configure.ac])
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAC_CONFIG_AUX_DIR([config])
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAC_CONFIG_HEADERS([src/config.h])
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability])
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAC_CANONICAL_HOST
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAM_PROG_CC_C_O
0ce7569856cc7a366f58688f6b6a71610167fc76Johannes Kastl# Detect the distribution. This is used for the default configuration and
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat# for some distro-specific build options.
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAC_MSG_CHECKING([host distribution])
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAC_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, mandriva or pardus.]))
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozatif test "z$with_distro" = "z"; then
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat with_distro=`lsb_release -is`
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozatif test "z$with_distro" = "z"; then
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat")
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber AC_CHECK_FILE(/etc/oracle-release,with_distro="oracle")
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat AC_CHECK_FILE(/etc/fedora-release,with_distro="fedora")
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat AC_CHECK_FILE(/etc/gentoo-release,with_distro="gentoo")
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat AC_CHECK_FILE(/etc/debian_version,with_distro="debian")
250b1eec71b074acdff1c5f6b5a1f0d7d2c20b77Stéphane Graber AC_CHECK_FILE(/etc/arch-release,with_distro="arch")
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware")
8ec981fc8b0105da5f071e40811e0c2472a6c3c9Stéphane Graber AC_CHECK_FILE(/etc/frugalware-release,with_distro="frugalware")
c63c04fcaf1c3a78c70500eae253d72fa9c8358aTAMUKI Shoichi AC_CHECK_FILE(/etc/mandrakelinux-release, with_distro="mandriva")
96283b546081e7ff709968378fca25cb44f1ab6cStéphane Graber AC_CHECK_FILE(/etc/mandriva-release,with_distro="mandriva")
96283b546081e7ff709968378fca25cb44f1ab6cStéphane Graber AC_CHECK_FILE(/etc/pardus-release,with_distro="pardus")
8ec981fc8b0105da5f071e40811e0c2472a6c3c9Stéphane Graberwith_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]'`
8ec981fc8b0105da5f071e40811e0c2472a6c3c9Stéphane Graberif test "z$with_distro" = "z"; then
8ec981fc8b0105da5f071e40811e0c2472a6c3c9Stéphane Graber with_distro="unknown"
207bf0e475f1dc6e9a2dac2cee3a209b56427855Stéphane Grabercase $with_distro in
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat redhat|fedora|oracle|oracleserver)
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. Warfield echo -n "Linux distribution network config unknown, defaulting to lxc.network.type = empty"
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAC_MSG_RESULT([$with_distro])
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAM_CONDITIONAL([HAVE_DEBIAN], [test x"$with_distro" = "xdebian" -o x"$with_distro" = "xubuntu"])
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat# Allow disabling rpath
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAC_ARG_ENABLE([rpath],
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat [AC_HELP_STRING([--disable-rpath], [do not set rpath in executables])],
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat [], [enable_rpath=yes])
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAM_CONDITIONAL([ENABLE_RPATH], [test "x$enable_rpath" = "xyes"])
ba4c42597399c72fbb0b8f99e6ded79f738a6ac3Frederic Crozat# Documentation (manpages)
ba4c42597399c72fbb0b8f99e6ded79f738a6ac3Frederic CrozatAC_ARG_ENABLE([doc],
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat [AC_HELP_STRING([--enable-doc], [make mans (require docbook2x-man installed) [default=auto]])],
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat [], [enable_doc=auto])
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozatif test "x$enable_doc" = "xyes" -o "x$enable_doc" = "xauto"; then
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat AC_MSG_CHECKING(for docbook2x-man)
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat for name in docbook2x-man db2x_docbook2man; do
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat if "$name" --help >/dev/null 2>&1; then
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat db2xman="$name"
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat if test -n "${db2xman}"; then
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat AC_MSG_RESULT([${db2xman}])
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat AC_MSG_RESULT([no])
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat if test "x$enable_doc" = "xyes"; then
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat AC_MSG_ERROR([docbook2x-man required by man request, but not found])
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat AC_SUBST(db2xman)
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAM_CONDITIONAL([ENABLE_DOCBOOK], [test "x$db2xman" != "x"])
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAC_ARG_ENABLE([apparmor],
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat [AC_HELP_STRING([--enable-apparmor], [enable apparmor])],
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozat [], [enable_apparmor=check])
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozatif test "$enable_apparmor" = "check" ; then
36368228d286cd5c1492ae7aab92b4d78dbfb616Serge Hallyn AC_CHECK_LIB([apparmor],[aa_change_profile],[enable_apparmor=yes], [enable_apparmor=no])
36368228d286cd5c1492ae7aab92b4d78dbfb616Serge HallynAM_CONDITIONAL([ENABLE_APPARMOR], [test "x$enable_apparmor" = "xyes"])
36368228d286cd5c1492ae7aab92b4d78dbfb616Serge HallynAM_COND_IF([ENABLE_APPARMOR],
36368228d286cd5c1492ae7aab92b4d78dbfb616Serge Hallyn [AC_CHECK_HEADER([sys/apparmor.h],[],[AC_MSG_ERROR([You must install the AppArmor development package in order to compile lxc])])
36368228d286cd5c1492ae7aab92b4d78dbfb616Serge Hallyn AC_CHECK_LIB([apparmor], [aa_change_profile],[],[AC_MSG_ERROR([You must install the AppArmor development package in order to compile lxc])])
36368228d286cd5c1492ae7aab92b4d78dbfb616Serge Hallyn AC_SUBST([APPARMOR_LIBS], [-lapparmor])])
98f5f7e2c54fc003f81b2164adf3c7bd8a104556Cedric Bosdonnat# Seccomp syscall filter
98f5f7e2c54fc003f81b2164adf3c7bd8a104556Cedric BosdonnatAC_ARG_ENABLE([seccomp],
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozat [AC_HELP_STRING([--enable-seccomp], [enable seccomp])],
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozat [], [enable_seccomp=check])
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozatif test "$enable_seccomp" = "check" ; then
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozat AC_CHECK_LIB([seccomp],[seccomp_init],[enable_seccomp=yes],[enable_seccomp=no])
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAM_CONDITIONAL([ENABLE_SECCOMP], [test "x$enable_seccomp" = "xyes"])
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAM_COND_IF([ENABLE_SECCOMP],
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat [AC_CHECK_HEADER([seccomp.h],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])])
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat AC_CHECK_LIB([seccomp], [seccomp_init],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])])
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat AC_SUBST([SECCOMP_LIBS], [-lseccomp])])
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat# HAVE_SCMP_FILTER_CTX=1 will tell us we have libseccomp api >= 1.0.0
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic CrozatAC_CHECK_TYPES([scmp_filter_ctx], [], [], [#include <seccomp.h>])
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat# Configuration examples
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic CrozatAC_ARG_ENABLE([examples],
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat [AC_HELP_STRING([--disable-examples], [do not install configuration examples])],
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat [], [enable_examples=yes])
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" = "xyes"])
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat# Python3 module and scripts
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAC_ARG_ENABLE([python],
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber [AC_HELP_STRING([--enable-python], [enable python binding])],
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber [enable_python=yes], [enable_python=no])
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAM_CONDITIONAL([ENABLE_PYTHON], [test "x$enable_python" = "xyes"])
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAM_COND_IF([ENABLE_PYTHON],
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat [AM_PATH_PYTHON([3.2], [], [AC_MSG_ERROR([You must install python3])])
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat PKG_CHECK_MODULES([PYTHONDEV], [python3 >= 3.2],[],[AC_MSG_ERROR([You must install python3-dev])])
f4936bf19c56a688eec182e1916c8b660e3a0058Jiri Slaby AC_DEFINE_UNQUOTED([ENABLE_PYTHON], 1, [Python3 is available])])
f4936bf19c56a688eec182e1916c8b660e3a0058Jiri Slaby# Lua module and scripts
36368228d286cd5c1492ae7aab92b4d78dbfb616Serge Hallynif test x"$with_distro" = "xdebian" -o x"$with_distro" = "xubuntu" ; then
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat LUAPKGCONFIG=lua5.1
cc33e055dd047af7b4cc8a226bb54b3b9c450152Jiri Slaby LUAPKGCONFIG=lua
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic CrozatAC_ARG_ENABLE([lua],
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat [AC_HELP_STRING([--enable-lua], [enable lua binding])],
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozat [enable_lua=yes], [enable_lua=no])
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic CrozatAM_CONDITIONAL([ENABLE_LUA], [test "x$enable_lua" = "xyes"])
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic CrozatAM_COND_IF([ENABLE_LUA],
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat [PKG_CHECK_MODULES([LUA], [$LUAPKGCONFIG >= 5.1],[],[AC_MSG_ERROR([You must install lua-devel for lua 5.1])])
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat AC_DEFINE_UNQUOTED([ENABLE_LUA], 1, [Lua is available])])
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozat# Optional test binaries
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic CrozatAC_ARG_ENABLE([tests],
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozat [AC_HELP_STRING([--enable-tests], [build test/example binaries])],
36368228d286cd5c1492ae7aab92b4d78dbfb616Serge Hallyn [enable_tests=yes], [enable_tests=no])
36368228d286cd5c1492ae7aab92b4d78dbfb616Serge HallynAM_CONDITIONAL([ENABLE_TESTS], [test "x$enable_tests" = "xyes"])
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozat# LXC container path, where the containers are actually stored
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozat# This is overridden by an entry in the file called LXCCONF
2e7a16a5a501acd1c1e270bd7b3c423b1aaa5d8bJohannes KastlAC_ARG_WITH([config-path],
2e7a16a5a501acd1c1e270bd7b3c423b1aaa5d8bJohannes Kastl [AC_HELP_STRING(
2e7a16a5a501acd1c1e270bd7b3c423b1aaa5d8bJohannes Kastl [--with-config-path=dir],
2e7a16a5a501acd1c1e270bd7b3c423b1aaa5d8bJohannes Kastl [lxc configuration repository path]
2e7a16a5a501acd1c1e270bd7b3c423b1aaa5d8bJohannes Kastl )], [], [with_config_path=['${localstatedir}/lib/lxc']])
17abf2784de1047fb2904ff130ee5efe4ea7b598Elan Ruusamäe# The path of the global lxc configuration file.
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic CrozatAC_ARG_WITH([global-conf],
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozat [AC_HELP_STRING(
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozat [--with-global-conf=dir],
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozat [global lxc configuration file]
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozat )], [], [with_global_conf=['${sysconfdir}/lxc/lxc.conf']])
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozat# Rootfs path, where the container mount structure is assembled
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. WarfieldAC_ARG_WITH([rootfs-path],
a7273db9f87f59815d36c3eca4d4501304ae84b2Frederic Crozat [AC_HELP_STRING(
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat [--with-rootfs-path=dir],
2e7a16a5a501acd1c1e270bd7b3c423b1aaa5d8bJohannes Kastl [lxc rootfs mount point]
2e7a16a5a501acd1c1e270bd7b3c423b1aaa5d8bJohannes Kastl )], [], [with_rootfs_path=['${libdir}/lxc/rootfs']])
f4936bf19c56a688eec182e1916c8b660e3a0058Jiri Slaby# Container log path. By default, use $lxcpath.
f4936bf19c56a688eec182e1916c8b660e3a0058Jiri SlabyAC_MSG_CHECKING([Whether to place logfiles in container config path])
f4936bf19c56a688eec182e1916c8b660e3a0058Jiri SlabyAC_ARG_ENABLE([configpath-log],
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat [AC_HELP_STRING([--enable-configpath-log], [use logfiles in config path])],
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat [use_configpath_logs=yes], [use_configpath_logs=no])
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic CrozatAC_MSG_RESULT([$use_configpath_logs])
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic CrozatAM_CONDITIONAL([USE_CONFIGPATH_LOGS], [test "$use_configpath_logs" = "yes"])
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozatif test "$use_configpath_logs" = "yes"; then
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat default_log_path="${with_config_path}"
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic Crozat default_log_path="${localstatedir}/log/lxc"
d696d21c2a7d5d15b3a456edd8ba742a5970d40aFrederic CrozatAC_ARG_WITH([log-path],
d696d21c2a7d5d15b3a456edd8ba742a5970d40aFrederic Crozat [AC_HELP_STRING(
d696d21c2a7d5d15b3a456edd8ba742a5970d40aFrederic Crozat [--with-log-path=dir],
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat [per container log path]
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber )], [], [with_log_path=['${default_log_path}']])
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat# Expand some useful variables
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAS_AC_EXPAND(PREFIX, "$prefix")
44ee8a102e3d8052631fbb119f58a55ce678d039Frederic CrozatAS_AC_EXPAND(LIBDIR, "$libdir")
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAS_AC_EXPAND(BINDIR, "$bindir")
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAS_AC_EXPAND(LIBEXECDIR, "$libexecdir")
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAS_AC_EXPAND(INCLUDEDIR, "$includedir")
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAS_AC_EXPAND(SYSCONFDIR, "$sysconfdir")
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAS_AC_EXPAND(DATADIR, "$datadir")
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAS_AC_EXPAND(LOCALSTATEDIR, "$localstatedir")
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAS_AC_EXPAND(DOCDIR, "$docdir")
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAS_AC_EXPAND(LXC_DEFAULT_CONF, "$defaultconf")
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAS_AC_EXPAND(LXCPATH, "$with_config_path")
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAS_AC_EXPAND(LXC_GLOBAL_CONF, "$with_global_conf")
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAS_AC_EXPAND(LXCROOTFSMOUNT, "$with_rootfs_path")
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAS_AC_EXPAND(LXCTEMPLATEDIR, "$datadir/lxc/templates")
285ee6b8f120ebb8f37578081fb4bdc400538306Jiri SlabyAS_AC_EXPAND(LXCHOOKDIR, "$datadir/lxc/hooks")
6d8ac56b658a7aa35a46580c2df060c58ef02821Serge HallynAS_AC_EXPAND(LXCINITDIR, "$libexecdir")
44d397891e691ab994a69766cc72e57265b62da1Serge HallynAS_AC_EXPAND(LOGPATH, "$with_log_path")
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat# Check for some standard kernel headers
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAC_CHECK_HEADERS([linux/unistd.h linux/netlink.h linux/genetlink.h],
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat AC_MSG_ERROR([Please install the Linux kernel headers.]),
e29bf450cafa2ce2564aeb0b64d2014c17228407Dwight Engen# Allow disabling libcap support
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAC_ARG_ENABLE([capabilities],
17abf2784de1047fb2904ff130ee5efe4ea7b598Elan Ruusamäe [AC_HELP_STRING([--disable-capabilities], [disable kernel capabilities])],
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber [], [enable_capabilities=yes])
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber# Check for libcap support
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graberif test "x$enable_capabilities" = "xyes"; then
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber AC_CHECK_LIB(cap,cap_set_proc,caplib=yes,caplib=no)
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber AC_MSG_CHECKING([linux capabilities])
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber if test "x$caplib" = "xyes" ; then
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber CAP_LIBS="-lcap"
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber AC_MSG_RESULT([$CAP_LIBS])
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber AC_MSG_RESULT([no])
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber AC_MSG_ERROR([You are missing libcap support. If you really want to build without kernel capabilities, use --disable-capabilities])
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane GraberAC_SUBST([CAP_LIBS])
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber# Check for alternate C libraries
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane GraberAC_MSG_CHECKING(for bionic libc)
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane GraberAC_COMPILE_IFELSE([AC_LANG_PROGRAM(
14d9c0f09d1a55d124ef210a4b4e205c9fe7596cStéphane Graber [[#ifndef __ANDROID__
17abf2784de1047fb2904ff130ee5efe4ea7b598Elan Ruusamäeerror: Not bionic!
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat [is_bionic=yes],
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat [is_bionic=no])
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozatif test "x$is_bionic" = "xyes"; then
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. Warfield AC_DEFINE([IS_BIONIC], 1, [bionic libc])
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. Warfield AC_MSG_RESULT([yes])
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. Warfield AC_MSG_RESULT([no])
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. WarfieldAM_CONDITIONAL([IS_BIONIC], [test "x$is_bionic" = "xyes"])
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat# Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
c840b37de865195a8742e219b4374d961a21d4d9Frederic Crozat# Check for some headers
c840b37de865195a8742e219b4374d961a21d4d9Frederic CrozatAC_CHECK_HEADERS([sys/signalfd.h pty.h sys/capability.h sys/personality.h utmpx.h sys/timerfd.h])
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. Warfield# Check for some syscalls functions
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. WarfieldAC_CHECK_FUNCS([setns pivot_root sethostname unshare])
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. Warfield# Check for some functions
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. WarfieldAC_CHECK_LIB(util, openpty)
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. WarfieldAC_CHECK_FUNCS([openpty hasmntopt setmntent endmntent])
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. WarfieldAC_CHECK_FUNCS([getline],
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. Warfield AM_CONDITIONAL(HAVE_GETLINE, true)
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. Warfield AC_DEFINE(HAVE_GETLINE,1,[Have getline]),
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. Warfield AM_CONDITIONAL(HAVE_GETLINE, false))
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. WarfieldAC_CHECK_FUNCS([fgetln],
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. Warfield AM_CONDITIONAL(HAVE_FGETLN, true)
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. Warfield AC_DEFINE(HAVE_FGETLN,1,[Have fgetln]),
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. Warfield AM_CONDITIONAL(HAVE_FGETLN, false))
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. Warfield# Check for some libraries
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. WarfieldAC_SEARCH_LIBS(sem_open, [rt pthread])
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. WarfieldAC_SEARCH_LIBS(clock_gettime, [rt])
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. Warfield# Check for some standard binaries
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. WarfieldAC_PROG_GCC_TRADITIONAL
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. Warfieldif test "x$GCC" = "xyes"; then
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. Warfield CFLAGS="$CFLAGS -Wall -Werror"
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. Warfield# Files requiring some variable expansion
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. WarfieldAC_CONFIG_FILES([
41cf1ac30de569888c70b1f1b40d29993950ff2eMichael H. WarfieldAC_CONFIG_COMMANDS([default],[[]],[[]])