From: Stefano Lattarini Date: Sat, 16 Feb 2013 18:39:07 +0000 (+0100) Subject: Merge branch 'maint' X-Git-Tag: v1.16~118 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e074aa5e14c7debc33f01ff9f40283278d06128;p=thirdparty%2Fautomake.git Merge branch 'maint' * maint: style: call perl functions 'like_this()', not '&like_this()' maint: use more perl subroutines prototypes in the automake script build: auto-generate perl subroutines prototypes for automake and aclocal refactor: rip module Automake::Language out of automake script Signed-off-by: Stefano Lattarini --- 5e074aa5e14c7debc33f01ff9f40283278d06128 diff --cc automake.in index 70214e45e,d4c25c4c0..02c6d4138 --- a/automake.in +++ b/automake.in @@@ -32,95 -34,17 +34,8 @@@ BEGI @Automake::perl_libdirs = ('@datadir@/@PACKAGE@-@APIVERSION@') unless @Automake::perl_libdirs; unshift @INC, @Automake::perl_libdirs; - - # Override SHELL. This is required on DJGPP so that system() uses - # bash, not COMMAND.COM which doesn't quote arguments properly. - # Other systems aren't expected to use $SHELL when Automake - # runs, but it should be safe to drop the "if DJGPP" guard if - # it turns up other systems need the same thing. After all, - # if SHELL is used, ./configure's SHELL is always better than - # the user's SHELL (which may be something like tcsh). - $ENV{'SHELL'} = '@SHELL@' if exists $ENV{'DJDIR'}; } - use Class::Struct (); - Class::Struct::struct ( - # Short name of the language (c, f77...). - 'name' => "\$", - # Nice name of the language (C, Fortran 77...). - 'Name' => "\$", - - # List of configure variables which must be defined. - 'config_vars' => '@', - - # 'pure' is '1' or ''. A 'pure' language is one where, if - # all the files in a directory are of that language, then we - # do not require the C compiler or any code to call it. - 'pure' => "\$", - - 'autodep' => "\$", - - # Name of the compiling variable (COMPILE). - 'compiler' => "\$", - # Content of the compiling variable. - 'compile' => "\$", - # Flag to require compilation without linking (-c). - 'compile_flag' => "\$", - 'extensions' => '@', - # A subroutine to compute a list of possible extensions of - # the product given the input extensions. - # (defaults to a subroutine which returns ('.$(OBJEXT)', '.lo')) - 'output_extensions' => "\$", - # A list of flag variables used in 'compile'. - # (defaults to []) - 'flags' => "@", - - # Any tag to pass to libtool while compiling. - 'libtool_tag' => "\$", - - # The file to use when generating rules for this language. - # The default is 'depend2'. - 'rule_file' => "\$", - - # Name of the linking variable (LINK). - 'linker' => "\$", - # Content of the linking variable. - 'link' => "\$", - - # Name of the compiler variable (CC). - 'ccer' => "\$", - - # Name of the linker variable (LD). - 'lder' => "\$", - # Content of the linker variable ($(CC)). - 'ld' => "\$", - - # Flag to specify the output file (-o). - 'output_flag' => "\$", - '_finish' => "\$", - - # This is a subroutine which is called whenever we finally - # determine the context in which a source file will be - # compiled. - '_target_hook' => "\$", - - # If TRUE, nodist_ sources will be compiled using specific rules - # (i.e. not inference rules). The default is FALSE. - 'nodist_specific' => "\$"); - - - sub finish ($) - { - my ($self) = @_; - if (defined $self->_finish) - { - &{$self->_finish} (@_); - } - } - - sub target_hook ($$$$%) - { - my ($self) = @_; - if (defined $self->_target_hook) - { - &{$self->_target_hook} (@_); - } - } - - package Automake; - - use strict; use Automake::Config; BEGIN { @@@ -5449,8 -5391,9 +5364,8 @@@ EO } - # &scan_autoconf_files () + # scan_autoconf_files () -# ---------------------- -# Check whether we use 'configure.ac' or 'configure.in'. +# ----------------------- # Scan it (and possibly 'aclocal.m4') for interesting things. # We must scan aclocal.m4 because there might be AC_SUBSTs and such there. sub scan_autoconf_files () diff --cc maintainer/syntax-checks.mk index e1d5e6b5d,878789f15..1f72085ea --- a/maintainer/syntax-checks.mk +++ b/maintainer/syntax-checks.mk @@@ -80,17 -80,20 +80,20 @@@ sc_tabs_in_texi sc_at_in_texi ## These check avoids accidental configure substitutions in the source. -## There are exactly 8 lines that should be modified from automake.in to +## There are exactly 7 lines that should be modified from automake.in to ## automake, and 9 lines that should be modified from aclocal.in to ## aclocal. -automake_diff_no = 8 +automake_diff_no = 7 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" ; \