From 90930335de935e1ce870f16617b0f09a57d7bff5 Mon Sep 17 00:00:00 2001 From: Paul Wise Date: Fri, 24 Apr 2009 14:02:14 +0800 Subject: [PATCH] Check a number of paths for newer versions and run the newest one. This patch is useful for distributions like Debian that add new architectures and then have to update config.sub and config.guess in every single package that uses automake or have to workaround the problem by adding code to each package to copy in the latest versions of these scripts from another package containing the latest version of the scripts (autotools-dev in Debian). --- config.guess | 28 ++++++++++++++++++++++++++++ config.sub | 29 +++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/config.guess b/config.guess index 872b96a..7663172 100755 --- a/config.guess +++ b/config.guess @@ -90,6 +90,34 @@ if test $# != 0; then exit 1 fi +# Look for newer versions in various paths in the system + +cur_v=`echo "$timestamp" | sed s/-//g` + +for path in \ + "$HOME/.config/automake" \ + /usr/local/share/automake \ + /usr/share/automake \ + /usr/share/misc \ + ; do + + if test -x "$path/config.guess" ; then + v=`"$path/config.guess" --time-stamp | sed s/-//g` + if test "$v" -gt "$cur_v" ; then + cur_v="$v" + latest="$path" + fi + fi +done + +if test "x$latest" != x ; then + case $# in + 0) "$latest/config.guess";; + *) "$latest/config.guess" "$@";; + esac + exit $? +fi + trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a diff --git a/config.sub b/config.sub index bdda9e4..49d79db 100755 --- a/config.sub +++ b/config.sub @@ -118,6 +118,35 @@ case $# in exit 1;; esac +# Debian specific change: +# Look for newer versions in various paths in the system + +cur_v=`echo "$timestamp" | sed s/-//g` + +for path in \ + "$HOME/.config/automake" \ + /usr/local/share/automake \ + /usr/share/automake \ + /usr/share/misc \ + ; do + + if test -x "$path/config.sub" ; then + v=`"$path/config.sub" --time-stamp | sed s/-//g` + if test "$v" -gt "$cur_v" ; then + cur_v="$v" + latest="$path" + fi + fi +done + +if test "x$latest" != x ; then + case $# in + 0) "$latest/config.sub";; + *) "$latest/config.sub" "$@";; + esac + exit $? +fi + # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -- 1.7.10.4