libsepol: bump to version 2.5
[buildroot-gz.git] / package / libsepol / 0001-support-static-only.patch
blob3e9a84f8222a64d48e81a09ae4e4234bdf475806
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>
12 Index: b/src/Makefile
13 ===================================================================
15 diff --git a/src/Makefile b/src/Makefile
16 index db6c2ba..0006285 100644
17 --- a/src/Makefile
18 +++ b/src/Makefile
19 @@ -30,8 +30,12 @@ LOBJS += $(sort $(patsubst %.c,%.lo,$(wildcard $(CILDIR)/src/*.c) $(CIL_GENERATE
20 override CFLAGS += -I$(CILDIR)/include
21 endif
23 +ALL_TARGETS = $(LIBA) $(LIBPC)
24 +ifeq ($(STATIC),)
25 +ALL_TARGETS += $(LIBSO)
26 +endif
28 -all: $(LIBA) $(LIBSO) $(LIBPC)
29 +all: $(ALL_TARGETS)
32 $(LIBA): $(OBJS)
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
37 +ifeq ($(STATIC),)
38 + test -d $(SHLIBDIR) || install -m 755 -d $(SHLIBDIR)
39 + install -m 755 $(LIBSO) $(SHLIBDIR)
40 ln -sf --relative $(SHLIBDIR)/$(LIBSO) $(LIBDIR)/$(TARGET)
41 +endif
43 relabel:
44 /sbin/restorecon $(SHLIBDIR)/$(LIBSO)