[vlc-commits] Contrib: detect zcat vs gzcat

Jean-Baptiste Kempf git at videolan.org
Tue Nov 15 16:33:14 CET 2011


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Nov 15 16:29:43 2011 +0100| [c38fed26b1646b65c50422d322729c1c587536c8] | committer: Jean-Baptiste Kempf

Contrib: detect zcat vs gzcat

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c38fed26b1646b65c50422d322729c1c587536c8
---

 contrib/src/ffmpeg/rules.mak |    2 +-
 contrib/src/main.mak         |    8 ++++++++
 contrib/src/x264/rules.mak   |    2 +-
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/contrib/src/ffmpeg/rules.mak b/contrib/src/ffmpeg/rules.mak
index b6441d9..45dc379 100644
--- a/contrib/src/ffmpeg/rules.mak
+++ b/contrib/src/ffmpeg/rules.mak
@@ -112,7 +112,7 @@ FFMPEG_VERSION := git
 ffmpeg: ffmpeg-$(FFMPEG_VERSION).tar.gz .sum-ffmpeg
 	rm -Rf $@ $@-git
 	mkdir -p $@-git
-	zcat "$<" | (cd $@-git && tar xv --strip-components=1)
+	$(ZCAT) "$<" | (cd $@-git && tar xv --strip-components=1)
 ifdef HAVE_WIN32
 	sed -i "s/std=c99/std=gnu99/" $@-$(FFMPEG_VERSION)/configure
 endif
diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index 231461a..63903c4 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -136,6 +136,14 @@ else
 download = $(error Neither curl nor wget found!)
 endif
 
+ifeq ($(shell gzcat --version >/dev/null 2>&1 || echo FAIL),)
+ZCAT = gzcat
+else ifeq ($(shell zcat --version >/dev/null 2>&1 || echo FAIL),)
+ZCAT = zcat
+else
+ZCAT ?= $(error Gunzip client (zcat) not found!)
+endif
+
 ifeq ($(shell sha512sum --version >/dev/null 2>&1 || echo FAIL),)
 SHA512SUM = sha512sum
 else ifeq ($(shell shasum --version >/dev/null 2>&1 || echo FAIL),)
diff --git a/contrib/src/x264/rules.mak b/contrib/src/x264/rules.mak
index 4692522..03953b0 100644
--- a/contrib/src/x264/rules.mak
+++ b/contrib/src/x264/rules.mak
@@ -43,7 +43,7 @@ X264_VERSION := git
 x264: x264-$(X264_VERSION).tar.gz .sum-x264
 	rm -Rf x264-git
 	mkdir -p x264-git
-	zcat "$<" | (cd x264-git && tar xv --strip-components=1)
+	$(ZCAT) "$<" | (cd x264-git && tar xv --strip-components=1)
 	$(MOVE)
 
 .x264: x264



More information about the vlc-commits mailing list