btrfs-progs: bump version to 4.8.3
[buildroot-gz.git] / package / libsepol / 0001-support-static-only.patch
blob3e6d555e96e535a5688c54313ead8ebb554b2e66
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 @@ -66,11 +70,13 @@
34 install: all
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
41 +ifeq ($(STATIC),)
42 + test -d $(SHLIBDIR) || install -m 755 -d $(SHLIBDIR)
43 + install -m 755 $(LIBSO) $(SHLIBDIR)
44 ln -sf --relative $(SHLIBDIR)/$(LIBSO) $(LIBDIR)/$(TARGET)
45 +endif
47 relabel:
48 /sbin/restorecon $(SHLIBDIR)/$(LIBSO)