buildgcc: support pigz and lbzip2 decpmpressors if installed.

These are multi-threaded decompressors for .gz and .bz2 compressed
files.  If they're installed, use them to decompress, if they're not,
use the standard single-threaded decompressors.

Change-Id: I397740817e6b234a43b62075899964bdab14f121
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/14146
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
Martin Roth 2016-03-20 12:38:48 -06:00
parent 588c79ddde
commit 95f7b22dc4
1 changed files with 9 additions and 4 deletions

View File

@ -243,10 +243,13 @@ unpack_and_patch() {
printf " * $(basename $archive)\n" printf " * $(basename $archive)\n"
FLAGS=zxf FLAGS=zxf
suffix=$(echo $archive | sed 's,.*\.,,') suffix=$(echo $archive | sed 's,.*\.,,')
test "$suffix" = "gz" && FLAGS=zxf if [ "$suffix" = "gz" ] && [ -n "$PIGZ" ]; then FLAGS="-I pigz -xf"
test "$suffix" = "bz2" && FLAGS=jxf elif [ "$suffix" = "gz" ]; then FLAGS=zxf
test "$suffix" = "xz" && FLAGS="--xz -xf" elif [ "$suffix" = "bz2" ] && [ -n "$LBZIP2" ]; then FLAGS="-I lbzip2 -xf"
test "$suffix" = "lzma" && FLAGS="--lzma -xf" elif [ "$suffix" = "bz2" ]; then FLAGS=jxf
elif [ "$suffix" = "xz" ]; then FLAGS="--xz -xf"
elif [ "$suffix" = "lzma" ]; then FLAGS="--lzma -xf"
fi
$TAR $FLAGS tarballs/$(basename $archive) $TAR $FLAGS tarballs/$(basename $archive)
for patch in patches/${dir}_*.patch; do for patch in patches/${dir}_*.patch; do
test -r $patch || continue test -r $patch || continue
@ -675,6 +678,8 @@ MAKE=$(searchtool make) || exit $?
SHA1SUM=$(searchtool sha1sum) SHA1SUM=$(searchtool sha1sum)
SHA512SUM=$(searchtool sha512sum) SHA512SUM=$(searchtool sha512sum)
CHECKSUM=$SHA1SUM CHECKSUM=$SHA1SUM
LBZIP2=$(searchtool lbzip2 "" nofail)
PIGZ=$(searchtool pigz "" nofail)
searchtool m4 > /dev/null searchtool m4 > /dev/null
searchtool bison > /dev/null searchtool bison > /dev/null