aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPalmer Dabbelt <palmer.dabbelt@eecs.berkeley.edu>2015-02-26 15:07:03 -0800
committerPalmer Dabbelt <palmer.dabbelt@eecs.berkeley.edu>2015-02-26 15:10:36 -0800
commitebf58cc30815b2260a6c3cd61a912f4787249ae3 (patch)
treee16eea156e77b2848130a0d11e317bc2fac7f8a7
parentde00a614ebc3bc5b72e5450ba1f5cd24ad8b8ab3 (diff)
downloadriscv-gnu-toolchain-ebf58cc30815b2260a6c3cd61a912f4787249ae3.zip
riscv-gnu-toolchain-ebf58cc30815b2260a6c3cd61a912f4787249ae3.tar.gz
riscv-gnu-toolchain-ebf58cc30815b2260a6c3cd61a912f4787249ae3.tar.bz2
Look for already downloaded files in DISTDIR (/var/cache/destfiles)
buildbot.dabbelt.com recently failed because it was unable to fetch the downloaded files fast enough because mirrors.kernel.org was being slow. This patch allows me to cache the downloaded files somewhere to avoid these sorts of network problems. This should also be generally useful for other people who build the toolchain regularly.
-rwxr-xr-xMakefile.in3
1 files changed, 2 insertions, 1 deletions
diff --git a/Makefile.in b/Makefile.in
index f781ec6..a6f2687 100755
--- a/Makefile.in
+++ b/Makefile.in
@@ -8,6 +8,7 @@ binutils_version := 2.25
glibc_version := 2.21
newlib_version := 1.18.0
+DISTDIR ?= /var/cache/distfiles
GNU_MIRROR := http://mirrors.kernel.org/gnu
gcc_url := $(GNU_MIRROR)/gcc/gcc-$(gcc_version)/gcc-$(gcc_version).tar.gz
binutils_url := $(GNU_MIRROR)/binutils/binutils-$(binutils_version).tar.gz
@@ -32,7 +33,7 @@ linux: stamps/build-gcc-linux-stage2
$(addprefix src/original-,$(PACKAGES)):
mkdir -p src
rm -rf $@ $(subst original-,,$@)-*
- cd src && @FETCHER@ $($(subst src/original-,,$@)_url) | tar zxf -
+ cd src && (cat $(DISTDIR)/$(subst src/original-,,$@)-$($(subst src/original-,,$@)_version).tar.gz || @FETCHER@ $($(subst src/original-,,$@)_url)) | tar zxf -
mv $(subst original-,,$@)-$($(subst src/original-,,$@)_version) $@
$(addprefix src/,$(PACKAGES)): src/%: src/original-%