0001-Makefile-install-static-library-and-headers-in-insta.patch 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. From ff93866eb119cedb791894814780c0e44db35715 Mon Sep 17 00:00:00 2001
  2. From: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
  3. Date: Fri, 10 Mar 2017 14:56:17 +0000
  4. Subject: [PATCH] Makefile: install static library and headers in
  5. install-static
  6. Currently, the install-static target only installs the statically
  7. compiled tools. However, some programs outside of btrfs-progs (for
  8. example docker) link with the btrfs libraries. If such programs want to
  9. link statically against the btrfs-progs library, then this library
  10. should be installed by "install-static". Indeed, "make install" cannot
  11. be used if the support for shared library is not enabled.
  12. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  13. [Gustavo: Rebase for btrfs-progs 4.7.2]
  14. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
  15. [Vincent: Rebase for btrfs-progs 4.10]
  16. Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
  17. [baruch: Rebase for btrfs-progs 4.16]
  18. Signed-off-by: Baruch Siach <baruch@tkos.co.il>
  19. ---
  20. Makefile | 6 +++++-
  21. 1 file changed, 5 insertions(+), 1 deletion(-)
  22. diff --git a/Makefile b/Makefile
  23. index 67fbc48..d9e34be 100644
  24. --- a/Makefile
  25. +++ b/Makefile
  26. @@ -308,7 +308,7 @@ test: test-fsck test-mkfs test-convert test-misc test-fuzz test-cli
  27. # NOTE: For static compiles, you need to have all the required libs
  28. # static equivalent available
  29. #
  30. -static: $(progs_static)
  31. +static: $(progs_static) $(libs_static)
  32. version.h: version.sh version.h.in configure.ac
  33. @echo " [SH] $@"
  34. @@ -537,6 +537,10 @@ install-static: $(progs_static) $(INSTALLDIRS)
  35. $(INSTALL) $(progs_static) $(DESTDIR)$(bindir)
  36. # btrfsck is a link to btrfs in the src tree, make it so for installed file as well
  37. $(LN_S) -f btrfs.static $(DESTDIR)$(bindir)/btrfsck.static
  38. + $(INSTALL) -m755 -d $(DESTDIR)$(libdir)
  39. + $(INSTALL) $(libs_static) $(DESTDIR)$(libdir)
  40. + $(INSTALL) -m755 -d $(DESTDIR)$(incdir)/btrfs
  41. + $(INSTALL) -m644 $(libbtrfs_headers) $(DESTDIR)$(incdir)/btrfs
  42. $(INSTALLDIRS):
  43. @echo "Making install in $(patsubst install-%,%,$@)"
  44. --
  45. 2.10.2