1 Add support for static-only build
3 Instead of unconditionally building shared libraries, this patch
4 improves the libsepol build system with a "STATIC" variable, which
5 when defined to some non-empty value, will disable the build of shared
6 libraries. It allows to support cases where the target architecture
7 does not have support for shared libraries.
9 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
10 Signed-off-by: Adam Duskett <Aduskett@gmail.com>
13 ===================================================================
15 diff --git a/src/Makefile b/src/Makefile
16 index db6c2ba..0006285 100644
19 @@ -30,8 +30,12 @@ LOBJS += $(sort $(patsubst %.c,%.lo,$(wildcard $(CILDIR)/src/*.c) $(CIL_GENERATE
20 override CFLAGS += -I$(CILDIR)/include
23 +ALL_TARGETS = $(LIBA) $(LIBPC)
25 +ALL_TARGETS += $(LIBSO)
28 -all: $(LIBA) $(LIBSO) $(LIBPC)
33 @@ -70,7 +74,11 @@ install: all
34 install -m 755 $(LIBSO) $(SHLIBDIR)
35 test -d $(LIBDIR)/pkgconfig || install -m 755 -d $(LIBDIR)/pkgconfig
36 install -m 644 $(LIBPC) $(LIBDIR)/pkgconfig
38 + test -d $(SHLIBDIR) || install -m 755 -d $(SHLIBDIR)
39 + install -m 755 $(LIBSO) $(SHLIBDIR)
40 ln -sf --relative $(SHLIBDIR)/$(LIBSO) $(LIBDIR)/$(TARGET)
44 /sbin/restorecon $(SHLIBDIR)/$(LIBSO)