kbuild: add variables for compression tools
Allow user to use alternative implementations of compression tools, such as pigz, pbzip2, pxz. For example, multi-threaded tools to speed up the build: $ make GZIP=pigz BZIP2=pbzip2 Variables _GZIP, _BZIP2, _LZOP are used internally because original env vars are reserved by the tools. The use of GZIP in gzip tool is obsolete since 2015. However, alternative implementations (e.g., pigz) still rely on it. BZIP2, BZIP, LZOP vars are not obsolescent. The credit goes to @grsecurity. As a sidenote, for multi-threaded lzma, xz compression one can use: $ export XZ_OPT="--threads=0" Signed-off-by: Denis Efremov <efremov@linux.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
This commit is contained in:
committed by
Masahiro Yamada
parent
e0b250b57d
commit
8dfb61dcba
@@ -45,7 +45,7 @@ if test "$(objtree)" != "$(srctree)"; then \
|
||||
false; \
|
||||
fi ; \
|
||||
$(srctree)/scripts/setlocalversion --save-scmversion; \
|
||||
tar -cz $(RCS_TAR_IGNORE) -f $(2).tar.gz \
|
||||
tar -I $(_GZIP) -c $(RCS_TAR_IGNORE) -f $(2).tar.gz \
|
||||
--transform 's:^:$(2)/:S' $(TAR_CONTENT) $(3); \
|
||||
rm -f $(objtree)/.scmversion
|
||||
|
||||
@@ -127,9 +127,9 @@ util/PERF-VERSION-GEN $(CURDIR)/$(perf-tar)/); \
|
||||
tar rf $(perf-tar).tar $(perf-tar)/HEAD $(perf-tar)/PERF-VERSION-FILE; \
|
||||
rm -r $(perf-tar); \
|
||||
$(if $(findstring tar-src,$@),, \
|
||||
$(if $(findstring bz2,$@),bzip2, \
|
||||
$(if $(findstring gz,$@),gzip, \
|
||||
$(if $(findstring xz,$@),xz, \
|
||||
$(if $(findstring bz2,$@),$(_BZIP2), \
|
||||
$(if $(findstring gz,$@),$(_GZIP), \
|
||||
$(if $(findstring xz,$@),$(XZ), \
|
||||
$(error unknown target $@)))) \
|
||||
-f -9 $(perf-tar).tar)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user