summaryrefslogtreecommitdiff
path: root/tools/Makefile
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-03-23 14:10:28 +0000
committerFelix Fietkau <nbd@openwrt.org>2012-03-23 14:10:28 +0000
commitc49f66675e04441b7089abb2aec1e95bda0dfe78 (patch)
tree9d6b2f3c7315fa7c7115ddfd9e4cb1f45fc74a18 /tools/Makefile
parent265d0b379abb993fa73ee156463f50d064be63e9 (diff)
downloadmtk-20170518-c49f66675e04441b7089abb2aec1e95bda0dfe78.zip
mtk-20170518-c49f66675e04441b7089abb2aec1e95bda0dfe78.tar.gz
mtk-20170518-c49f66675e04441b7089abb2aec1e95bda0dfe78.tar.bz2
tools: fix GNU stat detection to prevent it from picking up other things named "gstat" (see #4571)
SVN-Revision: 31059
Diffstat (limited to 'tools/Makefile')
-rw-r--r--tools/Makefile11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/Makefile b/tools/Makefile
index 4fe91f6..48cfbbc 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -101,10 +101,19 @@ $(STAGING_DIR_HOST)/bin/$(1): $(STAGING_DIR)/.prepared
endef
endif
+$(STAGING_DIR_HOST)/bin/stat: $(STAGING_DIR)/.prepared
+ @if stat --version > /dev/null 2>&1; then \
+ ln -s `which stat` $@; \
+ elif gstat --version > /dev/null 2>&1; then \
+ ln -s `which gstat` $@; \
+ else \
+ echo "GNU stat not found"; \
+ false; \
+ fi
+
$(eval $(call PrepareCommand,find,gfind find))
$(eval $(call PrepareCommand,md5sum,md5sum $(SCRIPT_DIR)/md5sum))
$(eval $(call PrepareCommand,cp,gcp cp))
-$(eval $(call PrepareCommand,stat,gstat stat))
$(eval $(call PrepareCommand,seq,gseq seq))
$(curdir)/cmddeps = $(patsubst %,$(STAGING_DIR_HOST)/bin/%,find md5sum cp stat seq)