tests: move most helper scripts and files into the 'ax' subdirectory
[platform/upstream/automake.git] / syntax-checks.mk
1 # Maintainer checks for Automake.  Requires GNU make.
2
3 # Copyright (C) 2012 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
8 # any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
18 # We also have to take into account VPATH builds (where some generated
19 # tests might be in '$(builddir)' rather than in '$(srcdir)'), TAP-based
20 # tests script (which have a '.tap' extension) and helper scripts used
21 # by other test cases (which have a '.sh' extension).
22 xtests := $(shell \
23   if test $(srcdir) = .; then \
24      dirs=.; \
25    else \
26      dirs='$(srcdir) .'; \
27    fi; \
28    for d in $$dirs; do \
29      for s in test tap sh; do \
30        ls $$d/tests/*.$$s 2>/dev/null; \
31      done; \
32      ls $$d/tests/ax/*.sh 2>/dev/null; \
33    done | sort)
34
35 ams := $(shell find $(srcdir) -name '*.am')
36
37 # Some simple checks, and then ordinary check.  These are only really
38 # guaranteed to work on my machine.
39 syntax_check_rules = \
40 sc_test_names \
41 sc_diff_automake_in_automake \
42 sc_diff_aclocal_in_automake \
43 sc_perl_syntax \
44 sc_no_brace_variable_expansions \
45 sc_rm_minus_f \
46 sc_no_for_variable_in_macro \
47 sc_mkinstalldirs \
48 sc_pre_normal_post_install_uninstall \
49 sc_perl_no_undef \
50 sc_perl_no_split_regex_space \
51 sc_cd_in_backquotes \
52 sc_cd_relative_dir \
53 sc_perl_at_uscore_in_scalar_context \
54 sc_perl_local \
55 sc_AMDEP_TRUE_in_automake_in \
56 sc_tests_make_without_am_makeflags \
57 sc_tests_obsolete_variables \
58 sc_tests_plain_make \
59 sc_tests_plain_autoconf \
60 sc_tests_plain_autoupdate \
61 sc_tests_plain_automake \
62 sc_tests_plain_autom4te \
63 sc_tests_plain_autoheader \
64 sc_tests_plain_autoreconf \
65 sc_tests_here_document_format \
66 sc_tests_Exit_not_exit \
67 sc_tests_automake_fails \
68 sc_tests_plain_aclocal \
69 sc_tests_plain_perl \
70 sc_tests_required_after_defs \
71 sc_tests_overriding_macros_on_cmdline \
72 sc_tests_plain_sleep \
73 sc_tests_plain_egrep_fgrep \
74 sc_tests_no_configure_in \
75 sc_tests_PATH_SEPARATOR \
76 sc_tests_logs_duplicate_prefixes \
77 sc_tests_makefile_variable_order \
78 sc_mkdir_p \
79 sc_perl_at_substs \
80 sc_unquoted_DESTDIR \
81 sc_tabs_in_texi \
82 sc_at_in_texi
83
84 $(syntax_check_rules): automake aclocal
85 maintainer-check: $(syntax_check_rules)
86 .PHONY: maintainer-check $(syntax_check_rules)
87
88 ## Check that the list of tests given in the Makefile is equal to the
89 ## list of all test scripts in the Automake testsuite.
90 .PHONY: maintainer-check-list-of-tests
91 maintainer-check-list-of-tests:
92         $(MAKE) -C tests $@
93 maintainer-check: maintainer-check-list-of-tests
94
95 ## Look for test whose names can cause spurious failures when used as
96 ## first argument to AC_INIT (chiefly because they might contain an
97 ## m4/m4sugar builtin or macro name).
98 m4_builtins = \
99   __gnu__ \
100   __unix__ \
101   bpatsubst \
102   bregexp \
103   builtin \
104   changecom \
105   changequote \
106   changeword \
107   debugfile \
108   debugmode \
109   decr \
110   define \
111   defn \
112   divert \
113   divnum \
114   dnl \
115   dumpdef \
116   errprint \
117   esyscmd \
118   eval \
119   format \
120   ifdef \
121   ifelse \
122   include \
123   incr \
124   index \
125   indir \
126   len \
127   m4exit \
128   m4wrap \
129   maketemp \
130   mkstemp \
131   patsubst \
132   popdef \
133   pushdef \
134   regexp \
135   shift \
136   sinclude \
137   substr \
138   symbols \
139   syscmd \
140   sysval \
141   traceoff \
142   traceon \
143   translit \
144   undefine \
145   undivert
146 sc_test_names:
147         @m4_builtin_rx=`echo $(m4_builtins) | sed 's/ /|/g'`; \
148          m4_macro_rx="\\<($$m4_builtin_rx)\\>|\\<_?(A[CUMHS]|m4)_"; \
149          if { \
150            for t in $(xtests); do echo $$t; done \
151              | LC_ALL=C grep -E "$$m4_macro_rx"; \
152          }; then \
153            echo "the names of the tests above can be problematic" 1>&2; \
154            echo "Avoid test names that contain names of m4 macros" 1>&2; \
155            exit 1; \
156          fi
157
158 ## These check avoids accidental configure substitutions in the source.
159 ## There are exactly 9 lines that should be modified from automake.in to
160 ## automake, and 10 lines that should be modified from aclocal.in to
161 ## aclocal; these wors out to 32 and 34 lines of diffs, respectively.
162 sc_diff_automake_in_automake:
163         @if test `diff $(srcdir)/automake.in automake | wc -l` -ne 32; then \
164           echo "found too many diffs between automake.in and automake" 1>&2; \
165           diff -c $(srcdir)/automake.in automake; \
166           exit 1; \
167         fi
168 sc_diff_aclocal_in_aclocal:
169         @if test `diff $(srcdir)/aclocal.in aclocal | wc -l` -ne 34; then \
170           echo "found too many diffs between aclocal.in and aclocal" 1>&2; \
171           diff -c $(srcdir)/aclocal.in aclocal; \
172           exit 1; \
173         fi
174
175 ## Syntax check with default Perl (on my machine, Perl 5).
176 sc_perl_syntax:
177         @perllibdir="./lib$(PATH_SEPARATOR)$(srcdir)/lib" $(PERL) -c -w automake
178         @perllibdir="./lib$(PATH_SEPARATOR)$(srcdir)/lib" $(PERL) -c -w aclocal
179
180 ## expect no instances of '${...}'.  However, $${...} is ok, since that
181 ## is a shell construct, not a Makefile construct.
182 sc_no_brace_variable_expansions:
183         @if grep -F '$${' $(ams) | grep -F -v '$$$$'; then \
184           echo "Found too many uses of '\$${' in the lines above." 1>&2; \
185           exit 1;                               \
186         else :; fi
187
188 ## Make sure 'rm' is called with '-f'.
189 sc_rm_minus_f:
190         @if grep -v '^#' $(ams) $(xtests) \
191            | grep -v '/spy-rm\.tap:' \
192            | grep -E '\<rm ([^-]|\-[^f ]*\>)'; \
193         then \
194           echo "Suspicious 'rm' invocation." 1>&2; \
195           exit 1;                               \
196         else :; fi
197
198 ## Never use something like "for file in $(FILES)", this doesn't work
199 ## if FILES is empty or if it contains shell meta characters (e.g. $ is
200 ## commonly used in Java filenames).
201 sc_no_for_variable_in_macro:
202         @if grep 'for .* in \$$(' $(ams) | grep -v '/Makefile\.am:'; then \
203           echo 'Use "list=$$(mumble); for var in $$$$list".' 1>&2 ; \
204           exit 1; \
205         else :; fi
206
207 ## Make sure all invocations of mkinstalldirs are correct.
208 sc_mkinstalldirs:
209         @if grep -n 'mkinstalldirs' $(ams) \
210               | grep -F -v '$$(mkinstalldirs)' \
211               | grep -v '^\./lib/Makefile.am:[0-9][0-9]*:  *mkinstalldirs \\$$'; \
212         then \
213           echo "Found incorrect use of mkinstalldirs in the lines above" 1>&2; \
214           exit 1; \
215         else :; fi
216
217 ## Make sure all calls to PRE/NORMAL/POST_INSTALL/UNINSTALL
218 sc_pre_normal_post_install_uninstall:
219         @if grep -E -n '\((PRE|NORMAL|POST)_(|UN)INSTALL\)' $(ams) | \
220               grep -v ':##' | grep -v ':        @\$$('; then \
221           echo "Found incorrect use of PRE/NORMAL/POST_INSTALL/UNINSTALL in the lines above" 1>&2; \
222           exit 1; \
223         else :; fi
224
225 ## We never want to use "undef", only "delete", but for $/.
226 sc_perl_no_undef:
227         @if grep -n -w 'undef ' $(srcdir)/automake.in | \
228               grep -F -v 'undef $$/'; then \
229           echo "Found undef in automake.in; use delete instead" 1>&2; \
230           exit 1; \
231         fi
232
233 ## We never want split (/ /,...), only split (' ', ...).
234 sc_perl_no_split_regex_space:
235         @if grep -n 'split (/ /' $(srcdir)/automake.in; then \
236           echo "Found bad split in the lines above." 1>&2; \
237           exit 1; \
238         fi
239
240 ## Look for cd within backquotes
241 sc_cd_in_backquotes:
242         @if grep -n '^[^#]*` *cd ' $(srcdir)/automake.in $(ams); then \
243           echo "Consider using \$$(am__cd) in the lines above." 1>&2; \
244           exit 1; \
245         fi
246
247 ## Look for cd to a relative directory (may be influenced by CDPATH).
248 ## Skip some known directories that are OK.
249 sc_cd_relative_dir:
250         @if grep -n '^[^#]*cd ' $(srcdir)/automake.in $(ams) | \
251               grep -v 'echo.*cd ' | \
252               grep -v 'am__cd =' | \
253               grep -v '^[^#]*cd [./]' | \
254               grep -v '^[^#]*cd \$$(top_builddir)' | \
255               grep -v '^[^#]*cd "\$$\$$am__cwd' | \
256               grep -v '^[^#]*cd \$$(abs' | \
257               grep -v '^[^#]*cd "\$$(DESTDIR)'; then \
258           echo "Consider using \$$(am__cd) in the lines above." 1>&2; \
259           exit 1; \
260         fi
261
262 ## Using @_ in a scalar context is most probably a programming error.
263 sc_perl_at_uscore_in_scalar_context:
264         @if grep -Hn '[^@_A-Za-z0-9][_A-Za-z0-9]*[^) ] *= *@_' $(srcdir)/automake.in; then \
265           echo "Using @_ in a scalar context in the lines above." 1>&2; \
266           exit 1; \
267         fi
268
269 ## Allow only few variables to be localized in Automake.
270 sc_perl_local:
271         @if egrep -v '^[ \t]*local \$$[_~]( *=|;)' $(srcdir)/automake.in | \
272                 grep '^[ \t]*local [^*]'; then \
273           echo "Please avoid 'local'." 1>&2; \
274           exit 1; \
275         fi
276
277 ## Don't let AMDEP_TRUE substitution appear in automake.in.
278 sc_AMDEP_TRUE_in_automake_in:
279         @if grep '@AMDEP''_TRUE@' $(srcdir)/automake.in; then \
280           echo "Don't put AMDEP_TRUE substitution in automake.in" 1>&2; \
281           exit 1; \
282         fi
283
284 ## Recursive make invocations should always pass $(AM_MAKEFLAGS)
285 ## to $(MAKE), for portability to non-GNU make.
286 sc_tests_make_without_am_makeflags:
287         @if grep '^[^#].*(MAKE) ' $(ams) $(srcdir)/automake.in \
288             | grep -v 'AM_MAKEFLAGS' \
289             | grep -v '/am/header-vars\.am:.*am--echo.*| $$(MAKE) -f *-'; \
290         then \
291           echo 'Use $$(MAKE) $$(AM_MAKEFLAGS).' 1>&2; \
292           exit 1; \
293         fi
294
295 ## Look out for some obsolete variables.
296 sc_tests_obsolete_variables:
297         @vars=" \
298           using_tap \
299           parallel_tests \
300           test_prefer_config_shell \
301           original_AUTOMAKE \
302           original_ACLOCAL \
303         "; \
304         seen=""; \
305         for v in $$vars; do \
306           if grep -E "\b$$v\b" \
307             $(xtests) $(srcdir)/tests/defs \
308             $(srcdir)/tests/defs-static.in \
309           ; then \
310             seen="$$seen $$v"; \
311           fi; \
312         done; \
313         if test -n "$$seen"; then \
314           for v in $$seen; do \
315             echo "Variable '$$v' is obsolete, use 'am_$$v' instead." 1>&2; \
316           done; \
317           exit 1; \
318         else :; fi
319
320 ## Tests should never call make directly.
321 sc_tests_plain_make:
322         @if grep -v '^#' $(xtests) | $(EGREP) ':[       ]*make( |$$)'; then \
323           echo 'Do not run "make" in the above tests.  Use "$$MAKE" instead.' 1>&2; \
324           exit 1; \
325         fi
326
327 ## Tests should never call autoconf directly.
328 sc_tests_plain_autoconf:
329         @if grep -v '^#' $(xtests) | grep ':[   ]*autoconf\>'; then \
330           echo 'Do not run "autoconf" in the above tests.  Use "$$AUTOCONF" instead.' 1>&2; \
331           exit 1; \
332         fi
333
334 ## Tests should never call autoupdate directly.
335 sc_tests_plain_autoupdate:
336         @if grep -v '^#' $(xtests) | grep ':[   ]*autoupdate\>'; then \
337           echo 'Do not run "autoupdate" in the above tests.  Use "$$AUTOUPDATE" instead.' 1>&2; \
338           exit 1; \
339         fi
340
341 ## Tests should never call automake directly.
342 sc_tests_plain_automake:
343         @if grep -v '^#' $(xtests) | grep -E ':[        ]*automake\>([^:]|$$)'; then \
344           echo 'Do not run "automake" in the above tests.  Use "$$AUTOMAKE" instead.' 1>&2;  \
345           exit 1; \
346         fi
347
348 ## Tests should never call autoheader directly.
349 sc_tests_plain_autoheader:
350         @if grep -v '^#' $(xtests) | grep ':[   ]*autoheader\>'; then \
351           echo 'Do not run "autoheader" in the above tests.  Use "$$AUTOHEADER" instead.' 1>&2;  \
352           exit 1; \
353         fi
354
355 ## Tests should never call autoreconf directly.
356 sc_tests_plain_autoreconf:
357         @if grep -v '^#' $(xtests) | grep ':[   ]*autoreconf\>'; then \
358           echo 'Do not run "autoreconf" in the above tests.  Use "$$AUTORECONF" instead.' 1>&2;  \
359           exit 1; \
360         fi
361
362 ## Tests should never call autom4te directly.
363 sc_tests_plain_autom4te:
364         @if grep -v '^#' $(xtests) | grep ':[   ]*autom4te\>'; then \
365           echo 'Do not run "autom4te" in the above tests.  Use "$$AUTOM4TE" instead.' 1>&2;  \
366           exit 1; \
367         fi
368
369 ## Tests should only use END and EOF for here documents
370 ## (so that the next test is effective).
371 sc_tests_here_document_format:
372         @if grep '<<' $(xtests) | grep -Ev '\b(END|EOF)\b|\bstd::cout <<'; then \
373           echo 'Use here documents with "END" and "EOF" only, for greppability.' 1>&2; \
374           exit 1; \
375         fi
376
377 ## Tests should never call exit directly, but use Exit.
378 ## This is so that the exit status is transported correctly across the 0 trap.
379 ## Ignore comments, testsuite self tests, and one perl line in ext2.test.
380 sc_tests_Exit_not_exit:
381         @found=false; for file in $(xtests); do \
382           case $$file in */self-check-*) continue;; esac; \
383           res=`sed -n -e '/^#/d; /^\$$PERL/d' -e '/<<.*END/,/^END/b' \
384                       -e '/<<.*EOF/,/^EOF/b' -e '/exit [$$0-9]/p' $$file`; \
385           if test -n "$$res"; then \
386             echo "$$file:$$res"; \
387             found=true; \
388           fi; \
389         done; \
390         if $$found; then \
391           echo 'Do not call plain "exit", use "Exit" instead, in above tests.' 1>&2; \
392           exit 1; \
393         fi
394
395 ## Use AUTOMAKE_fails when appropriate
396 sc_tests_automake_fails:
397         @if grep -v '^#' $(xtests) | grep '\$$AUTOMAKE.*&&.*[eE]xit'; then \
398           echo 'Use AUTOMAKE_fails + grep to catch automake failures in the above tests.' 1>&2;  \
399           exit 1; \
400         fi
401
402 ## Tests should never call aclocal directly.
403 sc_tests_plain_aclocal:
404         @if grep -v '^#' $(xtests) | grep ':[   ]*aclocal\>'; then \
405           echo 'Do not run "aclocal" in the above tests.  Use "$$ACLOCAL" instead.' 1>&2;  \
406           exit 1; \
407         fi
408
409 ## Tests should never call perl directly.
410 sc_tests_plain_perl:
411         @if grep -v '^#' $(xtests) | grep ':[   ]*perl\>'; then \
412           echo 'Do not run "perl" in the above tests.  Use "$$PERL" instead.' 1>&2; \
413           exit 1; \
414         fi
415
416 ## Setting 'required' after sourcing './defs' is a bug.
417 sc_tests_required_after_defs:
418         @for file in $(xtests); do \
419           if out=`sed -n '/defs/,$${/required=/p;}' $$file`; test -n "$$out"; then \
420             echo 'Do not set "required" after sourcing "defs" in '"$$file: $$out" 1>&2; \
421             exit 1; \
422           fi; \
423         done
424
425 ## Overriding a Makefile macro on the command line is not portable when
426 ## recursive targets are used.  Better use an envvar.  SHELL is an
427 ## exception, POSIX says it can't come from the environment.  V, DESTDIR,
428 ## DISTCHECK_CONFIGURE_FLAGS and DISABLE_HARD_ERRORS are exceptions, too,
429 ## as package authors are urged not to initialize them anywhere.
430 ## Finally, 'exp' is used by some ad-hoc checks, where we ensure it's
431 ## ok to override it from the command line.
432 sc_tests_overriding_macros_on_cmdline:
433         @if grep -E '\$$MAKE .*(SHELL=.*=|=.*SHELL=)' $(xtests); then \
434           echo 'Rewrite "$$MAKE foo=bar SHELL=$$SHELL" as "foo=bar $$MAKE -e SHELL=$$SHELL"' 1>&2; \
435           echo ' in the above lines, it is more portable.' 1>&2; \
436           exit 1; \
437         fi
438 # The first s/// tries to account for usages like "$MAKE || st=$?".
439 # 'DISTCHECK_CONFIGURE_FLAGS' and 'exp' are allowed to contain whitespace in
440 # their definitions, hence the more complex last three substitutions below.
441 # Also, the 'make-dryrun.test' is whitelisted, since there we need to
442 # override variables from the command line in order to cover the expected
443 # code paths.
444         @tests=`for t in $(xtests); do \
445                   case $$t in */make-dryrun.test);; *) echo $$t;; esac; \
446                 done`; \
447         if sed -e 's/ || .*//' -e 's/ && .*//' \
448                 -e 's/ DESTDIR=[^ ]*/ /' -e 's/ SHELL=[^ ]*/ /' \
449                 -e 's/ V=[^ ]*/ /' -e 's/ DISABLE_HARD_ERRORS=[^ ]*/ /' \
450                 -e "s/ DISTCHECK_CONFIGURE_FLAGS='[^']*'/ /" \
451                 -e 's/ DISTCHECK_CONFIGURE_FLAGS="[^"]*"/ /' \
452                 -e 's/ DISTCHECK_CONFIGURE_FLAGS=[^ ]/ /' \
453                 -e "s/ exp='[^']*'/ /" \
454                 -e 's/ exp="[^"]*"/ /' \
455                 -e 's/ exp=[^ ]/ /' \
456               $$tests | grep '\$$MAKE .*='; then \
457           echo 'Rewrite "$$MAKE foo=bar" as "foo=bar $$MAKE -e" in the above lines,' 1>&2; \
458           echo 'it is more portable.' 1>&2; \
459           exit 1; \
460         fi
461         @if grep 'SHELL=.*\$$MAKE' $(xtests); then \
462           echo '$$MAKE ignores the SHELL envvar, use "$$MAKE SHELL=$$SHELL" in' 1>&2; \
463           echo 'the above lines.' 1>&2; \
464           exit 1; \
465         fi
466
467 ## Never use 'sleep 1' to create files with different timestamps.
468 ## Use '$sleep' instead.  Some filesystems (e.g., Windows) have only
469 ## a 2sec resolution.
470 sc_tests_plain_sleep:
471         @if grep -E '\bsleep +[12345]\b' $(xtests); then \
472           echo 'Do not use "sleep x" in the above tests.  Use "$$sleep" instead.' 1>&2; \
473           exit 1; \
474         fi
475
476 ## fgrep and egrep are not required by POSIX.
477 sc_tests_plain_egrep_fgrep:
478         @if grep -E '\b[ef]grep\b' $(xtests) ; then \
479           echo 'Do not use egrep or fgrep in test cases.  Use $$FGREP or $$EGREP.' 1>&2; \
480           exit 1; \
481         fi
482         @if grep -E '\b[ef]grep\b' $(ams) $(srcdir)/m4/*.m4; then \
483           echo 'Do not use egrep or fgrep in the above files, they are not portable.' 1>&2; \
484           exit 1; \
485         fi
486
487 ## Prefer 'configure.ac' over the obsolescent 'configure.in' as the name
488 ## for configure input files in our testsuite.  The latter  has been
489 ## deprecated for several years (at least since autoconf 2.50).
490 sc_tests_no_configure_in:
491         @if grep -E '\bconfigure\\*\.in\b' $(xtests) $(srcdir)/tests/defs \
492               | grep -Ev '/backcompat.*\.(test|tap):' \
493               | grep -Ev '/autodist-configure-no-subdir\.test:' \
494               | grep -Ev '/(configure|help)\.test:' \
495               | grep .; \
496         then \
497           echo "Use 'configure.ac', not 'configure.in', as the name" >&2; \
498           echo "for configure input files in the test cases above." >&2; \
499           exit 1; \
500         fi
501
502 ## Rule to ensure that the testsuite has been run before.  We don't depend
503 ## on 'check' here, because that would be very wasteful in the common case.
504 ## We could run "make check RECHECK_LOGS=" and avoid toplevel races with
505 ## AM_RECURSIVE_TARGETS.  Suggest keeping test directories around for
506 ## greppability of the Makefile.in files.
507 sc_ensure_testsuite_has_run:
508         @if test ! -f tests/test-suite.log; then \
509           echo 'Run "env keep_testdirs=yes make check" before' \
510                'running "make maintainer-check"' >&2; \
511           exit 1; \
512         fi
513 .PHONY: sc_ensure_testsuite_has_run
514
515 ## Ensure our warning and error messages do not contain duplicate 'warning:' prefixes.
516 ## This test actually depends on the testsuite having been run before.
517 sc_tests_logs_duplicate_prefixes: sc_ensure_testsuite_has_run
518         @if grep -E '(warning|error):.*(warning|error):' tests/*.log; then \
519           echo 'Duplicate warning/error message prefixes seen in above tests.' >&2; \
520           exit 1; \
521         fi
522
523 ## Ensure variables are listed before rules in Makefile.in files we generate.
524 sc_tests_makefile_variable_order: sc_ensure_testsuite_has_run
525         @st=0; \
526         for file in `find tests -name Makefile.in -print`; do \
527           latevars=`sed -n \
528             -e :x -e 's/#.*//' \
529             -e '/\\\\$$/{' -e N -e 'b x' -e '}' \
530             -e '# Literal TAB.' \
531             -e '1,/^    /d' \
532             -e '# Allow @ so we match conditionals.' \
533             -e '/^ *[a-zA-Z_@]\{1,\} *=/p' $$file`; \
534           if test -n "$$latevars"; then \
535             echo "Variables are expanded too late in $$file:" >&2; \
536             echo "$$latevars" | sed 's/^/  /' >&2; \
537             st=1; \
538           fi; \
539         done; \
540         test $$st -eq 0 || { \
541           echo 'Ensure variables are expanded before rules' >&2; \
542           exit 1; \
543         }
544
545 ## Using ':' as a PATH separator is not portable.
546 sc_tests_PATH_SEPARATOR:
547         @if grep -E '\bPATH=.*:.*' $(xtests) ; then \
548           echo "Use '\$$PATH_SEPARATOR', not ':', in PATH definitions" \
549                "above." 1>&2; \
550           exit 1; \
551         fi
552
553 sc_mkdir_p:
554         @if grep 'mkdir_p' $(srcdir)/automake.in $(ams) $(xtests); then \
555           echo 'Do not use mkdir_p in the above files, use MKDIR_P.' 1>&2; \
556           exit 1; \
557         fi
558
559 ## Try to make sure all @...@ substitutions are covered by our
560 ## substitution rule.
561 sc_perl_at_substs:
562         @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' aclocal | wc -l` -ne 0; then \
563           echo "Unresolved @...@ substitution in aclocal" 1>&2; \
564           exit 1; \
565         fi
566         @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' automake | wc -l` -ne 0; then \
567           echo "Unresolved @...@ substitution in automake" 1>&2; \
568           exit 1; \
569         fi
570
571 sc_unquoted_DESTDIR:
572         @if grep -E "[^\'\"]\\\$$\(DESTDIR" $(ams); then \
573           echo 'Suspicious unquoted DESTDIR uses.' 1>&2 ; \
574           exit 1; \
575         fi
576
577 sc_tabs_in_texi:
578         @if grep '      ' $(srcdir)/doc/automake.texi; then \
579           echo 'Do not use tabs in the manual.' 1>&2; \
580           exit 1; \
581         fi
582
583 sc_at_in_texi:
584         @if grep -E '([^@]|^)@([         ][^@]|$$)' $(srcdir)/doc/automake.texi; \
585         then \
586           echo 'Unescaped @.' 1>&2; \
587           exit 1; \
588         fi