diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2014-12-22 17:56:22 +0100 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2014-12-22 17:56:22 +0100 |
commit | 88ac92b2d5beaf4aee7d7bb4f3dc9a86da823550 (patch) | |
tree | 16c1527969be06b21275e997f559333b738c8be5 /bin/automake.in | |
parent | 4179284a3de093f3578a67c9b258a0d91eb4b6be (diff) | |
parent | 912383451a4a394383a8e95240e3e98ee68faf72 (diff) | |
download | automake-88ac92b2d5beaf4aee7d7bb4f3dc9a86da823550.tar.gz |
Merge branch 'micro' into minor
* micro:
cleanup: refactor code to initialize DIST_COMMON
dist: ordering of files in DIST_COMMON is deterministic now
tests: refactor some tests on DIST_COMMON
maint: make output of 'gen-testsuite-part' deterministic
When computing lispdir, don't load emacs site wide init file.
PATH: quote $(PATH_SEPARATOR) as well
Improve detection of GNU make, avoiding "Arg list too long" errors.
Diffstat (limited to 'bin/automake.in')
-rw-r--r-- | bin/automake.in | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/bin/automake.in b/bin/automake.in index f9cc611a4..eedc8bcf1 100644 --- a/bin/automake.in +++ b/bin/automake.in @@ -342,7 +342,7 @@ my %extension_map = (); # List of the DIST_COMMON files we discovered while reading # configure.ac. -my $configure_dist_common = ''; +my @configure_dist_common = (); # This maps languages names onto objects. my %languages = (); @@ -489,6 +489,9 @@ my %language_scratch; # handling on a per-language basis. my %lang_specific_files; +# List of distributed files to be put in DIST_COMMON. +my @dist_common; + # This is set when 'handle_dist' has finished. Once this happens, # we should no longer push on dist_common. my $handle_dist_run; @@ -586,8 +589,11 @@ sub initialize_per_input () @dist_targets = (); + @dist_common = (); + $handle_dist_run = 0; + %known_programs = (); - %known_libraries= (); + %known_libraries = (); %extension_seen = (); @@ -595,8 +601,6 @@ sub initialize_per_input () %lang_specific_files = (); - $handle_dist_run = 0; - $need_link = 0; $must_handle_compiled_objects = 0; @@ -3693,8 +3697,8 @@ sub handle_dist () } } - # We might copy elements from $configure_dist_common to - # %dist_common if we think we need to. If the file appears in our + # We might copy elements from @configure_dist_common to + # @dist_common if we think we need to. If the file appears in our # directory, we would have discovered it already, so we don't # check that. But if the file is in a subdir without a Makefile, # we want to distribute it here if we are doing '.'. Ugly! @@ -3706,23 +3710,25 @@ sub handle_dist () # See also automake bug#9651. if ($relative_dir eq '.') { - foreach my $file (split (' ' , $configure_dist_common)) + foreach my $file (@configure_dist_common) { my $dir = dirname ($file); push_dist_common ($file) if ($dir eq '.' || ! is_make_dir ($dir)); } + @configure_dist_common = (); } - # 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); - variable_delete 'DIST_COMMON'; - define_pretty_variable ('DIST_COMMON', TRUE, INTERNAL, @dist_common); + # $(am__DIST_COMMON): files to be distributed automatically. Will be + # appended to $(DIST_COMMON) in the generated Makefile. + # Use 'sort' so that the expansion of $(DIST_COMMON) in the generated + # Makefile is deterministic, in face of m4 and/or perl randomizations + # (see automake bug#17908). + define_pretty_variable ('am__DIST_COMMON', TRUE, INTERNAL, + uniq (sort @dist_common)); - # Now that we've processed DIST_COMMON, disallow further attempts - # to set it. + # Now that we've processed @dist_common, disallow further attempts + # to modify it. $handle_dist_run = 1; $transform{'DISTCHECK-HOOK'} = !! rule 'distcheck-hook'; @@ -5432,8 +5438,7 @@ sub scan_autoconf_files () if -f $config_aux_dir . '/install.sh'; # Preserve dist_common for later. - $configure_dist_common = variable_value ('DIST_COMMON') || ''; - + @configure_dist_common = @dist_common; } ################################################################ @@ -7399,11 +7404,10 @@ sub required_file_check_or_copy return if $found_it && (! $add_missing || ! $force_missing); - # If we've already looked for it, we're done. You might - # wonder why we don't do this before searching for the - # file. If we do that, then something like - # AC_OUTPUT(subdir/foo foo) will fail to put foo.in into - # DIST_COMMON. + # If we've already looked for it, we're done. You might wonder why we + # don't do this before searching for the file. If we do that, then + # something like AC_OUTPUT([subdir/foo foo]) will fail to put 'foo.in' + # into $(DIST_COMMON). if (! $found_it) { return if defined $required_file_not_found{$fullfile}; @@ -7690,8 +7694,7 @@ sub push_dist_common { prog_error "push_dist_common run after handle_dist" if $handle_dist_run; - Automake::Variable::define ('DIST_COMMON', VAR_AUTOMAKE, '+', TRUE, "@_", - '', INTERNAL, VAR_PRETTY); + push @dist_common, @_; } @@ -7883,10 +7886,7 @@ sub generate_makefile # Helper function for usage(). 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 @lcomm = uniq (sort @_); my @four; format USAGE_FORMAT = |