:: commit 7d44e79abc8330b25b95bf278e4dad79ef2373eb

mintsuki <mintsuki@protonmail.com> — 2021-06-30 16:22

parents: 52cfc27d3e

build: which -> command -v

diff --git a/Makefile b/Makefile
index b765ed9c..76d7e74e 100644
--- a/Makefile
+++ b/Makefile
@@ -9,10 +9,10 @@ TOOLCHAIN = x86_64-elf
 TOOLCHAIN_CC = $(TOOLCHAIN)-gcc
 TOOLCHAIN_AR = $(TOOLCHAIN)-ar
 
-ifeq ($(shell export "PATH=$(PATH)"; which $(TOOLCHAIN_CC)), )
+ifeq ($(shell export "PATH=$(PATH)"; command -v $(TOOLCHAIN_CC) ; ), )
 TOOLCHAIN_CC := gcc
 endif
-ifeq ($(shell export "PATH=$(PATH)"; which $(TOOLCHAIN_AR)), )
+ifeq ($(shell export "PATH=$(PATH)"; command -v $(TOOLCHAIN_AR) ; ), )
 TOOLCHAIN_AR := ar
 endif
 
diff --git a/README.md b/README.md
index bdb27789..92aea9a5 100644
--- a/README.md
+++ b/README.md
@@ -79,7 +79,7 @@ make toolchain
 ### Building Limine
 
 In order to build Limine, the following packages have to be installed: `bash`, `make`,
-`git`, `which`, `nasm`, `mtools` (optional, necessary to build `limine-eltorito-efi.bin`).
+`git`, `nasm`, `mtools` (optional, necessary to build `limine-eltorito-efi.bin`).
 Furthermore, either the toolchain must have been built in the previous paragraph,
 or `gcc` or `llvm/clang` must also be installed.
 `GNU binutils` is necessary in order to build the UEFI port of Limine. A full
diff --git a/decompressor/Makefile b/decompressor/Makefile
index 015e336d..32526362 100644
--- a/decompressor/Makefile
+++ b/decompressor/Makefile
@@ -10,13 +10,13 @@ TOOLCHAIN_CC = $(TOOLCHAIN)-gcc
 TOOLCHAIN_LD = $(TOOLCHAIN)-ld
 TOOLCHAIN_OBJCOPY = $(TOOLCHAIN)-objcopy
 
-ifeq ($(shell which $(TOOLCHAIN_CC)), )
+ifeq ($(shell command -v $(TOOLCHAIN_CC) ; ), )
 TOOLCHAIN_CC := gcc
 endif
-ifeq ($(shell which $(TOOLCHAIN_LD)), )
+ifeq ($(shell command -v $(TOOLCHAIN_LD) ; ), )
 TOOLCHAIN_LD := ld
 endif
-ifeq ($(shell which $(TOOLCHAIN_OBJCOPY)), )
+ifeq ($(shell command -v $(TOOLCHAIN_OBJCOPY) ; ), )
 TOOLCHAIN_OBJCOPY := objcopy
 endif
 
diff --git a/stage23/Makefile b/stage23/Makefile
index a96b9718..a3fbfc17 100644
--- a/stage23/Makefile
+++ b/stage23/Makefile
@@ -21,19 +21,19 @@ TOOLCHAIN_OBJCOPY = $(TOOLCHAIN)-objcopy
 TOOLCHAIN_OBJDUMP = $(TOOLCHAIN)-objdump
 TOOLCHAIN_READELF = $(TOOLCHAIN)-readelf
 
-ifeq ($(shell which $(TOOLCHAIN_CC)), )
+ifeq ($(shell command -v $(TOOLCHAIN_CC) ; ), )
 TOOLCHAIN_CC := gcc
 endif
-ifeq ($(shell which $(TOOLCHAIN_LD)), )
+ifeq ($(shell command -v $(TOOLCHAIN_LD) ; ), )
 TOOLCHAIN_LD := ld
 endif
-ifeq ($(shell which $(TOOLCHAIN_OBJCOPY)), )
+ifeq ($(shell command -v $(TOOLCHAIN_OBJCOPY) ; ), )
 TOOLCHAIN_OBJCOPY := objcopy
 endif
-ifeq ($(shell which $(TOOLCHAIN_OBJDUMP)), )
+ifeq ($(shell command -v $(TOOLCHAIN_OBJDUMP) ; ), )
 TOOLCHAIN_OBJDUMP := objdump
 endif
-ifeq ($(shell which $(TOOLCHAIN_READELF)), )
+ifeq ($(shell command -v $(TOOLCHAIN_READELF) ; ), )
 TOOLCHAIN_READELF := readelf
 endif
 
tab: 248 wrap: offon