Skip to content
Snippets Groups Projects
Commit 3ab6be55 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk Committed by Adrien Béraud
Browse files

build: do not use system-provided sha512sum on macOS

This patch prevents macOS from using its system-provided sha512sum
to ensure consistent compatibility with other platforms.

Change-Id: Ie239cc14b9b0e17c486f5a3d4d55e6f26af32b0a
parent 6df44807
No related branches found
No related tags found
No related merge requests found
......@@ -287,14 +287,28 @@ else
ZCAT ?= $(error Gunzip client (zcat) not found!)
endif
ifeq ($(shell sha512sum --version >/dev/null 2>&1 || echo FAIL),)
SHA512SUM = sha512sum --check
else ifeq ($(shell shasum --version >/dev/null 2>&1 || echo FAIL),)
SHA512SUM = shasum -a 512 --check
else ifeq ($(shell openssl version >/dev/null 2>&1 || echo FAIL),)
SHA512SUM = openssl dgst -sha512
ifeq ($(shell uname),Darwin)
# On macOS, do not use sha512sum because the macOS implementation
# does not support reading piped input (STDIN) with the --check option.
# Instead, fallback to shasum or openssl if available.
ifeq ($(shell shasum --version >/dev/null 2>&1 || echo FAIL),)
SHA512SUM = shasum -a 512 --check
else ifeq ($(shell openssl version >/dev/null 2>&1 || echo FAIL),)
SHA512SUM = openssl dgst -sha512
else
SHA512SUM = $(error SHA-512 checksumming not found!)
endif
else
SHA512SUM = $(error SHA-512 checksumming not found!)
# On other systems, prefer sha512sum if available
ifeq ($(shell sha512sum --version >/dev/null 2>&1 || echo FAIL),)
SHA512SUM = sha512sum --check
else ifeq ($(shell shasum --version >/dev/null 2>&1 || echo FAIL),)
SHA512SUM = shasum -a 512 --check
else ifeq ($(shell openssl version >/dev/null 2>&1 || echo FAIL),)
SHA512SUM = openssl dgst -sha512
else
SHA512SUM = $(error SHA-512 checksumming not found!)
endif
endif
#
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment