btrfs-progs: Improve static building and installation
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sat, 30 Aug 2014 12:48:10 +0000 (14:48 +0200)
committerDavid Sterba <dsterba@suse.cz>
Tue, 2 Sep 2014 15:05:23 +0000 (17:05 +0200)
commit1cb7bd2f3c1c26508af5ca3cace4826b5760ee81
tree471416e0693b607b875213e53f5b68e5291bc702
parentef208e98cea2918aedb78f182b24461b9a5c275f
btrfs-progs: Improve static building and installation

This commit improves the static-only building of btrfs-progs, and adds
support for installing the static only tools:

 - It now ensures that all programs are built statically, not only a
   small subset of them, by defining 'progs_static' from the existing
   'progs' variable.

 - It changes the order of libraries in the btrfs-%.static rule so
   that -lpthread (part of STATIC_LIBS) appears *after* the '$($(subst
   -,_,$(subst .static,,$@)-libs))' logic, which brings in
   -lcom_err. This is needed because libcom_err.a uses the semaphore
   functions, which are available in the pthread library.

 - Adds the necessary rules to generate the btrfsck.static link and
   btrfstune.static binary.

 - Adds an 'install-static' target to install the static
   binaries. Note that they are renamed to not carry a '.static'
   suffix.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Makefile