blob: 185a5641de6254fb9ca04c395e27bea3ace51309 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
From 2140db697c7f1da2a0a3f7bbcb14c1a0dade84e5 Mon Sep 17 00:00:00 2001
From: Adam Duskett <Adamduskett@outlook.com>
Date: Mon, 9 Oct 2017 16:28:12 -0400
Subject: [PATCH] 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>
Signed-off-by: Adam Duskett <Adamduskett@outlook.com>
---
src/Makefile | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/Makefile b/src/Makefile
index 819d261..040921d 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -40,7 +40,12 @@ LDFLAGS += -undefined dynamic_lookup
LN=gln
endif
-all: $(LIBA) $(LIBSO) $(LIBPC)
+ALL_TARGETS = $(LIBA) $(LIBPC)
+ifeq ($(STATIC),)
+ALL_TARGETS += $(LIBSO)
+endif
+
+all: $(ALL_TARGETS)
$(LIBA): $(OBJS)
@@ -82,11 +87,13 @@ endif
install: all
test -d $(LIBDIR) || install -m 755 -d $(LIBDIR)
install -m 644 $(LIBA) $(LIBDIR)
- test -d $(SHLIBDIR) || install -m 755 -d $(SHLIBDIR)
- install -m 755 $(LIBSO) $(SHLIBDIR)
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)
$(LN) -sf --relative $(SHLIBDIR)/$(LIBSO) $(LIBDIR)/$(TARGET)
+endif
relabel:
/sbin/restorecon $(SHLIBDIR)/$(LIBSO)
--
2.13.6
|