[lxc-devel] [PATCH 05/21] No need to link against rt and util on bionic

Stéphane Graber stgraber at ubuntu.com
Thu Jan 3 17:24:06 UTC 2013


When building on bionic, -lrt and -lutil only cause a build failure.
Dropping those fixes the build, so it appears that the symbols are defined
in the main library.

This commit moves -lrt and -lutil under a !IS_BIONIC check.

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 src/lxc/Makefile.am | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/lxc/Makefile.am b/src/lxc/Makefile.am
index bf675f9..489beac 100644
--- a/src/lxc/Makefile.am
+++ b/src/lxc/Makefile.am
@@ -82,7 +82,11 @@ liblxc_so_LDFLAGS = \
 	-shared \
 	-Wl,-soname,liblxc.so.$(firstword $(subst ., ,$(VERSION)))
 
-liblxc_so_LDADD = -lutil $(CAP_LIBS) $(APPARMOR_LIBS) $(SECCOMP_LIBS) -lrt
+liblxc_so_LDADD = $(CAP_LIBS) $(APPARMOR_LIBS) $(SECCOMP_LIBS)
+
+if !IS_BIONIC
+liblxc_so_LDADD += -lutil -lrt
+endif
 
 bin_SCRIPTS = \
 	lxc-ps \
@@ -128,7 +132,11 @@ AM_LDFLAGS = -Wl,-E
 if ENABLE_RPATH
 AM_LDFLAGS += -Wl,-rpath -Wl,$(libdir)
 endif
-LDADD=liblxc.so @CAP_LIBS@ @APPARMOR_LIBS@ @SECCOMP_LIBS@ -lrt
+LDADD=liblxc.so @CAP_LIBS@ @APPARMOR_LIBS@ @SECCOMP_LIBS@
+
+if !IS_BIONIC
+	LDADD += -lrt
+endif
 
 lxc_attach_SOURCES = lxc_attach.c
 lxc_cgroup_SOURCES = lxc_cgroup.c
-- 
1.8.0





More information about the lxc-devel mailing list