From: PHO Date: Wed, 15 Feb 2012 00:08:00 +0000 (+0900) Subject: detect the name of GNU tar X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=build-hc-pkg.git;a=commitdiff_plain;h=dd13c430199fd856b830e6647f659d4ef3fb300a detect the name of GNU tar --- diff --git a/build-hc-pkg b/build-hc-pkg index 81dcea4..5743b3c 100755 --- a/build-hc-pkg +++ b/build-hc-pkg @@ -33,6 +33,21 @@ if [[ -z "$srcpath" || ! -e "$srcpath" ]]; then fi fi -gmake -f mk/main.mk SRCPATH="$srcpath" PLATFORM="$platform" SHELL="$SHELL" +# What's the name of our GNU tar? +declare gnutar="" +if which gnutar >/dev/null 2>&1; then + gnutar="gnutar" +elif which gtar >/dev/null 2>&1; then + gnutar="gtar" +else + echo "We need GNU tar to be installed." >&2 + exit 1 +fi + +gmake -f mk/main.mk \ + SRCPATH="$srcpath" \ + PLATFORM="$platform" \ + GNUTAR="$gnutar" \ + SHELL="$SHELL" echo "If you are done, run \"$0 clean\" to cleanup the working directory." diff --git a/mk/main.mk b/mk/main.mk index 815f653..cefcb83 100644 --- a/mk/main.mk +++ b/mk/main.mk @@ -1,5 +1,5 @@ DIRNAME := $(patsubst %-src.tar.bz2,%,$(notdir $(SRCPATH))) -GNUTAR ?= gnutar +GNUTAR ?= gtar HC_TARNAME ?= $(DIRNAME)-boot-$(PLATFORM).tar.bz2 all: work/pack-hc-pkg.stamp