From 283ded7f5b9b7ad97300293cd65f3f1b48c21115 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Mon, 4 Feb 2013 23:04:18 +0100 Subject: 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 --- Makefile.am | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index c245369ba..2e055612b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -96,13 +96,18 @@ uninstall-hook: # $(datadir) or other do_subst'ituted variables change. automake: automake.in aclocal: aclocal.in -automake aclocal: Makefile - $(AM_V_at)rm -f $@ $@-t - $(AM_V_GEN)in=$@.in; $(do_subst) <$(srcdir)/$@.in >$@-t +automake aclocal: Makefile lib/gen-perl-protos + $(AM_V_GEN)rm -f $@ $@-t $@-t2 \ +## Common substitutions. + && in=$@.in && $(do_subst) <$(srcdir)/$$in >$@-t \ +## Auto-compute prototypes of perl subroutines. + && $(PERL) -w $(srcdir)/lib/gen-perl-protos $@-t > $@-t2 \ + && mv -f $@-t2 $@-t \ ## We can't use '$(generated_file_finalize)' here, because currently ## Automake contains occurrences of unexpanded @substitutions@ in ## comments, and that is perfectly legit. - $(AM_V_at)chmod a+x,a-w $@-t && mv -f $@-t $@ + && chmod a+x,a-w $@-t && mv -f $@-t $@ +EXTRA_DIST += lib/gen-perl-protos # The master location for INSTALL is lib/INSTALL. # This is where "make fetch" will install new versions. -- cgit v1.2.1