ref: ee4fc9ced787c8daa675cc570debdb24d85441dd
parent: fee00949173342f9e7ea167f0c5f3dbf4b303472
author: Paul Brossier <piem@piem.org>
date: Sat Sep 30 18:37:25 EDT 2017
scripts/get_waf.sh: build waf from source tarball, add emscripten and syms (see #126)
--- a/scripts/get_waf.sh
+++ b/scripts/get_waf.sh
@@ -1,10 +1,37 @@
-#! /bin/sh
+#! /bin/bash
set -e
set -x
-WAFURL=https://waf.io/waf-2.0.1
+WAFVERSION=2.0.1
+WAFTARBALL=waf-$WAFVERSION.tar.bz2
+WAFURL=https://waf.io/$WAFTARBALL
-( which wget > /dev/null && wget -qO waf $WAFURL ) || ( which curl > /dev/null && curl $WAFURL > waf )
+WAFBUILDDIR=`mktemp -d`
-chmod +x waf
+function cleanup () {
+ rm -rf $WAFBUILDDIR
+}
+
+trap cleanup SIGINT SIGTERM
+
+function buildwaf () {
+ pushd $WAFBUILDDIR
+
+ ( which wget > /dev/null && wget -qO $WAFTARBALL $WAFURL ) || ( which curl > /dev/null && curl $WAFURL > $WAFTARBALL )
+
+ tar xf $WAFTARBALL
+ pushd waf-$WAFVERSION
+ NOCLIMB=1 python waf-light --tools=c_emscripten,syms
+
+ popd
+ popd
+
+ cp -prv $WAFBUILDDIR/waf-$WAFVERSION/waf $PWD
+
+ chmod +x waf
+}
+
+buildwaf
+
+cleanup
--- a/scripts/get_waf_emscripten.sh
+++ /dev/null
@@ -1,21 +1,0 @@
-#! /bin/sh
-
-set -e
-set -x
-
-SCRIPTPATH=`pwd`/$(dirname "$0")
-
-
-WAFFILE=waf-1.9.13
-WAFURL=https://waf.io/$WAFFILE.tar.bz2
-
-BUILDDIR=$SCRIPTPATH/../.waf-emscripten-dl
-mkdir -p $BUILDDIR
-
-cd $BUILDDIR
-curl -o $WAFFILE.tar.bz2 $WAFURL
-tar xjvf $WAFFILE.tar.bz2
-cd $WAFFILE
-NOCLIMB=1 ./waf-light --tools=c_emscripten && cp waf $SCRIPTPATH/../
-
-rm -r $BUILDDIR