aboutsummaryrefslogtreecommitdiffstats
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
commit617f57c20a853957f6aa15611fff52ef410fc055 (patch)
treebb0b4730e39e373ffab15b1f8e1f2ed181a7486d /tools/Makefile
parentb8c0d088cf5f008ffc464ab935801d08460e8faf (diff)
downloadmaster-187ad058-617f57c20a853957f6aa15611fff52ef410fc055.tar.gz
master-187ad058-617f57c20a853957f6aa15611fff52ef410fc055.tar.bz2
master-187ad058-617f57c20a853957f6aa15611fff52ef410fc055.zip
tools: fix GNU stat detection to prevent it from picking up other things named "gstat" (see #4571)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31059 3c298f89-4303-0410-b956-a3cf2f4a3e73
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 4fe91f665a..48cfbbcc5f 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)