configure: detect supported retry flags for wget.

Some systems may be using wget2 symlinked to wget (Fedora,
currently), which doesn't support --retry-on-host-error.

Change-Id: I9fac080e7ac1cc4c39a03f6c27e9c42f8697ecff
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8336
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
Jessica Hamilton
2024-10-14 11:01:19 +00:00
committed by Adrien Destugues
parent 66582b42a5
commit 7c6ab83094
2 changed files with 13 additions and 1 deletions
+7 -1
View File
@@ -449,6 +449,12 @@ rule DownloadLocatedFile target : url : source
URL on $(target) = $(url) ; URL on $(target) = $(url) ;
if $(HOST_WGET_RETRY_ON_HOST_ERROR) {
WGET_RETRY_FLAGS on $(target) = "--retry-connrefused --retry-on-host-error" ;
} else {
WGET_RETRY_FLAGS on $(target) = "--retry-connrefused" ;
}
if $(source) { if $(source) {
Depends $(target) : $(source) ; Depends $(target) : $(source) ;
} }
@@ -467,7 +473,7 @@ if $(HAIKU_NO_DOWNLOADS) = 1 {
actions DownloadLocatedFile1 actions DownloadLocatedFile1
{ {
source="$(2)" source="$(2)"
wget --retry-connrefused --retry-on-host-error --timeout 30 -O "$(1)" $(URL) || exit 1 wget $(WGET_RETRY_FLAGS) --timeout 30 -O "$(1)" $(URL) || exit 1
touch "$(1)" touch "$(1)"
} }
} }
Vendored
+6
View File
@@ -907,6 +907,11 @@ case $PYTHON_VERSION in
;; ;;
esac esac
# check if wget supports --retry-on-host-error
if wget --retry-on-host-error --version > /dev/null 2>&1; then
HOST_WGET_RETRY_ON_HOST_ERROR=1
fi
# check if nasm can actually output ELF files # check if nasm can actually output ELF files
# (the stock version in OSX can't) # (the stock version in OSX can't)
# XXX: should probably only test for x86* arch # XXX: should probably only test for x86* arch
@@ -1159,6 +1164,7 @@ HOST_OBJCOPY ?= ${HOST_GCC_OBJCOPY} ;
HOST_EXTENDED_REGEX_SED ?= ${HOST_EXTENDED_REGEX_SED} ; HOST_EXTENDED_REGEX_SED ?= ${HOST_EXTENDED_REGEX_SED} ;
HOST_SHA256 ?= ${HOST_SHA256} ; HOST_SHA256 ?= ${HOST_SHA256} ;
HOST_PYTHON ?= ${HOST_PYTHON} ; HOST_PYTHON ?= ${HOST_PYTHON} ;
HOST_WGET_RETRY_ON_HOST_ERROR ?= ${HOST_WGET_RETRY_ON_HOST_ERROR} ;
HAIKU_NASM ?= ${HAIKU_NASM} ; HAIKU_NASM ?= ${HAIKU_NASM} ;
HAIKU_BUILD_ATTRIBUTES_DIR ?= "${HAIKU_BUILD_ATTRIBUTES_DIR}" ; HAIKU_BUILD_ATTRIBUTES_DIR ?= "${HAIKU_BUILD_ATTRIBUTES_DIR}" ;