From: Stefano Lattarini Date: Wed, 12 Jun 2013 19:22:58 +0000 (+0200) Subject: Merge branch 'micro' into maint X-Git-Tag: v1.14~18 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fupstream%2Fautomake.git;a=commitdiff_plain;h=6febcd41b3dcf99a89aaf21329c00fdadcd68771;hp=-c Merge branch 'micro' into maint * micro: THANKS: update e-mall address for Ralf Corsepius lang, suffix rules: don't require C stuff needlessly tests: expose automake bug#14560 Signed-off-by: Stefano Lattarini --- 6febcd41b3dcf99a89aaf21329c00fdadcd68771 diff --combined NEWS index 46d6b2e,a6f0953..1cc00a4 --- a/NEWS +++ b/NEWS @@@ -91,128 -91,17 +91,139 @@@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +New in 1.14: + +* C compilation, and the AC_PROG_CC and AM_PROG_CC_C_O macros: + + - The 'compile' script is now unconditionally required for all + packages that perform C compilation (note that if you are using + the '--add-missing' option, automake will fetch that script for + you, so you shouldn't need any explicit adjustment). + This new behaviour is needed to avoid obscure errors when the + 'subdir-objects' option is used, and the compiler is an inferior + one that doesn't grasp the combined use of both the "-c -o" + options; see discussion about automake bug#13378 for more details: + + + + - The next major Automake version (2.0) will unconditionally turn on + the 'subdir-objects' option. In order to smooth out the transition, + we now give a warning (in the category 'unsupported') whenever a + source file is present in a subdirectory but the 'subdir-object' is + not enabled. For example, the following usage will trigger such a + warning (of course, assuming the 'subdir-objects' option is off): + + bin_PROGRAMS = sub/foo + sub_foo_SOURCES = sub/main.c sub/bar.c + + - Automake will automatically enhance the AC_PROG_CC autoconf macro + to make it check, at configure time, that the C compiler supports + the combined use of both the "-c -o" options. The result of this + check is saved in the cache variable 'am_cv_prog_cc_c_o', and said + result can be overridden by pre-defining that variable. + + - The AM_PROG_CC_C_O can still be called, but that should no longer + be necessary. This macro is now just a thin wrapper around the + Automake-enhanced AC_PROG_CC. This means, among the other things, + that its behaviour is changed in three ways: + + 1. It no longer invokes the Autoconf-provided AC_PROG_CC_C_O + macros behind the scenes. + + 2. It caches the check result in the 'am_cv_prog_cc_c_o'variable, + and not in a 'ac_cv_prog_cc_*_c_o' variable whose exact name + in only dynamically computed at configure runtime (sic!) from + the content of the '$CC' variable. + + 3. It no longer automatically AC_DEFINE the C preprocessor + symbol 'NO_MINUS_C_MINUS_O'. + +* Texinfo support: + + - Automake can now be instructed to place '.info' files generated from + Texinfo input in the builddir rather than in the srcdir; this is done + specifying the new automake option 'info-in-builddir'. This feature + was requested by the developers of GCC, GDB, GNU binutils and the GNU + bfd library. See the extensive discussion about automake bug#11034 + for more details. + + - For quite a long time, Automake has been implementing an undocumented + hack which ensured that '.info' files which appeared to be cleaned + (by e.g. being listed in the CLEANFILES or DISTCLEANFILES variables) + were built in the builddir rather than in the srcdir; this hack was + introduced to ensure better backward-compatibility with packages such + as Texinfo, which did things like: + + info_TEXINFOS = texinfo.txi info-stnd.texi info.texi + DISTCLEANFILES = texinfo texinfo-* info*.info* + # Do not create info files for distribution. + dist-info: + @: + + in order not to distribute generated '.info' files. + + Now that we have the 'info-in-builddir' option that explicitly causes + generated '.info' files to be placed in the builddir, this hack should + be longer necessary, so we deprecate it with runtime warnings. It will + likely be removed altogether in Automake 2.0. + +* Relative directory in Makefile fragments: + + - The special Automake-time substitutions '%reldir%' and '%canon_reldir%' + (and their short versions, '%D%' and '%C%' respectively) can now be used + in an included Makefile fragment. The former is substituted with the + relative directory of the included fragment (compared to the top level + including Makefile), and the latter with the canonicalized version of + the same relative directory: + + bin_PROGRAMS += %reldir%/foo + %canon_reldir%_foo_SOURCES = %reldir%/bar.c + +* Deprecated distribution formats: + + - The 'shar' and 'compress' distribution formats are deprecated, and + scheduled for removal in Automake 2.0. Accordingly, the use of the + 'dist-shar' and 'dist-tarZ' will cause warnings at automake runtime + (in the 'obsolete' category), and the recipes for the Automake-generated + targets 'dist-shar' and 'dist-tarZ' will unconditionally display + (non-fatal) warnings at make runtime. + +* New configure runtime warnings about "rm -f" support: + + - To simplify transition to Automake 2.0, the shell code expanded by + AM_INIT_AUTOMAKE now checks (at configure runtime) that the default + 'rm' program in PATH doesn't complain when called without any + non-option argument if the '-f' option is given (so that commands + like "rm -f" and "rm -rf" act as a no-op, instead of raising usage + error). If this is not the case, + the configure script is aborted, to call the attention of the user + on the issue, and invite him to fix his PATH. The checked 'rm' + behavior is very widespread in the wild, and will be required by + future POSIX version: + + + + The user can still force the configure process to complete even in the + presence of a broken 'rm' by defining the ACCEPT_INFERIOR_RM_PROGRAM + environment variable to "yes". And the generated Makefiles should + still work correctly even when such broken 'rm' is used. But note + that this will no longer be the case with Automake 2.0 though, so, if + you encounter the warning, please report it to us ASAP (and try to fix + your environment as well). + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + New in 1.13.4: + + * Bugs fixed: + + - Fix a minor regression introduced in Automake 1.13.3: when two or more + user-defined suffix rules were present in a single Makefile.am, + automake would needlessly include definition of some make variables + related to C compilation in the generated Makefile.in (bug#14560). + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + New in 1.13.3: * Documentation fixes: @@@ -265,6 -154,17 +276,6 @@@ New in 1.13.2: -* Obsolescent features: - - - Use of suffix-less info files (that can be specified through the - '@setfilename' macro in Texinfo input files) is discouraged, and - its use will raise warnings in the 'obsolete' category. - - - Use of Texinfo input files with '.txi' or '.texinfo' extensions - is discouraged, and its use will raise warnings in the 'obsolete' - category. You are advised to simply use the '.texi' extension - instead. - * Documentation fixes: - The long-deprecated but still supported two-arguments invocation form @@@ -289,25 -189,6 +300,25 @@@ - Other minor miscellaneous fixes and improvements; in particular, some improvements in cross-references. +* Obsolescent features: + + - Use of suffix-less info files (that can be specified through the + '@setfilename' macro in Texinfo input files) is discouraged, and + its use will raise warnings in the 'obsolete' category. Simply + use the '.info' extension for all your info files, transforming + usages like: + + @setfilename myprogram + + into: + + @setfilename myprogram.info + + - Use of Texinfo input files with '.txi' or '.texinfo' extensions + is discouraged, and its use will raise warnings in the 'obsolete' + category. You are advised to simply use the '.texi' extension + instead. + * Bugs fixed: - When the 'ustar' option is used, the generated configure script no diff --combined THANKS index 763c285,181f4f5..cc5e238 --- a/THANKS +++ b/THANKS @@@ -6,7 -6,7 +6,7 @@@ Adam J. Richter adam@yg Adam Mercer ramercer@gmail.com Adam Sampson ats@offog.org Adrian Bunk bunk@fs.tum.de -Akim Demaille akim@freefriends.org +Akim Demaille akim@gnu.org Alan Modra amodra@bigpond.net.au Alex Hornby alex@anvil.co.uk Alex Unleashed unledev@gmail.com @@@ -109,7 -109,7 +109,7 @@@ Elmar Hoffmann elho@el Elrond Elrond@Wunder-Nett.org Enrico Scholz enrico.scholz@informatik.tu-chemnitz.de Erez Zadok ezk@cs.columbia.edu -Eric Blake ebb9@byu.net +Eric Blake eblake@redhat.com Eric Dorland eric@debian.org Eric Magnien emagnien@club-internet.fr Eric Siegerman erics_97@pobox.com @@@ -332,7 -332,7 +332,7 @@@ Rainer Orth ro@tech Rafael Laboissiere laboissiere@psy.mpg.de Rainer Tammer tammer@tammer.net Raja R Harinath harinath@cs.umn.edu - Ralf Corsepius corsepiu@faw.uni-ulm.de + Ralf Corsepius ralf.corsepius@gmail.com Ralf Menzel menzel@ls6.cs.uni-dortmund.de Ralf Wildenhues Ralf.Wildenhues@gmx.de Ralph Schleicher rs@purple.UL.BaWue.DE diff --combined bin/automake.in index 40b3181,835d3bd..283d1bb --- a/bin/automake.in +++ b/bin/automake.in @@@ -25,9 -25,7 +25,9 @@@ eval 'case $# in 0) exec @PERL@ -S "$0" # Perl reimplementation by Tom Tromey , and # Alexandre Duret-Lutz . -package Language; +package Automake; + +use strict; BEGIN { @@@ -45,6 -43,93 +45,6 @@@ $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 { @@@ -71,18 -156,10 +71,18 @@@ use Automake::VarDef use Automake::Rule; use Automake::RuleDef; use Automake::Wrap 'makefile_wrap'; +use Automake::Language; use File::Basename; use File::Spec; use Carp; +## ----------------------- ## +## Subroutine prototypes. ## +## ----------------------- ## + +#! Prototypes here will automatically be generated by the build system. + + ## ----------- ## ## Constants. ## ## ----------- ## @@@ -264,7 -341,7 +264,7 @@@ my %ac_config_files_location = () my %ac_config_files_condition = (); # Directory to search for configure-required files. This -# will be computed by &locate_aux_dir and can be set using +# will be computed by locate_aux_dir() and can be set using # AC_CONFIG_AUX_DIR in configure.ac. # $CONFIG_AUX_DIR is the 'raw' directory, valid only in the source-tree. my $config_aux_dir = ''; @@@ -310,6 -387,9 +310,6 @@@ my $package_version_location # TRUE if we've seen AM_PROG_AR my $seen_ar = 0; -# TRUE if we've seen AM_PROG_CC_C_O -my $seen_cc_c_o = 0; - # Location of AC_REQUIRE_AUX_FILE calls, indexed by their argument. my %required_aux_file = (); @@@ -529,7 -609,7 +529,7 @@@ my %am_file_cache # macro_define() call because SUFFIXES definitions impact # on $KNOWN_EXTENSIONS_PATTERN which is used used when parsing # the input am file. -sub var_SUFFIXES_trigger ($$) +sub var_SUFFIXES_trigger { my ($type, $value) = @_; accept_extensions (split (' ', $value)); @@@ -538,9 -618,16 +538,9 @@@ Automake::Variable::hook ('SUFFIXES', \ ################################################################ -## --------------------------------- ## -## Forward subroutine declarations. ## -## --------------------------------- ## -sub register_language (%); -sub file_contents_internal ($$$%); -sub define_files_variable ($\@$$); - -# &initialize_per_input () -# ------------------------ +# initialize_per_input () +# ----------------------- # (Re)-Initialize per-Makefile.am variables. sub initialize_per_input () { @@@ -609,15 -696,6 +609,15 @@@ # Initialize our list of languages that are internally supported. +my @cpplike_flags = + qw{ + $(DEFS) + $(DEFAULT_INCLUDES) + $(INCLUDES) + $(AM_CPPFLAGS) + $(CPPFLAGS) + }; + # C. register_language ('name' => 'c', 'Name' => 'C', @@@ -626,13 -704,12 +626,13 @@@ 'flags' => ['CFLAGS', 'CPPFLAGS'], 'ccer' => 'CC', 'compiler' => 'COMPILE', - 'compile' => '$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)', + 'compile' => "\$(CC) @cpplike_flags \$(AM_CFLAGS) \$(CFLAGS)", 'lder' => 'CCLD', 'ld' => '$(CC)', 'linker' => 'LINK', 'link' => '$(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@', 'compile_flag' => '-c', + 'output_flag' => '-o', 'libtool_tag' => 'CC', 'extensions' => ['.c']); @@@ -644,7 -721,7 +644,7 @@@ register_language ('name' => 'cxx' 'link' => '$(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@', 'autodep' => 'CXX', 'flags' => ['CXXFLAGS', 'CPPFLAGS'], - 'compile' => '$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)', + 'compile' => "\$(CXX) @cpplike_flags \$(AM_CXXFLAGS) \$(CXXFLAGS)", 'ccer' => 'CXX', 'compiler' => 'CXXCOMPILE', 'compile_flag' => '-c', @@@ -663,7 -740,7 +663,7 @@@ register_language ('name' => 'objc' 'link' => '$(OBJCLD) $(AM_OBJCFLAGS) $(OBJCFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@', 'autodep' => 'OBJC', 'flags' => ['OBJCFLAGS', 'CPPFLAGS'], - 'compile' => '$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS)', + 'compile' => "\$(OBJC) @cpplike_flags \$(AM_OBJCFLAGS) \$(OBJCFLAGS)", 'ccer' => 'OBJC', 'compiler' => 'OBJCCOMPILE', 'compile_flag' => '-c', @@@ -681,7 -758,7 +681,7 @@@ register_language ('name' => 'objcxx' 'link' => '$(OBJCXXLD) $(AM_OBJCXXFLAGS) $(OBJCXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@', 'autodep' => 'OBJCXX', 'flags' => ['OBJCXXFLAGS', 'CPPFLAGS'], - 'compile' => '$(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCXXFLAGS) $(OBJCXXFLAGS)', + 'compile' => "\$(OBJCXX) @cpplike_flags \$(AM_OBJCXXFLAGS) \$(OBJCXXFLAGS)", 'ccer' => 'OBJCXX', 'compiler' => 'OBJCXXCOMPILE', 'compile_flag' => '-c', @@@ -699,7 -776,7 +699,7 @@@ register_language ('name' => 'upc' 'link' => '$(UPCLD) $(AM_UPCFLAGS) $(UPCFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@', 'autodep' => 'UPC', 'flags' => ['UPCFLAGS', 'CPPFLAGS'], - 'compile' => '$(UPC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_UPCFLAGS) $(UPCFLAGS)', + 'compile' => "\$(UPC) @cpplike_flags \$(AM_UPCFLAGS) \$(UPCFLAGS)", 'ccer' => 'UPC', 'compiler' => 'UPCCOMPILE', 'compile_flag' => '-c', @@@ -818,7 -895,7 +818,7 @@@ register_language ('name' => 'cppasm' 'autodep' => 'CCAS', 'flags' => ['CCASFLAGS', 'CPPFLAGS'], - 'compile' => '$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)', + 'compile' => "\$(CCAS) @cpplike_flags \$(AM_CCASFLAGS) \$(CCASFLAGS)", 'ccer' => 'CPPAS', 'compiler' => 'CPPASCOMPILE', 'compile_flag' => '-c', @@@ -872,7 -949,7 +872,7 @@@ register_language ('name' => 'ppfc' 'flags' => ['FCFLAGS', 'CPPFLAGS'], 'ccer' => 'PPFC', 'compiler' => 'PPFCCOMPILE', - 'compile' => '$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS)', + 'compile' => "\$(FC) @cpplike_flags \$(AM_FCFLAGS) \$(FCFLAGS)", 'compile_flag' => '-c', 'output_flag' => '-o', 'libtool_tag' => 'FC', @@@ -904,7 -981,7 +904,7 @@@ register_language ('name' => 'ppf77' 'flags' => ['FFLAGS', 'CPPFLAGS'], 'ccer' => 'PPF77', 'compiler' => 'PPF77COMPILE', - 'compile' => '$(F77) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FFLAGS) $(FFLAGS)', + 'compile' => "\$(F77) @cpplike_flags \$(AM_FFLAGS) \$(FFLAGS)", 'compile_flag' => '-c', 'output_flag' => '-o', 'libtool_tag' => 'F77', @@@ -956,7 -1033,7 +956,7 @@@ register_language ('name' => 'java' # err_am ($MESSAGE, [%OPTIONS]) # ----------------------------- # Uncategorized errors about the current Makefile.am. -sub err_am ($;%) +sub err_am { msg_am ('error', @_); } @@@ -964,7 -1041,7 +964,7 @@@ # err_ac ($MESSAGE, [%OPTIONS]) # ----------------------------- # Uncategorized errors about configure.ac. -sub err_ac ($;%) +sub err_ac { msg_ac ('error', @_); } @@@ -972,7 -1049,7 +972,7 @@@ # msg_am ($CHANNEL, $MESSAGE, [%OPTIONS]) # --------------------------------------- # Messages about about the current Makefile.am. -sub msg_am ($$;%) +sub msg_am { my ($channel, $msg, %opts) = @_; msg $channel, "${am_file}.am", $msg, %opts; @@@ -981,7 -1058,7 +981,7 @@@ # msg_ac ($CHANNEL, $MESSAGE, [%OPTIONS]) # --------------------------------------- # Messages about about configure.ac. -sub msg_ac ($$;%) +sub msg_ac { my ($channel, $msg, %opts) = @_; msg $channel, $configure_ac, $msg, %opts; @@@ -995,7 -1072,7 +995,7 @@@ # We do this to avoid having the substitutions directly in automake.in; # when we do that they are sometimes removed and this causes confusion # and bugs. -sub subst ($) +sub subst { my ($text) = @_; return '@' . $text . '@'; @@@ -1005,12 -1082,12 +1005,12 @@@ # $BACKPATH -# &backname ($RELDIR) -# -------------------- +# backname ($RELDIR) +# ------------------- # If I "cd $RELDIR", then to come back, I should "cd $BACKPATH". # For instance 'src/foo' => '../..'. # Works with non strictly increasing paths, i.e., 'src/../lib' => '..'. -sub backname ($) +sub backname { my ($file) = @_; my @res; @@@ -1037,7 -1114,7 +1037,7 @@@ # verbose_var (NAME) # ------------------ # The public variable stem used to implement silent rules. -sub verbose_var ($) +sub verbose_var { my ($name) = @_; return 'AM_V_' . $name; @@@ -1046,7 -1123,7 +1046,7 @@@ # verbose_private_var (NAME) # -------------------------- # The naming policy for the private variables for silent rules. -sub verbose_private_var ($) +sub verbose_private_var { my ($name) = @_; return 'am__v_' . $name; @@@ -1057,7 -1134,7 +1057,7 @@@ # For silent rules, setup VAR and dispatcher, to expand to # VAL-IF-SILENT if silent, to VAL-IF-VERBOSE (defaulting to # empty) if not. -sub define_verbose_var ($$;$) +sub define_verbose_var { my ($name, $silent_val, $verbose_val) = @_; $verbose_val = '' unless defined $verbose_val; @@@ -1080,16 -1157,18 +1080,16 @@@ if (! vardef ($verbose_var, TRUE)); } -# Above should not be needed in the general automake code. - # verbose_flag (NAME) # ------------------- -# Contents of %VERBOSE%: variable to expand before rule command. -sub verbose_flag ($) +# Contents of '%VERBOSE%' variable to expand before rule command. +sub verbose_flag { my ($name) = @_; return '$(' . verbose_var ($name) . ')'; } -sub verbose_nodep_flag ($) +sub verbose_nodep_flag { my ($name) = @_; return '$(' . verbose_var ($name) . subst ('am__nodep') . ')'; @@@ -1106,12 -1185,14 +1106,12 @@@ sub silent_flag ( # define_verbose_tagvar (NAME) # ---------------------------- # Engage the needed silent rules machinery for tag NAME. -sub define_verbose_tagvar ($) +sub define_verbose_tagvar { my ($name) = @_; define_verbose_var ($name, '@echo " '. $name . ' ' x (8 - length ($name)) . '" $@;'); } -# define_verbose_texinfo -# ---------------------- # Engage the needed silent rules machinery for assorted texinfo commands. sub define_verbose_texinfo () { @@@ -1124,6 -1205,8 +1124,6 @@@ define_verbose_var('texidevnull', '> /dev/null'); } -# define_verbose_libtool -# ---------------------- # Engage the needed silent rules machinery for 'libtool --silent'. sub define_verbose_libtool () { @@@ -1149,8 -1232,8 +1149,8 @@@ sub handle_silent ( ################################################################ -# Handle AUTOMAKE_OPTIONS variable. Return 1 on error, 0 otherwise. -sub handle_options +# Handle AUTOMAKE_OPTIONS variable. Return 0 on error, 1 otherwise. +sub handle_options () { my $var = var ('AUTOMAKE_OPTIONS'); if ($var) @@@ -1163,7 -1246,7 +1163,7 @@@ my @options = map { { option => $_->[1], where => $_->[0] } } $var->value_as_list_recursive (cond_filter => TRUE, location => 1); - return 1 if process_option_list (@options); + return 0 unless process_option_list (@options); } if ($strictness == GNITS) @@@ -1173,7 -1256,7 +1173,7 @@@ set_option ('check-news', INTERNAL); } - return 0; + return 1; } # shadow_unconditionally ($varname, $where) @@@ -1183,7 -1266,7 +1183,7 @@@ # If the VAR wasn't defined conditionally, return $(VAR). # Otherwise we create an am__VAR_DIST variable which contains # all possible values, and return $(am__VAR_DIST). -sub shadow_unconditionally ($$) +sub shadow_unconditionally { my ($varname, $where) = @_; my $var = var $varname; @@@ -1200,7 -1283,7 +1200,7 @@@ # ---------------------------- # Make sure each variable VAR in @LIST does not exist, suggest using AM_VAR # otherwise. -sub check_user_variables (@) +sub check_user_variables { my @dont_override = @_; foreach my $flag (@dont_override) @@@ -1223,7 -1306,7 +1223,7 @@@ } # Call finish function for each language that was used. -sub handle_languages +sub handle_languages () { if (! option 'no-dependencies') { @@@ -1232,10 -1315,10 +1232,10 @@@ if (keys %extension_seen && keys %dep_files) { # Set location of depcomp. - &define_variable ('depcomp', - "\$(SHELL) $am_config_aux_dir/depcomp", - INTERNAL); - &define_variable ('am__depfiles_maybe', 'depfiles', INTERNAL); + define_variable ('depcomp', + "\$(SHELL) $am_config_aux_dir/depcomp", + INTERNAL); + define_variable ('am__depfiles_maybe', 'depfiles', INTERNAL); require_conf_file ("$am_file.am", FOREIGN, 'depcomp'); @@@ -1258,15 -1341,15 +1258,15 @@@ # Compute the set of directories to remove in distclean-depend. my @depdirs = uniq (map { dirname ($_) } @deplist); - $output_rules .= &file_contents ('depend', - new Automake::Location, - DEPDIRS => "@depdirs"); + $output_rules .= file_contents ('depend', + new Automake::Location, + DEPDIRS => "@depdirs"); } } else { - &define_variable ('depcomp', '', INTERNAL); - &define_variable ('am__depfiles_maybe', '', INTERNAL); + define_variable ('depcomp', '', INTERNAL); + define_variable ('am__depfiles_maybe', '', INTERNAL); } my %done; @@@ -1301,7 -1384,7 +1301,7 @@@ 'FASTDEP' => $FASTDEP, '-c' => $lang->compile_flag || '', # These are not used, but they need to be defined - # so &transform do not complain. + # so transform() do not complain. SUBDIROBJ => 0, 'DERIVED-EXT' => 'BUG', DIST_SOURCE => 1, @@@ -1314,9 -1397,17 +1314,9 @@@ if (((! option 'no-dependencies') && $lang->autodep ne 'no') || defined $lang->compile) { - # Some C compilers don't support -c -o. Use it only if really - # needed. - my $output_flag = $lang->output_flag || ''; - $output_flag = '-o' - if (! $output_flag - && $lang->name eq 'c' - && option 'subdir-objects'); - # Compute a possible derived extension. # This is not used by depend2.am. - my $der_ext = (&{$lang->output_extensions} ($ext))[0]; + my $der_ext = ($lang->output_extensions->($ext))[0]; # When we output an inference rule like '.c.o:' we # have two cases to consider: either subdir-objects @@@ -1357,7 -1448,7 +1357,7 @@@ COMPILE => '$(' . $lang->compiler . ')', LTCOMPILE => '$(LT' . $lang->compiler . ')', - -o => $output_flag, + -o => $lang->output_flag, SUBDIROBJ => !! option 'subdir-objects'); } @@@ -1481,12 -1572,13 +1481,13 @@@ # If the project is entirely C++ or entirely Fortran 77 (i.e., 1 # suffix rule was learned), don't bother with the C stuff. But if # anything else creeps in, then use it. - $needs_c = 1 - if $need_link || suffix_rules_count > 1; - - if ($needs_c) + my @languages_seen = map { $languages{$extension_map{$_}}->name } + (keys %extension_seen); + @languages_seen = uniq (@languages_seen); + $needs_c = 1 if @languages_seen > 1; + if ($need_link || $needs_c) { - &define_compiler_variable ($languages{'c'}) + define_compiler_variable ($languages{'c'}) unless defined $done{$languages{'c'}}; define_linker_variable ($languages{'c'}); } @@@ -1570,7 -1662,7 +1571,7 @@@ sub check_libobjs_source # when producing explicit rules # Result is a list of the names of objects # %linkers_used will be updated with any linkers needed -sub handle_single_transform ($$$$$%) +sub handle_single_transform { my ($var, $topparent, $derived, $obj, $_file, %transform) = @_; my @files = ($_file); @@@ -1621,13 -1713,13 +1622,13 @@@ # language function. my $aggregate = 'AM'; - $extension = &derive_suffix ($extension, $obj); + $extension = derive_suffix ($extension, $obj); my $lang; if ($extension_map{$extension} && ($lang = $languages{$extension_map{$extension}})) { # Found the language, so see what it says. - &saw_extension ($extension); + saw_extension ($extension); # Do we have per-executable flags for this executable? my $have_per_exec_flags = 0; @@@ -1705,36 -1797,9 +1706,36 @@@ # If rewrite said it was ok, put the object into a # subdir. - if ($r == LANG_SUBDIR && $directory ne '') + if ($directory ne '') { - $object = $directory . '/' . $object; + if ($r == LANG_SUBDIR) + { + $object = $directory . '/' . $object; + } + else + { + # Since the next major version of automake (2.0) will + # make the behaviour so far only activated with the + # 'subdir-object' option mandatory, it's better if we + # start warning users not using that option. + # As suggested by Peter Johansson, we strive to avoid + # the warning when it would be irrelevant, i.e., if + # all source files sit in "current" directory. + msg_var 'unsupported', $var, + "source file '$full' is in a subdirectory," + . "\nbut option 'subdir-objects' is disabled"; + msg 'unsupported', INTERNAL, <<'EOF', uniq_scope => US_GLOBAL; +possible forward-incompatibility. +At least a source file is in a subdirectory, but the 'subdir-objects' +automake option hasn't been enabled. For now, the corresponding output +object file(s) will be placed in the top-level directory. However, +this behaviour will change in future Automake versions: they will +unconditionally cause object files to be placed in the same subdirectory +of the corresponding sources. +You are advised to start using 'subdir-objects' option throughout your +project, to avoid future incompatibilities. +EOF + } } # If the object file has been renamed (because per-target @@@ -1867,7 -1932,7 +1868,7 @@@ unshift (@files, $object); # Distribute derived sources unless the source they are # derived from is not. - &push_dist_common ($object) + push_dist_common ($object) unless ($topparent =~ /^(?:nobase_)?nodist_/); next; } @@@ -1922,7 -1987,7 +1923,7 @@@ unless option 'no-dependencies'; } - &pretty_print_rule ($object . ':', "\t", @dep_list) + pretty_print_rule ($object . ':', "\t", @dep_list) if scalar @dep_list > 0; } @@@ -1973,7 -2038,7 +1974,7 @@@ # # Result is a pair ($LINKER, $OBJVAR): # $LINKER is a boolean, true if a linker is needed to deal with the objects -sub define_objects_from_sources ($$$$$$$%) +sub define_objects_from_sources { my ($var, $objvar, $nodefine, $one_file, $obj, $topparent, $where, %transform) = @_; @@@ -2007,7 -2072,7 +2008,7 @@@ # extra arguments to pass to file_contents when producing rules # Return the name of the linker variable that must be used. # Empty return means just use 'LINK'. -sub handle_source_transform ($$$$%) +sub handle_source_transform { # one_file is canonical name. unxformed is given name. obj is # object extension. @@@ -2045,14 -2110,14 +2046,14 @@@ $needlinker |= define_objects_from_sources ($varname, $xpfx . $one_file . '_OBJECTS', - $prefix =~ /EXTRA_/, + !!($prefix =~ /EXTRA_/), $one_file, $obj, $varname, $where, DIST_SOURCE => ($prefix !~ /^nodist_/), %transform); } if ($needlinker) { - $linker ||= &resolve_linker (%linkers_used); + $linker ||= resolve_linker (%linkers_used); } my @keys = sort keys %used_pfx; @@@ -2092,7 -2157,7 +2093,7 @@@ $default_source = '$(srcdir)/' . $default_source; } - &define_variable ($one_file . "_SOURCES", $default_source, $where); + define_variable ($one_file . "_SOURCES", $default_source, $where); push (@sources, $default_source); push (@dist_sources, $default_source); @@@ -2102,7 -2167,7 +2103,7 @@@ $one_file . '_SOURCES', $one_file, $obj, $default_source, %transform); - $linker ||= &resolve_linker (%linkers_used); + $linker ||= resolve_linker (%linkers_used); define_pretty_variable ($one_file . '_OBJECTS', TRUE, $where, @result); } else @@@ -2207,7 -2272,7 +2208,7 @@@ sub handle_lib_object # ------------------------------- # Definitions common to LIBOBJS and ALLOCA. # VAR should be one of LIBOBJS, LTLIBOBJS, ALLOCA, or LTALLOCA. -sub handle_LIBOBJS_or_ALLOCA ($) +sub handle_LIBOBJS_or_ALLOCA { my ($var) = @_; @@@ -2246,7 -2311,7 +2247,7 @@@ return $dir; } -sub handle_LIBOBJS ($$$) +sub handle_LIBOBJS { my ($var, $cond, $lt) = @_; my $myobjext = $lt ? 'lo' : 'o'; @@@ -2261,8 -2326,8 +2262,8 @@@ { if ($iter =~ /\.[cly]$/) { - &saw_extension ($&); - &saw_extension ('.c'); + saw_extension ($&); + saw_extension ('.c'); } if ($iter =~ /\.h$/) @@@ -2285,7 -2350,7 +2286,7 @@@ } } -sub handle_ALLOCA ($$$) +sub handle_ALLOCA { my ($var, $cond, $lt) = @_; my $myobjext = $lt ? 'lo' : 'o'; @@@ -2295,10 -2360,10 +2296,10 @@@ $var->requires_variables ("\@${lt}ALLOCA\@ used", $lt . 'ALLOCA'); $dep_files{$dir . '$(DEPDIR)/alloca.P' . $myobjext} = 1; require_libsource_with_macro ($cond, $var, FOREIGN, 'alloca.c'); - &saw_extension ('.c'); + saw_extension ('.c'); } -# Canonicalize the input parameter +# Canonicalize the input parameter. sub canonicalize { my ($string) = @_; @@@ -2313,7 -2378,7 +2314,7 @@@ sub check_canonical_spellin { my ($name, @suffixes) = @_; - my $xname = &canonicalize ($name); + my $xname = canonicalize ($name); if ($xname ne $name) { foreach my $xt (@suffixes) @@@ -2325,6 -2390,9 +2326,6 @@@ return $xname; } - -# handle_compile () -# ----------------- # Set up the compile suite. sub handle_compile () { @@@ -2370,17 -2438,19 +2371,17 @@@ } my ($coms, $vars, $rules) = - &file_contents_internal (1, "$libdir/am/compile.am", - new Automake::Location, - ('DEFAULT_INCLUDES' => $default_includes, - 'MOSTLYRMS' => join ("\n", @mostly_rms), - 'DISTRMS' => join ("\n", @dist_rms))); + file_contents_internal (1, "$libdir/am/compile.am", + new Automake::Location, + 'DEFAULT_INCLUDES' => $default_includes, + 'MOSTLYRMS' => join ("\n", @mostly_rms), + 'DISTRMS' => join ("\n", @dist_rms)); $output_vars .= $vars; $output_rules .= "$coms$rules"; } -# handle_libtool () -# ----------------- # Handle libtool rules. -sub handle_libtool +sub handle_libtool () { return unless var ('LIBTOOL'); @@@ -2401,22 -2471,24 +2402,22 @@@ check_user_variables 'LIBTOOLFLAGS'; # Output the libtool compilation rules. - $output_rules .= &file_contents ('libtool', - new Automake::Location, + $output_rules .= file_contents ('libtool', + new Automake::Location, LTRMS => join ("\n", @libtool_rms)); } -# handle_programs () -# ------------------ -# Handle C programs. -sub handle_programs + +sub handle_programs () { - my @proglist = &am_install_var ('progs', 'PROGRAMS', - 'bin', 'sbin', 'libexec', 'pkglibexec', - 'noinst', 'check'); + my @proglist = am_install_var ('progs', 'PROGRAMS', + 'bin', 'sbin', 'libexec', 'pkglibexec', + 'noinst', 'check'); return if ! @proglist; $must_handle_compiled_objects = 1; my $seen_global_libobjs = - var ('LDADD') && &handle_lib_objects ('', 'LDADD'); + var ('LDADD') && handle_lib_objects ('', 'LDADD'); foreach my $pair (@proglist) { @@@ -2428,30 -2500,30 +2429,30 @@@ $known_programs{$one_file} = $where; # Canonicalize names and check for misspellings. - my $xname = &check_canonical_spelling ($one_file, '_LDADD', '_LDFLAGS', - '_SOURCES', '_OBJECTS', - '_DEPENDENCIES'); + my $xname = check_canonical_spelling ($one_file, '_LDADD', '_LDFLAGS', + '_SOURCES', '_OBJECTS', + '_DEPENDENCIES'); $where->push_context ("while processing program '$one_file'"); $where->set (INTERNAL->get); - my $linker = &handle_source_transform ($xname, $one_file, $obj, $where, - NONLIBTOOL => 1, LIBTOOL => 0); + my $linker = handle_source_transform ($xname, $one_file, $obj, $where, + NONLIBTOOL => 1, LIBTOOL => 0); if (var ($xname . "_LDADD")) { - $seen_libobjs = &handle_lib_objects ($xname, $xname . '_LDADD'); + $seen_libobjs = handle_lib_objects ($xname, $xname . '_LDADD'); } else { # User didn't define prog_LDADD override. So do it. - &define_variable ($xname . '_LDADD', '$(LDADD)', $where); + define_variable ($xname . '_LDADD', '$(LDADD)', $where); # This does a bit too much work. But we need it to # generate _DEPENDENCIES when appropriate. if (var ('LDADD')) { - $seen_libobjs = &handle_lib_objects ($xname, 'LDADD'); + $seen_libobjs = handle_lib_objects ($xname, 'LDADD'); } } @@@ -2463,7 -2535,7 +2464,7 @@@ set_seen ($xname . '_LDFLAGS'); # Determine program to use for link. - my($xlink, $vlink) = &define_per_target_linker_variable ($linker, $xname); + my($xlink, $vlink) = define_per_target_linker_variable ($linker, $xname); $vlink = verbose_flag ($vlink || 'GEN'); # If the resulting program lies in a subdirectory, @@@ -2472,34 -2544,37 +2473,34 @@@ $libtool_clean_directories{dirname ($one_file)} = 1; - $output_rules .= &file_contents ('program', - $where, - PROGRAM => $one_file, - XPROGRAM => $xname, - XLINK => $xlink, - VERBOSE => $vlink, - DIRSTAMP => $dirstamp, - EXEEXT => '$(EXEEXT)'); + $output_rules .= file_contents ('program', + $where, + PROGRAM => $one_file, + XPROGRAM => $xname, + XLINK => $xlink, + VERBOSE => $vlink, + DIRSTAMP => $dirstamp, + EXEEXT => '$(EXEEXT)'); if ($seen_libobjs || $seen_global_libobjs) { if (var ($xname . '_LDADD')) { - &check_libobjs_sources ($xname, $xname . '_LDADD'); + check_libobjs_sources ($xname, $xname . '_LDADD'); } elsif (var ('LDADD')) { - &check_libobjs_sources ($xname, 'LDADD'); + check_libobjs_sources ($xname, 'LDADD'); } } } } -# handle_libraries () -# ------------------- -# Handle libraries. -sub handle_libraries +sub handle_libraries () { - my @liblist = &am_install_var ('libs', 'LIBRARIES', - 'lib', 'pkglib', 'noinst', 'check'); + my @liblist = am_install_var ('libs', 'LIBRARIES', + 'lib', 'pkglib', 'noinst', 'check'); return if ! @liblist; $must_handle_compiled_objects = 1; @@@ -2512,9 -2587,9 +2513,9 @@@ $var->requires_variables ('library used', 'RANLIB'); } - &define_variable ('AR', 'ar', INTERNAL); - &define_variable ('ARFLAGS', 'cru', INTERNAL); - &define_verbose_tagvar ('AR'); + define_variable ('AR', 'ar', INTERNAL); + define_variable ('ARFLAGS', 'cru', INTERNAL); + define_verbose_tagvar ('AR'); foreach my $pair (@liblist) { @@@ -2541,27 -2616,27 +2542,27 @@@ my $obj = '.$(OBJEXT)'; # Canonicalize names and check for misspellings. - my $xlib = &check_canonical_spelling ($onelib, '_LIBADD', '_SOURCES', - '_OBJECTS', '_DEPENDENCIES', - '_AR'); + my $xlib = check_canonical_spelling ($onelib, '_LIBADD', '_SOURCES', + '_OBJECTS', '_DEPENDENCIES', + '_AR'); if (! var ($xlib . '_AR')) { - &define_variable ($xlib . '_AR', '$(AR) $(ARFLAGS)', $where); + define_variable ($xlib . '_AR', '$(AR) $(ARFLAGS)', $where); } # Generate support for conditional object inclusion in # libraries. if (var ($xlib . '_LIBADD')) { - if (&handle_lib_objects ($xlib, $xlib . '_LIBADD')) + if (handle_lib_objects ($xlib, $xlib . '_LIBADD')) { $seen_libobjs = 1; } } else { - &define_variable ($xlib . "_LIBADD", '', $where); + define_variable ($xlib . "_LIBADD", '', $where); } reject_var ($xlib . '_LDADD', @@@ -2571,8 -2646,8 +2572,8 @@@ set_seen ($xlib . '_DEPENDENCIES'); set_seen ('EXTRA_' . $xlib . '_DEPENDENCIES'); - &handle_source_transform ($xlib, $onelib, $obj, $where, - NONLIBTOOL => 1, LIBTOOL => 0); + handle_source_transform ($xlib, $onelib, $obj, $where, + NONLIBTOOL => 1, LIBTOOL => 0); # If the resulting library lies in a subdirectory, # make sure this directory will exist. @@@ -2580,19 -2655,19 +2581,19 @@@ my $verbose = verbose_flag ('AR'); my $silent = silent_flag (); - $output_rules .= &file_contents ('library', - $where, - VERBOSE => $verbose, - SILENT => $silent, - LIBRARY => $onelib, - XLIBRARY => $xlib, - DIRSTAMP => $dirstamp); + $output_rules .= file_contents ('library', + $where, + VERBOSE => $verbose, + SILENT => $silent, + LIBRARY => $onelib, + XLIBRARY => $xlib, + DIRSTAMP => $dirstamp); if ($seen_libobjs) { if (var ($xlib . '_LIBADD')) { - &check_libobjs_sources ($xlib, $xlib . '_LIBADD'); + check_libobjs_sources ($xlib, $xlib . '_LIBADD'); } } @@@ -2606,10 -2681,13 +2607,10 @@@ } -# handle_ltlibraries () -# --------------------- -# Handle shared libraries. -sub handle_ltlibraries +sub handle_ltlibraries () { - my @liblist = &am_install_var ('ltlib', 'LTLIBRARIES', - 'noinst', 'lib', 'pkglib', 'check'); + my @liblist = am_install_var ('ltlib', 'LTLIBRARIES', + 'noinst', 'lib', 'pkglib', 'check'); return if ! @liblist; $must_handle_compiled_objects = 1; @@@ -2711,9 -2789,9 +2712,9 @@@ my $obj = '.lo'; # Canonicalize names and check for misspellings. - my $xlib = &check_canonical_spelling ($onelib, '_LIBADD', '_LDFLAGS', - '_SOURCES', '_OBJECTS', - '_DEPENDENCIES'); + my $xlib = check_canonical_spelling ($onelib, '_LIBADD', '_LDFLAGS', + '_SOURCES', '_OBJECTS', + '_DEPENDENCIES'); # Check that the library fits the standard naming convention. my $libname_rx = '^lib.*\.la'; @@@ -2760,25 -2838,25 +2761,25 @@@ # libraries. if (var ($xlib . '_LIBADD')) { - if (&handle_lib_objects ($xlib, $xlib . '_LIBADD')) + if (handle_lib_objects ($xlib, $xlib . '_LIBADD')) { $seen_libobjs = 1; } } else { - &define_variable ($xlib . "_LIBADD", '', $where); + define_variable ($xlib . "_LIBADD", '', $where); } reject_var ("${xlib}_LDADD", "use '${xlib}_LIBADD', not '${xlib}_LDADD'"); - my $linker = &handle_source_transform ($xlib, $onelib, $obj, $where, - NONLIBTOOL => 0, LIBTOOL => 1); + my $linker = handle_source_transform ($xlib, $onelib, $obj, $where, + NONLIBTOOL => 0, LIBTOOL => 1); # Determine program to use for link. - my($xlink, $vlink) = &define_per_target_linker_variable ($linker, $xlib); + my($xlink, $vlink) = define_per_target_linker_variable ($linker, $xlib); $vlink = verbose_flag ($vlink || 'GEN'); my $rpathvar = "am_${xlib}_rpath"; @@@ -2823,19 -2901,19 +2824,19 @@@ my $dirname = dirname $onelib; $libtool_clean_directories{$dirname} = 1; - $output_rules .= &file_contents ('ltlibrary', - $where, - LTLIBRARY => $onelib, - XLTLIBRARY => $xlib, - RPATH => $rpath, - XLINK => $xlink, - VERBOSE => $vlink, - DIRSTAMP => $dirstamp); + $output_rules .= file_contents ('ltlibrary', + $where, + LTLIBRARY => $onelib, + XLTLIBRARY => $xlib, + RPATH => $rpath, + XLINK => $xlink, + VERBOSE => $vlink, + DIRSTAMP => $dirstamp); if ($seen_libobjs) { if (var ($xlib . '_LIBADD')) { - &check_libobjs_sources ($xlib, $xlib . '_LIBADD'); + check_libobjs_sources ($xlib, $xlib . '_LIBADD'); } } @@@ -2875,27 -2953,30 +2876,27 @@@ sub check_typos ( } -# Handle scripts. -sub handle_scripts +sub handle_scripts () { # NOTE we no longer automatically clean SCRIPTS, because it is # useful to sometimes distribute scripts verbatim. This happens # e.g. in Automake itself. - &am_install_var ('-candist', 'scripts', 'SCRIPTS', - 'bin', 'sbin', 'libexec', 'pkglibexec', 'pkgdata', - 'noinst', 'check'); + am_install_var ('-candist', 'scripts', 'SCRIPTS', + 'bin', 'sbin', 'libexec', 'pkglibexec', 'pkgdata', + 'noinst', 'check'); } - - ## ------------------------ ## ## Handling Texinfo files. ## ## ------------------------ ## # ($OUTFILE, $VFILE) -# &scan_texinfo_file ($FILENAME) -# ------------------------------ +# scan_texinfo_file ($FILENAME) +# ----------------------------- # $OUTFILE - name of the info file produced by $FILENAME. # $VFILE - name of the version.texi file used (undef if none). -sub scan_texinfo_file ($) +sub scan_texinfo_file { my ($filename) = @_; @@@ -2950,7 -3031,7 +2951,7 @@@ # DEST - the destination Info file # INSRC - whether DEST should be built in the source tree # DEPENDENCIES - known dependencies -sub output_texinfo_build_rules ($$$@) +sub output_texinfo_build_rules { my ($source, $dest, $insrc, @deps) = @_; @@@ -3044,8 -3125,8 +3045,8 @@@ # ($MOSTLYCLEAN, $TEXICLEAN, $MAINTCLEAN) # handle_texinfo_helper ($info_texinfos) # -------------------------------------- -# Handle all Texinfo source; helper for handle_texinfo. -sub handle_texinfo_helper ($) +# Handle all Texinfo source; helper for 'handle_texinfo'. +sub handle_texinfo_helper { my ($info_texinfos) = @_; my (@infobase, @info_deps_list, @texi_deps); @@@ -3194,51 -3275,23 +3195,51 @@@ # have a single variable ($INSRC) that controls whether # the current .info file must be built in the source tree # or in the build tree. Actually this variable is switched - # off for .info files that appear to be cleaned; this is - # for backward compatibility with package such as Texinfo, - # which do things like - # info_TEXINFOS = texinfo.txi info-stnd.texi info.texi - # DISTCLEANFILES = texinfo texinfo-* info*.info* - # # Do not create info files for distribution. - # dist-info: - # in order not to distribute .info files. - my $insrc = ($out_file =~ $user_cleaned_files) ? 0 : 1; - + # off in two cases: + # (1) For '.info' files that appear to be cleaned; this is for + # backward compatibility with package such as Texinfo, + # which do things like + # info_TEXINFOS = texinfo.txi info-stnd.texi info.texi + # DISTCLEANFILES = texinfo texinfo-* info*.info* + # # Do not create info files for distribution. + # dist-info: + # in order not to distribute .info files. + # (2) When the undocumented option 'info-in-builddir' is given. + # This is done to allow the developers of GCC, GDB, GNU + # binutils and the GNU bfd library to force the '.info' files + # to be generated in the builddir rather than the srcdir, as + # was once done when the (now removed) 'cygnus' option was + # given. See automake bug#11034 for more discussion. + my $insrc = 1; my $soutdir = '$(srcdir)/' . $outdir; + + if (option 'info-in-builddir') + { + $insrc = 0; + } + elsif ($out_file =~ $user_cleaned_files) + { + $insrc = 0; + msg 'obsolete', "$am_file.am", < $section, - DEPS => "@deps", - NOTRANS_MANS => $notrans_mans, - NOTRANS_SECT_LIST => "@notrans_sect_list", - HAVE_NOTRANS => $have_notrans, - NOTRANS_LIST => "@notrans_list", - TRANS_MANS => $trans_mans, - TRANS_SECT_LIST => "@trans_sect_list", - HAVE_TRANS => $have_trans, - TRANS_LIST => "@trans_list"); + $output_rules .= file_contents ('mans', + new Automake::Location, + SECTION => $section, + DEPS => "@deps", + NOTRANS_MANS => $notrans_mans, + NOTRANS_SECT_LIST => "@notrans_sect_list", + HAVE_NOTRANS => $have_notrans, + NOTRANS_LIST => "@notrans_list", + TRANS_MANS => $trans_mans, + TRANS_SECT_LIST => "@trans_sect_list", + HAVE_TRANS => $have_trans, + TRANS_LIST => "@trans_list"); } @unsorted_deps = (keys %notrans_vars, keys %trans_vars, @@@ -3531,17 -3588,17 +3532,17 @@@ unless option 'no-installman'; } -# Handle DATA variables. -sub handle_data + +sub handle_data () { - &am_install_var ('-noextra', '-candist', 'data', 'DATA', - 'data', 'dataroot', 'doc', 'dvi', 'html', 'pdf', - 'ps', 'sysconf', 'sharedstate', 'localstate', - 'pkgdata', 'lisp', 'noinst', 'check'); + am_install_var ('-noextra', '-candist', 'data', 'DATA', + 'data', 'dataroot', 'doc', 'dvi', 'html', 'pdf', + 'ps', 'sysconf', 'sharedstate', 'localstate', + 'pkgdata', 'lisp', 'noinst', 'check'); } -# Handle TAGS. -sub handle_tags + +sub handle_tags () { my @config; foreach my $spec (@config_headers) @@@ -3563,7 -3620,7 +3564,7 @@@ if (rvar('am__tagged_files')->value_as_list_recursive || var ('ETAGS_ARGS') || var ('SUBDIRS')) { - $output_rules .= &file_contents ('tags', new Automake::Location); + $output_rules .= file_contents ('tags', new Automake::Location); set_seen 'TAGS_DEPENDENCIES'; } else @@@ -3588,7 -3645,7 +3589,7 @@@ # Return false if rule $NAME does not exist. Otherwise, # declare it as phony, complete its definition (in case it is # conditional), and return its Automake::Rule instance. -sub user_phony_rule ($) +sub user_phony_rule { my ($name) = @_; my $rule = rule $name; @@@ -3608,6 -3665,8 +3609,6 @@@ } -# handle_dist -# ----------- # Handle 'dist' target. sub handle_dist () { @@@ -3670,7 -3729,7 +3671,7 @@@ if ($relative_dir eq '.' && $config_aux_dir_set_in_configure_ac) { - if (! &is_make_dir ($config_aux_dir)) + if (! is_make_dir ($config_aux_dir)) { $check_aux = 1; } @@@ -3681,14 -3740,14 +3682,14 @@@ # The file might be absent, but if it can be built it's ok. || rule $cfile) { - &push_dist_common ($cfile); + push_dist_common ($cfile); } # Don't use 'elsif' here because a file might meaningfully # appear in both directories. if ($check_aux && dir_has_case_matching_file ($config_aux_dir, $cfile)) { - &push_dist_common ("$config_aux_dir/$cfile") + push_dist_common ("$config_aux_dir/$cfile") } } @@@ -3716,7 -3775,7 +3717,7 @@@ # Files to distributed. Don't use ->value_as_list_recursive # as it recursively expands '$(dist_pkgdata_DATA)' etc. my @dist_common = split (' ', rvar ('DIST_COMMON')->variable_value); - @dist_common = uniq @dist_common; + @dist_common = uniq (@dist_common); variable_delete 'DIST_COMMON'; define_pretty_variable ('DIST_COMMON', TRUE, INTERNAL, @dist_common); @@@ -3737,10 -3796,10 +3738,10 @@@ my $flm = option ('filename-length-max'); my $filename_filter = $flm ? '.' x $flm->[1] : ''; - $output_rules .= &file_contents ('distdir', - new Automake::Location, - %transform, - FILENAME_FILTER => $filename_filter); + $output_rules .= file_contents ('distdir', + new Automake::Location, + %transform, + FILENAME_FILTER => $filename_filter); } @@@ -3748,7 -3807,7 +3749,7 @@@ # ------------------------------------------------------- # Ensure $NAME is a directory (in $RELATIVE_DIR), and that it uses a sane # name. Use $WHERE as a location in the diagnostic, if any. -sub check_directory ($$;$) +sub check_directory { my ($dir, $where, $reldir) = @_; $reldir = '.' unless defined $reldir; @@@ -3786,7 -3845,7 +3787,7 @@@ # check_directories_in_var ($VARIABLE) # ------------------------------------ # Recursively check all items in variables $VARIABLE as directories -sub check_directories_in_var ($) +sub check_directories_in_var { my ($var) = @_; $var->traverse_recursively @@@ -3800,7 -3859,9 +3801,7 @@@ skip_ac_subst => 1); } -# &handle_subdirs () -# ------------------ -# Handle subdirectories. + sub handle_subdirs () { my $subdirs = var ('SUBDIRS'); @@@ -3813,14 -3874,14 +3814,14 @@@ check_directories_in_var $dsubdirs if $dsubdirs; - $output_rules .= &file_contents ('subdirs', new Automake::Location); + $output_rules .= file_contents ('subdirs', new Automake::Location); rvar ('RECURSIVE_TARGETS')->rdef (TRUE)->{'pretty'} = VAR_SORTED; # Gross! } # ($REGEN, @DEPENDENCIES) -# &scan_aclocal_m4 -# ---------------- +# scan_aclocal_m4 +# --------------- # If aclocal.m4 creation is automated, return the list of its dependencies. sub scan_aclocal_m4 () { @@@ -3831,7 -3892,7 +3832,7 @@@ if (-f 'aclocal.m4') { - &define_variable ("ACLOCAL_M4", '$(top_srcdir)/aclocal.m4', INTERNAL); + define_variable ("ACLOCAL_M4", '$(top_srcdir)/aclocal.m4', INTERNAL); my $aclocal = new Automake::XFile "< aclocal.m4"; my $line = $aclocal->getline; @@@ -3856,8 -3917,8 +3857,8 @@@ } -# Helper function for substitute_ac_subst_variables. -sub substitute_ac_subst_variables_worker($) +# Helper function for 'substitute_ac_subst_variables'. +sub substitute_ac_subst_variables_worker { my ($token) = @_; return "\@$token\@" if var $token; @@@ -3868,22 -3929,22 +3869,22 @@@ # ------------------------------------- # Replace any occurrence of ${FOO} in $TEXT by @FOO@ if FOO is an AC_SUBST # variable. -sub substitute_ac_subst_variables ($) +sub substitute_ac_subst_variables { my ($text) = @_; - $text =~ s/\${([^ \t=:+{}]+)}/&substitute_ac_subst_variables_worker ($1)/ge; + $text =~ s/\${([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ($1)/ge; return $text; } # @DEPENDENCIES -# &prepend_srcdir (@INPUTS) -# ------------------------- +# prepend_srcdir (@INPUTS) +# ------------------------ # Prepend $(srcdir) or $(top_srcdir) to all @INPUTS. The idea is that # if an input file has a directory part the same as the current # directory, then the directory part is simply replaced by $(srcdir). # But if the directory part is different, then $(top_srcdir) is # prepended. -sub prepend_srcdir (@) +sub prepend_srcdir { my (@inputs) = @_; my @newinputs; @@@ -3909,7 -3970,7 +3910,7 @@@ # rule of # AC_CONFIG_FILES($OUTPUT:$INPUT[0]:$INPUTS[1]:...) # Also distribute $INPUTs which are not built by another AC_CONFIG_FOOs. -sub rewrite_inputs_into_dependencies ($@) +sub rewrite_inputs_into_dependencies { my ($file, @inputs) = @_; my @res = (); @@@ -3950,11 -4011,11 +3951,11 @@@ -# &handle_configure ($MAKEFILE_AM, $MAKEFILE_IN, $MAKEFILE, @INPUTS) -# ------------------------------------------------------------------ +# handle_configure ($MAKEFILE_AM, $MAKEFILE_IN, $MAKEFILE, @INPUTS) +# ----------------------------------------------------------------- # Handle remaking and configure stuff. # We need the name of the input file, to do proper remaking rules. -sub handle_configure ($$$@) +sub handle_configure { my ($makefile_am, $makefile_in, $makefile, @inputs) = @_; @@@ -3997,7 -4058,7 +3998,7 @@@ if ($relative_dir eq '.') { - &push_dist_common ('acconfig.h') + push_dist_common ('acconfig.h') if -f 'acconfig.h'; } @@@ -4016,7 -4077,7 +4017,7 @@@ # directory and the header's directory doesn't have a # Makefile, then we also want to build the header. if ($relative_dir eq $config_h_dir - || ($relative_dir eq '.' && ! &is_make_dir ($config_h_dir))) + || ($relative_dir eq '.' && ! is_make_dir ($config_h_dir))) { my ($cn_sans_dir, $stamp_dir); if ($relative_dir eq $config_h_dir) @@@ -4163,7 -4224,7 +4164,7 @@@ my $fd = dirname ($file); if ($fd ne $relative_dir) { - if ($relative_dir eq '.' && ! &is_make_dir ($fd)) + if ($relative_dir eq '.' && ! is_make_dir ($fd)) { $local = $file; } @@@ -4218,7 -4279,7 +4219,7 @@@ my $fd = dirname ($link); if ($fd ne $relative_dir) { - if ($relative_dir eq '.' && ! &is_make_dir ($fd)) + if ($relative_dir eq '.' && ! is_make_dir ($fd)) { $local = $link; } @@@ -4246,7 -4307,7 +4247,7 @@@ # At the top-level ('.') we also distribute files whose # directory does not have a Makefile. if (($fd eq $relative_dir) - || ($relative_dir eq '.' && ! &is_make_dir ($fd))) + || ($relative_dir eq '.' && ! is_make_dir ($fd))) { # The following will distribute $file as a side-effect when # it is appropriate (i.e., when $file is not already an output). @@@ -4263,19 -4324,20 +4264,19 @@@ @actual_other_vpath_files); } -# Handle C headers. -sub handle_headers +sub handle_headers () { - my @r = &am_install_var ('-defaultdist', 'header', 'HEADERS', 'include', - 'oldinclude', 'pkginclude', - 'noinst', 'check'); + my @r = am_install_var ('-defaultdist', 'header', 'HEADERS', 'include', + 'oldinclude', 'pkginclude', + 'noinst', 'check'); foreach (@r) { next unless $_->[1] =~ /\..*$/; - &saw_extension ($&); + saw_extension ($&); } } -sub handle_gettext +sub handle_gettext () { return if ! $seen_gettext || $relative_dir ne '.'; @@@ -4331,8 -4393,8 +4332,8 @@@ require_file ($ac_gettext_location, GNU, 'ABOUT-NLS'); } -# Handle footer elements. -sub handle_footer +# Emit makefile footer. +sub handle_footer () { reject_rule ('.SUFFIXES', "use variable 'SUFFIXES', not target '.SUFFIXES'"); @@@ -4370,23 -4432,21 +4371,23 @@@ # Generate 'make install' rules. sub handle_install () { - $output_rules .= &file_contents + $output_rules .= file_contents ('install', new Automake::Location, maybe_BUILT_SOURCES => (set_seen ('BUILT_SOURCES') ? (" \$(BUILT_SOURCES)\n" . "\t\$(MAKE) \$(AM_MAKEFLAGS)") : ''), - 'installdirs-local' => (user_phony_rule 'installdirs-local' + 'installdirs-local' => (user_phony_rule ('installdirs-local') ? ' installdirs-local' : ''), am__installdirs => variable_value ('am__installdirs') || ''); } -# Deal with all and all-am. -sub handle_all ($) +# handle_all ($MAKEFILE) +#----------------------- +# Deal with 'all' and 'all-am'. +sub handle_all { my ($makefile) = @_; @@@ -4408,8 -4468,8 +4409,8 @@@ push (@all, "all-local") if user_phony_rule "all-local"; - &pretty_print_rule ("all-am:", "\t\t", @all); - &depend ('.PHONY', 'all-am', 'all'); + pretty_print_rule ("all-am:", "\t\t", @all); + depend ('.PHONY', 'all-am', 'all'); # Output 'all'. @@@ -4446,7 -4506,7 +4447,7 @@@ } } -# Generate helper targets for user recursion, where needed. +# Generate helper targets for user-defined recursive targets, where needed. sub handle_user_recursion () { return unless @extra_recursive_targets; @@@ -4465,7 -4525,7 +4466,7 @@@ # associated 'foo-local' rule; we define it as an empty rule by # default, so that the user can transparently extend it in his # own Makefile.am. - pretty_print_rule ("$target-local:"); + pretty_print_rule ("$target-local:", '', ''); # $target-recursive might as well be undefined, so do not add # it here; it's taken care of in subdirs.am anyway. depend (".PHONY", "$target-am", "$target-local"); @@@ -4473,6 -4533,8 +4474,6 @@@ } -# &do_check_merge_target () -# ------------------------- # Handle check merge target specially. sub do_check_merge_target () { @@@ -4509,8 -4571,10 +4510,8 @@@ if var ('BUILT_SOURCES'); } -# handle_clean ($MAKEFILE) -# ------------------------ # Handle all 'clean' targets. -sub handle_clean ($) +sub handle_clean { my ($makefile) = @_; @@@ -4548,7 -4612,7 +4549,7 @@@ push @{$rms{$when}}, "\t-$rm\n"; } - $output_rules .= &file_contents + $output_rules .= file_contents ('clean', new Automake::Location, MOSTLYCLEAN_RMS => join ('', sort @{$rms{&MOSTLY_CLEAN}}), @@@ -4560,9 -4624,10 +4561,9 @@@ } -# &target_cmp ($A, $B) -# -------------------- -# Subroutine for &handle_factored_dependencies to let '.PHONY' and -# other '.TARGETS' be last. +# Subroutine for handle_factored_dependencies() to let '.PHONY' and +# other '.TARGETS' be last. This is meant to be used as a comparison +# subroutine passed to the sort built-int. sub target_cmp { return 0 if $a eq $b; @@@ -4578,8 -4643,10 +4579,8 @@@ } -# &handle_factored_dependencies () -# -------------------------------- # Handle everything related to gathered targets. -sub handle_factored_dependencies +sub handle_factored_dependencies () { # Reject bad hooks. foreach my $utarg ('uninstall-data-local', 'uninstall-data-hook', @@@ -4656,7 -4723,7 +4657,7 @@@ foreach my $cond (@undefined_conds) { my $condstr = $cond->subst_string; - &pretty_print_rule ("$condstr$_:", "$condstr\t", @uniq_deps); + pretty_print_rule ("$condstr$_:", "$condstr\t", @uniq_deps); $output_rules .= $actions{$_} if defined $actions{$_}; $output_rules .= "\n"; } @@@ -4664,14 -4731,14 +4665,14 @@@ } -# &handle_tests_dejagnu () -# ------------------------ -sub handle_tests_dejagnu +sub handle_tests_dejagnu () { push (@check_tests, 'check-DEJAGNU'); $output_rules .= file_contents ('dejagnu', new Automake::Location); } +# handle_per_suffix_test ($TEST_SUFFIX, [%TRANSFORM]) +#---------------------------------------------------- sub handle_per_suffix_test { my ($test_suffix, %transform) = @_; @@@ -4725,7 -4792,7 +4726,7 @@@ # ------------------------------ # Return true if $EXT can appear in $(TEST_EXTENSIONS), return false # otherwise. -sub is_valid_test_extension ($) +sub is_valid_test_extension { my $ext = shift; return 1 @@@ -4735,12 -4802,12 +4736,12 @@@ return 0; } -# Handle TESTS variable and other checks. -sub handle_tests + +sub handle_tests () { if (option 'dejagnu') { - &handle_tests_dejagnu; + handle_tests_dejagnu; } else { @@@ -4755,9 -4822,9 +4756,9 @@@ { push (@check_tests, 'check-TESTS'); my $check_deps = "@check"; - $output_rules .= &file_contents ('check', new Automake::Location, - SERIAL_TESTS => !! option 'serial-tests', - CHECK_DEPS => $check_deps); + $output_rules .= file_contents ('check', new Automake::Location, + SERIAL_TESTS => !! option 'serial-tests', + CHECK_DEPS => $check_deps); # Tests that are known programs should have $(EXEEXT) appended. # For matching purposes, we need to adjust XFAIL_TESTS as well. @@@ -4869,10 -4936,11 +4870,10 @@@ } } -# Handle Emacs Lisp. -sub handle_emacs_lisp +sub handle_emacs_lisp () { - my @elfiles = &am_install_var ('-candist', 'lisp', 'LISP', - 'lisp', 'noinst'); + my @elfiles = am_install_var ('-candist', 'lisp', 'LISP', + 'lisp', 'noinst'); return if ! @elfiles; @@@ -4889,22 -4957,24 +4890,22 @@@ 'EMACS', 'lispdir'); } -# Handle Python -sub handle_python +sub handle_python () { - my @pyfiles = &am_install_var ('-defaultdist', 'python', 'PYTHON', - 'noinst'); + my @pyfiles = am_install_var ('-defaultdist', 'python', 'PYTHON', + 'noinst'); return if ! @pyfiles; require_variables ($pyfiles[0][0], "Python sources seen", TRUE, 'PYTHON'); require_conf_file ($pyfiles[0][0], FOREIGN, 'py-compile'); - &define_variable ('py_compile', "$am_config_aux_dir/py-compile", INTERNAL); + define_variable ('py_compile', "$am_config_aux_dir/py-compile", INTERNAL); } -# Handle Java. -sub handle_java +sub handle_java () { - my @sourcelist = &am_install_var ('-candist', - 'java', 'JAVA', - 'noinst', 'check'); + my @sourcelist = am_install_var ('-candist', + 'java', 'JAVA', + 'noinst', 'check'); return if ! @sourcelist; my @prefixes = am_primary_prefixes ('JAVA', 1, @@@ -4944,7 -5014,8 +4945,7 @@@ } -# Handle some of the minor options. -sub handle_minor_options +sub handle_minor_options () { if (option 'readme-alpha') { @@@ -4969,11 -5040,11 +4970,11 @@@ ################################################################ # ($OUTPUT, @INPUTS) -# &split_config_file_spec ($SPEC) -# ------------------------------- +# split_config_file_spec ($SPEC) +# ------------------------------ # Decode the Autoconf syntax for config files (files, headers, links # etc.). -sub split_config_file_spec ($) +sub split_config_file_spec { my ($spec) = @_; my ($output, @inputs) = split (/:/, $spec); @@@ -4990,7 -5061,7 +4991,7 @@@ # AC_CONFIG_FILES allow specifications such as Makefile:top.in:mid.in:bot.in # This functions returns the first *.in file for which a *.am exists. # It returns undef otherwise. -sub locate_am (@) +sub locate_am { my (@rest) = @_; my $input; @@@ -5007,11 -5078,11 +5008,11 @@@ my %make_list; -# &scan_autoconf_config_files ($WHERE, $CONFIG-FILES) -# --------------------------------------------------- +# scan_autoconf_config_files ($WHERE, $CONFIG-FILES) +# -------------------------------------------------- # Study $CONFIG-FILES which is the first argument to AC_CONFIG_FILES # (or AC_OUTPUT). -sub scan_autoconf_config_files ($$) +sub scan_autoconf_config_files { my ($where, $config_files) = @_; @@@ -5049,7 -5120,9 +5050,7 @@@ } -# &scan_autoconf_traces ($FILENAME) -# --------------------------------- -sub scan_autoconf_traces ($) +sub scan_autoconf_traces { my ($filename) = @_; @@@ -5080,6 -5153,7 +5081,6 @@@ AM_INIT_AUTOMAKE => 0, AM_MAINTAINER_MODE => 0, AM_PROG_AR => 0, - AM_PROG_CC_C_O => 0, _AM_SUBST_NOTMAKE => 1, _AM_COND_IF => 1, _AM_COND_ELSE => 1, @@@ -5272,7 -5346,7 +5273,7 @@@ EO { my @opts = split (' ', $args[1]); @opts = map { { option => $_, where => $where } } @opts; - exit $exit_code if process_global_option_list (@opts); + exit $exit_code unless process_global_option_list (@opts); } } elsif ($macro eq 'AM_MAINTAINER_MODE') @@@ -5283,6 -5357,10 +5284,6 @@@ { $seen_ar = $where; } - elsif ($macro eq 'AM_PROG_CC_C_O') - { - $seen_cc_c_o = $where; - } elsif ($macro eq '_AM_COND_IF') { cond_stack_if ('', $args[1], $where); @@@ -5353,6 -5431,8 +5354,6 @@@ } -# &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. @@@ -5438,7 -5518,7 +5439,7 @@@ sub scan_autoconf_files ( ################################################################ # Do any extra checking for GNU standards. -sub check_gnu_standards +sub check_gnu_standards () { if ($relative_dir eq '.') { @@@ -5470,7 -5550,7 +5471,7 @@@ } # Do any extra checking for GNITS standards. -sub check_gnits_standards +sub check_gnits_standards () { if ($relative_dir eq '.') { @@@ -5496,11 -5576,50 +5497,11 @@@ # This is just a convenience function that can be used to determine # when a subdir object should be used. -sub lang_sub_obj +sub lang_sub_obj () { return option 'subdir-objects' ? LANG_SUBDIR : LANG_PROCESS; } -# Rewrite a single C source file. -sub lang_c_rewrite -{ - my ($directory, $base, $ext, $obj, $have_per_exec_flags, $var) = @_; - - my $r = LANG_PROCESS; - if (option 'subdir-objects') - { - $r = LANG_SUBDIR; - if ($directory && $directory ne '.') - { - $base = $directory . '/' . $base; - - # libtool is always able to put the object at the proper place, - # so we do not have to require AM_PROG_CC_C_O when building .lo files. - msg_var ('portability', $var, - "compiling '$base.c' in subdir requires " - . "'AM_PROG_CC_C_O' in '$configure_ac'", - uniq_scope => US_GLOBAL, - uniq_part => 'AM_PROG_CC_C_O subdir') - unless $seen_cc_c_o || $obj eq '.lo'; - } - } - - if (! $seen_cc_c_o - && $have_per_exec_flags - && ! option 'subdir-objects' - && $obj ne '.lo') - { - msg_var ('portability', - $var, "compiling '$base.c' with per-target flags requires " - . "'AM_PROG_CC_C_O' in '$configure_ac'", - uniq_scope => US_GLOBAL, - uniq_part => 'AM_PROG_CC_C_O per-target') - } - - return $r; -} - # Rewrite a single header file. sub lang_header_rewrite { @@@ -5522,7 -5641,7 +5523,7 @@@ sub lang_yacc_rewrit { my ($directory, $base, $ext) = @_; - my $r = &lang_sub_obj; + my $r = lang_sub_obj; (my $newext = $ext) =~ tr/y/c/; return ($r, $newext); } @@@ -5533,7 -5652,7 +5534,7 @@@ sub lang_lex_rewrit { my ($directory, $base, $ext) = @_; - my $r = &lang_sub_obj; + my $r = lang_sub_obj; (my $newext = $ext) =~ tr/l/c/; return ($r, $newext); } @@@ -5550,7 -5669,7 +5551,7 @@@ sub lang_java_rewrit # language, etc. A finish function is only called if a source file of # the appropriate type has been seen. -sub lang_vala_finish_target ($$) +sub lang_vala_finish_target { my ($self, $name) = @_; @@@ -5645,7 -5764,7 +5646,7 @@@ # Add output rules to invoke valac and create stamp file as a witness # to handle multiple outputs. This function is called after all source # file processing is done. -sub lang_vala_finish +sub lang_vala_finish () { my ($self) = @_; @@@ -5731,9 -5850,9 +5732,9 @@@ sub lang_yacc_target_hoo . "$condstr\t\@if test ! -f \$@; then \$(MAKE) \$(AM_MAKEFLAGS) $output; else :; fi\n"; } # Distribute the generated file, unless its .y source was - # listed in a nodist_ variable. (&handle_source_transform + # listed in a nodist_ variable. (handle_source_transform() # will set DIST_SOURCE.) - &push_dist_common ($header) + push_dist_common ($header) if $transform{'DIST_SOURCE'}; # The GNU rules say that yacc/lex output files should be removed @@@ -5759,17 -5878,17 +5760,17 @@@ sub lang_lex_target_hoo } # This is a helper for both lex and yacc. -sub yacc_lex_finish_helper +sub yacc_lex_finish_helper () { return if defined $language_scratch{'lex-yacc-done'}; $language_scratch{'lex-yacc-done'} = 1; # FIXME: for now, no line number. require_conf_file ($configure_ac, FOREIGN, 'ylwrap'); - &define_variable ('YLWRAP', "$am_config_aux_dir/ylwrap", INTERNAL); + define_variable ('YLWRAP', "$am_config_aux_dir/ylwrap", INTERNAL); } -sub lang_yacc_finish +sub lang_yacc_finish () { return if defined $language_scratch{'yacc-done'}; $language_scratch{'yacc-done'} = 1; @@@ -5780,7 -5899,7 +5781,7 @@@ } -sub lang_lex_finish +sub lang_lex_finish () { return if defined $language_scratch{'lex-done'}; $language_scratch{'lex-done'} = 1; @@@ -5815,7 -5934,7 +5816,7 @@@ sub saw_extensio # ------------------------------ # Register a single language. # Each %ATTRIBUTE is of the form ATTRIBUTE => VALUE. -sub register_language (%) +sub register_language { my (%option) = @_; @@@ -5831,7 -5950,7 +5832,7 @@@ $option{'nodist_specific'} = 0 unless defined $option{'nodist_specific'}; - my $lang = new Language (%option); + my $lang = new Automake::Language (%option); # Fill indexes. $extension_map{$_} = $lang->name foreach @{$lang->extensions}; @@@ -5857,7 -5976,7 +5858,7 @@@ # Update the suffix rules map. foreach my $suffix (@{$lang->extensions}) { - foreach my $dest (&{$lang->output_extensions} ($suffix)) + foreach my $dest ($lang->output_extensions->($suffix)) { register_suffix_rule (INTERNAL, $suffix, $dest); } @@@ -5868,7 -5987,7 +5869,7 @@@ # -------------------------- # This function is used to find a path from a user-specified suffix $EXT # to $OBJ or to some other suffix we recognize internally, e.g. 'cc'. -sub derive_suffix ($$) +sub derive_suffix { my ($source_ext, $obj) = @_; @@@ -5883,10 -6002,12 +5884,10 @@@ } -################################################################ - -# Pretty-print something and append to output_rules. +# Pretty-print something and append to '$output_rules'. sub pretty_print_rule { - $output_rules .= &makefile_wrap (@_); + $output_rules .= makefile_wrap (shift, shift, @_); } @@@ -5901,7 -6022,7 +5902,7 @@@ # $STRING # make_conditional_string ($NEGATE, $COND) # ---------------------------------------- -sub make_conditional_string ($$) +sub make_conditional_string { my ($negate, $cond) = @_; $cond = "${cond}_TRUE" @@@ -5929,7 -6050,7 +5930,7 @@@ my %_am_macro_for_cond # $COND # cond_stack_if ($NEGATE, $COND, $WHERE) # -------------------------------------- -sub cond_stack_if ($$$) +sub cond_stack_if { my ($negate, $cond, $where) = @_; @@@ -5959,7 -6080,7 +5960,7 @@@ # $COND # cond_stack_else ($NEGATE, $COND, $WHERE) # ---------------------------------------- -sub cond_stack_else ($$$) +sub cond_stack_else { my ($negate, $cond, $where) = @_; @@@ -5989,7 -6110,7 +5990,7 @@@ # $COND # cond_stack_endif ($NEGATE, $COND, $WHERE) # ----------------------------------------- -sub cond_stack_endif ($$$) +sub cond_stack_endif { my ($negate, $cond, $where) = @_; my $old_cond; @@@ -6024,15 -6145,15 +6025,15 @@@ ## ------------------------ ## -# &define_pretty_variable ($VAR, $COND, $WHERE, @VALUE) -# ----------------------------------------------------- +# define_pretty_variable ($VAR, $COND, $WHERE, @VALUE) +# ---------------------------------------------------- # Like define_variable, but the value is a list, and the variable may # be defined conditionally. The second argument is the condition # under which the value should be defined; this should be the empty # string to define the variable unconditionally. The third argument # is a list holding the values to use for the variable. The value is # pretty printed in the output file. -sub define_pretty_variable ($$$@) +sub define_pretty_variable { my ($var, $cond, $where, @value) = @_; @@@ -6049,7 -6170,7 +6050,7 @@@ # -------------------------------------- # Define a new Automake Makefile variable VAR to VALUE, but only if # not already defined. -sub define_variable ($$$) +sub define_variable { my ($var, $value, $where) = @_; define_pretty_variable ($var, TRUE, $where, $value); @@@ -6071,14 -6192,14 +6072,14 @@@ sub define_files_variable ($\@$$ # Like define_variable, but define a variable to be the configure # substitution by the same name. -sub define_configure_variable ($) +sub define_configure_variable { my ($var) = @_; # Some variables we do not want to output. For instance it # would be a bad idea to output `U = @U@` when `@U@` can be # substituted as `\`. my $pretty = exists $ignored_configure_vars{$var} ? VAR_SILENT : VAR_ASIS; - Automake::Variable::define ($var, VAR_CONFIGURE, '', TRUE, subst $var, + Automake::Variable::define ($var, VAR_CONFIGURE, '', TRUE, subst ($var), '', $configure_vars{$var}, $pretty); } @@@ -6087,7 -6208,7 +6088,7 @@@ # -------------------------------- # Define a compiler variable. We also handle defining the 'LT' # version of the command when using libtool. -sub define_compiler_variable ($) +sub define_compiler_variable { my ($lang) = @_; @@@ -6095,20 -6216,23 +6096,20 @@@ my $libtool_tag = ''; $libtool_tag = '--tag=' . $lang->libtool_tag . ' ' if $lang->libtool_tag && exists $libtool_tags{$lang->libtool_tag}; - &define_variable ($var, $value, INTERNAL); + define_variable ($var, $value, INTERNAL); if (var ('LIBTOOL')) { my $verbose = define_verbose_libtool (); - &define_variable ("LT$var", - "\$(LIBTOOL) $verbose $libtool_tag\$(AM_LIBTOOLFLAGS) " - . "\$(LIBTOOLFLAGS) --mode=compile $value", - INTERNAL); + define_variable ("LT$var", + "\$(LIBTOOL) $verbose $libtool_tag\$(AM_LIBTOOLFLAGS)" + . " \$(LIBTOOLFLAGS) --mode=compile $value", + INTERNAL); } define_verbose_tagvar ($lang->ccer || 'GEN'); } -# define_linker_variable ($LANG) -# ------------------------------ -# Define linker variables. -sub define_linker_variable ($) +sub define_linker_variable { my ($lang) = @_; @@@ -6116,7 -6240,7 +6117,7 @@@ $libtool_tag = '--tag=' . $lang->libtool_tag . ' ' if $lang->libtool_tag && exists $libtool_tags{$lang->libtool_tag}; # CCLD = $(CC). - &define_variable ($lang->lder, $lang->ld, INTERNAL); + define_variable ($lang->lder, $lang->ld, INTERNAL); # CCLINK = $(CCLD) blah blah... my $link = ''; if (var ('LIBTOOL')) @@@ -6125,12 -6249,12 +6126,12 @@@ $link = "\$(LIBTOOL) $verbose $libtool_tag\$(AM_LIBTOOLFLAGS) " . "\$(LIBTOOLFLAGS) --mode=link "; } - &define_variable ($lang->linker, $link . $lang->link, INTERNAL); - &define_variable ($lang->compiler, $lang); - &define_verbose_tagvar ($lang->lder || 'GEN'); + define_variable ($lang->linker, $link . $lang->link, INTERNAL); + define_variable ($lang->compiler, $lang, INTERNAL); + define_verbose_tagvar ($lang->lder || 'GEN'); } -sub define_per_target_linker_variable ($$) +sub define_per_target_linker_variable { my ($linker, $target) = @_; @@@ -6174,14 -6298,14 +6175,14 @@@ return ($lang->linker, $lang->lder) if $link_command eq $orig_command; - &define_variable ("${target}_LINK", $link_command, INTERNAL); + define_variable ("${target}_LINK", $link_command, INTERNAL); return ("${target}_LINK", $lang->lder); } ################################################################ -# &check_trailing_slash ($WHERE, $LINE) -# ------------------------------------- +# check_trailing_slash ($WHERE, $LINE) +# ------------------------------------ # Return 1 iff $LINE ends with a slash. # Might modify $LINE. sub check_trailing_slash ($\$) @@@ -6199,16 -6323,15 +6200,16 @@@ } -# &read_am_file ($AMFILE, $WHERE) -# ------------------------------- +# read_am_file ($AMFILE, $WHERE, $RELDIR) +# --------------------------------------- # Read Makefile.am and set up %contents. Simultaneously copy lines # from Makefile.am into $output_trailer, or define variables as # appropriate. NOTE we put rules in the trailer section. We want # user rules to come after our generated stuff. -sub read_am_file ($$) +sub read_am_file { - my ($amfile, $where) = @_; + my ($amfile, $where, $reldir) = @_; + my $canon_reldir = &canonicalize ($reldir); my $am_file = new Automake::XFile ("< $amfile"); verb "reading $amfile"; @@@ -6293,17 -6416,6 +6294,17 @@@ my $new_saw_bk = check_trailing_slash ($where, $_); + if ($reldir eq '.') + { + # If present, eat the following '_' or '/', converting + # "%reldir%/foo" and "%canon_reldir%_foo" into plain "foo" + # when $reldir is '.'. + $_ =~ s,%(D|reldir)%/,,g; + $_ =~ s,%(C|canon_reldir)%_,,g; + } + $_ =~ s/%(D|reldir)%/${reldir}/g; + $_ =~ s/%(C|canon_reldir)%/${canon_reldir}/g; + if (/$IGNORE_PATTERN/o) { # Merely delete comments beginning with two hashes. @@@ -6465,10 -6577,8 +6466,10 @@@ push_dist_common ("\$\(srcdir\)/$path"); $path = $relative_dir . "/" . $path if $relative_dir ne '.'; } + my $new_reldir = File::Spec->abs2rel ($path, $relative_dir); + $new_reldir = '.' if $new_reldir !~ s,/[^/]*$,,; $where->push_context ("'$path' included from here"); - &read_am_file ($path, $where); + read_am_file ($path, $where, $new_reldir); $where->pop_context; } else @@@ -6501,9 -6611,11 +6502,9 @@@ } -# define_standard_variables () -# ---------------------------- # A helper for read_main_am_file which initializes configure variables # and variables from header-vars.am. -sub define_standard_variables +sub define_standard_variables () { my $saved_output_vars = $output_vars; my ($comments, undef, $rules) = @@@ -6512,16 -6624,14 +6513,16 @@@ foreach my $var (sort keys %configure_vars) { - &define_configure_variable ($var); + define_configure_variable ($var); } $output_vars .= $comments . $rules; } -# Read main am file. -sub read_main_am_file ($$) + +# read_main_am_file ($MAKEFILE_AM, $MAKEFILE_IN) +# ---------------------------------------------- +sub read_main_am_file { my ($amfile, $infile) = @_; @@@ -6538,19 -6648,20 +6539,19 @@@ # We want to predefine as many variables as possible. This lets # the user set them with '+=' in Makefile.am. - &define_standard_variables; + define_standard_variables; # Read user file, which might override some of our values. - &read_am_file ($amfile, new Automake::Location); + read_am_file ($amfile, new Automake::Location, '.'); } ################################################################ -# $FLATTENED -# &flatten ($STRING) -# ------------------ -# Flatten the $STRING and return the result. +# $STRING +# flatten ($ORIGINAL_STRING) +# -------------------------- sub flatten { $_ = shift; @@@ -6565,10 -6676,10 +6566,10 @@@ # transform_token ($TOKEN, \%PAIRS, $KEY) -# ======================================= +# --------------------------------------- # Return the value associated to $KEY in %PAIRS, as used on $TOKEN # (which should be ?KEY? or any of the special %% requests).. -sub transform_token ($$$) +sub transform_token ($\%$) { my ($token, $transform, $key) = @_; my $res = $transform->{$key}; @@@ -6578,12 -6689,12 +6579,12 @@@ # transform ($TOKEN, \%PAIRS) -# =========================== +# --------------------------- # If ($TOKEN, $VAL) is in %PAIRS: # - replaces %KEY% with $VAL, # - enables/disables ?KEY? and ?!KEY?, # - replaces %?KEY% with TRUE or FALSE. -sub transform ($$) +sub transform ($\%) { my ($token, $transform) = @_; @@@ -6592,18 -6703,18 +6593,18 @@@ # when there is neither IFTRUE nor IFFALSE. if ($token =~ /^%([\w\-]+)%$/) { - return transform_token ($token, $transform, $1); + return transform_token ($token, %$transform, $1); } # %?KEY%. elsif ($token =~ /^%\?([\w\-]+)%$/) { - return transform_token ($token, $transform, $1) ? 'TRUE' : 'FALSE'; + return transform_token ($token, %$transform, $1) ? 'TRUE' : 'FALSE'; } # ?KEY? and ?!KEY?. elsif ($token =~ /^ \? (!?) ([\w\-]+) \? $/x) { my $neg = ($1 eq '!') ? 1 : 0; - my $val = transform_token ($token, $transform, $2); + my $val = transform_token ($token, %$transform, $2); return (!!$val == $neg) ? '##%' : ''; } else @@@ -6618,7 -6729,7 +6619,7 @@@ # Load a $MAKEFILE, apply the %TRANSFORM, and return the result. # No extra parsing or post-processing is done (i.e., recognition of # rules declaration or of make variables definitions). -sub preprocess_file ($%) +sub preprocess_file { my ($file, %transform) = @_; @@@ -6670,7 -6781,7 +6671,7 @@@ # Substitute Automake template tokens. s/(?: % \?? [\w\-]+ % | \? !? [\w\-]+ \? - )/transform($&, \%transform)/gex; + )/transform($&, %transform)/gex; # transform() may have added some ##%-comments to strip. # (we use '##%' instead of '##' so we can distinguish ##%##%##% from # ####### and do not remove the latter.) @@@ -6681,11 -6792,11 +6682,11 @@@ # @PARAGRAPHS -# &make_paragraphs ($MAKEFILE, [%TRANSFORM]) -# ------------------------------------------ +# make_paragraphs ($MAKEFILE, [%TRANSFORM]) +# ----------------------------------------- # Load a $MAKEFILE, apply the %TRANSFORM, and return it as a list of # paragraphs. -sub make_paragraphs ($%) +sub make_paragraphs { my ($file, %transform) = @_; $transform{FIRST} = !$transformed_files{$file}; @@@ -6727,12 -6838,12 +6728,12 @@@ # ($COMMENT, $VARIABLES, $RULES) -# &file_contents_internal ($IS_AM, $FILE, $WHERE, [%TRANSFORM]) -# ------------------------------------------------------------- +# file_contents_internal ($IS_AM, $FILE, $WHERE, [%TRANSFORM]) +# ------------------------------------------------------------ # Return contents of a file from $libdir/am, automatically skipping # macros or rules which are already known. $IS_AM iff the caller is # reading an Automake file (as opposed to the user's Makefile.am). -sub file_contents_internal ($$$%) +sub file_contents_internal { my ($is_am, $file, $where, %transform) = @_; @@@ -6826,7 -6937,7 +6827,7 @@@ my ($targets, $dependencies) = ($1, $2); # Remove the escaped new lines. # I don't know why, but I have to use a tmp $flat_deps. - my $flat_deps = &flatten ($dependencies); + my $flat_deps = flatten ($dependencies); my @deps = split (' ', $flat_deps); foreach (split (' ', $targets)) @@@ -6850,7 -6961,7 +6851,7 @@@ # Output only if not in FALSE. if (defined $dependencies{$_} && $cond != FALSE) { - &depend ($_, @deps); + depend ($_, @deps); register_action ($_, $actions); } else @@@ -6920,11 -7031,11 +6921,11 @@@ # $CONTENTS -# &file_contents ($BASENAME, $WHERE, [%TRANSFORM]) -# ------------------------------------------------ +# file_contents ($BASENAME, $WHERE, [%TRANSFORM]) +# ----------------------------------------------- # Return contents of a file from $libdir/am, automatically skipping # macros or rules which are already known. -sub file_contents ($$%) +sub file_contents { my ($basename, $where, %transform) = @_; my ($comments, $variables, $rules) = @@@ -6935,8 -7046,8 +6936,8 @@@ # @PREFIX -# &am_primary_prefixes ($PRIMARY, $CAN_DIST, @PREFIXES) -# ----------------------------------------------------- +# am_primary_prefixes ($PRIMARY, $CAN_DIST, @PREFIXES) +# ---------------------------------------------------- # Find all variable prefixes that are used for install directories. A # prefix 'zar' qualifies iff: # @@@ -6950,7 -7061,7 +6951,7 @@@ # variable "zardir" is defined, then "zar_PROGRAMS" becomes valid. # This is to provide a little extra flexibility in those cases which # need it. -sub am_primary_prefixes ($$@) +sub am_primary_prefixes { my ($primary, $can_dist, @prefixes) = @_; @@@ -7010,9 -7121,6 +7011,9 @@@ } +# am_install_var (-OPTION..., file, HOW, where...) +# ------------------------------------------------ +# # Handle 'where_HOW' variable magic. Does all lookups, generates # install code, and possibly generates code to define the primary # variable. The first argument is the name of the .am file to munge, @@@ -7027,6 -7135,7 +7028,6 @@@ # FIXME: this should be rewritten to be cleaner. It should be broken # up into multiple functions. # -# Usage is: am_install_var (OPTION..., file, HOW, where...) sub am_install_var { my (@args) = @_; @@@ -7131,12 -7240,11 +7132,12 @@@ } else { - # Strip any $(EXEEXT) suffix the user might have added, or this - # will confuse &handle_source_transform and &check_canonical_spelling. + # Strip any $(EXEEXT) suffix the user might have added, + # or this will confuse handle_source_transform() and + # check_canonical_spelling(). # We'll add $(EXEEXT) back later anyway. - # Do it here rather than in handle_programs so the uniquifying at the - # end of this function works. + # Do it here rather than in handle_programs so the + # uniquifying at the end of this function works. ${$locvals}[1] =~ s/\$\(EXEEXT\)$// if $primary eq 'PROGRAMS'; @@@ -7180,17 -7288,18 +7181,17 @@@ # Singular form of $PRIMARY. (my $one_primary = $primary) =~ s/S$//; - $output_rules .= &file_contents ($file, $where, - PRIMARY => $primary, - ONE_PRIMARY => $one_primary, - DIR => $X, - NDIR => $nodir_name, - BASE => $strip_subdir, - - EXEC => $exec_p, - INSTALL => $install_p, - DIST => $dist_p, - DISTVAR => $distvar, - 'CK-OPTS' => $check_options_p); + $output_rules .= file_contents ($file, $where, + PRIMARY => $primary, + ONE_PRIMARY => $one_primary, + DIR => $X, + NDIR => $nodir_name, + BASE => $strip_subdir, + EXEC => $exec_p, + INSTALL => $install_p, + DIST => $dist_p, + DISTVAR => $distvar, + 'CK-OPTS' => $check_options_p); } # The JAVA variable is used as the name of the Java interpreter. @@@ -7233,8 -7342,6 +7234,8 @@@ my %make_dirs = (); my $make_dirs_set = 0; +# is_make_dir ($DIRECTORY) +# ------------------------ sub is_make_dir { my ($dir) = @_; @@@ -7286,8 -7393,8 +7287,8 @@@ sub locate_aux_dir ( } -# &push_required_file ($DIR, $FILE, $FULLFILE) -# -------------------------------------------------- +# push_required_file ($DIR, $FILE, $FULLFILE) +# ------------------------------------------- # Push the given file onto DIST_COMMON. sub push_required_file { @@@ -7323,7 -7430,7 +7324,7 @@@ $am_config_libobj_dir =~ s|/*$||; push_dist_common ("$am_config_libobj_dir/$file"); } - elsif ($relative_dir eq '.' && ! &is_make_dir ($dir)) + elsif ($relative_dir eq '.' && ! is_make_dir ($dir)) { # If we are doing the topmost directory, and the file is in a # subdir which does not have a Makefile, then we distribute it @@@ -7373,10 -7480,10 +7374,10 @@@ # than once. my %required_file_not_found = (); -# &required_file_check_or_copy ($WHERE, $DIRECTORY, $FILE) -# -------------------------------------------------------- +# required_file_check_or_copy ($WHERE, $DIRECTORY, $FILE) +# ------------------------------------------------------- # Verify that the file must exist in $DIRECTORY, or install it. -sub required_file_check_or_copy ($$$) +sub required_file_check_or_copy { my ($where, $dir, $file) = @_; @@@ -7482,13 -7589,13 +7483,13 @@@ } -# &require_file_internal ($WHERE, $MYSTRICT, $DIRECTORY, $QUEUE, @FILES) -# ---------------------------------------------------------------------- +# require_file_internal ($WHERE, $MYSTRICT, $DIRECTORY, $QUEUE, @FILES) +# --------------------------------------------------------------------- # Verify that the file must exist in $DIRECTORY, or install it. # $MYSTRICT is the strictness level at which this file becomes required. # Worker threads may queue up the action to be serialized by the master, # if $QUEUE is true -sub require_file_internal ($$$@) +sub require_file_internal { my ($where, $mystrict, $dir, $queue, @files) = @_; @@@ -7511,28 -7618,28 +7512,28 @@@ } } -# &require_file ($WHERE, $MYSTRICT, @FILES) -# ----------------------------------------- -sub require_file ($$@) +# require_file ($WHERE, $MYSTRICT, @FILES) +# ---------------------------------------- +sub require_file { my ($where, $mystrict, @files) = @_; require_file_internal ($where, $mystrict, $relative_dir, 0, @files); } -# &require_file_with_macro ($COND, $MACRO, $MYSTRICT, @FILES) -# ----------------------------------------------------------- -sub require_file_with_macro ($$$@) +# require_file_with_macro ($COND, $MACRO, $MYSTRICT, @FILES) +# ---------------------------------------------------------- +sub require_file_with_macro { my ($cond, $macro, $mystrict, @files) = @_; $macro = rvar ($macro) unless ref $macro; require_file ($macro->rdef ($cond)->location, $mystrict, @files); } -# &require_libsource_with_macro ($COND, $MACRO, $MYSTRICT, @FILES) -# ---------------------------------------------------------------- +# require_libsource_with_macro ($COND, $MACRO, $MYSTRICT, @FILES) +# --------------------------------------------------------------- # Require an AC_LIBSOURCEd file. If AC_CONFIG_LIBOBJ_DIR was called, it # must be in that directory. Otherwise expect it in the current directory. -sub require_libsource_with_macro ($$$@) +sub require_libsource_with_macro { my ($cond, $macro, $mystrict, @files) = @_; $macro = rvar ($macro) unless ref $macro; @@@ -7547,10 -7654,10 +7548,10 @@@ } } -# &queue_required_file_check_or_copy ($QUEUE, $KEY, $DIR, $WHERE, -# $MYSTRICT, @FILES) -# --------------------------------------------------------------- -sub queue_required_file_check_or_copy ($$$$@) +# queue_required_file_check_or_copy ($QUEUE, $KEY, $DIR, $WHERE, +# $MYSTRICT, @FILES) +# -------------------------------------------------------------- +sub queue_required_file_check_or_copy { my ($queue, $key, $dir, $where, $mystrict, @files) = @_; my @serial_loc; @@@ -7565,9 -7672,9 +7566,9 @@@ $queue->enqueue ($key, $dir, @serial_loc, $mystrict, 0 + @files, @files); } -# &require_queued_file_check_or_copy ($QUEUE) -# ------------------------------------------- -sub require_queued_file_check_or_copy ($) +# require_queued_file_check_or_copy ($QUEUE) +# ------------------------------------------ +sub require_queued_file_check_or_copy { my ($queue) = @_; my $where; @@@ -7598,10 -7705,10 +7599,10 @@@ } } -# &require_conf_file ($WHERE, $MYSTRICT, @FILES) -# ---------------------------------------------- +# require_conf_file ($WHERE, $MYSTRICT, @FILES) +# --------------------------------------------- # Looks in configuration path, as specified by AC_CONFIG_AUX_DIR. -sub require_conf_file ($$@) +sub require_conf_file { my ($where, $mystrict, @files) = @_; my $queue = defined $required_conf_file_queue ? 1 : 0; @@@ -7610,9 -7717,9 +7611,9 @@@ } -# &require_conf_file_with_macro ($COND, $MACRO, $MYSTRICT, @FILES) -# ---------------------------------------------------------------- -sub require_conf_file_with_macro ($$$@) +# require_conf_file_with_macro ($COND, $MACRO, $MYSTRICT, @FILES) +# --------------------------------------------------------------- +sub require_conf_file_with_macro { my ($cond, $macro, $mystrict, @files) = @_; require_conf_file (rvar ($macro)->rdef ($cond)->location, @@@ -7621,14 -7728,14 +7622,14 @@@ ################################################################ -# &require_build_directory ($DIRECTORY) -# ------------------------------------- +# require_build_directory ($DIRECTORY) +# ------------------------------------ # Emit rules to create $DIRECTORY if needed, and return # the file that any target requiring this directory should be made # dependent upon. # We don't want to emit the rule twice, and want to reuse it # for directories with equivalent names (e.g., 'foo/bar' and './foo//bar'). -sub require_build_directory ($) +sub require_build_directory { my $directory = shift; @@@ -7662,12 -7769,12 +7663,12 @@@ return $dirstamp; } -# &require_build_directory_maybe ($FILE) -# -------------------------------------- +# require_build_directory_maybe ($FILE) +# ------------------------------------- # If $FILE lies in a subdirectory, emit a rule to create this # directory and return the file that $FILE should be made # dependent upon. Otherwise, just return the empty string. -sub require_build_directory_maybe ($) +sub require_build_directory_maybe { my $file = shift; my $directory = dirname ($file); @@@ -7684,7 -7791,7 +7685,7 @@@ ################################################################ -# Push a list of files onto dist_common. +# Push a list of files onto '@dist_common'. sub push_dist_common { prog_error "push_dist_common run after handle_dist" @@@ -7700,7 -7807,7 +7701,7 @@@ # ---------------------------------------------- # Generate a Makefile.in given the name of the corresponding Makefile and # the name of the file output by config.status. -sub generate_makefile ($$) +sub generate_makefile { my ($makefile_am, $makefile_in) = @_; @@@ -7715,14 -7822,14 +7716,14 @@@ # $OUTPUT is encoded. If it contains a ":" then the first element # is the real output file, and all remaining elements are input # files. We don't scan or otherwise deal with these input files, - # other than to mark them as dependencies. See - # &scan_autoconf_files for details. + # other than to mark them as dependencies. See the subroutine + # 'scan_autoconf_files' for details. my ($makefile, @inputs) = split (/:/, $output_files{$makefile_in}); $relative_dir = dirname ($makefile); read_main_am_file ($makefile_am, $makefile_in); - if (handle_options) + if (not handle_options) { # Process buffered warnings. flush_messages; @@@ -7772,9 -7879,9 +7773,9 @@@ handle_silent; - # These must be run after all the sources are scanned. They - # use variables defined by &handle_libraries, &handle_ltlibraries, - # or &handle_programs. + # These must be run after all the sources are scanned. They use + # variables defined by handle_libraries(), handle_ltlibraries(), + # or handle_programs(). handle_compile; handle_languages; handle_libtool; @@@ -7875,16 -7982,16 +7876,16 @@@ print $gm_file $output; } -################################################################ - - - ################################################################ + # Helper function for usage(). -sub print_autodist_files (@) +sub print_autodist_files { + # NOTE: we need to call our 'uniq' function with the leading '&' + # here, because otherwise perl complains that "Unquoted string + # 'uniq' may clash with future reserved word". my @lcomm = sort (&uniq (@_)); my @four; @@@ -7926,6 -8033,7 +7927,6 @@@ } -# Print usage information. sub usage () { print "Usage: $0 [OPTION]... [Makefile]... @@@ -7976,6 -8084,9 +7977,6 @@@ General help using GNU software: