From ee122baacfe147857854f3cf2d33875485ecb1ed Mon Sep 17 00:00:00 2001 From: "W. Felix Handte" Date: Tue, 4 May 2021 12:30:39 -0400 Subject: [PATCH] Detect Presence of `md5` on Darwin This fixes #2568. --- lib/Makefile | 4 +++- programs/Makefile | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/Makefile b/lib/Makefile index 6a26e6c79..35860974d 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -176,7 +176,9 @@ UNAME := $(shell uname) ifndef BUILD_DIR ifeq ($(UNAME), Darwin) - HASH ?= md5 + ifeq ($(shell md5 < /dev/null > /dev/null; echo $$?), 0) + HASH ?= md5 + endif else ifeq ($(UNAME), FreeBSD) HASH ?= gmd5sum else ifeq ($(UNAME), NetBSD) diff --git a/programs/Makefile b/programs/Makefile index 7157c7a54..fcdd90e53 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -103,7 +103,9 @@ UNAME := $(shell uname) ifndef BUILD_DIR ifeq ($(UNAME), Darwin) - HASH ?= md5 + ifeq ($(shell md5 < /dev/null > /dev/null; echo $$?), 0) + HASH ?= md5 + endif else ifeq ($(UNAME), FreeBSD) HASH ?= gmd5sum else ifeq ($(UNAME), NetBSD) -- 2.47.2