From 5c37199dd3b44bee69b6a18880d5883eb7e6147f Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 14 Dec 2016 23:42:27 -0500 Subject: [PATCH] allow using programs over than wget to download sources based on patch by Michael Forney, but using a plain variable without without the need for $(call ...). I used a different name for the variable so that it won't break if anyone has an HTTP_GET variable for use with the original patch in their config.mak. --- Makefile | 6 ++++-- config.mak.dist | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 9aee7f9..394b97d 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,8 @@ MUSL_REPO = git://git.musl-libc.org/musl LINUX_SITE = https://cdn.kernel.org/pub/linux/kernel +DL_CMD = wget -c -O + BUILD_DIR = build-$(TARGET) -include config.mak @@ -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 && $(DL_CMD) $(notdir $@) "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=$(CONFIG_SUB_REV)" 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 && $(DL_CMD) $(notdir $@) $(SITE)/$(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..a5034fa 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. + +# DL_CMD = wget -c -O +# DL_CMD = curl -C - -L -o + # 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