From e1e800262e184fb8cf178843cc7df2c6af7f818a Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Fri, 2 Dec 2016 23:58:08 -0800 Subject: [PATCH] Allow overriding HTTP download tool in config.mak --- Makefile | 6 ++++-- config.mak.dist | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 9aee7f9..d43e73b 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,8 @@ LINUX_SITE = https://cdn.kernel.org/pub/linux/kernel BUILD_DIR = build-$(TARGET) +HTTP_GET = wget -c -O $(2) $(1) + -include config.mak SRC_DIRS = gcc-$(GCC_VER) binutils-$(BINUTILS_VER) musl-$(MUSL_VER) \ @@ -65,7 +67,7 @@ $(SOURCES): $(SOURCES)/config.sub: | $(SOURCES) mkdir -p $@.tmp - cd $@.tmp && wget -c -O $(notdir $@) "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=$(CONFIG_SUB_REV)" + cd $@.tmp && $(call HTTP_GET,"http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=$(CONFIG_SUB_REV)",$(notdir $@)) cd $@.tmp && touch $(notdir $@) cd $@.tmp && sha1sum -c $(CURDIR)/hashes/$(notdir $@).$(CONFIG_SUB_REV).sha1 mv $@.tmp/$(notdir $@) $@ @@ -73,7 +75,7 @@ $(SOURCES)/config.sub: | $(SOURCES) $(SOURCES)/%: hashes/%.sha1 | $(SOURCES) mkdir -p $@.tmp - cd $@.tmp && wget -c -O $(notdir $@) $(SITE)/$(notdir $@) + cd $@.tmp && $(call HTTP_GET,$(SITE)/$(notdir $@),$(notdir $@)) cd $@.tmp && touch $(notdir $@) cd $@.tmp && sha1sum -c $(CURDIR)/hashes/$(notdir $@).sha1 mv $@.tmp/$(notdir $@) $@ diff --git a/config.mak.dist b/config.mak.dist index eb02542..fcdaad6 100644 --- a/config.mak.dist +++ b/config.mak.dist @@ -41,6 +41,11 @@ # ISL_VER = # LINUX_VER = +# By default source archives are downloaded with wget. curl is also an option. + +# HTTP_GET = wget -c -O $(2) $(1) +# HTTP_GET = curl -C - -L -o $(2) $(1) + # Something like the following can be used to produce a static-linked # toolchain that's deployable to any system with matching arch, using # an existing musl-targeted cross compiler. This only # works if the