0001-support-static-only.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. From 2140db697c7f1da2a0a3f7bbcb14c1a0dade84e5 Mon Sep 17 00:00:00 2001
  2. From: Adam Duskett <aduskett@gmail.com>
  3. Date: Mon, 9 Oct 2017 16:28:12 -0400
  4. Subject: [PATCH] Add support for static-only build
  5. Instead of unconditionally building shared libraries, this patch
  6. improves the libsepol build system with a "STATIC" variable, which
  7. when defined to some non-empty value, will disable the build of shared
  8. libraries. It allows to support cases where the target architecture
  9. does not have support for shared libraries.
  10. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  11. Signed-off-by: Adam Duskett <aduskett@gmail.com>
  12. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  13. [Update for 2.8]
  14. ---
  15. src/Makefile | 13 ++++++++++---
  16. 1 file changed, 10 insertions(+), 3 deletions(-)
  17. diff -durNw libsepol-2.7.orig/src/Makefile libsepol-2.7/src/Makefile
  18. --- libsepol-2.7.orig/src/Makefile 2018-01-15 21:07:51.285183415 +0100
  19. +++ libsepol-2.7/src/Makefile 2018-01-15 21:08:56.515182717 +0100
  20. @@ -39,7 +39,12 @@
  21. LN=gln
  22. endif
  23. -all: $(LIBA) $(LIBSO) $(LIBPC)
  24. +ALL_TARGETS = $(LIBA) $(LIBPC)
  25. +ifeq ($(STATIC),)
  26. +ALL_TARGETS += $(LIBSO)
  27. +endif
  28. +
  29. +all: $(ALL_TARGETS)
  30. $(LIBA): $(OBJS)
  31. @@ -81,8 +86,10 @@
  32. install: all
  33. test -d $(DESTDIR)$(LIBDIR) || install -m 755 -d $(DESTDIR)$(LIBDIR)
  34. install -m 644 $(LIBA) $(DESTDIR)$(LIBDIR)
  35. +ifeq ($(STATIC),)
  36. test -d $(DESTDIR)$(SHLIBDIR) || install -m 755 -d $(DESTDIR)$(SHLIBDIR)
  37. install -m 755 $(LIBSO) $(DESTDIR)$(SHLIBDIR)
  38. +endif
  39. test -d $(DESTDIR)$(LIBDIR)/pkgconfig || install -m 755 -d $(DESTDIR)$(LIBDIR)/pkgconfig
  40. install -m 644 $(LIBPC) $(DESTDIR)$(LIBDIR)/pkgconfig
  41. $(LN) -sf --relative $(DESTDIR)$(SHLIBDIR)/$(LIBSO) $(DESTDIR)$(LIBDIR)/$(TARGET)