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