Feature #22628
openconfigure: Skip the GNU config downloader when both auxiliary files exist
Description
For the official source tarball, I’d like native and cross builds to handle config.guess and config.sub the same way.
Today, a native build without BASERUBY uses the bundled files directly, while a cross build requires BASERUBY and therefore takes an extra trip through the downloader to use those same files.
Could configure check whether both files are already present before invoking the downloader?
With that check, both builds would use the bundled files directly, regardless of whether BASERUBY is available.
Here is the patch I tested.
diff --git a/configure.ac b/configure.ac
index b4dc31c..db5fc98 100644
--- a/configure.ac
+++ b/configure.ac
@@ -93,7 +93,9 @@ AS_IF([test "${HAVE_BASERUBY:=no}" != no], [
])
RUBY_APPEND_OPTION(BASERUBY, "--disable=gems")
BASERUBY_VERSION=`$BASERUBY -v`
- $BASERUBY -C "$srcdir" tool/downloader.rb -d tool -e gnu config.guess config.sub >&AS_MESSAGE_FD
+ AS_IF([test ! -e "$srcdir/tool/config.guess" || test ! -e "$srcdir/tool/config.sub"], [
+ $BASERUBY -C "$srcdir" tool/downloader.rb -d tool -e gnu config.guess config.sub >&AS_MESSAGE_FD
+ ])
])
AS_IF([test "$HAVE_BASERUBY" = no], [
AS_IF([test "$cross_compiling" = yes], [AC_MSG_ERROR([executable host ruby is required for cross-compiling])])
I verified that cross configuration from the official CRuby 4.0.10 source tarball succeeded on x86-64 Linux targeting AArch64 Linux without invoking tool/downloader.rb.
Updated by nobu (Nobuyoshi Nakada) 2 days ago
It is not different by native and cross builds, but just the BASERUBY is available or not.
These auxiliary files are required to run configure, which means they should already exist, so I don't think there's any point in trying to download them here.
Updated by ledsun (shigeru nakajima) 2 days ago
Thank you, nobu.
I removed the downloader call and tested a native build from a Git checkout on x86_64 Linux.
./autogen.sh created symlinks to the config.guess and config.sub provided by Autoconf 2.71.
I ran configure with --with-baseruby pointing to Ruby 4.0.9, then ran make -j8.
Both succeeded.
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -102,7 +102,6 @@ AS_IF([test "${HAVE_BASERUBY:=no}" != no], [
])
RUBY_APPEND_OPTION(BASERUBY, "--disable=gems")
BASERUBY_VERSION=`$BASERUBY -v`
- $BASERUBY -C "$srcdir" tool/downloader.rb -d tool -e gnu config.guess config.sub >&AS_MESSAGE_FD
])
AS_IF([test "$HAVE_BASERUBY" = no], [
AS_IF([test "$cross_compiling" = yes], [AC_MSG_ERROR([executable host ruby is required for cross-compiling])])