Paul Eggert <egg...@cs.ucla.edu> writes:

> 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

Thank you for patch and background context!

> [ awk cat cmp cp diff echo expr false
> grep ls mkdir mv printf pwd rm rmdir
> sed sort test touch tr true

Of those, I'm guessing awk, grep, sed and ls are the most complex.  The
'diff' tool also stands out, and most of my packages build fine (except
for some spuriois error messages during ./configure) without 'diff', and
it is often not available in containers.

>> 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.

Python is not available in the default Fedora 42 image either.

I think the trend is to either assume /bin/sh with the smallest set of
utilities possible, or to switch everything to some higher-level
language like Python, Rust/Go or Guile.

It seems awk is going away as a standard tool, and it is possible to
either fight that or just accept it.

I would prefer if we can make things work with /bin/sh and as few
low-complex utilities as possible, for bootstrapping reasons.  Making
Python, Rust/Go, Guile etc work on new architectures is serious work,
and sometimes people just give up (e.g., m68k, sh4, sparc64 is not in a
good state here).  So I don't think that is always the right solution.

Having a limited/partial/inefficient awk implementation inside Autoconf,
implemented in /bin/sh, for the functionality that Autoconf needs
itself, would be nice.  It could be used if the system lacks 'awk'.  Or
all code that rely on awk could be rewritten in shell syntax.

/Simon

Attachment: signature.asc
Description: PGP signature

Reply via email to