btrfs-progs: build: install static library and headers in install-static

Currently, the install-static target only installs the statically
compiled tools. However, some programs outside of btrfs-progs (for
example docker) link with the btrfs libraries. If such programs want to
link statically against the btrfs-progs library, then this library
should be installed by "install-static". Indeed, "make install" cannot
be used if the support for shared library is not enabled.

Pull-request: #211
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[Gustavo: Rebase for btrfs-progs 4.7.2]
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
[Vincent: Rebase for btrfs-progs 4.10]
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
[baruch: Rebase for btrfs-progs 4.16]
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
[Retrieved from:
https://git.buildroot.net/buildroot/tree/package/btrfs-progs/0001-Makefile-install-static-library-and-headers-in-insta.patch]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
master
Fabrice Fontaine 2019-09-26 20:34:22 +02:00 committed by David Sterba
parent 50ec684a20
commit 9a03f6d41f
1 changed files with 5 additions and 1 deletions

View File

@ -438,7 +438,7 @@ endif
# NOTE: For static compiles, you need to have all the required libs
# static equivalent available
#
static: $(progs_static)
static: $(progs_static) $(libs_static)
version.h: version.h.in configure.ac
@echo " [SH] $@"
@ -769,6 +769,10 @@ install-static: $(progs_static) $(INSTALLDIRS)
$(INSTALL) $(progs_static) $(DESTDIR)$(bindir)
# btrfsck is a link to btrfs in the src tree, make it so for installed file as well
$(LN_S) -f btrfs.static $(DESTDIR)$(bindir)/btrfsck.static
$(INSTALL) -m755 -d $(DESTDIR)$(libdir)
$(INSTALL) $(libs_static) $(DESTDIR)$(libdir)
$(INSTALL) -m755 -d $(DESTDIR)$(incdir)/btrfs
$(INSTALL) -m644 $(libbtrfs_headers) $(DESTDIR)$(incdir)/btrfs
$(INSTALLDIRS):
@echo "Making install in $(patsubst install-%,%,$@)"