On 2025-04-16 23:31, Simon Josefsson via Bug reports for autoconf wrote:

I tried reading through the autoconf manual to see if 'awk' is a
run-time dependency for running generated ./configure scripts

It is a dependency, and the documentation should mention this. I installed the attached patch into Autoconf on Savannah. This repeats the list of programs mentioned in the GNU Coding Standards <https://www.gnu.org/prep/standards/html_node/Utilities-in-Makefiles.html>, except it adds [ (which Autoconf-generated scripts use) and omits install-info, ln, sleep, and tar (which I don't think they do).


0) Modify autoconf to continue to work in this situation without awk,
    replacing it with more POSIX shell or something else?

It might be possible to replace awk with Python (say), but it'd be a nontrivial. I doubt whether the shell itself would suffice. Probably not worth the effort at this point.


2) Autoconf require awk only for certain kind of usages (substitions?),
    and then this should be documented to clarify which autoconf
    functionality requires awk, and I need to document for libidn.

I didn't take the time to do this. The main thing is substitutions, but there are others.


4) If 2) is true and gnulib uses the necessary features from autoconf
    that brings in awk, could gnulib be modified to not use those
    features so that building on systems without awk works?

This is mostly an Autoconf thing. Two Gnulib modules (getopt, libunistring-base) also use Awk.

Typically the Autoconf and Gnulib code that use Awk can't easily be rewritten to use other POSIX utilities, as Awk was generally the last resort.

I expect that builders on Fedora will quickly learn to install an awk, preferably GNU awk.

Maybe Autoconf should be changed so that 'configure' fails quickly if there's no awk. That shouldn't be much work.
From 56860215d1af490eddb821d73154a190137aa8ec Mon Sep 17 00:00:00 2001
From: Paul Eggert <egg...@cs.ucla.edu>
Date: Thu, 17 Apr 2025 01:08:52 -0700
Subject: [PATCH] Document that 'configure' needs awk etc

Problem reported by Simon Josefsson in:
https://lists.gnu.org/r/bug-gnulib/2025-04/msg00127.html
* doc/install.texi (Installation Prerequisites): New section.
---
 doc/autoconf.texi |  2 ++
 doc/install.texi  | 16 ++++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 8dffd02c..fd16d5fb 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -598,6 +598,7 @@ Transforming Program Names When Installing
 Running @command{configure} Scripts
 
 * Basic Installation::          Instructions for typical cases
+* Installation Prerequisites::  What you need to install
 * Compilers and Options::       Selecting compilers and optimization
 * Multiple Architectures::      Compiling for multiple architectures at once
 * Installation Names::          Installing in different directories
@@ -22893,6 +22894,7 @@ may use comes with Autoconf.
 
 @menu
 * Basic Installation::          Instructions for typical cases
+* Installation Prerequisites::  What you need to install
 * Compilers and Options::       Selecting compilers and optimization
 * Multiple Architectures::      Compiling for multiple architectures at once
 * Installation Names::          Installing in different directories
diff --git a/doc/install.texi b/doc/install.texi
index 414c8939..cf9a9c67 100644
--- a/doc/install.texi
+++ b/doc/install.texi
@@ -132,6 +132,22 @@ If the package follows the GNU Coding Standards,
 you can type @samp{make uninstall} to remove the installed files.
 @end enumerate
 
+@node Installation Prerequisites
+@section Installation Prerequisites
+
+Installation requires a POSIX-like environment
+with a shell and the following standard utilities:
+
+@example
+[ awk cat cmp cp diff echo expr false
+grep ls mkdir mv printf pwd rm rmdir
+sed sort test touch tr true
+@end example
+
+@noindent
+Depending on the package, other programs may be needed,
+such as a compiler for the language the package is written in.
+
 @node Compilers and Options
 @section Compilers and Options
 
-- 
2.45.2

Reply via email to