2014-02-20 14:32:50 +01:00
|
|
|
Add support for static-only build
|
|
|
|
|
|
|
|
Instead of unconditionally building shared libraries, this patch
|
|
|
|
improves the libsepol build system with a "STATIC" variable, which
|
|
|
|
when defined to some non-empty value, will disable the build of shared
|
|
|
|
libraries. It allows to support cases where the target architecture
|
|
|
|
does not have support for shared libraries.
|
|
|
|
|
|
|
|
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
2016-06-27 00:39:12 +02:00
|
|
|
Signed-off-by: Adam Duskett <Aduskett@gmail.com>
|
2014-02-20 14:32:50 +01:00
|
|
|
|
|
|
|
Index: b/src/Makefile
|
|
|
|
===================================================================
|
2016-06-27 00:39:12 +02:00
|
|
|
|
|
|
|
diff --git a/src/Makefile b/src/Makefile
|
|
|
|
index db6c2ba..0006285 100644
|
2014-02-20 14:32:50 +01:00
|
|
|
--- a/src/Makefile
|
|
|
|
+++ b/src/Makefile
|
2016-06-27 00:39:12 +02:00
|
|
|
@@ -30,8 +30,12 @@ LOBJS += $(sort $(patsubst %.c,%.lo,$(wildcard $(CILDIR)/src/*.c) $(CIL_GENERATE
|
|
|
|
override CFLAGS += -I$(CILDIR)/include
|
|
|
|
endif
|
2014-02-20 14:32:50 +01:00
|
|
|
|
|
|
|
+ALL_TARGETS = $(LIBA) $(LIBPC)
|
|
|
|
+ifeq ($(STATIC),)
|
|
|
|
+ALL_TARGETS += $(LIBSO)
|
|
|
|
+endif
|
2016-06-27 00:39:12 +02:00
|
|
|
|
|
|
|
-all: $(LIBA) $(LIBSO) $(LIBPC)
|
2014-02-20 14:32:50 +01:00
|
|
|
+all: $(ALL_TARGETS)
|
|
|
|
|
2016-06-27 00:39:12 +02:00
|
|
|
|
2014-02-20 14:32:50 +01:00
|
|
|
$(LIBA): $(OBJS)
|
2016-06-27 00:39:12 +02:00
|
|
|
@@ -70,7 +74,11 @@ install: all
|
|
|
|
install -m 755 $(LIBSO) $(SHLIBDIR)
|
2014-02-20 14:32:50 +01:00
|
|
|
test -d $(LIBDIR)/pkgconfig || install -m 755 -d $(LIBDIR)/pkgconfig
|
|
|
|
install -m 644 $(LIBPC) $(LIBDIR)/pkgconfig
|
|
|
|
+ifeq ($(STATIC),)
|
|
|
|
+ test -d $(SHLIBDIR) || install -m 755 -d $(SHLIBDIR)
|
|
|
|
+ install -m 755 $(LIBSO) $(SHLIBDIR)
|
2016-06-27 00:39:12 +02:00
|
|
|
ln -sf --relative $(SHLIBDIR)/$(LIBSO) $(LIBDIR)/$(TARGET)
|
2014-02-20 14:32:50 +01:00
|
|
|
+endif
|
|
|
|
|
|
|
|
relabel:
|
|
|
|
/sbin/restorecon $(SHLIBDIR)/$(LIBSO)
|