more portability fixes and a prereq check for gnu tar
[openwrt/openwrt.git] / openwrt / include / host.mk
index abcf045d01e05327408dcb6e9bc8310b695ee74d..3a5fd9683e3592f4750a80964a321075e388cde7 100644 (file)
@@ -7,6 +7,8 @@
 
 include $(TOPDIR)/.host.mk
 
+export TAR
+
 $(TOPDIR)/.host.mk: $(INCLUDE_DIR)/host.mk
        @( \
                HOST_OS=`uname`; \
@@ -23,5 +25,7 @@ $(TOPDIR)/.host.mk: $(INCLUDE_DIR)/host.mk
                if tar --version 2>&1 | grep 'GNU' >/dev/null; then \
                        echo "TAR_WILDCARDS:=--wildcards" >> $@; \
                fi; \
+               TAR=`which gtar tar | head -n 1`; \
+               echo "TAR:=$$TAR" >> $@; \
        )