[sr #110657] Autoconf configure script considers absence of usable grep a fatal error, although it only uses egrep thereafter

Alain Knaff <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.bugs
Message-ID <[email protected]>
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.

Hi,

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
AC_CHECK_TYPE" :-)

(file #53274)

    _______________________________________________________

Additional Item Attachment:

File name: autoconf-grep.diff             Size:2 KB
    <https://file.savannah.gnu.org/file/autoconf-grep.diff?file_id=53274>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/support/?110657>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.