more portability fixes and a prereq check for gnu tar

SVN-Revision: 5037
This commit is contained in:
Felix Fietkau 2006-10-10 21:06:45 +00:00
parent 10db4ed4cc
commit ddc5584244
4 changed files with 15 additions and 1 deletions

View File

@ -7,6 +7,8 @@
include $(TOPDIR)/.host.mk include $(TOPDIR)/.host.mk
export TAR
$(TOPDIR)/.host.mk: $(INCLUDE_DIR)/host.mk $(TOPDIR)/.host.mk: $(INCLUDE_DIR)/host.mk
@( \ @( \
HOST_OS=`uname`; \ HOST_OS=`uname`; \
@ -23,5 +25,7 @@ $(TOPDIR)/.host.mk: $(INCLUDE_DIR)/host.mk
if tar --version 2>&1 | grep 'GNU' >/dev/null; then \ if tar --version 2>&1 | grep 'GNU' >/dev/null; then \
echo "TAR_WILDCARDS:=--wildcards" >> $@; \ echo "TAR_WILDCARDS:=--wildcards" >> $@; \
fi; \ fi; \
TAR=`which gtar tar | head -n 1`; \
echo "TAR:=$$TAR" >> $@; \
) )

View File

@ -8,6 +8,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
TMP_DIR:=$(TOPDIR)/tmp TMP_DIR:=$(TOPDIR)/tmp
include $(INCLUDE_DIR)/prereq.mk include $(INCLUDE_DIR)/prereq.mk
include $(INCLUDE_DIR)/host.mk
define Require/non-root define Require/non-root
[ "$$(shell whoami)" != "root" ] [ "$$(shell whoami)" != "root" ]
@ -94,3 +95,11 @@ $(eval $(call RequireCommand,patch, \
$(eval $(call RequireCommand,perl, \ $(eval $(call RequireCommand,perl, \
Please install perl. \ Please install perl. \
)) ))
define Require/gnutar
$(TAR) --version 2>&1 | grep GNU > /dev/null
endef
$(eval $(call Require,gnutar, \
Please install GNU tar. \
))

View File

@ -6,6 +6,7 @@
# #
-include $(TOPDIR)/.config -include $(TOPDIR)/.config
include $(TOPDIR)/include/host.mk
include $(TOPDIR)/include/verbose.mk include $(TOPDIR)/include/verbose.mk
export SHELL=/usr/bin/env bash -c '. $(TOPDIR)/include/shell.sh; eval "$$2"' -- export SHELL=/usr/bin/env bash -c '. $(TOPDIR)/include/shell.sh; eval "$$2"' --

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/bin/sh
BASE=http://svn.openwrt.org/openwrt/trunk/openwrt BASE=http://svn.openwrt.org/openwrt/trunk/openwrt
TARGET=$1 TARGET=$1
CONTROL=$2 CONTROL=$2