+# Ensure that dd's definition of LONGEST_SYMBOL stays in sync
+# with the strings from the two affected variables.
+dd_c = $(srcdir)/src/dd.c
+sc_dd_max_sym_length:
+ifneq ($(wildcard $(dd_c)),)
+ @len=$$( (sed -n '/conversions\[\] =$$/,/^};/p' $(dd_c);\
+ sed -n '/flags\[\] =$$/,/^};/p' $(dd_c) ) \
+ |sed -n '/"/s/^[^"]*"\([^"]*\)".*/\1/p' \
+ | wc --max-line-length); \
+ max=$$(sed -n '/^#define LONGEST_SYMBOL /s///p' $(dd_c) \
+ |tr -d '"' | wc --max-line-length); \
+ if test "$$len" = "$$max"; then :; else \
+ echo 'dd.c: LONGEST_SYMBOL is not longest' 1>&2; \
+ exit 1; \
+ fi
+endif
+
+# Many m4 macros names once began with `jm_'.
+# On 2004-04-13, they were all changed to start with gl_ instead.
+# Make sure that none are inadvertently reintroduced.
+sc_prohibit_jm_in_m4:
+ @grep -nE 'jm_[A-Z]' \
+ $$($(CVS_LIST) $(srcdir)/m4 |grep '\.m4$$') && \
+ { echo '$(ME): do not use jm_ in m4 macro names' \
+ 1>&2; exit 1; } || :
+
+sc_root_tests:
+ @t1=sc-root.expected; t2=sc-root.actual; \
+ grep -nl '^PRIV_CHECK_ARG=require-root' \
+ $$($(CVS_LIST) tests) |sed s,tests,., |sort > $$t1; \
+ sed -n 's, cd \([^ ]*\) .*MAKE..check TESTS=\(.*\),./\1/\2,p' \
+ $(srcdir)/tests/Makefile.am |sort > $$t2; \
+ diff -u $$t1 $$t2 || diff=1; \
+ rm -f $$t1 $$t2; \
+ test "$$diff" \
+ && { echo 'tests/Makefile.am: missing check-root action'>&2; \
+ exit 1; } || :
+
+# Create a list of regular expressions matching the names
+# of files included from system.h. Exclude a couple.
+.re-list:
+ @sed -n '/^# *include /s///p' $(srcdir)/src/system.h \
+ | grep -Ev 'sys/(param|file)\.h' \
+ | sed 's/ .*//;;s/^["<]/^# *include [<"]/;s/\.h[">]$$/\\.h[">]/' \
+ > $@-t
+ @mv $@-t $@