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 22:03:25 +0000 (23:03 +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>
(cherry picked from commit 13069b1a1dcbef0bb9b42db98025fa9203283220)

README.md
include/prereq-build.mk

index 21acbf4b8056279ec223296afec5ce1d085428fe..6bb4d2e913b3ee1a972b23e93f2c5ecab9c822ff 100644 (file)
--- a/README.md
+++ b/README.md
@@ -26,7 +26,7 @@ documentation.
 
 ```
 gcc binutils bzip2 flex python3 perl make find grep diff unzip gawk getopt
-subversion libz-dev libc-dev rsync
+subversion libz-dev libc-dev rsync which
 ```
 
 ### Quickstart
index 7c668968b6dd70b765b97e10226331d299c117eb..86c22f7c959b326a8bed2f9331b38c3758c3151d 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 $@ $<