1 keyutils: Allow building of the shared library to be suppressed
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
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
20 SPECFILE := keyutils.spec
30 ###############################################################################
31 -all: $(DEVELLIB) keyctl request-key key.dns_resolver
32 +all: keyctl request-key key.dns_resolver
34 ###############################################################################
37 ###############################################################################
38 #RPATH = -Wl,-rpath,$(LIBDIR)
46 VCPPFLAGS := -DPKGBUILD="\"$(shell date -u +%F)\""
47 VCPPFLAGS += -DPKGVERSION="\"keyutils-$(VERSION)\""
48 VCPPFLAGS += -DAPIVERSION="\"libkeyutils-$(APIVERSION)\""
55 keyutils.o: keyutils.c keyutils.h Makefile
56 $(CC) $(CPPFLAGS) $(VCPPFLAGS) $(CFLAGS) -UNO_GLIBC_KEYERR -o $@ -c $<
57 +LIB_DEPENDENCY := libkeyutils.a
63 $(DEVELLIB): $(SONAME)
68 keyutils.os: keyutils.c keyutils.h Makefile
69 $(CC) $(CPPFLAGS) $(VCPPFLAGS) $(CFLAGS) -fPIC -o $@ -c $<
70 +LIB_DEPENDENCY := $(DEVELLIB)
73 ###############################################################################
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 ###############################################################################
94 $(INSTALL) -D -m 0644 $(ARLIB) $(DESTDIR)$(USRLIBDIR)/$(ARLIB)
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)
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