Merge pull request #2374 from bket/portability

'head -c BYTES' is non-portable
This commit is contained in:
Yann Collet 2020-10-27 14:15:35 -07:00 committed by GitHub
commit 2d2507b9db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -185,7 +185,7 @@ HASH ?= md5sum
HAVE_HASH := $(shell echo 1 | $(HASH) > /dev/null && echo 1 || echo 0)
ifeq ($(HAVE_HASH), 1)
HASH_VALUE := $(shell echo $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(ZSTD_FILES) | $(HASH) | head -c 16)
HASH_VALUE := $(shell echo $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(ZSTD_FILES) | $(HASH) | dd bs=1 count=16 status=none)
HASH_DIR := conf_$(HASH_VALUE)
else
$(info warning : could not find hash function to differentiate builds with different flags)

View File

@ -107,7 +107,7 @@ HASH ?= md5sum
HAVE_HASH := $(shell echo 1 | $(HASH) > /dev/null && echo 1 || echo 0)
ifeq ($(HAVE_HASH), 1)
HASH_VALUE := $(shell echo $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) | $(HASH) | head -c 16)
HASH_VALUE := $(shell echo $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) | $(HASH) | dd bs=1 count=16 status=none)
HASH_DIR := conf_$(HASH_VALUE)
else
$(info warning : could not find hash function to differentiate builds with different flags)