summaryrefslogtreecommitdiff
path: root/maintainer
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2013-02-04 23:04:18 +0100
committerStefano Lattarini <stefano.lattarini@gmail.com>2013-02-13 17:46:26 +0100
commit283ded7f5b9b7ad97300293cd65f3f1b48c21115 (patch)
treea6602008cf901a41d6e153219724a48784e2c9ac /maintainer
parent6d9e9dd453944cd86ddc530a131bd338f4734638 (diff)
downloadautomake-283ded7f5b9b7ad97300293cd65f3f1b48c21115.tar.gz
build: auto-generate perl subroutines prototypes for automake and aclocal
This will allow us to avoid either using the '&foo' invocation form when invoking a subroutine before its definition, or having to maintain the list of prototypes by hand (with the risk of having it become incomplete or fall out-of-sync when future edits to the automake and aclocal scripts are done). * Makefile.am (automake, aclocal): Automatically generate a list of prototypes by looking at the subroutines definitions. * bootstrap.sh: Likewise, when generating the temporary automake and aclocal scripts used for bootstrapping. * automake.in: Add a placeholder that will be tracked by the new recipes and substituted with the computed prototypes. Remove existing prototypes, that are now superfluous. Some adjustments required by the new, more comprehensive prototypes declarations. * aclocal.in: Likewise. * maintainer/syntax-checks.mk (sc_diff_automake, sc_diff_aclocal): Adjust. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 'maintainer')
-rw-r--r--maintainer/syntax-checks.mk19
1 files changed, 11 insertions, 8 deletions
diff --git a/maintainer/syntax-checks.mk b/maintainer/syntax-checks.mk
index e7e2fc055..878789f15 100644
--- a/maintainer/syntax-checks.mk
+++ b/maintainer/syntax-checks.mk
@@ -86,19 +86,22 @@ sc_at_in_texi
automake_diff_no = 8
aclocal_diff_no = 9
sc_diff_automake sc_diff_aclocal: sc_diff_% :
- @set +e; tmp=$*-diffs.tmp; \
- diff -u $(srcdir)/$*.in $* > $$tmp; test $$? -eq 1 || exit 1; \
- added=`grep -v '^+++ ' $$tmp | grep -c '^+'` || exit 1; \
- removed=`grep -v '^--- ' $$tmp | grep -c '^-'` || exit 1; \
- test $$added,$$removed = $($*_diff_no),$($*_diff_no) \
+ @set +e; \
+ in=$*-in.tmp out=$*-out.tmp diffs=$*-diffs.tmp \
+ && sed '/^#!.*[pP]rototypes/d' $(srcdir)/$*.in > $$in \
+ && sed '/^# BEGIN.* PROTO/,/^# END.* PROTO/d' $* > $$out \
+ && { diff -u $$in $$out > $$diffs; test $$? -eq 1; } \
+ && added=`grep -v '^+++ ' $$diffs | grep -c '^+'` \
+ && removed=`grep -v '^--- ' $$diffs | grep -c '^-'` \
+ && test $$added,$$removed = $($*_diff_no),$($*_diff_no) \
|| { \
echo "Found unexpected diffs between $*.in and $*"; \
echo "Lines added: $$added" ; \
echo "Lines removed: $$removed"; \
- cat $$tmp >&2; \
+ cat $$diffs; \
exit 1; \
- } >&1; \
- rm -f $$tmp
+ } >&2; \
+ rm -f $$in $$out $$diffs
## Expect no instances of '${...}'. However, $${...} is ok, since that
## is a shell construct, not a Makefile construct.