Makefile: use bash to evaluate tool paths

The makefile uses the pattern $(shell command -v path1 path2 ...) to
deduce pathnames for various executables. On FreeBSD, the default shell
does have a 'command' builtin which supports the '-v' option but only
allows a single path as argument. Rather than work around this limitation
with alternatives like for, just set bash as the default shell. We
already require bash to be installed for various helper scripts.

This change only affects FreeBSD so no new tests are needed.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
This commit is contained in:
Doug Rabson 2022-06-28 08:02:13 +01:00
parent a575098975
commit 94a634fcfe
1 changed files with 5 additions and 0 deletions

View File

@ -51,6 +51,11 @@ BUILDTAGS ?= \
$(shell hack/libsubid_tag.sh) \ $(shell hack/libsubid_tag.sh) \
exclude_graphdriver_devicemapper \ exclude_graphdriver_devicemapper \
seccomp seccomp
ifeq ($(shell uname -s),FreeBSD)
# Use bash for make's shell function - the default shell on FreeBSD
# has a command builtin is not compatible with the way its used below
SHELL := $(shell command -v bash)
endif
PYTHON ?= $(shell command -v python3 python|head -n1) PYTHON ?= $(shell command -v python3 python|head -n1)
PKG_MANAGER ?= $(shell command -v dnf yum|head -n1) PKG_MANAGER ?= $(shell command -v dnf yum|head -n1)
# ~/.local/bin is not in PATH on all systems # ~/.local/bin is not in PATH on all systems