[vlc-devel] [PATCH 2/3] tools: add GNU sed
Sean McGovern
gseanmcg at gmail.com
Tue Mar 11 20:12:36 CET 2014
---
extras/tools/bootstrap | 12 ++++++++++++
extras/tools/packages.mak | 3 +++
extras/tools/tools.mak | 17 +++++++++++++++++
3 files changed, 32 insertions(+)
diff --git a/extras/tools/bootstrap b/extras/tools/bootstrap
index 8465f8f..fcd3f10 100755
--- a/extras/tools/bootstrap
+++ b/extras/tools/bootstrap
@@ -32,6 +32,17 @@ then
fi
}
+check_sed() {
+tmp="`pwd`/check_sed"
+trap "rm $tmp" EXIT
+echo "test file for GNU sed" > $tmp
+if ! sed -i -e 's/sed//' $tmp >/dev/null 2>&1
+then
+ echo "sed doesn't do in-place editing (-i option)"
+ NEEDED="$NEEDED .sed"
+fi
+}
+
check() {
if ! $1 --version >/dev/null 2>&1
then
@@ -63,6 +74,7 @@ check cmake
check yasm
check_tar
check ragel
+check_sed
[ -n "$NEEDED" ] && mkdir -p build/
diff --git a/extras/tools/packages.mak b/extras/tools/packages.mak
index a4ce1db..9e3d3d3 100644
--- a/extras/tools/packages.mak
+++ b/extras/tools/packages.mak
@@ -37,3 +37,6 @@ GAS_URL=http://git.libav.org/?p=gas-preprocessor.git;a=snapshot;h=$(GAS_VERSION)
RAGEL_VERSION=6.8
RAGEL_URL=http://www.complang.org/ragel/ragel-$(RAGEL_VERSION).tar.gz
+
+SED_VERSION=4.2.2
+SED_URL=$(GNU)/sed/sed-$(SED_VERSION).tar.bz2
diff --git a/extras/tools/tools.mak b/extras/tools/tools.mak
index ab7a404..3c20446 100644
--- a/extras/tools/tools.mak
+++ b/extras/tools/tools.mak
@@ -248,6 +248,23 @@ CLEAN_FILE += .ragel
CLEAN_PKG += ragel
DISTCLEAN_PKG += ragel-$(RAGEL_VERSION).tar.gz
+# GNU sed
+
+sed-$(SED_VERSION).tar.bz2:
+ $(call download,$(SED_URL))
+
+sed: sed-$(SED_VERSION).tar.bz2
+ $(UNPACK)
+ $(MOVE)
+
+.sed: sed
+ (cd $<; ./configure --prefix=$(PREFIX) && $(MAKE) && $(MAKE) install)
+ touch $@
+
+CLEAN_PKG += sed
+DISTCLEAN_PKG += sed-$(SED_VERSION).tar.bz2
+CLEAN_FILE += .sed
+
#
#
#
--
1.7.9.2
More information about the vlc-devel
mailing list