fune/build/unix/build-binutils/build-binutils.sh
Gregory Szorc 6f469dc037 Bug 1430908 - Use --progress=dot:mega with wget; r=glandium
By default, wget prints dots every 1k bytes. This can render a
lot of output for large files. We switch to the "mega" style, which
makes each dot represent 64k, thus reducing output by up to 64x.

We also force the use of dot display. By default, it uses "bar"
which attempts to use terminal formatting if possible. Since most
of this code executes in CI and terminal control characters can
interfere with logged output, we force the use of "dot." (Although
wget appears to automatically switch to dot in TC today. But
consistency is good.)

MozReview-Commit-ID: IpTWJdcauTV

--HG--
extra : rebase_source : 5c9aa1bbdcd78eaa0b31347ad026a2c1beaedc03
2018-01-16 14:24:31 -08:00

32 lines
803 B
Bash
Executable file

#!/bin/bash
binutils_version=2.25.1
make_flags='-j12'
root_dir="$1"
if [ -z "$root_dir" -o ! -d "$root_dir" ]; then
root_dir=$(mktemp -d)
fi
cd $root_dir
if test -z $TMPDIR; then
TMPDIR=/tmp/
fi
# Download the source of the specified version of binutils
wget -c --progress=dot:mega -P $TMPDIR ftp://ftp.gnu.org/gnu/binutils/binutils-${binutils_version}.tar.bz2 || exit 1
tar xjf $TMPDIR/binutils-${binutils_version}.tar.bz2
# Build binutils
mkdir binutils-objdir
cd binutils-objdir
../binutils-$binutils_version/configure --prefix /tools/binutils/ --enable-gold --enable-plugins --disable-nls || exit 1
make $make_flags || exit 1
make install $make_flags DESTDIR=$root_dir || exit 1
cd ..
# Make a package of the built binutils
cd $root_dir/tools
tar caf $root_dir/binutils.tar.xz binutils/