[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: About a mass bug report not based on Sid or Jessie.



On Wed, Apr 16, 2014 at 7:13 PM, Santiago Vila wrote:

> I would call that a serious design flaw.

I agree

> What some people here try to do, update config.guess and related files,
> is, IMHO, just a hack. Sure, it will just work, but only for us (Debian).
> Other distributors will still have the same problem.

Other distributors do the config.guess/sub dance by default IIRC.

> Anybody from the GNU project reading this?

A long time ago I implemented the config.guess/sub dance in
config.guess/sub but that was rejected by the upstream config (aka
autotools-dev) maintainer. Then I implemented the config.guess/sub
dance in autoconf but that was rejected by the upstream autoconf
people. Patches attached in case you want to try convincing them
again. Links to the newer threads below, the GNU folks seem to have
lost archives before 2012 on the config-patches list, the first patch
was in 2009 but was only discussed off-list:

http://bugs.debian.org/660179
https://lists.gnu.org/archive/html/autoconf/2012-10/threads.html#00005
https://lists.gnu.org/archive/html/autoconf/2013-05/threads.html#00025
https://lists.gnu.org/archive/html/config-patches/2012-10/msg00000.html
https://lists.gnu.org/archive/html/config-patches/2013-05/threads.html#00006

-- 
bye,
pabs

http://wiki.debian.org/PaulWise
From 26c75a966ba3b87fce84ad7c622e05e45eb42638 Mon Sep 17 00:00:00 2001
From: Paul Wise <pabs3@bonedaddy.net>
Date: Tue, 9 Oct 2012 11:06:37 +0800
Subject: [PATCH] Check a number of paths for newer config.guess/config.sub,
 run the latest.

This helps people who are bootstrapping new systems from existing software
that uses GNU autotools, config.guess and config.sub.

This is very 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).

Allow software authors and distro porters to override the latest version.
---
 lib/autoconf/general.m4 | 72 ++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 56 insertions(+), 16 deletions(-)

diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index 86c1e73..f0fc6a7 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -1691,6 +1691,51 @@ AC_DEFUN([AC_CONFIG_AUX_DIR],
 AC_DEFUN([AC_CONFIG_AUX_DIR_DEFAULT],
 [AC_CONFIG_AUX_DIRS("$srcdir" "$srcdir/.." "$srcdir/../..")])
 
+# AC_CONFIG_AUX_DIR
+# -------------------------
+# Internal subroutine.
+# Find the latest version of config.guess and config.sub that is
+# available on the system to prevent issues with bootstrapping.
+# Allows explicitly overriding the latest one where needed.
+AC_DEFUN([AC_CONFIG_AUX_DIR,
+[
+for path in \
+  "$AUTOCONF_AUX_DIR" \
+  "$HOME/.config/autotools" \
+  "$2" \
+  ; do
+    if test -x "$path/config.$1.override" ; then
+      ac_config_$1="$path/config.$1.override"
+    fi
+done
+if test -z "$ac_config_$1" ; then
+  cur_v=0
+  for path in \
+    "$AUTOCONF_AUX_DIR" \
+    "$2" \
+    "$HOME/.config/autotools" \
+    /usr/local/share/automake-* \
+    /usr/local/share/automake \
+    /usr/local/share/libtool/config \
+    /usr/share/misc \
+    /usr/share/gnuconfig \
+    /usr/share/automake-* \
+    /usr/share/automake \
+    /usr/share/libtool/config \
+    "$[CONFIG_]m4_toupper([$1])" \
+    ; do
+      if test -x "$path/config.$1" ; then
+        v=`$SHELL "$path/config.$1" --time-stamp | sed s/-//g`
+        if test "$v" -gt "$cur_v" ; then
+          cur_v="$v"
+          latest="$path"
+        fi
+      fi
+  done
+  ac_config_$1="$latest/config.$1"
+fi
+])# AC_CONFIG_AUX_DIR
+
 
 # AC_CONFIG_AUX_DIRS(DIR ...)
 # ---------------------------
@@ -1719,13 +1764,8 @@ if test -z "$ac_aux_dir"; then
   AC_MSG_ERROR([cannot find install-sh, install.sh, or shtool in $1])
 fi
 
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+AC_CONFIG_AUX_DIR([guess],[$1])
+AC_CONFIG_AUX_DIR([sub],[$1])
 
 AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
 ])# AC_CONFIG_AUX_DIRS
@@ -1843,17 +1883,17 @@ m4_divert_once([HELP_CANON],
 System types:
   --build=BUILD     configure for building on BUILD [guessed]]])dnl
 # Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
-  AC_MSG_ERROR([cannot run $SHELL $ac_aux_dir/config.sub])
+$SHELL "$ac_config_sub" sun4 >/dev/null 2>&1 ||
+  AC_MSG_ERROR([cannot run $SHELL $ac_config_sub])
 
 AC_CACHE_CHECK([build system type], [ac_cv_build],
 [ac_build_alias=$build_alias
 test "x$ac_build_alias" = x &&
-  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+  ac_build_alias=`$SHELL "$ac_config_guess"`
 test "x$ac_build_alias" = x &&
   AC_MSG_ERROR([cannot guess build type; you must specify one])
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
-  AC_MSG_ERROR([$SHELL $ac_aux_dir/config.sub $ac_build_alias failed])
+ac_cv_build=`$SHELL "$ac_config_sub" $ac_build_alias` ||
+  AC_MSG_ERROR([$SHELL $ac_config_sub $ac_build_alias failed])
 ])
 _AC_CANONICAL_SPLIT(build)
 ])# AC_CANONICAL_BUILD
@@ -1869,8 +1909,8 @@ AC_CACHE_CHECK([host system type], [ac_cv_host],
 [if test "x$host_alias" = x; then
   ac_cv_host=$ac_cv_build
 else
-  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
-    AC_MSG_ERROR([$SHELL $ac_aux_dir/config.sub $host_alias failed])
+  ac_cv_host=`$SHELL "$ac_config_sub" $host_alias` ||
+    AC_MSG_ERROR([$SHELL $ac_config_sub $host_alias failed])
 fi
 ])
 _AC_CANONICAL_SPLIT([host])
@@ -1888,8 +1928,8 @@ AC_CACHE_CHECK([target system type], [ac_cv_target],
 [if test "x$target_alias" = x; then
   ac_cv_target=$ac_cv_host
 else
-  ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
-    AC_MSG_ERROR([$SHELL $ac_aux_dir/config.sub $target_alias failed])
+  ac_cv_target=`$SHELL "$ac_config_sub" $target_alias` ||
+    AC_MSG_ERROR([$SHELL $ac_config_sub $target_alias failed])
 fi
 ])
 _AC_CANONICAL_SPLIT([target])
-- 
1.9.1

From 449958bf6dbfc2277f73baee0cb36148c746375a Mon Sep 17 00:00:00 2001
From: Paul Wise <pabs3@bonedaddy.net>
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 1f5c50c..d1c4ca2 100755
--- a/config.guess
+++ b/config.guess
@@ -84,6 +84,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 6acbfac..681acd2 100755
--- a/config.sub
+++ b/config.sub
@@ -111,6 +111,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.9.1


Reply to: