Commit e78884c9 by Dwight Engen Committed by Stéphane Graber

don't build init.lxc.static if libcap.a isn't available

Note that building init.lxc.static still requires a static libutil.a and libpthread.a, but these are available on most distro's through glibc-static. Signed-off-by: 's avatarDwight Engen <dwight.engen@oracle.com> Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
parent 513e1502
...@@ -266,6 +266,19 @@ if test "x$have_abs_cgroups" = "xyes"; then ...@@ -266,6 +266,19 @@ if test "x$have_abs_cgroups" = "xyes"; then
else else
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
fi fi
# Check for static libcap, make sure the function checked for differs from the
# the one checked below so the cache doesn't give a wrong answer
OLD_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -static"
AC_CHECK_LIB([cap],[cap_init],[have_static_libcap=yes],[have_static_libcap=no])
AM_CONDITIONAL([HAVE_STATIC_LIBCAP], [test "x$have_static_libcap" = "xyes"])
if test "x$have_static_libcap" = "xyes"; then
AC_DEFINE([HAVE_STATIC_LIBCAP], 1, [Have static libcap])
fi
CFLAGS="$OLD_CFLAGS"
# Linux capabilities # Linux capabilities
AC_ARG_ENABLE([capabilities], AC_ARG_ENABLE([capabilities],
[AC_HELP_STRING([--enable-capabilities], [enable kernel capabilities support [default=auto]])], [AC_HELP_STRING([--enable-capabilities], [enable kernel capabilities support [default=auto]])],
......
...@@ -199,7 +199,7 @@ bin_PROGRAMS = \ ...@@ -199,7 +199,7 @@ bin_PROGRAMS = \
lxc-usernsexec \ lxc-usernsexec \
lxc-wait lxc-wait
sbin_PROGRAMS = init.lxc init.lxc.static sbin_PROGRAMS = init.lxc
pkglibexec_PROGRAMS = \ pkglibexec_PROGRAMS = \
lxc-monitord \ lxc-monitord \
lxc-user-nic lxc-user-nic
...@@ -233,6 +233,9 @@ lxc_snapshot_SOURCES = lxc_snapshot.c ...@@ -233,6 +233,9 @@ lxc_snapshot_SOURCES = lxc_snapshot.c
lxc_usernsexec_SOURCES = lxc_usernsexec.c lxc_usernsexec_SOURCES = lxc_usernsexec.c
lxc_user_nic_SOURCES = lxc_user_nic.c network.c network.h lxc_user_nic_SOURCES = lxc_user_nic.c network.c network.h
if HAVE_STATIC_LIBCAP
sbin_PROGRAMS += init.lxc.static
init_lxc_static_SOURCES = lxc_init.c error.c log.c utils.c caps.c init_lxc_static_SOURCES = lxc_init.c error.c log.c utils.c caps.c
if !HAVE_GETLINE if !HAVE_GETLINE
...@@ -243,6 +246,7 @@ endif ...@@ -243,6 +246,7 @@ endif
init_lxc_static_LDFLAGS = -static init_lxc_static_LDFLAGS = -static
init_lxc_static_LDADD = @CAP_LIBS@ init_lxc_static_LDADD = @CAP_LIBS@
endif
install-exec-local: install-soPROGRAMS install-exec-local: install-soPROGRAMS
mkdir -p $(DESTDIR)$(datadir)/lxc mkdir -p $(DESTDIR)$(datadir)/lxc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment