maintcheck: guard against obsolete $required entries
authorStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 20 Jun 2012 11:49:18 +0000 (13:49 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 20 Jun 2012 11:49:18 +0000 (13:49 +0200)
* syntax-check.mk: Add rules guarding against the use of the
obsolete test requirements 'texi2dvi-o' and 'makeinfo-html'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
syntax-checks.mk

index bd16063..99a0946 100644 (file)
@@ -55,6 +55,7 @@ sc_perl_at_uscore_in_scalar_context \
 sc_perl_local \
 sc_AMDEP_TRUE_in_automake_in \
 sc_tests_make_without_am_makeflags \
+$(sc_obsolete_requirements_rules) \
 sc_tests_obsolete_variables \
 sc_tests_here_document_format \
 sc_tests_Exit_not_exit \
@@ -236,6 +237,19 @@ sc_tests_obsolete_variables:
          exit 1; \
        else :; fi
 
+## Look out for obsolete requirements specified in the test cases.
+sc_obsolete_requirements_rules = sc_no_texi2dvi-o sc_no_makeinfo-html
+modern-requirement.texi2dvi-o = texi2dvi
+modern-requirement.makeinfo-html = makeinfo
+
+$(sc_obsolete_requirements_rules): sc_no_% :
+       @if grep -E 'required=.*\b$*\b' $(xtests); then \
+         echo "Requirement '$*' is obsolete and shouldn't" \
+              "be used anymore." >&2; \
+         echo "You should use '$(modern-requirement.$*)' instead." >&2; \
+         exit 1; \
+       fi
+
 ## Tests should never call some programs directly, but only through the
 ## corresponding variable (e.g., '$MAKE', not 'make').  This will allow
 ## the programs to be overridden at configure time (for less brittleness)