python-dataproperty: bump version to 0.17.0
[buildroot-gz.git] / package / keyutils / 0001-allow-building-of-the-shared-library-to-be-suppressed.patch
blob88d32b0cf0d3c2f5ebd63c3cd39695998559286d
1 keyutils: Allow building of the shared library to be suppressed
3 Upstream patch:
4 https://kernel.googlesource.com/pub/scm/linux/kernel/git/dhowells/keyutils/+/a4deb71ddc05e951c8be8d46615beed9d408a5c8
6 Signed-off-by: Vicente Olivert Riera <vincent.riera@imgtec.com>
8 LIB: Allow building of the shared library to be suppressed
10 Allow building of the shared library to be suppressed by passing NO_SOLIB=1 to
11 the Makefile.
13 Reported-and-tested-by: Vicente Olivert Riera <vincent.riera@imgtec.com>
14 Signed-off-by: David Howells <dhowells@redhat.com>
15 diff --git a/Makefile b/Makefile
16 index c904eaf..5dd2113 100644
17 --- a/Makefile
18 +++ b/Makefile
19 @@ -5,6 +5,7 @@
20 SPECFILE := keyutils.spec
21 NO_GLIBC_KEYERR := 0
22 NO_ARLIB := 0
23 +NO_SOLIB := 0
24 ETCDIR := /etc
25 BINDIR := /bin
26 SBINDIR := /sbin
27 @@ -95,7 +96,7 @@
28 # Normal build rule
30 ###############################################################################
31 -all: $(DEVELLIB) keyctl request-key key.dns_resolver
32 +all: keyctl request-key key.dns_resolver
34 ###############################################################################
36 @@ -104,20 +105,23 @@
37 ###############################################################################
38 #RPATH = -Wl,-rpath,$(LIBDIR)
40 -ifeq ($(NO_ARLIB),0)
41 -all: $(ARLIB)
42 -$(ARLIB): keyutils.o
43 - $(AR) rcs $@ $<
44 -endif
46 VCPPFLAGS := -DPKGBUILD="\"$(shell date -u +%F)\""
47 VCPPFLAGS += -DPKGVERSION="\"keyutils-$(VERSION)\""
48 VCPPFLAGS += -DAPIVERSION="\"libkeyutils-$(APIVERSION)\""
50 +ifeq ($(NO_ARLIB),0)
51 +all: $(ARLIB)
52 +$(ARLIB): keyutils.o
53 + $(AR) rcs $@ $<
55 keyutils.o: keyutils.c keyutils.h Makefile
56 $(CC) $(CPPFLAGS) $(VCPPFLAGS) $(CFLAGS) -UNO_GLIBC_KEYERR -o $@ -c $<
57 +LIB_DEPENDENCY := libkeyutils.a
58 +endif
61 +ifeq ($(NO_SOLIB),0)
62 +all: $(DEVELLIB)
63 $(DEVELLIB): $(SONAME)
64 ln -sf $< $@
66 @@ -131,6 +135,8 @@
68 keyutils.os: keyutils.c keyutils.h Makefile
69 $(CC) $(CPPFLAGS) $(VCPPFLAGS) $(CFLAGS) -fPIC -o $@ -c $<
70 +LIB_DEPENDENCY := $(DEVELLIB)
71 +endif
73 ###############################################################################
75 @@ -140,13 +146,13 @@
76 %.o: %.c keyutils.h Makefile
77 $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
79 -keyctl: keyctl.o $(DEVELLIB)
80 +keyctl: keyctl.o $(LIB_DEPENDENCY)
81 $(CC) -L. $(CFLAGS) $(LDFLAGS) $(RPATH) -o $@ $< -lkeyutils
83 -request-key: request-key.o $(DEVELLIB)
84 +request-key: request-key.o $(LIB_DEPENDENCY)
85 $(CC) -L. $(CFLAGS) $(LDFLAGS) $(RPATH) -o $@ $< -lkeyutils
87 -key.dns_resolver: key.dns_resolver.o $(DEVELLIB)
88 +key.dns_resolver: key.dns_resolver.o $(LIB_DEPENDENCY)
89 $(CC) -L. $(CFLAGS) $(LDFLAGS) $(RPATH) -o $@ $< -lkeyutils -lresolv
91 ###############################################################################
92 @@ -158,10 +164,12 @@
93 ifeq ($(NO_ARLIB),0)
94 $(INSTALL) -D -m 0644 $(ARLIB) $(DESTDIR)$(USRLIBDIR)/$(ARLIB)
95 endif
96 +ifeq ($(NO_SOLIB),0)
97 $(INSTALL) -D $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBNAME)
98 $(LNS) $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(SONAME)
99 mkdir -p $(DESTDIR)$(USRLIBDIR)
100 $(LNS) $(LIBDIR)/$(SONAME) $(DESTDIR)$(USRLIBDIR)/$(DEVELLIB)
101 +endif
102 $(INSTALL) -D keyctl $(DESTDIR)$(BINDIR)/keyctl
103 $(INSTALL) -D request-key $(DESTDIR)$(SBINDIR)/request-key
104 $(INSTALL) -D request-key-debug.sh $(DESTDIR)$(SHAREDIR)/request-key-debug.sh