Skip to content

Commit 535040a

Browse files
committed
Generate CFG_FILENAME_EXTRA from the version
The code takes a prefix of the MD5 hash of the version string. Since the hash command differs across GNU and BSD platforms, we scan for the right one in the configure script. Closes #25007
1 parent b402c43 commit 535040a

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

configure

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,20 @@ else
709709
probe_need CFG_GIT git
710710
fi
711711

712+
# Use `md5sum` on GNU platforms, or `md5 -q` on BSD
713+
probe CFG_MD5 md5
714+
probe CFG_MD5SUM md5sum
715+
if [ -n "$CFG_MD5" ]
716+
then
717+
CFG_HASH_COMMAND="$CFG_MD5 -q | head -c 8"
718+
elif [ -n "$CFG_MD5SUM" ]
719+
then
720+
CFG_HASH_COMMAND="$CFG_MD5SUM | head -c 8"
721+
else
722+
err 'could not find one of: md5 md5sum'
723+
fi
724+
putvar CFG_HASH_COMMAND
725+
712726
probe CFG_CLANG clang++
713727
probe CFG_CCACHE ccache
714728
probe CFG_GCC gcc

mk/main.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ CFG_RELEASE_NUM=1.1.0
2020
# versions (section 9)
2121
CFG_PRERELEASE_VERSION=.1
2222

23-
CFG_FILENAME_EXTRA=4e7c5e5c
23+
# Append a version-dependent hash to each library, so we can install different
24+
# versions in the same place
25+
CFG_FILENAME_EXTRA=$(shell echo -n $(CFG_RELEASE) | $(CFG_HASH_COMMAND))
2426

2527
ifeq ($(CFG_RELEASE_CHANNEL),stable)
2628
# This is the normal semver version string, e.g. "0.12.0", "0.12.0-nightly"

0 commit comments

Comments
 (0)