]> git.proxmox.com Git - mirror_lxcfs.git/commitdiff
libtool: do not link lxcfs against liblxcfs
authorChristian Brauner <cbrauner@suse.de>
Mon, 29 Aug 2016 08:12:27 +0000 (10:12 +0200)
committerChristian Brauner <cbrauner@suse.de>
Mon, 29 Aug 2016 16:59:37 +0000 (18:59 +0200)
Make liblxcfs a libtool module. Also, stop linking lxcfs against liblxcfs. We do
not really need this since we call dlopen() anyway. Furthermore, this allows us
to make sure that functions marked with __attribute__(constructor) are not run
before we call dlopen() in main() in lxcfs. This has the advantage that we can
show help output without __attribute__(constructor) functions being run.

Signed-off-by: Christian Brauner <cbrauner@suse.de>
Makefile.am

index cb4abc1e4b252352c9cea1392bf1eafa328c39a1..444eaf5e08b37cd753db4b68d5efb0af4337de55 100644 (file)
@@ -9,15 +9,15 @@ AM_CFLAGS += -DLIBDIR=\"$(LIBDIR)\"
 AM_LDFLAGS = $(FUSE_LIBS) -pthread
 #AM_CFLAGS += -DDEBUG
 
-AM_CFLAGS += -DRUNTIME_PATH=\"$(RUNTIME_PATH)\" 
+AM_CFLAGS += -DRUNTIME_PATH=\"$(RUNTIME_PATH)\"
 
 liblxcfs_la_SOURCES = bindings.c cpuset.c bindings.h
 liblxcfs_la_CFLAGS = $(AM_CFLAGS)
-liblxcfs_la_LDFLAGS = $(AM_CFLAGS) -shared
+liblxcfs_la_LDFLAGS = $(AM_CFLAGS) -module -shared
 
 liblxcfstest_la_SOURCES = bindings.c cpuset.c bindings.h
 liblxcfstest_la_CFLAGS = $(AM_CFLAGS) -DRELOADTEST
-liblxcfstest_la_LDFLAGS = $(AM_CFLAGS) -shared
+liblxcfstest_la_LDFLAGS = $(AM_CFLAGS) -module -shared
 
 noinst_HEADERS = bindings.h
 
@@ -26,7 +26,7 @@ lib_LTLIBRARIES = liblxcfs.la
 EXTRA_LTLIBRARIES = liblxcfstest.la
 
 lxcfs_SOURCES = lxcfs.c
-lxcfs_LDADD = liblxcfs.la -ldl
+lxcfs_LDADD = -ldl
 lxcfs_CFLAGS = $(AM_CFLAGS)
 lxcfs_LDFLAGS = $(AM_LDFLAGS)
 bin_PROGRAMS = lxcfs