]> gitweb @ CieloNegro.org - build-hc-pkg.git/commitdiff
detect the name of GNU tar
authorPHO <pho@cielonegro.org>
Wed, 15 Feb 2012 00:08:00 +0000 (09:08 +0900)
committerPHO <pho@cielonegro.org>
Wed, 15 Feb 2012 00:08:00 +0000 (09:08 +0900)
build-hc-pkg
mk/main.mk

index 81dcea4c97ed0650f1ed4cf38c59f4c981e43ef3..5743b3cf1554a574db00c73649001000750cb3dd 100755 (executable)
@@ -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."
index 815f6531a31177041c203bac574e9bde5c3071c4..cefcb832a01572441aac91b2badfb5059a67baae 100644 (file)
@@ -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