[Top][All Lists]

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

[sr #110657] Autoconf configure script considers absence of usable grep

From: Alain Knaff
Subject: [sr #110657] Autoconf configure script considers absence of usable grep a fatal error, although it only uses egrep thereafter
Date: Sat, 4 Jun 2022 14:02:58 -0400 (EDT)

Follow-up Comment #5, sr #110657 (project autoconf):

[comment #4 comment #4:]
> For the record, despite this having been marked "won't do", I _would_
consider and review a patch (against current development trunk) that would
make configure scripgs set $EGREP and $GREP to `egrep` on systems where `egrep
-e` works but `grep -E -e` doesn't work.  It's just that neither Paul nor I
have the time, nor the necessary test environment, to develop such a patch.


Thanks for "opening the way" for a patch :-)

Attached is a patch which addresses the issue (the patch is against 2.71, as
available in Debian testing).

It removes the dependency of AC_PROG_EGREP on AC_PROG_GREP , and does the
"acceptable" check itself instead. If no acceptable grep is found (for use
with -E), it falls back on searching for an acceptable egrep.

Moreover, I noticed that the only reason why AC_PROG_EGREP is brought in (in
my case) is due to the macro AC_EGREP_CPP, which does not ever use the -e
option (to supply multiple pattern, or pattern that start with a dash).

So the patch has an additional fix, by defining an AC_PROG_EGREP_SIMPLE which
relaxes the requirements. It now only needs to conform to extended regexp
syntax, and work with long lines, but doesn't need to support -e.

So this should also work on platforms were egrep doesn't support -e either.

Then, in my example, AC_EGREP_CPP is only needed by AC_EGREP_HEADER, itself
only needed by AC_TYPE_UID_T.
And AC_TYPE_UID_T has a FIXME comment at the top saying "Rewrite using

(file #53274)


Additional Item Attachment:

File name: autoconf-grep.diff             Size:2 KB


Reply to this item at:


Message sent via Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]