From 5fdbce31950978fd3f1c222216d18c1966167dff Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Thu, 22 May 2014 17:05:07 -0700 Subject: Add tool to update config.guess Signed-off-by: Timothy Gu --- tools/update-config-guess | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 tools/update-config-guess 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 -- cgit v0.12