[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Automake patch to not assume egrep or fgrep
From: |
Ralf Corsepius |
Subject: |
Re: Automake patch to not assume egrep or fgrep |
Date: |
30 May 2002 09:02:42 +0200 |
Am Don, 2002-05-30 um 08.21 schrieb Paul Eggert:
> I've been porting GNU tools to a stricter POSIX 1003.1-2001
> environment, and noticed that Automake uses the obsolecent commands
> 'egrep' and 'fgrep'. These commands need not exist on a modern POSIX
> host; you're supposed to use grep -E and grep -F instead. I installed
> the following patch on the main Automake branch; I don't know whether
> this sort of thing is suitable for branch-1-6 so I left branch-1-6
> alone.
AFAIS, your patch now hard-codes grep -E and grep -F into several
general automake-files (some annotations interspersed below).
I.e. your patch breaks old platforms which do not support grep -E and
grep -F (eg. SunOS4).
> Index: Makefile.am
> ===================================================================
> RCS file: /cvs/automake/automake/Makefile.am,v
> retrieving revision 1.191
> diff -p -u -r1.191 Makefile.am
> --- Makefile.am 6 May 2002 19:29:37 -0000 1.191
> +++ Makefile.am 30 May 2002 05:50:37 -0000
> @@ -78,33 +79,32 @@ maintainer-check: automake aclocal
> perllibdir=$(srcdir)/lib $(PERL) -c -w aclocal
> ## expect no instances of '${...}'. However, $${...} is ok, since that
> ## is a shell construct, not a Makefile construct.
> -## The backslash in `$${' is needed for some versions of bash.
> - @if fgrep '\$${' $(srcdir)/lib/am/[a-z]*.am | \
> - fgrep -v '$$$$'; then \
> + @if grep -F '$${' $(srcdir)/lib/am/[a-z]*.am | \
> + grep -F -v '$$$$'; then \
Hard-coded grep -F
> echo "Found too many uses of '\$${' in the lines above." 1>&2; \
> exit 1; \
> else :; fi
> ## Make sure `rm' is called with `-f'.
> - @if egrep '\<rm ([^-]|\-[^f ]*\>)' \
> + @if grep -E '\<rm ([^-]|\-[^f ]*\>)' \
> $(srcdir)/lib/am/[a-z]*.am $(srcdir)/tests/*.test | \
Hard-coded grep -E
> Index: lib/am/distdir.am
> ===================================================================
> RCS file: /cvs/automake/automake/lib/am/distdir.am,v
> retrieving revision 1.33
> diff -p -u -r1.33 distdir.am
> --- lib/am/distdir.am 17 May 2002 10:49:53 -0000 1.33
> +++ lib/am/distdir.am 30 May 2002 05:50:37 -0000
> @@ -1,5 +1,5 @@
> ## automake - create Makefile.in from Makefile.am
> -## Copyright 2001 Free Software Foundation, Inc.
> +## Copyright (C) 2001, 2002 Free Software Foundation, Inc.
>
> ## This program is free software; you can redistribute it and/or modify
> ## it under the terms of the GNU General Public License as published by
> @@ -42,7 +42,7 @@ distdir: $(DISTFILES)
> ##
> if %?TOPDIR_P%
> if %?CK-NEWS%
> - @if sed 15q $(srcdir)/NEWS | fgrep -e "$(VERSION)" >/dev/null; \
> + @if sed 15q $(srcdir)/NEWS | grep -F -e "$(VERSION)" >/dev/null; \
Hard-coded grep -F .
[..]
Why not implementing a general AC_PROG_FGREP and AC_PROG_EGREP into
autoconf and others (including automake) use $(FGREP) or $(EGREP) in
general?
Or alternatively, let automake provide and use such macros, in general?
Ralf