treewide: drop use of which
[openwrt/staging/jow.git] / include / prereq.mk
index 23d5ded9b272b59e0c7700ed32ff4dd22b23dd22..0033535e782a71fd7f15aae96f832f957d2fa32e 100644 (file)
@@ -49,7 +49,7 @@ endef
 
 define RequireCommand
   define Require/$(1)
-    which $(1)
+    command -v $(1)
   endef
 
   $$(eval $$(call Require,$(1),$(2)))
@@ -103,7 +103,7 @@ define SetupHostCommand
                   $(call QuoteHostCommand,$(11)) $(call QuoteHostCommand,$(12)); do \
                if [ -n "$$$$$$$$cmd" ]; then \
                        bin="$$$$$$$$(PATH="$(subst $(space),:,$(filter-out $(STAGING_DIR_HOST)/%,$(subst :,$(space),$(PATH))))" \
-                               which "$$$$$$$${cmd%% *}")"; \
+                               command -v "$$$$$$$${cmd%% *}")"; \
                        if [ -x "$$$$$$$$bin" ] && eval "$$$$$$$$cmd" >/dev/null 2>/dev/null; then \
                                mkdir -p "$(STAGING_DIR_HOST)/bin"; \
                                ln -sf "$$$$$$$$bin" "$(STAGING_DIR_HOST)/bin/$(strip $(1))"; \