Bug 1335667 - Use set -e instead of manual exit 1. r=froydnj

--HG--
extra : rebase_source : 2cdffa62dafab2f9cc588122bdb3240d92a8d188
This commit is contained in:
Mike Hommey 2017-02-01 16:35:18 +09:00
parent bc1a9d9837
commit 4a68fd13bf

View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
set -e
gcc_version=4.9.4 gcc_version=4.9.4
binutils_version=2.25.1 binutils_version=2.25.1
this_path=$(readlink -f $(dirname $0)) this_path=$(readlink -f $(dirname $0))
@ -15,23 +17,23 @@ if test -z $TMPDIR; then
TMPDIR=/tmp/ TMPDIR=/tmp/
fi fi
wget -c -P $TMPDIR ftp://ftp.gnu.org/gnu/binutils/binutils-$binutils_version.tar.bz2 || exit 1 wget -c -P $TMPDIR ftp://ftp.gnu.org/gnu/binutils/binutils-$binutils_version.tar.bz2
tar xjf $TMPDIR/binutils-$binutils_version.tar.bz2 tar xjf $TMPDIR/binutils-$binutils_version.tar.bz2
mkdir binutils-objdir mkdir binutils-objdir
cd binutils-objdir cd binutils-objdir
# gold is disabled because we don't use it on automation, and also we ran into # gold is disabled because we don't use it on automation, and also we ran into
# some issues with it using this script in build-clang.py. # some issues with it using this script in build-clang.py.
../binutils-$binutils_version/configure --prefix /tools/gcc/ --disable-gold --enable-plugins --disable-nls || exit 1 ../binutils-$binutils_version/configure --prefix /tools/gcc/ --disable-gold --enable-plugins --disable-nls
make $make_flags || exit 1 make $make_flags
make install $make_flags DESTDIR=$root_dir || exit 1 make install $make_flags DESTDIR=$root_dir
cd .. cd ..
case "$gcc_version" in case "$gcc_version" in
*-*) *-*)
wget -c -P $TMPDIR ftp://gcc.gnu.org/pub/gcc/snapshots/$gcc_version/gcc-$gcc_version.tar.bz2 || exit 1 wget -c -P $TMPDIR ftp://gcc.gnu.org/pub/gcc/snapshots/$gcc_version/gcc-$gcc_version.tar.bz2
;; ;;
*) *)
wget -c -P $TMPDIR ftp://ftp.gnu.org/gnu/gcc/gcc-$gcc_version/gcc-$gcc_version.tar.bz2 || exit 1 wget -c -P $TMPDIR ftp://ftp.gnu.org/gnu/gcc/gcc-$gcc_version/gcc-$gcc_version.tar.bz2
;; ;;
esac esac
tar xjf $TMPDIR/gcc-$gcc_version.tar.bz2 tar xjf $TMPDIR/gcc-$gcc_version.tar.bz2
@ -39,14 +41,14 @@ cd gcc-$gcc_version
./contrib/download_prerequisites ./contrib/download_prerequisites
patch -p1 < "${this_path}/PR64905.patch" || exit 1 patch -p1 < "${this_path}/PR64905.patch"
cd .. cd ..
mkdir gcc-objdir mkdir gcc-objdir
cd gcc-objdir cd gcc-objdir
../gcc-$gcc_version/configure --prefix=/tools/gcc --enable-languages=c,c++ --disable-nls --disable-gnu-unique-object --enable-__cxa_atexit --with-arch-32=pentiumpro || exit 1 ../gcc-$gcc_version/configure --prefix=/tools/gcc --enable-languages=c,c++ --disable-nls --disable-gnu-unique-object --enable-__cxa_atexit --with-arch-32=pentiumpro
make $make_flags || exit 1 make $make_flags
make $make_flags install DESTDIR=$root_dir || exit 1 make $make_flags install DESTDIR=$root_dir
cd $root_dir/tools cd $root_dir/tools
tar caf $root_dir/gcc.tar.xz gcc/ tar caf $root_dir/gcc.tar.xz gcc/