[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: grep/egrep -w non-portable (doc/Makefile.am)
From: |
Paul Eggert |
Subject: |
Re: grep/egrep -w non-portable (doc/Makefile.am) |
Date: |
Wed, 03 Nov 2004 09:40:32 -0800 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
Albert Chin <address@hidden> writes:
> It doesn't cause "make check" to fail but it is annoying. How about
> using $(GREP) and $(EGREP) and in configure.ac we:
> AC_CHECK_PROGS(GREP, [ggrep grep], grep)
> AC_CHECK_PROGS(EGREP, [gegrep egrep], egrep)
I worry that this will collide with AC_PROG_GREP and AC_PROG_EGREP.
I installed this patch instead; it's a bit ugly, but it should work.
2004-11-03 Paul Eggert <address@hidden>
* Makefile.am (_W, W_): New macros.
(check-texinfo): Use them instead of assuming grep -w (which is not
portable).
Index: Makefile.am
===================================================================
RCS file: /fetish/cu/doc/Makefile.am,v
retrieving revision 1.33
retrieving revision 1.34
diff -p -u -r1.33 -r1.34
--- Makefile.am 12 Oct 2004 07:58:47 -0000 1.33
+++ Makefile.am 3 Nov 2004 17:39:00 -0000 1.34
@@ -24,16 +24,20 @@ MAINTAINERCLEANFILES = constants.texi
$(DVIS): $(EXTRA_DIST)
$(INFO_DEPS): $(EXTRA_DIST)
+# Extended regular expressions to match word starts and ends.
+_W = (^|[^A-Za-z0-9_])
+W_ = ([^A-Za-z0-9_]|$$)
+
# List words/regexps here that should not appear in the texinfo documentation.
# E.g., use @sc{nul}, not `NUL'
# and use `time zone', not `timezone'.
check-texinfo:
fail=0; \
grep timezone $(srcdir)/*.texi && fail=1; \
- grep -w IO $(srcdir)/*.texi && fail=1; \
+ $(EGREP) '$(_W)IO$(W_)' $(srcdir)/*.texi && fail=1; \
grep non-zero $(srcdir)/*.texi && fail=1; \
grep '@url{' $(srcdir)/*.texi && fail=1; \
- grep -w NUL $(srcdir)/*.texi && fail=1; \
+ $(EGREP) '$(_W)NUL$(W_)' $(srcdir)/*.texi && fail=1; \
grep '\$$@"' $(srcdir)/*.texi && fail=1; \
grep -n '[^[:punct:address@hidden' $(srcdir)/*.texi && fail=1; \
grep -n filename $(srcdir)/*.texi|grep -vE 'setfilename|{filename}' \