summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorMartin Roth <martinroth@google.com>2016-03-20 12:38:48 -0600
committerMartin Roth <martinroth@google.com>2016-03-25 18:14:31 +0100
commit95f7b22dc4e0db2e27fab615c6e9c42bf7898ce4 (patch)
treeefbfdf879aed2c835999fcb064592c99103c10e6 /util
parent588c79ddde002d023f12c778dd054f33454df723 (diff)
downloadcoreboot-95f7b22dc4e0db2e27fab615c6e9c42bf7898ce4.tar.xz
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>
Diffstat (limited to 'util')
-rwxr-xr-xutil/crossgcc/buildgcc13
1 files changed, 9 insertions, 4 deletions
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
index 33c2226f81..423d769047 100755
--- a/util/crossgcc/buildgcc
+++ b/util/crossgcc/buildgcc
@@ -243,10 +243,13 @@ unpack_and_patch() {
printf " * $(basename $archive)\n"
FLAGS=zxf
suffix=$(echo $archive | sed 's,.*\.,,')
- test "$suffix" = "gz" && FLAGS=zxf
- test "$suffix" = "bz2" && FLAGS=jxf
- test "$suffix" = "xz" && FLAGS="--xz -xf"
- test "$suffix" = "lzma" && FLAGS="--lzma -xf"
+ if [ "$suffix" = "gz" ] && [ -n "$PIGZ" ]; then FLAGS="-I pigz -xf"
+ elif [ "$suffix" = "gz" ]; then FLAGS=zxf
+ elif [ "$suffix" = "bz2" ] && [ -n "$LBZIP2" ]; then FLAGS="-I lbzip2 -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)
for patch in patches/${dir}_*.patch; do
test -r $patch || continue
@@ -675,6 +678,8 @@ MAKE=$(searchtool make) || exit $?
SHA1SUM=$(searchtool sha1sum)
SHA512SUM=$(searchtool sha512sum)
CHECKSUM=$SHA1SUM
+LBZIP2=$(searchtool lbzip2 "" nofail)
+PIGZ=$(searchtool pigz "" nofail)
searchtool m4 > /dev/null
searchtool bison > /dev/null