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)
35 test -d $(LIBDIR) || install -m 755 -d $(LIBDIR)
36 install -m 644 $(LIBA) $(LIBDIR)
37 - test -d $(SHLIBDIR) || install -m 755 -d $(SHLIBDIR)
38 - install -m 755 $(LIBSO) $(SHLIBDIR)
39 test -d $(LIBDIR)/pkgconfig || install -m 755 -d $(LIBDIR)/pkgconfig
40 install -m 644 $(LIBPC) $(LIBDIR)/pkgconfig
42 + test -d $(SHLIBDIR) || install -m 755 -d $(SHLIBDIR)
43 + install -m 755 $(LIBSO) $(SHLIBDIR)
44 ln -sf --relative $(SHLIBDIR)/$(LIBSO) $(LIBDIR)/$(TARGET)
48 /sbin/restorecon $(SHLIBDIR)/$(LIBSO)