[RFC] getting rid of the config.guess/sub problem when bootstrapping new ports/systems

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

 



Hi all,

So, Debian is in the process of bringing up our upcoming arm64 port.
Unfortunately we are also coming across lots of packages with rather
outdated config.guess and config.sub files (see links below). We could
patch every single package that contains config.guess and config.sub but
that would be a lot of effort that doesn't scale. We could also patch
our build tools but the problem would still exist for other distros.

I would like to get rid of this issue once and for all by making the
update process for config.guess and config.sub once per machine or once
per package instead of once per package.

My initial approach in 2009 was to patch config.guess and config.sub to
look for newer versions of themselves but the maintainer of these files
wasn't happy with that approach.

I recently re-contacted him about this issue and was suggested to patch
autoconf. The approach I have taken is to make autoconf-produced
configure scripts use the package-local config.guess/config.sub by
default and if that fails then find the newest config.guess/config.sub
in a number of paths on the system and use it. I am not very familiar
with autoconf internals, m4 or the intricacies of ancient shells, so I
would very much appreciate a review of both the approach and my initial
attempt at implementing this, please see the attached patch.

If anyone knows where config.guess and config.sub are installed on
common platforms like the various Linux or BSD distributions, please let
me know those locations. I have only the paths for Debian and Gentoo.

http://wookware.org/files/aarch64faillog
http://bugs.debian.org/689607
http://bugs.debian.org/689610
http://bugs.debian.org/689611
http://bugs.debian.org/689612
http://bugs.debian.org/689613
http://bugs.debian.org/689614
http://bugs.debian.org/689615
http://bugs.debian.org/689617
http://bugs.debian.org/689618
http://bugs.debian.org/689619
http://bugs.debian.org/689620
http://bugs.debian.org/689621

-- 
bye,
pabs

http://bonedaddy.net/pabs3/
From a8e1e438d4e529ba0a9d1f28b73eacb2d881071d Mon Sep 17 00:00:00 2001
From: Paul Wise <pabs3@xxxxxxxxxxxxx>
Date: Mon, 8 Oct 2012 19:34:50 +0800
Subject: [PATCH] Check a number of paths for newer config.guess/config.sub
 and 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).
---
 lib/autoconf/general.m4 |   34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index 51cee30..d6366c9 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -1719,6 +1719,35 @@ ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
 ])# AC_CONFIG_AUX_DIRS
 
+# Search for the newest config.sub/config.guess
+AC_DEFUN([AC_CONFIG_AUX_EXT_DIRS],
+[
+cur_v=`$SHELL "$ac_aux_dir/$1" --time-stamp | sed s/-//g`
+for path in \
+  "$HOME/.config/autotools" \
+  /usr/local/share/automake-* \
+  /usr/local/share/automake \
+  /usr/share/misc \
+  /usr/share/gnuconfig \
+  /usr/share/automake-* \
+  /usr/share/automake \
+  ; do
+    if test -x "$path/$1" ; then
+      v=`$SHELL "$path/$1" --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
+  if test "x$2" != x ; then
+    $SHELL "$latest/$1" "$2"
+  else
+    $SHELL "$latest/$1"
+  if
+fi
+])
 
 
 
@@ -1804,8 +1833,11 @@ AC_CACHE_CHECK([build system type], [ac_cv_build],
 test "x$ac_build_alias" = x &&
   ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
 test "x$ac_build_alias" = x &&
+  ac_build_alias=`AC_CONFIG_AUX_EXT_DIRS([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_cv_build=`AC_CONFIG_AUX_EXT_DIRS([config.sub],[$ac_build_alias])` ||
   AC_MSG_ERROR([$SHELL $ac_aux_dir/config.sub $ac_build_alias failed])
 ])
 _AC_CANONICAL_SPLIT(build)
@@ -1823,6 +1855,7 @@ AC_CACHE_CHECK([host system type], [ac_cv_host],
   ac_cv_host=$ac_cv_build
 else
   ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    ac_cv_host=`AC_CONFIG_AUX_EXT_DIRS([config.sub],[$ac_host_alias])` ||
     AC_MSG_ERROR([$SHELL $ac_aux_dir/config.sub $host_alias failed])
 fi
 ])
@@ -1842,6 +1875,7 @@ AC_CACHE_CHECK([target system type], [ac_cv_target],
   ac_cv_target=$ac_cv_host
 else
   ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
+    ac_cv_target=`AC_CONFIG_AUX_EXT_DIRS([config.sub],[$ac_target_alias])` ||
     AC_MSG_ERROR([$SHELL $ac_aux_dir/config.sub $target_alias failed])
 fi
 ])
-- 
1.7.10.4

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
https://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux