build: add which command to build requirements
authorPetr Štetiar <ynezz@true.cz>
Wed, 3 Mar 2021 18:48:55 +0000 (19:48 +0100)
committerPetr Štetiar <ynezz@true.cz>
Wed, 3 Mar 2021 21:51:39 +0000 (22:51 +0100)
`which` utility is not shipped by default for example on recent Arch
Linux and then any steps relying on its presence fails, like for example
following Python3 prereq build check:

 $ python3 --version
 Python 3.9.1

 $ make
 /bin/sh: line 1: which: command not found
 ...
 Checking 'python3'... failed.

So make `which` utility host build requirement.

References: PR#3820 FS#3525
Signed-off-by: Petr Štetiar <ynezz@true.cz>
README.md
include/prereq-build.mk

index cb4b0436552a9cc1f03341104e26c259c4e60fba..68063d9f86678a4aaabea3786e355b87982dd683 100644 (file)
--- a/README.md
+++ b/README.md
@@ -26,7 +26,7 @@ documentation.
 
 ```
 gcc-6+ binutils bzip2 flex python3 perl make4.1+ find grep diff unzip gawk getopt
-subversion libz-dev libc-dev rsync
+subversion libz-dev libc-dev rsync which
 ```
 
 ### Quickstart
index bbeba3f8ff6a8c91ae353326fc161c729aa7aa42..32edc6e4370aa4197c1df0cb76f867a104469534 100644 (file)
@@ -166,6 +166,9 @@ $(eval $(call SetupHostCommand,file,Please install the 'file' package, \
 $(eval $(call SetupHostCommand,rsync,Please install 'rsync', \
        rsync --version </dev/null))
 
+$(eval $(call SetupHostCommand,which,Please install 'which', \
+       which which | grep which))
+
 $(STAGING_DIR_HOST)/bin/mkhash: $(SCRIPT_DIR)/mkhash.c
        mkdir -p $(dir $@)
        $(CC) -O2 -I$(TOPDIR)/tools/include -o $@ $<