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