summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorTimothy Gu <timothygu99@gmail.com>2014-05-23 00:05:07 (GMT)
committerTimothy Gu <timothygu99@gmail.com>2014-05-23 00:09:10 (GMT)
commit5fdbce31950978fd3f1c222216d18c1966167dff (patch)
treee0df1dc46ca8dc6f69bf03c6d9f8ad9e9d8dd4b2 /tools
parentc4561d939df680845ba1ab9953c6c350668aa08c (diff)
downloadmxe-5fdbce31950978fd3f1c222216d18c1966167dff.zip
mxe-5fdbce31950978fd3f1c222216d18c1966167dff.tar.gz
mxe-5fdbce31950978fd3f1c222216d18c1966167dff.tar.bz2
Add tool to update config.guess
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/update-config-guess43
1 files changed, 43 insertions, 0 deletions
diff --git a/tools/update-config-guess b/tools/update-config-guess
new file mode 100755
index 0000000..2c65500
--- /dev/null
+++ b/tools/update-config-guess
@@ -0,0 +1,43 @@
+#!/bin/sh
+# This file is part of MXE.
+# See index.html for further information.
+#
+# Script to automatically update GNU Make Standard Library
+# (http://gmsl.sourceforge.net/)
+
+clean(){
+ rm -rf tmp-config-guess
+}
+
+# Ported from main Makefile
+SED='sed'
+SORT='sort'
+if [ gsed --help >/dev/null 2>&1 ]; then
+ SED='gsed'
+fi
+if [ gsort --help >/dev/null 2>&1 ]; then
+ SED='gsort'
+fi
+WGET="wget --no-check-certificate
+ --user-agent=$(wget --version |
+ $SED -n 's,GNU \(Wget\) \([0-9.]*\).*,\1/\2,p')"
+
+# Current config.guess timestamp.
+current_version=$(grep 'timestamp.*=' 'ext/config.guess' 2>/dev/null | \
+ head -1 | cut -d'=' -f2 | $SED -e 's/^ //' -e 's/ *$//' )
+
+clean
+# Fetch latest config.guess from Savannah Git
+$WGET -q -O tmp-config-guess 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'
+# Latest config.guess timestamp
+latest_version=$(grep 'timestamp.*=' 'tmp-config-guess' | head -1 | \
+ head -1 | cut -d'=' -f2 | $SED -e 's/^ //' -e 's/ *$//')
+if [ "$current_version" != "$latest_version" ]; then
+ echo "New version found: $current_version --> $latest_version"
+ rm -f ext/config.guess
+ cp -a tmp-config-guess ext/config.guess
+ chmod +x ext/config.guess
+ clean
+else
+ echo "No new version available: $current_version"
+fi