X-Git-Url: https://git.archive.openwrt.org/?p=openwrt.git;a=blobdiff_plain;f=include%2Fhost.mk;h=423ca1661082b53cfd6ce8daf0dd56640a4d884d;hp=3a5fd9683e3592f4750a80964a321075e388cde7;hb=bfb1bd03544db4b097c6967e4ce177626c6350d6;hpb=3dcf8b9e33a39bb791904fcf6b2a4ff6ccbcfa7a diff --git a/include/host.mk b/include/host.mk index 3a5fd9683e..423ca16610 100644 --- a/include/host.mk +++ b/include/host.mk @@ -5,11 +5,14 @@ # See /LICENSE for more information. # -include $(TOPDIR)/.host.mk +include $(TMP_DIR)/.host.mk export TAR -$(TOPDIR)/.host.mk: $(INCLUDE_DIR)/host.mk +ifneq ($(__host_inc),1) +__host_inc:=1 +$(TMP_DIR)/.host.mk: $(TOPDIR)/include/host.mk + @mkdir -p $(TMP_DIR) @( \ HOST_OS=`uname`; \ case "$$HOST_OS" in \ @@ -22,10 +25,13 @@ $(TOPDIR)/.host.mk: $(INCLUDE_DIR)/host.mk echo "HOST_OS:=$$HOST_OS" > $@; \ echo "HOST_ARCH:=$$HOST_ARCH" >> $@; \ echo "GNU_HOST_NAME:=$$GNU_HOST_NAME" >> $@; \ - if tar --version 2>&1 | grep 'GNU' >/dev/null; then \ - echo "TAR_WILDCARDS:=--wildcards" >> $@; \ - fi; \ - TAR=`which gtar tar | head -n 1`; \ + TAR=`which gtar 2>/dev/null`; \ + [ -n "$$TAR" -a -x "$$TAR" ] || TAR=`which tar 2>/dev/null`; \ echo "TAR:=$$TAR" >> $@; \ + ZCAT=`which gzcat 2>/dev/null`; \ + [ -n "$$ZCAT" -a -x "$$ZCAT" ] || ZCAT=`which zcat 2>/dev/null`; \ + echo "ZCAT:=$$ZCAT" >> $@; \ + echo "BASH:=$(shell which bash)" >> $@; \ ) +endif