From: Stefano Lattarini Date: Mon, 22 Dec 2014 19:25:13 +0000 (+0100) Subject: Merge branch 'master' into ng/master X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50a6af3c7807c44148544adbbf2ae67b848fb585;p=thirdparty%2Fautomake.git Merge branch 'master' into ng/master * master: 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. Signed-off-by: Stefano Lattarini --- 50a6af3c7807c44148544adbbf2ae67b848fb585 diff --cc bin/automake.in index 13b27d155,c06fc0fa4..d699ec6ee --- a/bin/automake.in +++ b/bin/automake.in @@@ -462,6 -472,9 +459,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; ++# List of the "auto-discovered" distributed files. ++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; @@@ -536,9 -572,11 +534,12 @@@ sub initialize_per_input ( @dist_targets = (); + @dist_common = (); + $handle_dist_run = 0; + %known_programs = (); - %known_libraries= (); - %known_ltlibraries= (); + %known_libraries = (); ++ %known_ltlibraries = (); %extension_seen = (); @@@ -3125,21 -3606,23 +3124,21 @@@ sub handle_dist ( push_dist_common ($file) if ($dir eq '.' || ! is_make_dir ($dir)); } - @configure_dist_common = (); + @configure_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 modify it. + # We don't expected further attempts to modify @dist_common + # after this point, so disallow it, for extra safety. $handle_dist_run = 1; - $transform{'DISTCHECK-HOOK'} = !! rule 'distcheck-hook'; - $transform{'GETTEXT'} = $seen_gettext && !$seen_gettext_external; + define_variable ('am.dist.handle-distcheck-hook', INTERNAL, + rule ('distcheck-hook') ? 'yes' : ''); + define_variable ('am.dist.handle-gettext', INTERNAL, + $seen_gettext && !$seen_gettext_external ? 'yes' : ''); + + my $flm = option 'filename-length-max'; + define_variable ('am.dist.filename-filter', INTERNAL, + $flm ? ('.' x $flm->[1]) : ''); # If the target 'dist-hook' exists, make sure it is run. This # allows users to do random weird things to the distribution diff --cc lib/am/texi-vers.am index 5e8010b31,ec91dfe02..cda2c262f --- a/lib/am/texi-vers.am +++ b/lib/am/texi-vers.am @@@ -27,18 -27,32 +27,18 @@@ am.dist.common-files += %VTEXI% %STAMPV ## (Not configure.ac, because not all setups define the version number ## in this file.) %STAMPVTI%: %TEXI% $(top_srcdir)/configure -## It is wrong to have %STAMPVTI% dependent on %DIRSTAMP%, because -## %STAMPVTI% is distributed and %DIRSTAMP% isn't: a distributed file -## should never be dependent upon a non-distributed built file. -## Therefore we ensure that %DIRSTAMP% exists in the rule. -## Use cp + mv so that the update of %VTEXI% is atomic even if -## the source directory is on a different file system. -?DIRSTAMP? @test -f %DIRSTAMP% || $(MAKE) $(AM_MAKEFLAGS) %DIRSTAMP% - @(dir=.; test -f ./%TEXI% || dir=$(srcdir); \ - set `$(SHELL) %MDDIR%mdate-sh $$dir/%TEXI%`; \ - echo "@set UPDATED $$1 $$2 $$3"; \ - echo "@set UPDATED-MONTH $$2 $$3"; \ - echo "@set EDITION $(VERSION)"; \ - echo "@set VERSION $(VERSION)") > %VTI%.tmp$$$$ && \ - (cmp -s %VTI%.tmp$$$$ %VTEXI% \ - || (echo "Updating %VTEXI%" && \ - cp %VTI%.tmp$$$$ %VTEXI%.tmp$$$$ && \ - mv %VTEXI%.tmp$$$$ %VTEXI%)) && \ - rm -f %VTI%.tmp$$$$ %VTEXI%.$$$$ + @$(am.cmd.ensure-target-dir-exists) - @(set `$(SHELL) $(am.conf.aux-dir)/mdate-sh $<`; \ - echo "@set UPDATED $$1 $$2 $$3"; \ - echo "@set UPDATED-MONTH $$2 $$3"; \ - echo "@set EDITION $(VERSION)"; \ - echo "@set VERSION $(VERSION)") > %VTI%.$$$$.tmp - @if cmp -s %VTI%.$$$$.tmp %VTEXI%; then \ ++ @(set `$(SHELL) $(am.conf.aux-dir)/mdate-sh $<` \ ++ && echo "@set UPDATED $$1 $$2 $$3" \ ++ && echo "@set UPDATED-MONTH $$2 $$3" \ ++ && echo "@set EDITION $(VERSION)" \ ++ && echo "@set VERSION $(VERSION)") > %VTI%.$$$$.tmp || exit; \ ++ if cmp -s %VTI%.$$$$.tmp %VTEXI%; then \ + rm -f %VTI%.$$$$.tmp; \ + else \ + echo "Updating %VTEXI%" && mv -f %VTI%.$$$$.tmp %VTEXI%; \ - fi; ++ fi @cp %VTEXI% $@ -mostlyclean-am: mostlyclean-%VTI% -mostlyclean-%VTI%: - -rm -f %VTI%.tmp* %VTEXI%.tmp* - -maintainer-clean-am: maintainer-clean-%VTI% -maintainer-clean-%VTI%: -%MAINTAINER-MODE% -rm -f %STAMPVTI% %VTEXI% - -.PHONY: mostlyclean-%VTI% maintainer-clean-%VTI% +am.clean.mostly.f += %VTI%.[0-9]*.tmp +am.clean.maint.f += %STAMPVTI% %VTEXI% diff --cc t/Makefile.inc index a7b371439,62613ac7d..8091be479 --- a/t/Makefile.inc +++ b/t/Makefile.inc @@@ -125,22 -64,45 +125,22 @@@ AM_TESTS_ENVIRONMENT += stderr_fileno_= # in case it is given with a relative name containing no slashes. AM_TESTS_ENVIRONMENT += \ if test $(srcdir) != .; then \ - PATH='$(abs_srcdir)/%D%/ax'$(PATH_SEPARATOR)$$PATH; \ + PATH='$(abs_srcdir)/%D%/ax$(PATH_SEPARATOR)'$$PATH; \ fi; \ - PATH='$(abs_builddir)/%D%/ax'$(PATH_SEPARATOR)$$PATH; \ + PATH='$(abs_builddir)/%D%/ax$(PATH_SEPARATOR)'$$PATH; \ export PATH; -# Hand-written tests. - -include $(srcdir)/%D%/list-of-tests.mk - -TESTS += $(handwritten_TESTS) -EXTRA_DIST += $(handwritten_TESTS) - -# Automatically-generated tests wrapping hand-written ones. -# Also, automatically-computed dependencies for tests. +# Automatically-computed dependencies for tests. +include $(srcdir)/testsuite-autodeps.am -include $(srcdir)/%D%/testsuite-part.am - -TESTS += $(generated_TESTS) -EXTRA_DIST += $(generated_TESTS) - -$(srcdir)/%D%/testsuite-part.am: - $(AM_V_at)rm -f %D%/testsuite-part.tmp $@ - $(AM_V_GEN)$(PERL) $(srcdir)/gen-testsuite-part \ - --srcdir $(srcdir) > %D%/testsuite-part.tmp - $(AM_V_at)chmod a-w %D%/testsuite-part.tmp - $(AM_V_at)mv -f %D%/testsuite-part.tmp $@ -EXTRA_DIST += gen-testsuite-part - -# The dependecies declared here are not truly complete, but such +# The dependencies declared here are not truly complete, but such # completeness would cause more issues than it would solve. See # automake bug#11347. -$(generated_TESTS): $(srcdir)/gen-testsuite-part -$(srcdir)/%D%/testsuite-part.am: $(srcdir)/gen-testsuite-part -$(srcdir)/%D%/testsuite-part.am: Makefile.am - -# Hand-written tests for stuff in 'contrib/'. -include $(srcdir)/contrib/%D%/Makefile.inc -TESTS += $(contrib_TESTS) -EXTRA_DIST += $(contrib_TESTS) +$(srcdir)/testsuite-autodeps.am: $(srcdir)/gen-testsuite-part + $(AM_V_at)rm -f $(@F)-t $@ + $(AM_V_GEN)$(PERL) $< --srcdir $(srcdir) > $(@F)-t + $(AM_V_at)chmod a-w $(@F)-t && mv -f $(@F)-t $@ +EXTRA_DIST += gen-testsuite-part # Static dependencies valid for each test case (also further # extended later). Note that use 'noinst_' rather than 'check_'