summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--INSTALL2
-rw-r--r--Makefile.am7
-rw-r--r--NEWS49
-rw-r--r--PLANS/subdir-objects.txt10
-rw-r--r--THANKS6
-rw-r--r--bin/Makefile.inc23
-rw-r--r--bin/aclocal.in40
-rw-r--r--bin/automake.in303
-rwxr-xr-xbin/gen-perl-protos36
-rwxr-xr-xbootstrap12
-rw-r--r--configure.ac22
-rw-r--r--doc/Makefile.inc9
-rw-r--r--doc/automake.texi16
-rwxr-xr-xdoc/help2man251
-rw-r--r--lib/Automake/Config.in2
-rw-r--r--lib/am/check.am2
-rw-r--r--lib/am/configure.am6
-rw-r--r--lib/am/dejagnu.am2
-rw-r--r--lib/am/depend.am14
-rw-r--r--m4/amversion.m46
-rw-r--r--m4/depout.m478
-rw-r--r--m4/make.m459
-rw-r--r--m4/python.m45
-rwxr-xr-xmaintainer/check-perl-protos50
-rw-r--r--maintainer/syntax-checks.mk8
-rw-r--r--pre-inst-env.in (renamed from t/wrap/aclocal.in)48
-rw-r--r--t/Makefile.inc10
-rw-r--r--t/ansi2knr-no-more.sh2
-rw-r--r--t/ax/test-defs.in6
-rw-r--r--t/depcomp8a.sh16
-rw-r--r--t/depcomp8b.sh16
-rw-r--r--t/depend-postproc.sh (renamed from t/postproc.sh)29
-rw-r--r--t/extra-sources.sh5
-rw-r--r--t/get-sysconf.sh4
-rw-r--r--t/lex-depend-cxx.sh5
-rw-r--r--t/lex-depend-grep.sh2
-rw-r--r--t/libobj-no-dependency-tracking.sh56
-rw-r--r--t/list-of-tests.mk8
-rw-r--r--t/pr224.sh4
-rw-r--r--t/subobj-indir-pr13928.sh4
-rw-r--r--t/subobj-objname-clash.sh104
-rw-r--r--t/subobj-pr13928-more-langs.sh138
-rw-r--r--t/subobj-vpath-pr13928.sh89
-rw-r--r--t/subobj11b.sh10
-rw-r--r--t/subobj11c.sh2
-rw-r--r--t/wrap/automake.in27
47 files changed, 1159 insertions, 448 deletions
diff --git a/.gitignore b/.gitignore
index 19da02f71..56bdce2c6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,7 +13,9 @@
/config.status.lineno
/configure.lineno
/bin/aclocal
+/bin/aclocal-1.*
/bin/automake
+/bin/automake-1.*
/runtest
/doc/.dirstamp
/doc/automake*.info
@@ -41,8 +43,6 @@
/doc/web-manual
/lib/Automake/Config.pm
/test-suite.log
-/t/wrap/aclocal-1.*
-/t/wrap/automake-1.*
/t/ax/test-defs.sh
/t/ax/shell-no-trail-bslash
/t/ax/cc-no-c-o
diff --git a/INSTALL b/INSTALL
index 209984075..4cbd15f99 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,7 +1,7 @@
Installation Instructions
*************************
-Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation,
+Copyright (C) 1994-1996, 1999-2002, 2004-2014 Free Software Foundation,
Inc.
Copying and distribution of this file, with or without modification,
diff --git a/Makefile.am b/Makefile.am
index cfe4dd40d..ab6533ea9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -69,10 +69,9 @@ generated_file_finalize = $(AM_V_at) \
fi; \
chmod a-w $@-t && mv -f $@-t $@
-# For some tests or targets, we need to have the just-build automake and
-# aclocal scripts avaiable on PATH.
-extend_PATH = \
- { PATH='$(abs_builddir)/t/wrap$(PATH_SEPARATOR)'$$PATH && export PATH; }
+# Wrapper for the build environment.
+nodist_noinst_SCRIPTS += pre-inst-env
+CLEANFILES += $(noinst_SCRIPTS)
# The master location for INSTALL is lib/INSTALL.
# This is where "make fetch" will install new versions.
diff --git a/NEWS b/NEWS
index 92be90634..eb0a4155d 100644
--- a/NEWS
+++ b/NEWS
@@ -64,6 +64,55 @@
New in ?.?.?:
+* Miscellaneous changes
+
+ - When subdir-objects is in effect, Automake will now construct
+ shorter object file names when no programs and libraries name
+ clashes are encountered. This should make the discouraged use of
+ 'foo_SHORTNAME' unnecessary in many cases.
+
+* Bugs fixed:
+
+ - Automatic dependency tracking has been fixed to work also when the
+ 'subdir-object' option is used and some 'foo_SOURCES' definition
+ contains unexpanded references to make variables, as in, e.g.:
+
+ a_src = sources/libs/aaa
+ b_src = sources/bbb
+ foo_SOURCES = $(a_src)/bar.c $(b_src)/baz.c
+
+ With such a setup, the created makefile fragment containing dependency
+ tracking information will be correctly placed under the directories
+ named 'sources/libs/aaa/.deps' and 'sources/bbb/.deps', rather than
+ mistakenly under directories named (literally!) '$(src_a)/.deps' and
+ '$(src_b)/.deps' (this was the first part of automake bug#13928).
+
+ Notice that in order to fix this bug we had to slightly change the
+ semantics of how config.status bootstraps the makefile fragments
+ required for the dependency tracking to work: rather than attempting
+ to parse the Makefiles via grep and sed trickeries only, we actually
+ invoke 'make' on a slightly preprocessed version of those Makefiles,
+ using a private target that is only meant to bootstrap the required
+ makefile fragments.
+
+ - The 'subdir-object' option no longer causes object files corresponding
+ to source files specified with an explicit '$(srcdir)' component to be
+ placed in the source tree rather than in the build tree.
+
+ For example, if Makefile.am contains:
+
+ AUTOMAKE_OPTIONS = subdir-objects
+ foo_SOURCES = $(srcdir)/foo.c $(srcdir)/s/bar.c $(top_srcdir)/baz.c
+
+ then "make all" will create 'foo.o' and 's/bar.o' in $(builddir) rather
+ than in $(srcdir), and will create 'baz.o' in $(top_builddir) rather
+ than in $(top_srcdir).
+
+ This was the second part of automake bug#13928.
+
+ - Installed 'aclocal' m4 macros can now accept installation directories
+ containing '@' characters (automake bug#20903)
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
New in 1.15.1:
diff --git a/PLANS/subdir-objects.txt b/PLANS/subdir-objects.txt
index 3cf610124..c849e338e 100644
--- a/PLANS/subdir-objects.txt
+++ b/PLANS/subdir-objects.txt
@@ -5,9 +5,6 @@ We want to make the behaviour currently enabled by the 'subdir-objects'
the default one, and in fact the *only* one, in Automake 2.0.
See automake bug#13378: <http://debbugs.gnu.org/13378>.
-Sadly, **THIS IS IMPOSSIBLE** until automake bug#13928 is resolved:
-http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13928
-
Details
-------
@@ -53,11 +50,10 @@ We also make sure to avoid the warning when it would be irrelevant, i.e.,
if all source files sit in "current" directory (thanks to Peter Johansson
for suggesting this).
-For some automake 1.x (*before* 2.0 can be released)
-----------------------------------------------------
+For automake 1.16 (*before* 2.0 can be released)
+------------------------------------------------
-Find a proper way to fix the blocking automake bug#13928:
-http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13928
+Submit the pending patch series that fixes http://debbugs.gnu.org/13928
For automake 2.0
----------------
diff --git a/THANKS b/THANKS
index 9b9faa179..a2b8c29ec 100644
--- a/THANKS
+++ b/THANKS
@@ -60,6 +60,7 @@ Brian Gough bjg@network-theory.co.uk
Brian Jones cbj@nortel.net
Bruce Korb bkorb@gnu.org
Bruno Haible haible@ilog.fr
+Carnë Draug carandraug+dev@gmail.com
Carsten Lohrke carlo@gentoo.org
Charles Wilson cwilson@ece.gatech.edu
Chris Hoogendyk hoogendyk@bio.umass.edu
@@ -89,6 +90,7 @@ David Byron dbyron@dbyron.com
David Fang fang@csl.cornell.edu
Davyd Madeley davyd@fugro-fsi.com.au
David Pashley david@davidpashley.com
+David Wohlferd dw@limegreensocks.com
David Zaroski cz253@cleveland.Freenet.Edu
Dean Povey dpovey@wedgetail.com
Dennis J. Linse Dennis.J.Linse@SAIC.com
@@ -104,6 +106,7 @@ Dmitry Mikhin dmitrym@acres.com.au
Dmitry V. Levin ldv@altlinux.org
Doug Evans devans@cygnus.com
Duncan Gibson duncan@thermal.esa.int
+Dilyan Palauzov dilyan.palauzov@aegee.org
Ed Hartnett ed@unidata.ucar.edu
Eleftherios Gkioulekas lf@amath.washington.edu
Elena A. Vengerova helen@oktetlabs.ru
@@ -111,6 +114,7 @@ Elmar Hoffmann elho@elho.net
Elrond Elrond@Wunder-Nett.org
Enrico Scholz enrico.scholz@informatik.tu-chemnitz.de
Erez Zadok ezk@cs.columbia.edu
+Eric Bavier bavier@cray.com
Eric Blake eblake@redhat.com
Eric Dorland eric@debian.org
Eric Magnien emagnien@club-internet.fr
@@ -192,6 +196,7 @@ Joel N. Weber II nemo@koa.iolani.honolulu.hi.us
Joerg-Martin Schwarz jms@jms.prima.ruhr.de
Johan Dahlin jdahlin@async.com.br
Johan Danielsson joda@pdc.kth.se
+Johan Kristensen johankristensen@gmail.com
Johannes Nicolai johannes.nicolai@student.hpi.uni-potsdam.de
John Calcote john.calcote@gmail.com
John F Trudeau JohnTrudeau@firsthealth.com
@@ -286,6 +291,7 @@ Nathanael Nerode neroden@twcny.rr.com
Nelson H. F. Beebe beebe@math.utah.edu
Nicholas Wourms nwourms@netscape.net
Nick Bowler nbowler@elliptictech.com
+Nick Brown brownn@brocade.com
Nicola Fontana ntd@entidi.it
Nicolas Joly njoly@pasteur.fr
Nicolas Thiery nthiery@Icare.mines.edu
diff --git a/bin/Makefile.inc b/bin/Makefile.inc
index 102dec9fc..c63f670b8 100644
--- a/bin/Makefile.inc
+++ b/bin/Makefile.inc
@@ -18,7 +18,14 @@
## ----------------------------------- ##
bin_SCRIPTS = %D%/automake %D%/aclocal
-CLEANFILES += $(bin_SCRIPTS)
+nodist_noinst_SCRIPTS += \
+ %D%/aclocal-$(APIVERSION) \
+ %D%/automake-$(APIVERSION)
+
+CLEANFILES += \
+ $(bin_SCRIPTS) \
+ %D%/aclocal-$(APIVERSION) \
+ %D%/automake-$(APIVERSION)
# Used by maintainer checks and such.
automake_in = $(srcdir)/%D%/automake.in
@@ -54,18 +61,22 @@ uninstall-hook:
# $(datadir) or other do_subst'ituted variables change.
%D%/automake: %D%/automake.in
%D%/aclocal: %D%/aclocal.in
-%D%/automake %D%/aclocal: Makefile %D%/gen-perl-protos
+%D%/automake %D%/aclocal: Makefile
$(AM_V_GEN)rm -f $@ $@-t $@-t2 \
&& $(MKDIR_P) $(@D) \
## Common substitutions.
&& in=$@.in && $(do_subst) <$(srcdir)/$$in >$@-t \
-## Auto-compute prototypes of perl subroutines.
- && $(PERL) -w $(srcdir)/%D%/gen-perl-protos $@-t > $@-t2 \
- && mv -f $@-t2 $@-t \
## We can't use '$(generated_file_finalize)' here, because currently
## Automake contains occurrences of unexpanded @substitutions@ in
## comments, and that is perfectly legit.
&& chmod a+x,a-w $@-t && mv -f $@-t $@
-EXTRA_DIST += %D%/gen-perl-protos
+
+%D%/aclocal-$(APIVERSION): %D%/aclocal
+ $(AM_V_GEN) rm -f $@; \
+ $(LN) %D%/aclocal $@
+
+%D%/automake-$(APIVERSION): %D%/automake
+ $(AM_V_GEN) rm -f $@; \
+ $(LN) %D%/automake $@
# vim: ft=automake noet
diff --git a/bin/aclocal.in b/bin/aclocal.in
index a4535bc47..64fd66233 100644
--- a/bin/aclocal.in
+++ b/bin/aclocal.in
@@ -27,9 +27,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
BEGIN
{
- @Aclocal::perl_libdirs = ('@datadir@/@PACKAGE@-@APIVERSION@')
- unless @Aclocal::perl_libdirs;
- unshift @INC, @Aclocal::perl_libdirs;
+ unshift (@INC, '@datadir@/@PACKAGE@-@APIVERSION@')
+ unless $ENV{AUTOMAKE_UNINSTALLED};
}
use strict;
@@ -69,7 +68,7 @@ $perl_threads = 0;
# ACLOCAL_PATH environment variable, and reset with the '--system-acdir'
# option.
my @user_includes = ();
-my @automake_includes = ("@datadir@/aclocal-$APIVERSION");
+my @automake_includes = ('@datadir@/aclocal-' . $APIVERSION);
my @system_includes = ('@datadir@/aclocal');
# Whether we should copy M4 file in $user_includes[0].
@@ -174,7 +173,26 @@ use constant SCAN_M4_DIRS_ERROR => 2;
# Prototypes for all subroutines.
-#! Prototypes here will automatically be generated by the build system.
+sub add_file ($);
+sub add_macro ($);
+sub check_acinclude ();
+sub install_file ($$);
+sub list_compare (\@\@);
+sub parse_ACLOCAL_PATH ();
+sub parse_arguments ();
+sub reset_maps ();
+sub scan_configure ();
+sub scan_configure_dep ($);
+sub scan_file ($$$);
+sub scan_m4_dirs ($$@);
+sub scan_m4_files ();
+sub strip_redundant_includes (%);
+sub trace_used_macros ();
+sub unlink_tmp (;$);
+sub usage ($);
+sub version ();
+sub write_aclocal ($@);
+sub xmkdir_p ($);
################################################################
@@ -1112,7 +1130,7 @@ sub parse_arguments ()
}
# Finally, adds any directory listed in the 'dirlist' file.
- if (open (DIRLIST, "$system_includes[0]/dirlist"))
+ if (@system_includes && open (DIRLIST, "$system_includes[0]/dirlist"))
{
while (<DIRLIST>)
{
@@ -1147,6 +1165,16 @@ sub parse_ACLOCAL_PATH ()
################################################################
+# Don't refer to installation directories from the build environment
+if (exists $ENV{"AUTOMAKE_UNINSTALLED"})
+ {
+ @automake_includes = ();
+ @system_includes = ();
+ }
+
+@automake_includes = ($ENV{"ACLOCAL_AUTOMAKE_DIR"})
+ if (exists $ENV{"ACLOCAL_AUTOMAKE_DIR"});
+
parse_WARNINGS; # Parse the WARNINGS environment variable.
parse_arguments;
parse_ACLOCAL_PATH;
diff --git a/bin/automake.in b/bin/automake.in
index d356336c3..3433d3de7 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -31,9 +31,8 @@ use strict;
BEGIN
{
- @Automake::perl_libdirs = ('@datadir@/@PACKAGE@-@APIVERSION@')
- unless @Automake::perl_libdirs;
- unshift @INC, @Automake::perl_libdirs;
+ unshift (@INC, '@datadir@/@PACKAGE@-@APIVERSION@')
+ unless $ENV{AUTOMAKE_UNINSTALLED};
# Override SHELL. This is required on DJGPP so that system() uses
# bash, not COMMAND.COM which doesn't quote arguments properly.
@@ -74,14 +73,68 @@ use Automake::Wrap 'makefile_wrap';
use Automake::Language;
use File::Basename;
use File::Spec;
+use List::Util 'none';
use Carp;
## ----------------------- ##
## Subroutine prototypes. ##
## ----------------------- ##
-#! Prototypes here will automatically be generated by the build system.
-
+sub append_exeext (&$);
+sub check_gnits_standards ();
+sub check_gnu_standards ();
+sub check_trailing_slash ($\$);
+sub check_typos ();
+sub define_files_variable ($\@$$);
+sub define_standard_variables ();
+sub define_verbose_libtool ();
+sub define_verbose_texinfo ();
+sub do_check_merge_target ();
+sub get_number_of_threads ();
+sub handle_compile ();
+sub handle_data ();
+sub handle_dist ();
+sub handle_emacs_lisp ();
+sub handle_factored_dependencies ();
+sub handle_footer ();
+sub handle_gettext ();
+sub handle_headers ();
+sub handle_install ();
+sub handle_java ();
+sub handle_languages ();
+sub handle_libraries ();
+sub handle_libtool ();
+sub handle_ltlibraries ();
+sub handle_makefiles_serial ();
+sub handle_man_pages ();
+sub handle_minor_options ();
+sub handle_options ();
+sub handle_programs ();
+sub handle_python ();
+sub handle_scripts ();
+sub handle_silent ();
+sub handle_subdirs ();
+sub handle_tags ();
+sub handle_targets ();
+sub handle_tests ();
+sub handle_tests_dejagnu ();
+sub handle_texinfo ();
+sub handle_user_recursion ();
+sub initialize_per_input ();
+sub lang_lex_finish ();
+sub lang_sub_obj ();
+sub lang_vala_finish ();
+sub lang_yacc_finish ();
+sub locate_aux_dir ();
+sub parse_arguments ();
+sub scan_aclocal_m4 ();
+sub scan_autoconf_files ();
+sub silent_flag ();
+sub transform ($\%);
+sub transform_token ($\%$);
+sub usage ();
+sub version ();
+sub yacc_lex_finish_helper ();
## ----------- ##
## Constants. ##
@@ -472,6 +525,15 @@ my %dep_files;
# This is a list of all targets to run during "make dist".
my @dist_targets;
+# List of all programs, libraries and ltlibraries as returned
+# by am_install_var
+my @proglist;
+my @liblist;
+my @ltliblist;
+# Blacklist of targets (as canonical base name) for which object file names
+# may not be automatically shortened
+my @dup_shortnames;
+
# Keep track of all programs declared in this Makefile, without
# $(EXEEXT). @substitutions@ are not listed.
my %known_programs;
@@ -592,6 +654,11 @@ sub initialize_per_input ()
@dist_common = ();
$handle_dist_run = 0;
+ @proglist = ();
+ @liblist = ();
+ @ltliblist = ();
+ @dup_shortnames = ();
+
%known_programs = ();
%known_libraries = ();
@@ -1230,48 +1297,50 @@ sub check_user_variables
sub handle_languages ()
{
if (! option 'no-dependencies')
- {
- # Include auto-dep code. Don't include it if DEP_FILES would
- # be empty.
- 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);
-
- require_conf_file ("$am_file.am", FOREIGN, 'depcomp');
-
- my @deplist = sort keys %dep_files;
- # Generate each 'include' individually. Irix 6 make will
- # not properly include several files resulting from a
- # variable expansion; generating many separate includes
- # seems safest.
- $output_rules .= "\n";
- foreach my $iter (@deplist)
- {
- $output_rules .= (subst ('AMDEP_TRUE')
- . subst ('am__include')
- . ' '
- . subst ('am__quote')
- . $iter
- . subst ('am__quote')
- . "\n");
- }
-
- # 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");
- }
- }
+ {
+ # Include auto-dep code. Don't include it if DEP_FILES would
+ # be empty.
+ if (keys %extension_seen && keys %dep_files)
+ {
+ my @dep_files = sort keys %dep_files;
+ # Set location of depcomp.
+ define_variable ('depcomp',
+ "\$(SHELL) $am_config_aux_dir/depcomp",
+ INTERNAL);
+ define_variable ('am__maybe_remake_depfiles', 'depfiles', INTERNAL);
+ define_variable ('am__depfiles_remade', "@dep_files", INTERNAL);
+ $output_rules .= "\n";
+ my @dist_rms;
+ foreach my $depfile (@dep_files)
+ {
+ push @dist_rms, "\t-rm -f $depfile";
+ # Generate each 'include' directive individually. Several
+ # make implementations (IRIX 6, Solaris 10, FreeBSD 8) will
+ # fail to properly include several files resulting from a
+ # variable expansion. Just Generating many separate includes
+ # seems thus safest.
+ $output_rules .= subst ('AMDEP_TRUE') .
+ subst ('am__include') .
+ " " .
+ subst('am__quote') .
+ $depfile .
+ subst('am__quote') .
+ " " .
+ "# am--include-marker\n";
+ }
+
+ require_conf_file ("$am_file.am", FOREIGN, 'depcomp');
+
+ $output_rules .= file_contents (
+ 'depend', new Automake::Location,
+ 'DISTRMS' => join ("\n", @dist_rms));
+ }
+ }
else
- {
- define_variable ('depcomp', '', INTERNAL);
- define_variable ('am__depfiles_maybe', '', INTERNAL);
- }
+ {
+ define_variable ('depcomp', '', INTERNAL);
+ define_variable ('am__maybe_remake_depfiles', '', INTERNAL);
+ }
my %done;
@@ -1615,9 +1684,9 @@ sub handle_single_transform
my $renamed = 0;
my ($linker, $object);
- # This records whether we've seen a derived source file (e.g.
- # yacc output).
- my $derived_source = 0;
+ # This records whether we've seen a derived source file (e.g., yacc
+ # or lex output).
+ my $derived_source;
# This holds the 'aggregate context' of the file we are
# currently examining. If the file is compiled with
@@ -1665,17 +1734,36 @@ sub handle_single_transform
# Now extract linker and other info.
$linker = $lang->linker;
- my $this_obj_ext;
- if (defined $source_extension)
- {
- $this_obj_ext = $source_extension;
- $derived_source = 1;
- }
- else
- {
- $this_obj_ext = $obj;
- }
- $object = $base . $this_obj_ext;
+ my $this_obj_ext;
+ if (defined $source_extension)
+ {
+ $this_obj_ext = $source_extension;
+ $derived_source = 1;
+ }
+ else
+ {
+ $this_obj_ext = $obj;
+ $derived_source = 0;
+ # Don't ever place built object files in $(srcdir),
+ # even when sources are specified explicitly as (say)
+ # '$(srcdir)/foo.c' or '$(top_srcdir)/foo.c'.
+ # See automake bug#13928.
+ my @d = split '/', $directory;
+ if (@d > 0 && option 'subdir-objects')
+ {
+ my $d = $d[0];
+ if ($d eq '$(srcdir)' or $d eq '${srcdir}')
+ {
+ shift @d;
+ }
+ elsif ($d eq '$(top_srcdir)' or $d eq '${top_srcdir}')
+ {
+ $d[0] = '$(top_builddir)';
+ }
+ $directory = join '/', @d;
+ }
+ }
+ $object = $base . $this_obj_ext;
if ($have_per_exec_flags)
{
@@ -1683,14 +1771,48 @@ sub handle_single_transform
# object. In this case we rewrite the object's
# name to ensure it is unique.
- # We choose the name 'DERIVED_OBJECT' to ensure
- # (1) uniqueness, and (2) continuity between
- # invocations. However, this will result in a
- # name that is too long for losing systems, in
- # some situations. So we provide _SHORTNAME to
- # override.
-
- my $dname = $derived;
+ # We choose the name 'DERIVED_OBJECT' to ensure (1) uniqueness,
+ # and (2) continuity between invocations. However, this will
+ # result in a name that is too long for losing systems, in some
+ # situations. So we attempt to shorten automatically under
+ # subdir-objects, and provide _SHORTNAME to override as a last
+ # resort. If subdir-object is in effect, it's usually
+ # unnecessary to use the complete 'DERIVED_OBJECT' (that is
+ # often the result from %canon_reldir%/%C% usage) since objects
+ # are placed next to their source file. Generally, this means
+ # it is already unique within that directory (see below for an
+ # exception). Thus, we try to avoid unnecessarily long file
+ # names by stripping the directory components of
+ # 'DERIVED_OBJECT'. This allows avoiding explicit _SHORTNAME
+ # usage in many cases. EXCEPTION: If two (or more) targets in
+ # different directories but with the same base name (after
+ # canonicalization), using target-specific FLAGS, link the same
+ # object, then this logic clashes. Thus, we don't strip if
+ # this is detected.
+ my $dname = $derived;
+ if ($directory ne ''
+ && option 'subdir-objects'
+ && none { $dname =~ /$_$/ } @dup_shortnames)
+ {
+ # At this point, we don't clear information about what
+ # parts of $derived are truly file name components. We can
+ # determine that by comparing against the canonicalization
+ # of $directory.
+ my $dir = $directory . "/";
+ my $cdir = canonicalize ($dir);
+ my $dir_len = length ($dir);
+ # Make sure we only strip full file name components. This
+ # is done by repeatedly trying to find cdir at the
+ # beginning. Each iteration removes one file name
+ # component from the end of cdir.
+ while ($dir_len > 0 && index ($derived, $cdir) != 0)
+ {
+ # Eventually $dir_len becomes 0.
+ $dir_len = rindex ($dir, "/", $dir_len - 2) + 1;
+ $cdir = substr ($cdir, 0, $dir_len);
+ }
+ $dname = substr ($derived, $dir_len);
+ }
my $var = var ($derived . '_SHORTNAME');
if ($var)
{
@@ -1708,8 +1830,7 @@ sub handle_single_transform
$renamed = 1;
}
- # If rewrite said it was ok, put the object into a
- # subdir.
+ # If rewrite said it was ok, put the object into a subdir.
if ($directory ne '')
{
if ($r == LANG_SUBDIR)
@@ -2237,9 +2358,8 @@ sub handle_LIBOBJS_or_ALLOCA
if $relative_dir ne '.';
define_variable ('LIBOBJDIR', "$dir", INTERNAL);
$clean_files{"\$($var)"} = MOSTLY_CLEAN;
- # If LTLIBOBJS is used, we must also clear LIBOBJS (which might
- # be created by libtool as a side-effect of creating LTLIBOBJS).
- $clean_files{"\$($var)"} = MOSTLY_CLEAN if $var =~ s/^LT//;
+ # libtool might create LIBOBJS as a side-effect of using LTLIBOBJS.
+ $clean_files{"\$(LIBOBJS)"} = MOSTLY_CLEAN if $var eq "LTLIBOBJS";
}
else
{
@@ -2412,12 +2532,33 @@ sub handle_libtool ()
LTRMS => join ("\n", @libtool_rms));
}
+# Check for duplicate targets
+sub handle_targets ()
+{
+ my %seen = ();
+ my @dups = ();
+ @proglist = am_install_var ('progs', 'PROGRAMS',
+ 'bin', 'sbin', 'libexec', 'pkglibexec',
+ 'noinst', 'check');
+ @liblist = am_install_var ('libs', 'LIBRARIES',
+ 'lib', 'pkglib', 'noinst', 'check');
+ @ltliblist = am_install_var ('ltlib', 'LTLIBRARIES',
+ 'noinst', 'lib', 'pkglib', 'check');
+
+ # Record duplications that may arise after canonicalization of the
+ # base names, in order to prevent object file clashes in the presence
+ # of target-specific *FLAGS
+ my @targetlist = (@proglist, @liblist, @ltliblist);
+ foreach my $pair (@targetlist)
+ {
+ my $base = canonicalize (basename (@$pair[1]));
+ push (@dup_shortnames, $base) if ($seen{$base});
+ $seen{$base} = $base;
+ }
+}
sub handle_programs ()
{
- my @proglist = am_install_var ('progs', 'PROGRAMS',
- 'bin', 'sbin', 'libexec', 'pkglibexec',
- 'noinst', 'check');
return if ! @proglist;
$must_handle_compiled_objects = 1;
@@ -2504,8 +2645,6 @@ sub handle_programs ()
sub handle_libraries ()
{
- my @liblist = am_install_var ('libs', 'LIBRARIES',
- 'lib', 'pkglib', 'noinst', 'check');
return if ! @liblist;
$must_handle_compiled_objects = 1;
@@ -2614,9 +2753,7 @@ sub handle_libraries ()
sub handle_ltlibraries ()
{
- my @liblist = am_install_var ('ltlib', 'LTLIBRARIES',
- 'noinst', 'lib', 'pkglib', 'check');
- return if ! @liblist;
+ return if ! @ltliblist;
$must_handle_compiled_objects = 1;
my @prefix = am_primary_prefixes ('LTLIBRARIES', 0, 'lib', 'pkglib',
@@ -2709,7 +2846,7 @@ sub handle_ltlibraries ()
skip_ac_subst => 1);
}
- foreach my $pair (@liblist)
+ foreach my $pair (@ltliblist)
{
my ($where, $onelib) = @$pair;
@@ -7773,6 +7910,8 @@ sub generate_makefile
handle_configure ($makefile_am, $makefile_in, $makefile, @inputs);
handle_gettext;
+
+ handle_targets;
handle_libraries;
handle_ltlibraries;
handle_programs;
diff --git a/bin/gen-perl-protos b/bin/gen-perl-protos
deleted file mode 100755
index 215d275b8..000000000
--- a/bin/gen-perl-protos
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env perl
-#
-# Copyright (C) 2013-2017 Free Software Foundation, Inc.
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-use warnings;
-use strict;
-
-my @lines = <>;
-my @protos = map { /^(sub \w+\s*\(.*\))/ ? ("$1;") : () } @lines;
-
-while (defined ($_ = shift @lines))
- {
- if (/^#!.* prototypes/i)
- {
- print "# BEGIN AUTOMATICALLY GENERATED PROTOTYPES\n";
- print join ("\n", sort @protos) . "\n";
- print "# END AUTOMATICALLY GENERATED PROTOTYPES\n";
- }
- else
- {
- print;
- }
- }
diff --git a/bootstrap b/bootstrap
index d0766d4c8..82f3859a2 100755
--- a/bootstrap
+++ b/bootstrap
@@ -37,6 +37,7 @@ export AUTOM4TE # ditto
# Variables to substitute.
VERSION=`sed -ne '/AC_INIT/s/^[^[]*\[[^[]*\[\([^]]*\)\].*$/\1/p' configure.ac`
+APIVERSION=`sed -n 's/^APIVERSION=//p' configure.ac`
PACKAGE=automake
datadir=.
# This should be automatically updated by the 'update-copyright'
@@ -52,10 +53,6 @@ else
BOOTSTRAP_SHELL=/bin/sh
fi
-# Read the rule for calculating APIVERSION and execute it.
-apiver_cmd=`sed -ne 's/\[\[/[/g;s/\]\]/]/g;/^APIVERSION=/p' configure.ac`
-eval "$apiver_cmd"
-
# Sanity checks.
if test -z "$VERSION"; then
echo "$me: cannot find VERSION" >&2
@@ -103,11 +100,8 @@ dosubst automake-$APIVERSION/Automake/Config.in \
dosubst m4/amversion.in m4/amversion.m4
# Create temporary replacement for aclocal and automake.
-for p in bin/aclocal bin/automake; do
- dosubst $p.in $p.tmp
- $PERL -w bin/gen-perl-protos $p.tmp > $p.tmp2
- mv -f $p.tmp2 $p.tmp
-done
+dosubst bin/aclocal.in bin/aclocal.tmp
+dosubst bin/automake.in bin/automake.tmp
# Create required makefile snippets.
$PERL ./gen-testsuite-part > t/testsuite-part.tmp
diff --git a/configure.ac b/configure.ac
index afdfd5c8a..806dcce43 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,7 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
AC_PREREQ([2.69])
-AC_INIT([GNU Automake], [1.15.1a], [bug-automake@gnu.org])
+AC_INIT([GNU Automake], [1.15a], [bug-automake@gnu.org])
AC_CONFIG_SRCDIR([bin/automake.in])
AC_CONFIG_AUX_DIR([lib])
@@ -49,12 +49,7 @@ AC_SUBST([RELEASE_YEAR])
# The API version is the base version. We must guarantee
# compatibility for all releases with the same API version.
-# Our current rule is that:
-# * All releases, including the prereleases, in an X.Y series
-# are compatible. So 1.5.1c is compatible with 1.5.
-# * Prereleases on the trunk are all incompatible -- 1.5b and 1.5c
-# aren't the same.
-APIVERSION=`echo "$VERSION" | sed -e 's/^\([[0-9]]*\.[[0-9]]*[[a-z]]*\).*$/\1/'`
+APIVERSION=1.15a
AC_SUBST([APIVERSION])
AC_SUBST([pkgvdatadir], ["\${datadir}/$PACKAGE-$APIVERSION"])
@@ -67,8 +62,8 @@ AC_SUBST([system_acdir], ["\${datadir}/aclocal"])
# aclocal and automake, hence the remake rules must use those versions
# as well. The extra quoting is to cater to cases when the build
# directory contains whitespace or shell metacharacters.
-ACLOCAL="\"`pwd`/t/wrap/aclocal-$APIVERSION\""
-AUTOMAKE="\"`pwd`/t/wrap/automake-$APIVERSION\""
+ACLOCAL="\"`pwd`/pre-inst-env\" aclocal-$APIVERSION"
+AUTOMAKE="\"`pwd`/pre-inst-env\" automake-$APIVERSION"
AC_PROG_LN_S
@@ -579,14 +574,7 @@ AC_SUBST([EXEEXT])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_LINKS([GNUmakefile:GNUmakefile])
-
-AC_CONFIG_FILES([t/wrap/aclocal-${APIVERSION}:t/wrap/aclocal.in],
- [chmod +x t/wrap/aclocal-${APIVERSION}],
- [APIVERSION=$APIVERSION])
-AC_CONFIG_FILES([t/wrap/automake-${APIVERSION}:t/wrap/automake.in],
- [chmod +x t/wrap/automake-${APIVERSION}],
- [APIVERSION=$APIVERSION])
-
+AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env])
AC_OUTPUT
# Inform the user if this version of automake is a beta release or
diff --git a/doc/Makefile.inc b/doc/Makefile.inc
index b39ce89c7..807c29308 100644
--- a/doc/Makefile.inc
+++ b/doc/Makefile.inc
@@ -32,13 +32,13 @@ man1_MANS = \
$(man1_MANS): $(top_srcdir)/configure.ac
CLEANFILES += $(man1_MANS)
+# XXX: This script should be updated with 'fetch' target.
EXTRA_DIST += %D%/help2man
update_mans = \
$(AM_V_GEN): \
&& $(MKDIR_P) %D% \
- && $(extend_PATH) \
- && $(PERL) $(srcdir)/%D%/help2man --output=$@
+ && ./pre-inst-env $(PERL) $(srcdir)/%D%/help2man --output=$@
%D%/aclocal.1 %D%/automake.1:
$(AM_V_GEN): \
@@ -77,8 +77,7 @@ dist_noinst_DATA += $(amhello_sources)
dist_doc_DATA = $(srcdir)/%D%/amhello-1.0.tar.gz
setup_autotools_paths = { \
- $(extend_PATH) \
- && ACLOCAL=aclocal-$(APIVERSION) && export ACLOCAL \
+ ACLOCAL=aclocal-$(APIVERSION) && export ACLOCAL \
&& AUTOMAKE=automake-$(APIVERSION) && export AUTOMAKE \
&& AUTOCONF='$(am_AUTOCONF)' && export AUTOCONF \
&& AUTOM4TE='$(am_AUTOM4TE)' && export AUTOM4TE \
@@ -97,7 +96,7 @@ $(srcdir)/%D%/amhello-1.0.tar.gz: $(amhello_sources) $(srcdir)/configure.ac
&& $(setup_autotools_paths) \
&& ( \
{ $(AM_V_P) || exec 5>&2 >$$tmp 2>&1; } \
- && $(am_AUTORECONF) -vfi \
+ && $(abs_builddir)/pre-inst-env $(am_AUTORECONF) -vfi \
&& ./configure \
&& $(MAKE) $(AM_MAKEFLAGS) distcheck \
&& $(MAKE) $(AM_MAKEFLAGS) distclean \
diff --git a/doc/automake.texi b/doc/automake.texi
index da0aa2942..dbe222d20 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -2579,6 +2579,11 @@ for more information.
Look for Automake data files in directory @var{dir} instead of in the
installation directory. This is typically used for debugging.
+@vindex AUTOMAKE_LIBDIR
+The environment variable @env{AUTOMAKE_LIBDIR} provides another way to
+set the directory containing Automake data files. However
+@option{--libdir} takes precedence over it.
+
@item --print-libdir
@opindex --print-libdir
Print the path of the installation directory containing Automake-provided
@@ -3216,6 +3221,11 @@ overridden using the @env{AUTOM4TE} environment variable.
Look for the automake-provided macro files in @var{dir} instead of
in the installation directory. This is typically used for debugging.
+@vindex ACLOCAL_AUTOMAKE_DIR
+The environment variable @env{ACLOCAL_AUTOMAKE_DIR} provides another
+way to set the directory containing automake-provided macro files.
+However @option{--automake-acdir} takes precedence over it.
+
@item --system-acdir=@var{dir}
@opindex --system-acdir
Look for the system-wide third-party macro files (and the special
@@ -8576,7 +8586,7 @@ to supply additional flags to @command{configure}, define them in the
provided there by defining the @code{DISTCHECK_CONFIGURE_FLAGS} variable,
on the command line when invoking @command{make}.
@c See automake bug#14991 for more details about how the following holds.
-It's worth nothing that @command{make distcheck} needs complete control
+It's worth noting that @command{make distcheck} needs complete control
over the @command{configure} options @option{--srcdir} and
@option{--prefix}, so those options cannot be overridden by
@code{AM_DISTCHECK_CONFIGURE_FLAGS} nor by
@@ -8896,7 +8906,7 @@ Note however that, for tests based on more complex test protocols,
the exact effects of @code{XFAIL_TESTS} and @code{DISABLE_HARD_ERRORS}
might change, or they might even have no effect at all (for example,
@c Keep this in sync with tap-no-disable-hard-errors.sh
-in tests using TAP, there is not way to disable hard errors, and the
+in tests using TAP, there is no way to disable hard errors, and the
@code{DISABLE_HARD_ERRORS} variable has no effect on them).
@anchor{Testsuite progress on console}
@@ -9164,7 +9174,7 @@ as a side-effect.
It's important to note that, differently from what we've seen for the
serial test harness (@pxref{Serial Test Harness}), the
@code{AM_TESTS_ENVIRONMENT} and @code{TESTS_ENVIRONMENT} variables
-@emph{cannot} be use to define a custom test runner; the
+@emph{cannot} be used to define a custom test runner; the
@code{LOG_COMPILER} and @code{LOG_FLAGS} (or their extension-specific
counterparts) should be used instead:
diff --git a/doc/help2man b/doc/help2man
index e651b8d2d..829a8713b 100755
--- a/doc/help2man
+++ b/doc/help2man
@@ -1,7 +1,8 @@
#!/usr/bin/perl -w
# Generate a short man page from --help and --version output.
-# Copyright (C) 1997-2017 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2009,
+# 2010, 2011, 2012, 2013, 2014, 2015 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -19,14 +20,15 @@
# Written by Brendan O'Dea <bod@debian.org>
# Available from ftp://ftp.gnu.org/gnu/help2man/
-use 5.006;
+use 5.008;
use strict;
use Getopt::Long;
+use Text::ParseWords qw(shellwords);
use Text::Tabs qw(expand);
use POSIX qw(strftime setlocale LC_ALL);
my $this_program = 'help2man';
-my $this_version = '1.40.8';
+my $this_version = '1.47.4';
sub _ { $_[0] }
sub configure_locale
@@ -42,11 +44,16 @@ sub enc_user { $_[0] }
sub kark { die +(sprintf shift, @_), "\n" }
sub N_ { $_[0] }
+sub program_basename;
+sub get_option_value;
+sub convert_option;
+sub fix_italic_spacing;
+
my $version_info = enc_user sprintf _(<<'EOT'), $this_program, $this_version;
GNU %s %s
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2009, 2010,
-2011, 2012 Free Software Foundation, Inc.
+2011, 2012, 2013, 2014, 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@@ -117,18 +124,32 @@ Getopt::Long::config('bundling');
die $help_info unless GetOptions %opt_def and @ARGV == 1;
my %include = ();
+my %replace = ();
my %append = ();
-my @include = (); # retain order given in include file
+my %append_match = ();
+my @sections = (); # retain order of include file or in-line *section*s
# Process include file (if given). Format is:
#
-# [section name]
-# verbatim text
+# Optional initial text, ignored. May include lines starting with `-'
+# which are processed as options.
+#
+# [section]
+# Verbatim text to be included in the named section. By default at
+# the start, but in the case of `name' and `synopsis' the content
+# will replace the autogenerated contents.
#
-# or
+# [<section]
+# Verbatim text to be inserted at the start of the named section.
+#
+# [=section]
+# Verbatim text to replace the named section.
+#
+# [>section]
+# Verbatim text to be appended to the end of the named section.
#
# /pattern/
-# verbatim text
+# Verbatim text for inclusion below a paragraph matching `pattern'.
#
while (@opt_include)
@@ -140,7 +161,7 @@ while (@opt_include)
unless open INC, $inc;
my $key;
- my $hash = \%include;
+ my $hash;
while (<INC>)
{
@@ -155,7 +176,23 @@ while (@opt_include)
$key =~ s/^\s+//;
$key =~ s/\s+$//;
$hash = \%include;
- push @include, $key unless $include{$key};
+ # Handle explicit [<section], [=section] and [>section]
+ if ($key =~ s/^([<>=])\s*//)
+ {
+ if ($1 eq '>') { $hash = \%append; }
+ elsif ($1 eq '=') { $hash = \%replace; }
+ }
+ # NAME/SYNOPSIS replace by default
+ elsif ($key eq _('NAME') or $key eq _('SYNOPSIS'))
+ {
+ $hash = \%replace;
+ }
+ else
+ {
+ $hash = \%include;
+ }
+
+ push @sections, $key;
next;
}
@@ -172,7 +209,7 @@ while (@opt_include)
die "$inc:$.:$@";
}
- $hash = \%append;
+ $hash = \%append_match;
next;
}
@@ -184,48 +221,57 @@ while (@opt_include)
# handle options
if (/^-/)
{
- local @ARGV = split;
+ local @ARGV = shellwords $_;
GetOptions %opt_def;
}
next;
}
- $hash->{$key} ||= '';
$hash->{$key} .= $_;
}
close INC;
kark N_("%s: no valid information found in `%s'"), $this_program, $inc
- unless $key;
+ unless $key;
}
# Compress trailing blank lines.
-for my $hash (\(%include, %append))
+for my $hash (\(%include, %replace, %append, %append_match))
{
for (keys %$hash) { $hash->{$_} =~ s/\n+$/\n/ }
}
-sub get_option_value;
-
# Grab help and version info from executable.
my $help_text = get_option_value $ARGV[0], $help_option;
$version_text ||= get_option_value $ARGV[0], $version_option;
+# By default the generated manual pages will include the current date. This may
+# however be overriden by setting the environment variable $SOURCE_DATE_EPOCH
+# to an integer value of the seconds since the UNIX epoch. This is primarily
+# intended to support reproducible builds (wiki.debian.org/ReproducibleBuilds)
+# and will additionally ensure that the output date string is UTC.
+my $epoch_secs = time;
+if (exists $ENV{SOURCE_DATE_EPOCH} and $ENV{SOURCE_DATE_EPOCH} =~ /^(\d+)$/)
+{
+ $epoch_secs = $1;
+ $ENV{TZ} = 'UTC';
+}
+
# Translators: the following message is a strftime(3) format string, which in
# the English version expands to the month as a word and the full year. It
# is used on the footer of the generated manual pages. If in doubt, you may
# just use %x as the value (which should be the full locale-specific date).
-my $date = enc strftime _("%B %Y"), localtime;
-(my $program = $ARGV[0]) =~ s!.*/!!;
+my $date = enc strftime _("%B %Y"), localtime $epoch_secs;
+my $program = program_basename $ARGV[0];
my $package = $program;
my $version;
if ($opt_output)
{
unlink $opt_output or kark N_("%s: can't unlink %s (%s)"),
- $this_program, $opt_output, $! if -e $opt_output;
+ $this_program, $opt_output, $! if -e $opt_output;
open STDOUT, ">$opt_output"
or kark N_("%s: can't create %s (%s)"), $this_program, $opt_output, $!;
@@ -247,14 +293,14 @@ if ($opt_output)
if (/^(\S+) +\(((?:GNU|Free) +[^)]+)\) +(.*)/ or
/^(\S+) +- *((?:GNU|Free) +\S+) +(.*)/)
{
- $program = $1;
+ $program = program_basename $1;
$package = $2;
$version = $3;
}
elsif (/^((?:GNU|Free) +)?(\S+) +(.*)/)
{
- $program = $2;
- $package = $1 ? "$1$2" : $2;
+ $program = program_basename $2;
+ $package = $1 ? "$1$program" : $program;
$version = $3;
}
else
@@ -262,21 +308,21 @@ else
$version = $_;
}
-$program =~ s!.*/!!;
-
# No info for `info' itself.
$opt_no_info = 1 if $program eq 'info';
+if ($opt_name)
+{
+ # --name overrides --include contents.
+ $replace{_('NAME')} = "$program \\- $opt_name\n";
+}
+
# Translators: "NAME", "SYNOPSIS" and other one or two word strings in all
# upper case are manual page section headings. The man(1) manual page in your
# language, if available should provide the conventional translations.
-for ($include{_('NAME')})
+for ($replace{_('NAME')} || ($include{_('NAME')} ||= ''))
{
- if ($opt_name) # --name overrides --include contents.
- {
- $_ = "$program \\- $opt_name\n";
- }
- elsif ($_) # Use first name given as $program
+ if ($_) # Use first name given as $program
{
$program = $1 if /^([^\s,]+)(?:,?\s*[^\s,\\-]+)*\s+\\?-/;
}
@@ -339,10 +385,11 @@ if ($help_text =~ s/^($PAT_USAGE):( +(\S+))(.*)((?:\n(?: {6}\1| *($PAT_USAGE_CON
s/\\fI$//;
s/^\./\\&./;
+ $_ = fix_italic_spacing $_;
$synopsis .= "$_\n";
}
- $include{_('SYNOPSIS')} ||= $synopsis;
+ $include{_('SYNOPSIS')} .= $synopsis;
}
# Process text, initial section is DESCRIPTION.
@@ -371,13 +418,13 @@ s/\\/\x82/g;
# "(?:[\\w-]+ +)?" in the bug reporting pattern is used to indicate an
# optional word, so that either "Report bugs" or "Report _program_ bugs" will
# be matched.
-my $PAT_BUGS = _('Report +(?:[\w-]+ +)?bugs|Email +bug +reports +to');
-my $PAT_AUTHOR = _('Written +by');
-my $PAT_OPTIONS = _('Options');
-my $PAT_ENVIRONMENT = _('Environment');
-my $PAT_FILES = _('Files');
-my $PAT_EXAMPLES = _('Examples');
-my $PAT_FREE_SOFTWARE = _('This +is +free +software');
+my $PAT_BUGS = _('Report +(?:[\w-]+ +)?bugs|Email +bug +reports +to');
+my $PAT_AUTHOR = _('Written +by');
+my $PAT_OPTIONS = _('Options');
+my $PAT_ENVIRONMENT = _('Environment');
+my $PAT_FILES = _('Files');
+my $PAT_EXAMPLES = _('Examples');
+my $PAT_FREE_SOFTWARE = _('This +is +free +software');
# Start a new paragraph (if required) for these.
s/([^\n])\n($PAT_BUGS|$PAT_AUTHOR) /$1\n\n$2 /og;
@@ -386,33 +433,40 @@ s/([^\n])\n($PAT_BUGS|$PAT_AUTHOR) /$1\n\n$2 /og;
# character.
s/^Copyright +(?:\xa9|\([Cc]\))/Copyright \\(co/mg;
-sub convert_option;
-
while (length)
{
# Convert some standard paragraph names.
- if (s/^($PAT_OPTIONS): *\n//o)
+ if (s/^($PAT_OPTIONS): *\n+//o)
{
$sect = _('OPTIONS');
next;
}
- if (s/^($PAT_ENVIRONMENT): *\n//o)
+ if (s/^($PAT_ENVIRONMENT): *\n+//o)
{
$sect = _('ENVIRONMENT');
next;
}
- if (s/^($PAT_FILES): *\n//o)
+ if (s/^($PAT_FILES): *\n+//o)
{
$sect = _('FILES');
next;
}
- elsif (s/^($PAT_EXAMPLES): *\n//o)
+ elsif (s/^($PAT_EXAMPLES): *\n+//o)
{
$sect = _('EXAMPLES');
next;
}
- # Copyright section
+ # Custom section indicated by a line containing "*Section Name*".
+ if (s/^\*(\w(.*\w)?)\* *\n+//)
+ {
+ $sect = uc $1;
+ $sect =~ tr/*/ /; # also accept *Section*Name*
+ push @sections, $sect;
+ next;
+ }
+
+ # Copyright section.
if (/^Copyright /)
{
$sect = _('COPYRIGHT');
@@ -437,7 +491,6 @@ while (length)
my $indent = $1;
my $prefix = $2;
my $break = '.IP';
- $include{$sect} ||= '';
while (s/^$indent\Q$prefix\E(\S.*)\n*//)
{
$include{$sect} .= "$break\n\\f(CW$prefix$1\\fR\n";
@@ -448,12 +501,11 @@ while (length)
}
my $matched = '';
- $include{$sect} ||= '';
# Sub-sections have a trailing colon and the second line indented.
if (s/^(\S.*:) *\n / /)
{
- $matched .= $& if %append;
+ $matched .= $& if %append_match;
$include{$sect} .= qq(.SS "$1"\n);
}
@@ -463,7 +515,7 @@ while (length)
# Option with description.
if (s/^( {1,10}([+-]\S.*?))(?:( +(?!-))|\n( {20,}))(\S.*)\n//)
{
- $matched .= $& if %append;
+ $matched .= $& if %append_match;
$indent = length ($4 || "$1$3");
$content = ".TP\n\x84$2\n\x84$5\n";
unless ($4)
@@ -476,23 +528,23 @@ while (length)
# Option without description.
elsif (s/^ {1,10}([+-]\S.*)\n//)
{
- $matched .= $& if %append;
+ $matched .= $& if %append_match;
$content = ".HP\n\x84$1\n";
$indent = 80; # not continued
}
# Indented paragraph with tag.
- elsif (s/^( +(\S.*?) +)(\S.*)\n//)
+ elsif (s/^( +(\S.*?))(?:( +)|\n( {20,}))(\S.*)\n//)
{
- $matched .= $& if %append;
- $indent = length $1;
- $content = ".TP\n\x84$2\n\x84$3\n";
+ $matched .= $& if %append_match;
+ $indent = length ($4 || "$1$3");
+ $content = ".TP\n\x84$2\n\x84$5\n";
}
# Indented paragraph.
elsif (s/^( +)(\S.*)\n//)
{
- $matched .= $& if %append;
+ $matched .= $& if %append_match;
$indent = length $1;
$content = ".IP\n\x84$2\n";
}
@@ -501,7 +553,7 @@ while (length)
else
{
s/(.*)\n//;
- $matched .= $& if %append;
+ $matched .= $& if %append_match;
$content = ".PP\n" if $include{$sect};
$content .= "$1\n";
}
@@ -509,7 +561,7 @@ while (length)
# Append continuations.
while ($indent ? s/^ {$indent}(\S.*)\n// : s/^(\S.*)\n//)
{
- $matched .= $& if %append;
+ $matched .= $& if %append_match;
$content .= "\x84$1\n";
}
@@ -523,19 +575,35 @@ while (length)
s/\x84'/\x81/g;
s/\x84//g;
- # Convert options.
- s/(^| |\()(-[][\w=-]+)/$1 . convert_option $2/mge;
+ # Examples should be verbatim.
+ unless ($sect eq _('EXAMPLES'))
+ {
+ # Convert options.
+ s/(^|[ (])(-[][\w=-]+)/$1 . convert_option $2/mge;
+
+ # Italicise filenames: /a/b, $VAR/c/d, ~/e/f
+ s!
+ (^|[ (]) # space/punctuation before
+ (
+ (?:\$\w+|~)? # leading variable, or tilde
+ (?:/\w(?:[\w.-]*\w)?)+ # path components
+ )
+ ($|[ ,;.)]) # space/punctuation after
+ !$1\\fI$2\\fP$3!xmg;
+
+ $_ = fix_italic_spacing $_;
+ }
- # Escape remaining hyphens
+ # Escape remaining hyphens.
s/-/\x83/g;
- if ($sect eq 'COPYRIGHT')
+ if ($sect eq _('COPYRIGHT'))
{
# Insert line breaks before additional copyright messages
# and the disclaimer.
s/\n(Copyright |$PAT_FREE_SOFTWARE)/\n.br\n$1/og;
}
- elsif ($sect eq 'REPORTING BUGS')
+ elsif ($sect eq _('REPORTING BUGS'))
{
# Handle multi-line bug reporting sections of the form:
#
@@ -547,14 +615,14 @@ while (length)
}
# Check if matched paragraph contains /pat/.
- if (%append)
+ if (%append_match)
{
- for my $pat (keys %append)
+ for my $pat (keys %append_match)
{
if ($matched =~ $pat)
{
- $content .= ".PP\n" unless $append{$pat} =~ /^\./;
- $content .= $append{$pat};
+ $content .= ".PP\n" unless $append_match{$pat} =~ /^\./;
+ $content .= $append_match{$pat};
}
}
}
@@ -568,7 +636,6 @@ unless ($opt_no_info)
my $info_page = $opt_info || $program;
$sect = _('SEE ALSO');
- $include{$sect} ||= '';
$include{$sect} .= ".PP\n" if $include{$sect};
$include{$sect} .= sprintf _(<<'EOT'), $program, $program, $info_page;
The full documentation for
@@ -585,6 +652,18 @@ should give you access to the complete manual.
EOT
}
+# Append additional text.
+while (my ($sect, $text) = each %append)
+{
+ $include{$sect} .= $append{$sect};
+}
+
+# Replace sections.
+while (my ($sect, $text) = each %replace)
+{
+ $include{$sect} = $replace{$sect};
+}
+
# Output header.
print <<EOT;
.\\" DO NOT MODIFY THIS FILE! It was generated by $this_program $this_version.
@@ -592,15 +671,17 @@ print <<EOT;
EOT
# Section ordering.
-my @pre = (_('NAME'), _('SYNOPSIS'), _('DESCRIPTION'), _('OPTIONS'),
- _('ENVIRONMENT'), _('FILES'), _('EXAMPLES'));
-
-my @post = (_('AUTHOR'), _('REPORTING BUGS'), _('COPYRIGHT'), _('SEE ALSO'));
-my $filter = join '|', @pre, @post;
+my @pre = (_('NAME'), _('SYNOPSIS'), _('DESCRIPTION'), _('OPTIONS'));
+my @post = (_('ENVIRONMENT'), _('FILES'), _('EXAMPLES'), _('AUTHOR'),
+ _('REPORTING BUGS'), _('COPYRIGHT'), _('SEE ALSO'));
+my %filter = map { $_ => 1 } @pre, @post;
# Output content.
-for my $sect (@pre, (grep ! /^($filter)$/o, @include), @post)
+my %done;
+for my $sect (@pre, (grep !$filter{$_}, @sections), @post)
{
+ next if $done{$sect}++; # ignore duplicates
+ next unless $include{$sect};
if ($include{$sect})
{
my $quote = $sect =~ /\W/ ? '"' : '';
@@ -628,6 +709,15 @@ close STDOUT or kark N_("%s: error writing to %s (%s)"), $this_program,
exit;
+# Get program basename, and strip libtool "lt-" prefix if required.
+sub program_basename
+{
+ local $_ = shift;
+ s!.*/!!;
+ s/^lt-// if $opt_libtool;
+ $_;
+}
+
# Call program with given option and return results.
sub get_option_value
{
@@ -648,7 +738,7 @@ sub get_option_value
kark $err, $this_program, $opt, $prog, $extra;
}
- return $value;
+ $value;
}
# Convert option dashes to \- to stop nroff from hyphenating 'em, and
@@ -667,3 +757,12 @@ sub convert_option
$_;
}
+
+# Insert spacing escape characters \, and \/ before and after italic text. See
+# http://www.gnu.org/software/groff/manual/html_node/Ligatures-and-Kerning.html
+sub fix_italic_spacing
+{
+ local $_ = shift;
+ s!\\fI(.*?)\\f([BRP])!\\fI\\,$1\\/\\f$2!g;
+ return $_;
+}
diff --git a/lib/Automake/Config.in b/lib/Automake/Config.in
index 9437eca9d..a22fdc0f7 100644
--- a/lib/Automake/Config.in
+++ b/lib/Automake/Config.in
@@ -32,7 +32,7 @@ our $PACKAGE = '@PACKAGE@';
our $PACKAGE_BUGREPORT = '@PACKAGE_BUGREPORT@';
our $VERSION = '@VERSION@';
our $RELEASE_YEAR = '@RELEASE_YEAR@';
-our $libdir = '@datadir@/@PACKAGE@-@APIVERSION@';
+our $libdir = $ENV{"AUTOMAKE_LIBDIR"} || '@datadir@/@PACKAGE@-@APIVERSION@';
our $perl_threads = 0;
# We need at least this version for CLONE support.
diff --git a/lib/am/check.am b/lib/am/check.am
index 741a5c0f0..ff174191d 100644
--- a/lib/am/check.am
+++ b/lib/am/check.am
@@ -401,7 +401,7 @@ RECHECK_LOGS = $(TEST_LOGS)
## Running all tests, or rechecking failures. ##
## ------------------------------------------ ##
-check-TESTS:
+check-TESTS: %CHECK_DEPS%
@list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
@list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
## We always have to remove $(TEST_SUITE_LOG), to ensure its rule is run
diff --git a/lib/am/configure.am b/lib/am/configure.am
index 76ecbff5d..ec0b293ad 100644
--- a/lib/am/configure.am
+++ b/lib/am/configure.am
@@ -76,10 +76,10 @@ endif %?TOPDIR_P%
?TOPDIR_P? $(SHELL) ./config.status;; \
?!TOPDIR_P? cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
-## FIXME: $(am__depfiles_maybe) lets us re-run the rule to create the
+## FIXME: $(am__maybe_remake_depfiles) lets us re-run the rule to create the
## .P files. Ideally we wouldn't have to do this by hand.
- echo ' cd $(top_builddir) && $(SHELL) ./config.status %CONFIG-MAKEFILE% $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status %CONFIG-MAKEFILE% $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status %CONFIG-MAKEFILE% $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status %CONFIG-MAKEFILE% $(am__maybe_remake_depfiles);; \
esac;
## Avoid the "deleted header file" problem for the dependencies.
diff --git a/lib/am/dejagnu.am b/lib/am/dejagnu.am
index 75ec97dca..04e97e2b1 100644
--- a/lib/am/dejagnu.am
+++ b/lib/am/dejagnu.am
@@ -33,7 +33,7 @@ check-DEJAGNU: site.exp
## pointless to cause a failure if the tests cannot be run at all.
if $(SHELL) -c "$(RUNTEST) --version" > /dev/null 2>&1; then \
exit_status=0; l='$(DEJATOOL)'; for tool in $$l; do \
- if $(RUNTEST) $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \
+ if $(RUNTEST) $(RUNTESTDEFAULTFLAGS) $(AM_RUNTESTFLAGS) $(RUNTESTFLAGS); \
then :; else exit_status=1; fi; \
done; \
else echo "WARNING: could not find '$(RUNTEST)'" 1>&2; :;\
diff --git a/lib/am/depend.am b/lib/am/depend.am
index e9875f002..8ce0cd4c7 100644
--- a/lib/am/depend.am
+++ b/lib/am/depend.am
@@ -16,12 +16,20 @@
am__mv = mv -f
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+.PHONY: am--depfiles
+
## This Makefile depends on Depdirs' files, so we should never
## erase them in -am or -recursive rules; that would prevent any other
## rules from being recursive (for instance multilib clean rules are
## recursive).
+if %?DISTRMS%
distclean:
- -rm -rf %DEPDIRS%
-
+ %DISTRMS%
maintainer-clean:
- -rm -rf %DEPDIRS%
+ %DISTRMS%
+endif
diff --git a/m4/amversion.m4 b/m4/amversion.m4
index 2a3ffec18..a843427a4 100644
--- a/m4/amversion.m4
+++ b/m4/amversion.m4
@@ -12,10 +12,10 @@
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.15'
+[am__api_version='1.15a'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.15.1a], [],
+m4_if([$1], [1.15a], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -31,7 +31,7 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.15.1a])dnl
+[AM_AUTOMAKE_VERSION([1.15a])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
diff --git a/m4/depout.m4 b/m4/depout.m4
index 5e3f5f768..204d47989 100644
--- a/m4/depout.m4
+++ b/m4/depout.m4
@@ -6,7 +6,6 @@
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
@@ -14,49 +13,41 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
# Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
- case $CONFIG_FILES in
- *\'*) eval set x "$CONFIG_FILES" ;;
- *) set x $CONFIG_FILES ;;
- esac
+ # TODO: see whether this extra hack can be removed once we start
+ # requiring Autoconf 2.70 or later.
+ AS_CASE([$CONFIG_FILES],
+ [*\'*], [eval set x "$CONFIG_FILES"],
+ [*], [set x $CONFIG_FILES])
shift
- for mf
+ # Used to flag and report bootstrapping failures.
+ am_rc=0
+ for am_mf
do
# Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named 'Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
+ am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile which includes
+ # dependency-tracking related rules and includes.
+ # Grep'ing the whole file directly is not great: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`AS_DIRNAME("$mf")`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running 'make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "$am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`AS_DIRNAME(["$file"])`
- AS_MKDIR_P([$dirpart/$fdir])
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
+ sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+ || continue
+ am_dirpart=`AS_DIRNAME(["$am_mf"])`
+ am_filepart=`AS_BASENAME(["$am_mf"])`
+ AM_RUN_LOG([cd "$am_dirpart" \
+ && sed -e '/# am--include-marker/d' "$am_filepart" \
+ | $MAKE -f - am--depfiles]) || am_rc=$?
done
+ if test $am_rc -ne 0; then
+ AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
+ for automatic dependency tracking. Try re-running configure with the
+ '--disable-dependency-tracking' option to at least be able to build
+ the package (albeit without support for automatic dependency tracking).])
+ fi
+ AS_UNSET([am_dirpart])
+ AS_UNSET([am_filepart])
+ AS_UNSET([am_mf])
+ AS_UNSET([am_rc])
+ rm -f conftest-deps.mk
}
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
@@ -65,11 +56,10 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
-# This code is only required when automatic dependency tracking
-# is enabled. FIXME. This creates each '.P' file that we will
-# need in order to bootstrap the dependency handling code.
+# This code is only required when automatic dependency tracking is enabled.
+# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
+# order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
- [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
+ [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
diff --git a/m4/make.m4 b/m4/make.m4
index b3ddca92c..d62dcfb22 100644
--- a/m4/make.m4
+++ b/m4/make.m4
@@ -8,42 +8,35 @@
# AM_MAKE_INCLUDE()
# -----------------
-# Check to see how make treats includes.
+# Check whether make has an 'include' directive that can support all
+# the idioms we need for our automatic dependency tracking code.
AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
+[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
+cat > confinc.mk << 'END'
am__doit:
- @echo this is the am__doit target
+ @echo this is the am__doit target >confinc.out
.PHONY: am__doit
END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
am__include="#"
am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
- am__include=include
- am__quote=
- _am_result=GNU
- ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- case `$am_make -s -f confmf 2> /dev/null` in #(
- *the\ am__doit\ target*)
- am__include=.include
- am__quote="\""
- _am_result=BSD
- ;;
- esac
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+ AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
+ AS_CASE([$?:`cat confinc.out 2>/dev/null`],
+ ['0:this is the am__doit target'],
+ [AS_CASE([$s],
+ [BSD], [am__include='.include' am__quote='"'],
+ [am__include='include' am__quote=''])])
+ if test "$am__include" != "#"; then
+ _am_result="yes ($s style)"
+ break
+ fi
+done
+rm -f confinc.* confmf.*
+AC_MSG_RESULT([${_am_result}])
+AC_SUBST([am__include])])
+AC_SUBST([am__quote])])
diff --git a/m4/python.m4 b/m4/python.m4
index 6d9e93401..bd66aae46 100644
--- a/m4/python.m4
+++ b/m4/python.m4
@@ -38,8 +38,9 @@ AC_DEFUN([AM_PATH_PYTHON],
dnl supported. (2.0 was released on October 16, 2000).
dnl FIXME: Remove the need to hard-code Python versions here.
m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
-[python python2 python3 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python2.7 dnl
- python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0])
+[python python2 python3 python3.6 python3.5 python3.4 python3.3 python3.2 dnl
+ python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 dnl
+ python2.2 python2.1 python2.0])
AC_ARG_VAR([PYTHON], [the Python interpreter])
diff --git a/maintainer/check-perl-protos b/maintainer/check-perl-protos
new file mode 100755
index 000000000..b1d6a72b5
--- /dev/null
+++ b/maintainer/check-perl-protos
@@ -0,0 +1,50 @@
+#!/usr/bin/env perl
+#
+# Copyright (C) 2017 Free Software Foundation, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+use warnings;
+use strict;
+
+my @lines = <>;
+my %forwards = map { /^sub (\w+)\s*\((.*)\);$/ ? ("$1" => "$2") : () } @lines;
+my %subs = map { /^sub (\w+)\s*\((.*)\)$/ ? ("$1" => "$2") : () } @lines;
+my $error_count = 0;
+
+# $subs{"foo"} = "$$";
+# $subs{"bar"} = "@";
+# $forwards{"bar"} = "\$";
+
+# Check that every subroutine has a matching forward declaration with
+# the same prototype.
+foreach my $sub (keys (%subs))
+ {
+ # XXX: The location of the subroutine is not reported.
+ if (grep { $sub eq $_ } keys (%forwards))
+ {
+ if ($forwards{$sub} ne $subs{$sub})
+ {
+ $error_count += 1;
+ warn ("prototype mismatch for \"$sub\" subroutine\n");
+ }
+ }
+ else
+ {
+ $error_count += 1;
+ warn ("missing prototype for \"$sub\" subroutine\n");
+ }
+ }
+
+exit (($error_count == 0) ? 0 : 1);
diff --git a/maintainer/syntax-checks.mk b/maintainer/syntax-checks.mk
index c8b074008..07a12ab6f 100644
--- a/maintainer/syntax-checks.mk
+++ b/maintainer/syntax-checks.mk
@@ -51,6 +51,7 @@ sc_mkinstalldirs \
sc_pre_normal_post_install_uninstall \
sc_perl_no_undef \
sc_perl_no_split_regex_space \
+sc_perl_protos \
sc_cd_in_backquotes \
sc_cd_relative_dir \
sc_perl_at_uscore_in_scalar_context \
@@ -102,6 +103,13 @@ sc_sanity_gnu_grep:
.PHONY: sc_sanity_gnu_grep
$(syntax_check_rules): sc_sanity_gnu_grep
+# Check that every subroutine in perl scripts has a corresponding
+# prototype
+sc_perl_protos:
+ $(AM_V_GEN)$(srcdir)/maintainer/check-perl-protos \
+ <$(srcdir)/bin/aclocal.in && \
+ $(srcdir)/maintainer/check-perl-protos <$(srcdir)/bin/automake.in
+
# These check avoids accidental configure substitutions in the source.
# There are exactly 8 lines that should be modified from automake.in to
# automake, and 9 lines that should be modified from aclocal.in to
diff --git a/t/wrap/aclocal.in b/pre-inst-env.in
index a624bcb16..f285ca62c 100644
--- a/t/wrap/aclocal.in
+++ b/pre-inst-env.in
@@ -1,29 +1,41 @@
-#!@PERL@ -w
-# @configure_input@
-
-# Copyright (C) 2012-2017 Free Software Foundation, Inc.
-
+#! /bin/sh
+# Copyright © 2017 Free Software Foundation, Inc.
+#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
-
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-
+#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-BEGIN
-{
- use strict;
- @Aclocal::perl_libdirs = ('@abs_top_srcdir@/lib');
- unshift @Aclocal::perl_libdirs, '@abs_top_builddir@/lib'
- if '@srcdir@' ne '.';
- unshift @ARGV,
- '--automake-acdir=@abs_top_srcdir@/m4',
- '--system-acdir=@abs_top_srcdir@/m4/acdir';
-}
-require '@abs_top_builddir@/bin/aclocal';
+abs_top_srcdir="@abs_top_srcdir@"
+abs_top_builddir="@abs_top_builddir@"
+
+sep='@PATH_SEPARATOR@';
+
+PERL5LIB="$abs_top_builddir/lib/${sep}$abs_top_srcdir/lib/${PERL5LIB:+${sep}}$PERL5LIB"
+export PERL5LIB
+
+PATH="$abs_top_builddir/bin${sep}$PATH"
+export PATH
+
+# Trigger the use of local modules.
+AUTOMAKE_UNINSTALLED=1
+export AUTOMAKE_UNINSTALLED
+
+AUTOMAKE_LIBDIR="$abs_top_srcdir/lib"
+export AUTOMAKE_LIBDIR
+
+ACLOCAL_AUTOMAKE_DIR="$abs_top_srcdir/m4"
+export ACLOCAL_AUTOMAKE_DIR
+
+ACLOCAL_PATH="$abs_top_srcdir/m4/acdir"
+export ACLOCAL_PATH
+
+exec "$@"
diff --git a/t/Makefile.inc b/t/Makefile.inc
index 708e93397..6b3b62fed 100644
--- a/t/Makefile.inc
+++ b/t/Makefile.inc
@@ -20,13 +20,13 @@
## ------------ ##
# Run the tests with a proper shell detected at configure time.
-LOG_COMPILER = $(AM_TEST_RUNNER_SHELL)
+LOG_COMPILER = ./pre-inst-env $(AM_TEST_RUNNER_SHELL)
TEST_EXTENSIONS = .pl .sh .tap
SH_LOG_COMPILER = $(LOG_COMPILER)
TAP_LOG_COMPILER = $(LOG_COMPILER)
-PL_LOG_COMPILER = $(PERL)
-AM_PL_LOG_FLAGS = -Mstrict -I $(builddir)/lib -I $(srcdir)/lib -w
+PL_LOG_COMPILER = ./pre-inst-env $(PERL)
+AM_PL_LOG_FLAGS = -Mstrict -w
TAP_LOG_DRIVER = AM_TAP_AWK='$(AWK)' $(SHELL) $(srcdir)/lib/tap-driver.sh
@@ -110,10 +110,6 @@ EXTRA_DIST += $(contrib_TESTS)
# "make all". This makes it easier to run the test cases by
# hand after having simply configured and built the package.
-nodist_noinst_SCRIPTS += \
- %D%/wrap/aclocal-$(APIVERSION) \
- %D%/wrap/automake-$(APIVERSION)
-
dist_noinst_DATA += \
%D%/ax/test-init.sh \
%D%/ax/test-lib.sh \
diff --git a/t/ansi2knr-no-more.sh b/t/ansi2knr-no-more.sh
index f9128022b..8c13cd0a3 100644
--- a/t/ansi2knr-no-more.sh
+++ b/t/ansi2knr-no-more.sh
@@ -32,7 +32,7 @@ $ACLOCAL -Wnone 2>stderr && { cat stderr >&2; exit 1; }
cat stderr >&2
grep "^configure\\.ac:5:.*$warn_rx" stderr
-cat aclocal.sav "$am_automake_acdir"/obsolete.m4 > aclocal.m4
+cat aclocal.sav "$am_top_srcdir"/m4/obsolete.m4 > aclocal.m4
$AUTOCONF -Wnone 2>stderr && { cat stderr >&2; exit 1; }
cat stderr >&2
grep "^configure\\.ac:5:.*$warn_rx" stderr
diff --git a/t/ax/test-defs.in b/t/ax/test-defs.in
index 2465c61c1..8cace053b 100644
--- a/t/ax/test-defs.in
+++ b/t/ax/test-defs.in
@@ -55,13 +55,13 @@ case ${am_running_installcheck:=no} in
;;
no)
am_amdir=$am_top_srcdir/lib/am
- am_automake_acdir=$am_top_srcdir/m4
- am_bindir=$am_top_builddir/t/wrap
+ am_automake_acdir=""
+ am_bindir=$am_top_builddir/bin
am_datadir=$am_top_srcdir
am_docdir=$am_top_srcdir/doc
am_pkgvdatadir=$am_top_srcdir/lib
am_scriptdir=$am_top_srcdir/lib
- am_system_acdir=$am_top_srcdir/m4/acdir
+ am_system_acdir=""
;;
*)
echo "$me: variable 'am_running_installcheck' has invalid"
diff --git a/t/depcomp8a.sh b/t/depcomp8a.sh
index 0db7bf6d5..20d162326 100644
--- a/t/depcomp8a.sh
+++ b/t/depcomp8a.sh
@@ -51,10 +51,10 @@ $ACLOCAL
# FIXME: stop disabling the warnings in the 'unsupported' category
# FIXME: once the 'subdir-objects' option has been mandatory.
$AUTOMAKE -a -Wno-unsupported
-grep include Makefile.in # For debugging.
-grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in
-grep 'include.*\./\$(DEPDIR)/bar\.P' Makefile.in
-grep 'include.*/\./\$(DEPDIR)' Makefile.in && exit 1
+grep '\.P' Makefile.in # For debugging.
+grep '\./\$(DEPDIR)/foo\.Po' Makefile.in
+grep '\./\$(DEPDIR)/bar\.Po' Makefile.in
+grep '/\./\$(DEPDIR)' Makefile.in && exit 1
$AUTOCONF
# Don't reject slower dependency extractors, for better coverage.
@@ -68,10 +68,10 @@ DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' $MAKE distcheck
echo AUTOMAKE_OPTIONS = subdir-objects >> Makefile.am
$AUTOMAKE
-grep include Makefile.in # For debugging.
-grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in
-grep 'include.*[^a-zA-Z0-9_/]sub/\$(DEPDIR)/bar\.P' Makefile.in
-$EGREP 'include.*/(\.|sub)/\$\(DEPDIR\)' Makefile.in && exit 1
+grep '\.P' Makefile.in # For debugging.
+grep '\./\$(DEPDIR)/foo\.Po' Makefile.in
+grep '[^a-zA-Z0-9_/]sub/\$(DEPDIR)/bar\.Po' Makefile.in
+$EGREP '/(\.|sub)/\$\(DEPDIR\)' Makefile.in && exit 1
$AUTOCONF
# Don't reject slower dependency extractors, for better coverage.
diff --git a/t/depcomp8b.sh b/t/depcomp8b.sh
index 9f57a2b82..13152f716 100644
--- a/t/depcomp8b.sh
+++ b/t/depcomp8b.sh
@@ -48,10 +48,10 @@ $ACLOCAL
# FIXME: stop disabling the warnings in the 'unsupported' category
# FIXME: once the 'subdir-objects' option has been mandatory.
$AUTOMAKE -a -Wno-unsupported
-grep include Makefile.in # For debugging.
-grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in
-grep 'include.*\./\$(DEPDIR)/bar\.P' Makefile.in
-grep 'include.*/\./\$(DEPDIR)' Makefile.in && exit 1
+grep '\.P' Makefile.in # For debugging.
+grep '\./\$(DEPDIR)/foo\.Plo' Makefile.in
+grep '\./\$(DEPDIR)/bar\.Plo' Makefile.in
+grep '/\./\$(DEPDIR)' Makefile.in && exit 1
$AUTOCONF
# Don't reject slower dependency extractors, for better coverage.
@@ -64,10 +64,10 @@ DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' $MAKE distcheck
echo AUTOMAKE_OPTIONS += subdir-objects >> Makefile.am
$AUTOMAKE
-grep include Makefile.in # For debugging.
-grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in
-grep 'include.*[^a-zA-Z0-9_/]sub/\$(DEPDIR)/bar\.P' Makefile.in
-$EGREP 'include.*/(\.|sub)/\$\(DEPDIR\)' Makefile.in && exit 1
+grep '\.P' Makefile.in # For debugging.
+grep '\./\$(DEPDIR)/foo\.Plo' Makefile.in
+grep '[^a-zA-Z0-9_/]sub/\$(DEPDIR)/bar\.Plo' Makefile.in
+$EGREP '/(\.|sub)/\$\(DEPDIR\)' Makefile.in && exit 1
$AUTOCONF
# Don't reject slower dependency extractors, for better coverage.
diff --git a/t/postproc.sh b/t/depend-postproc.sh
index 2c421765e..9e20b057a 100644
--- a/t/postproc.sh
+++ b/t/depend-postproc.sh
@@ -15,20 +15,22 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Check to make sure we recognize a Makefile.in, even if post-processed
-# and renamed.
+# and renamed. The particularly tricky code for automatic dependency
+# tracking support used to have issues with that.
required=cc
. test-init.sh
-cat >configure.ac <<END
+cat > configure.ac <<END
AC_INIT([$me], [1.0])
AM_INIT_AUTOMAKE
AC_PROG_CC
AC_CONFIG_FILES([myMakefile])
+dnl: AC_CONFIG_LINKS([Makefile:Makefile])
AC_OUTPUT
END
-cat > myMakefile.am << 'END'
+cat > myMakefile.am <<'END'
bin_PROGRAMS = fred
fred_SOURCES = fred.c
END
@@ -45,4 +47,25 @@ cat myMakefile.old >> myMakefile.in
test -f .deps/fred.Po || test -f _deps/fred.Po || exit 1
+$sleep
+
+cat > Makefile <<'END'
+include myMakefile
+END
+
+sed 's/^dnl: *//' configure.ac >t
+mv -f t configure.ac
+
+$MAKE myMakefile Makefile
+
+rm -rf .deps _deps
+./config.status
+
+test ! -e fred.c
+echo 'int main (void) { return 0; }' > fred.c
+
+$MAKE
+test -f .deps/fred.Po || test -f _deps/fred.Po || exit 1
+$MAKE distcheck
+
:
diff --git a/t/extra-sources.sh b/t/extra-sources.sh
index 09e797d5c..51e5e55a1 100644
--- a/t/extra-sources.sh
+++ b/t/extra-sources.sh
@@ -21,7 +21,7 @@
echo AC_PROG_CC >> configure.ac
-cat > Makefile.am << 'END'
+cat > Makefile.am <<'END'
bin_PROGRAMS = www
www_SOURCES = www.c
EXTRA_www_SOURCES = xtra.c
@@ -31,6 +31,7 @@ END
$ACLOCAL
$AUTOMAKE
-grep '@am__include@ .*/xtra\.P' Makefile.in
+grep '@am__include@ .*/xtra\.Po' Makefile.in
+grep '^am__depfiles_remade =.*/xtra.Po' Makefile.in
:
diff --git a/t/get-sysconf.sh b/t/get-sysconf.sh
index 986c1dd36..a768b4769 100644
--- a/t/get-sysconf.sh
+++ b/t/get-sysconf.sh
@@ -55,8 +55,8 @@ $YACC --version || :
$YACC --help || :
cat "$am_top_builddir/config.log" || st=1
-cat "$am_top_builddir/t/wrap/aclocal-$APIVERSION" || st=1
-cat "$am_top_builddir/t/wrap/automake-$APIVERSION" || st=1
+cat "$am_top_builddir/bin/aclocal-$APIVERSION" || st=1
+cat "$am_top_builddir/bin/automake-$APIVERSION" || st=1
if test $st -eq 0; then
# This test SKIPs, so that all the information it has gathered and
diff --git a/t/lex-depend-cxx.sh b/t/lex-depend-cxx.sh
index 1d303a7cb..a20890872 100644
--- a/t/lex-depend-cxx.sh
+++ b/t/lex-depend-cxx.sh
@@ -82,6 +82,11 @@ $AUTOCONF
# using slow dependency extractors.
./configure --enable-dependency-tracking
+# For debugging.
+for f in $(find . -name '*.Po'); do
+ cat $f
+done
+
$MAKE test-deps-exist
$MAKE
diff --git a/t/lex-depend-grep.sh b/t/lex-depend-grep.sh
index ac4c9b3f4..81e61bae8 100644
--- a/t/lex-depend-grep.sh
+++ b/t/lex-depend-grep.sh
@@ -40,7 +40,7 @@ $AUTOMAKE -a
$EGREP '([mj]oe|_[01234]|include|\.P)' Makefile.in # For debugging.
for x in joe moe _0 _1 _2 _3 _4; do
- grep "include.*$x\.Po" Makefile.in
+ $EGREP '\$\(DEPDIR\)/'"$x"'\.Po( |$)' Makefile.in
done
:
diff --git a/t/libobj-no-dependency-tracking.sh b/t/libobj-no-dependency-tracking.sh
new file mode 100644
index 000000000..1f024057e
--- /dev/null
+++ b/t/libobj-no-dependency-tracking.sh
@@ -0,0 +1,56 @@
+#! /bin/sh
+# Copyright (C) 2017 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Ensure that LIBOBJS source files are properly built without dependency
+# tracking when using out of tree builds.
+#
+# This is a non regression test which is following an issue in flex-2.6.4 when
+# "malloc.o" was required, see <https://github.com/westes/flex/issues/244>.
+
+. test-init.sh
+
+# The LIBOBJS are in a separate LIBOBJ_DIR directory without anything else in
+# it to not trigger the creation of the build directory accidentally.
+cat >> configure.ac << 'END'
+AC_PROG_CC
+AC_CONFIG_LIBOBJ_DIR([foo])
+AC_LIBOBJ([foo])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
+bin_PROGRAMS = helldl
+LDADD = $(LIBOBJS)
+.PHONY: dummy
+dummy: $(LIBOBJS)
+END
+
+mkdir foo
+cat > foo/foo.c << 'END'
+int foo() { return 0; }
+END
+
+mkdir build
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+cd build
+../configure --disable-dependency-tracking
+run_make dummy
+:
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index 83e69659e..dab4a7c20 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -38,11 +38,10 @@ t/override-conditional-pr13940.sh \
t/dist-pr109765.sh \
t/instdir-cond2.sh \
t/java-nobase.sh \
+t/libobj-no-dependency-tracking.sh \
t/objext-pr10128.sh \
t/remake-timing-bug-pr8365.sh \
t/lex-subobj-nodep.sh \
-t/subobj-indir-pr13928.sh \
-t/subobj-vpath-pr13928.sh \
t/remake-am-pr10111.sh \
t/remake-m4-pr10111.sh \
$(perl_fake_XFAIL_TESTS)
@@ -392,6 +391,7 @@ t/depend3.sh \
t/depend4.sh \
t/depend5.sh \
t/depend6.sh \
+t/depend-postproc.sh \
t/deprecated-acinit.sh \
t/destdir.sh \
t/dir-named-obj-is-bad.sh \
@@ -603,6 +603,7 @@ t/lflags.sh \
t/lflags-cxx.sh \
t/libexec.sh \
t/libobj-basic.sh \
+t/libobj-no-dependency-tracking.sh \
t/libobj2.sh \
t/libobj3.sh \
t/libobj4.sh \
@@ -867,7 +868,6 @@ t/posixsubst-programs.sh \
t/posixsubst-scripts.sh \
t/posixsubst-sources.sh \
t/posixsubst-tests.sh \
-t/postproc.sh \
t/ppf77.sh \
t/pr2.sh \
t/pr9.sh \
@@ -1064,7 +1064,9 @@ t/subobjname.sh \
t/subobj-clean-pr10697.sh \
t/subobj-clean-lt-pr10697.sh \
t/subobj-indir-pr13928.sh \
+t/subobj-objname-clash.sh \
t/subobj-vpath-pr13928.sh \
+t/subobj-pr13928-more-langs.sh \
t/subpkg.sh \
t/subpkg2.sh \
t/subpkg3.sh \
diff --git a/t/pr224.sh b/t/pr224.sh
index 94bce380a..ddf675541 100644
--- a/t/pr224.sh
+++ b/t/pr224.sh
@@ -56,8 +56,8 @@ cd build
../configure
$MAKE
-test -d foo/.deps
+test -f foo/.deps/main.Po
$MAKE distclean
-test -d foo/.deps && exit 1
+test ! -e foo/.deps/main.Po
:
diff --git a/t/subobj-indir-pr13928.sh b/t/subobj-indir-pr13928.sh
index 3fa45d72b..6564607d5 100644
--- a/t/subobj-indir-pr13928.sh
+++ b/t/subobj-indir-pr13928.sh
@@ -38,7 +38,9 @@ END
mkdir s
echo 'int main(void) { return 0; }' > s/foo.c
-$ACLOCAL && $AUTOCONF && $AUTOMAKE -a || fatal_ "autotools failed"
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
./configure
$MAKE
diff --git a/t/subobj-objname-clash.sh b/t/subobj-objname-clash.sh
new file mode 100644
index 000000000..a33d36bc5
--- /dev/null
+++ b/t/subobj-objname-clash.sh
@@ -0,0 +1,104 @@
+#! /bin/sh
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Make sure that object names don't clash when using subdir-objects.
+# The check is done for clashing programs, clashing libraries and
+# a program that clashes with a library
+
+. test-init.sh
+
+mkdir src
+
+cat >> configure.ac << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects foreign
+noinst_PROGRAMS =
+noinst_LIBRARIES =
+
+# CLASHING PROGRAMS
+noinst_PROGRAMS += foo src/foo
+foo_SOURCES = src/foo.c src/main.c
+foo_CPPFLAGS = -DVAL=0
+src_foo_CPPFLAGS = -DVAL=1
+src_foo_SOURCES = src/foo.c src/main.c
+
+# CLASHING LIBS
+noinst_PROGRAMS += bar src/bar
+noinst_LIBRARIES += libbar.a src/libbar.a
+bar_SOURCES = src/main.c
+bar_LDADD = libbar.a
+src_bar_SOURCES = src/main.c
+src_bar_LDADD = src/libbar.a
+libbar_a_SOURCES = src/foo.c
+libbar_a_CPPFLAGS = -DVAL=0
+src_libbar_a_SOURCES = src/foo.c
+src_libbar_a_CPPFLAGS = -DVAL=1
+
+# CLASHING PROGRAM + LIB
+noinst_PROGRAMS += libzap_a src/zap
+noinst_LIBRARIES += src/libzap.a
+libzap_a_SOURCES = src/main.c src/foo.c
+libzap_a_CPPFLAGS = -DVAL=2
+src_zap_SOURCES = src/main.c
+src_zap_LDADD = src/libzap.a
+src_libzap_a_SOURCES = src/foo.c
+src_libzap_a_CPPFLAGS = -DVAL=3
+
+# NON-CLASHING
+noinst_PROGRAMS += src/foo-uniq
+src_foo_uniq_SOURCES = src/main.c src/foo.c
+src_foo_uniq_CPPFLAGS = -DVAL=4
+END
+
+cat > src/foo.c << 'END'
+int
+foo ()
+{
+ return VAL;
+}
+END
+
+cat > src/main.c << 'END'
+int foo (void);
+
+int
+main ()
+{
+ return foo ();
+}
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+./configure
+$MAKE
+set +e
+./foo || fail_ "./foo should return 0"
+./src/foo; test $? = 1 || fail_ "./src/foo should return 1"
+./bar || fail_ "./bar should return 0"
+./src/bar; test $? = 1 || fail_ "./src/bar should return 1"
+./libzap_a; test $? = 2 || fail_ "./libfoo_a should return 2"
+./src/zap; test $? = 3 || fail_ "./src/prog_libfoo should return 3"
+./src/foo-uniq; test $? = 4 || fail_ "./foo_uniq should return 4"
+set -e
+$MAKE clean
diff --git a/t/subobj-pr13928-more-langs.sh b/t/subobj-pr13928-more-langs.sh
new file mode 100644
index 000000000..323e24899
--- /dev/null
+++ b/t/subobj-pr13928-more-langs.sh
@@ -0,0 +1,138 @@
+#! /bin/sh
+# Copyright (C) 2015 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Expose part of automake bug#13928, also for non-C languages: if the
+# subdir-objects option is in use and a source file is listed in a
+# _SOURCES variable with a leading $(srcdir) component, Automake will
+# generate a Makefile that tries to create the corresponding object
+# file in $(srcdir) as well.
+
+required='cc c++ fortran77 fortran'
+. test-init.sh
+
+cat >> configure.ac <<'END'
+AC_PROG_CC
+AC_PROG_CXX
+AC_PROG_F77
+AC_PROG_FC
+AM_CONDITIONAL([OBVIOUS], [:])
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+AUTOMAKE_OPTIONS = subdir-objects
+SUBDIRS = sub
+
+LESS = m/o/r/e
+
+noinst_PROGRAMS = test test2
+test_SOURCES = $(srcdir)/test.f90
+
+test2_SOURCES = $(indir)
+
+indir = ${indir2} $(empty)
+indir2 =
+if OBVIOUS
+indir2 += ${srcdir}/$(LESS)///test.f
+else
+endif
+
+test-objs:
+ ls -la @srcdir@ .
+ :
+ test ! -f @srcdir@/test.$(OBJEXT)
+ test -f test.$(OBJEXT)
+ test ! -f @srcdir@/m/o/r/e/test.$(OBJEXT)
+ test -f m/o/r/e/test.$(OBJEXT)
+ :
+ test ! -f @srcdir@/bar.$(OBJEXT)
+ test -f bar.$(OBJEXT)
+ test ! -f @srcdir@/baz.$(OBJEXT)
+ test -f baz.$(OBJEXT)
+ :
+ test ! -d @srcdir@/$(DEPDIR)
+ test ! -d @srcdir@/m/o/r/e/$(DEPDIR)
+ test -d $(DEPDIR)
+ test -d m/o/r/e/$(DEPDIR)
+
+check-local: test-objs
+END
+
+mkdir sub
+cat > sub/Makefile.am <<'END'
+AUTOMAKE_OPTIONS = subdir-objects
+bin_PROGRAMS = foo
+foo = baz
+foo_SOURCES = foo.h \
+ $(top_srcdir)/bar.cc \
+ ${top_srcdir}/$(foo).c
+END
+
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+mkfiles='Makefile.in sub/Makefile.in'
+$EGREP '(test|ba[rz])\.|DEPDIR|dirstamp|srcdir' $mkfiles # For debugging.
+$EGREP '\$.(top_)?srcdir./(test|ba[rz]|\$.foo.)\.[o$]' $mkfiles && exit 1
+$FGREP '\$.(top_)?srcdir./.*$(am__dirstamp)' $mkfiles && exit 1
+$FGREP '\$.(top_)?srcdir./.*$(DEPDIR)' $mkfiles && exit 1
+
+cat > test.f90 <<'EOF'
+ program foo
+ stop
+ end
+EOF
+
+mkdir -p m/o/r/e
+cp test.f90 m/o/r/e/test.f
+
+cat > sub/foo.h <<'END'
+#ifdef __cplusplus
+extern "C"
+#endif
+int foo (void);
+END
+
+cat > bar.cc <<'END'
+#include "foo.h"
+#include <iostream>
+int main (void)
+{
+ std::cout << "OK!" << "\n";
+ return foo ();
+}
+END
+
+cat > baz.c <<'END'
+#include "foo.h"
+int foo (void)
+{
+ return 0;
+}
+END
+
+mkdir build
+cd build
+../configure
+
+$MAKE
+$MAKE test-objs
+$MAKE distcheck
+
+:
diff --git a/t/subobj-vpath-pr13928.sh b/t/subobj-vpath-pr13928.sh
index 0d4c2433d..9af7502bf 100644
--- a/t/subobj-vpath-pr13928.sh
+++ b/t/subobj-vpath-pr13928.sh
@@ -22,39 +22,106 @@
required=cc
. test-init.sh
-cat >> configure.ac << 'END'
+cat >> configure.ac <<'END'
AC_PROG_CC
AM_PROG_CC_C_O
+AM_CONDITIONAL([OBVIOUS], [:])
+AC_CONFIG_FILES([sub/Makefile])
AC_OUTPUT
END
cat > Makefile.am <<'END'
AUTOMAKE_OPTIONS = subdir-objects
-noinst_PROGRAMS = test
+SUBDIRS = sub
+
+LESS = more
+
+noinst_PROGRAMS = test test2
test_SOURCES = $(srcdir)/test.c
+
+test2_SOURCES = $(indir)
+
+indir =
+if OBVIOUS
+indir += ${srcdir}/$(LESS)/test.c
+else
+endif
+
test-objs:
- test ! -f $(srcdir)/test.$(OBJEXT)
+ ls -la @srcdir@ .
+ :
+ test ! -f @srcdir@/test.$(OBJEXT)
test -f test.$(OBJEXT)
+ test ! -f @srcdir@/more/test.$(OBJEXT)
+ test -f more/test.$(OBJEXT)
+ :
+ test ! -f @srcdir@/bar.$(OBJEXT)
+ test -f bar.$(OBJEXT)
+ test ! -f @srcdir@/baz.$(OBJEXT)
+ test -f baz.$(OBJEXT)
+ :
+ test ! -d @srcdir@/$(DEPDIR)
+ test ! -d @srcdir@/more/$(DEPDIR)
+ test -d $(DEPDIR)
+ test -d more/$(DEPDIR)
+
+check-local: test-objs
+END
+
+mkdir sub
+cat > sub/Makefile.am <<'END'
+AUTOMAKE_OPTIONS = subdir-objects
+bin_PROGRAMS = foo
+foo_SOURCES = foo.h \
+ $(top_srcdir)/bar.c \
+ ${top_srcdir}/baz.c
+END
+
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+mkfiles='Makefile.in sub/Makefile.in'
+$EGREP '(test|ba[rz])\.|DEPDIR|dirstamp|srcdir' $mkfiles # For debugging.
+$EGREP '\$.(top_)?srcdir./(test|ba[rz])\.[o$]' $mkfiles && exit 1
+$FGREP '\$.(top_)?srcdir./.*$(am__dirstamp)' $mkfiles && exit 1
+$FGREP '\$.(top_)?srcdir./.*$(DEPDIR)' $mkfiles && exit 1
+
+cat > test.c <<'END'
+int main (void)
+{
+ return 0;
+}
END
-$ACLOCAL && $AUTOCONF && $AUTOMAKE -a || fatal_ "autotools failed"
+mkdir more
+cp test.c more/test.c
-$EGREP 'test\.|DEPDIR|dirstamp|srcdir' Makefile.in || : # For debugging.
-$EGREP '\$.srcdir./test\.[o$]' Makefile.in && exit 1
-$EGREP '$(srcdir)/$(am__dirstamp)' Makefile.in && exit 1
-$EGREP '$(srcdir)/$(DEPDIR)' && exit 1
+echo 'int foo (void);' > sub/foo.h
-cat > test.c << 'END'
+cat > bar.c <<'END'
+#include "foo.h"
int main (void)
{
+ return foo ();
+}
+END
+
+cat > baz.c <<'END'
+#include "foo.h"
+int foo (void)
+{
return 0;
}
END
-mkdir build && cd build || fatal "preparation of build directory failed"
-../configure || fatal_ "./configure failed"
+mkdir build
+cd build
+../configure
$MAKE
$MAKE test-objs
+$MAKE distcheck
:
diff --git a/t/subobj11b.sh b/t/subobj11b.sh
index 1fb280e3d..d28ab4b85 100644
--- a/t/subobj11b.sh
+++ b/t/subobj11b.sh
@@ -56,9 +56,9 @@ END
$ACLOCAL
$AUTOMAKE -a
-# Be lax in the regexp, to account for automake conditionals, the
-# use of @am__include@, and similar stuff.
-grep 'include.*//.*foobar' Makefile.in && exit 1
+grep '\.P' Makefile.in # For debugging.
+
+grep '//.*foobar\.P' Makefile.in && exit 1
# These checks depend on automake internals, but presently this is
# the only way to test the code path we are interested in.
@@ -71,12 +71,12 @@ for x in zardoz0 zardoz1 path/to/zardoz2 another/path/to/zardoz3; do
esac
# Be a little lax in the regexp, to account for automake conditionals,
# quoting, and similar stuff.
- grep "^[^/]*am__include[^/]*//server/$d\\\$(DEPDIR)/$b\\.[^/]*$" Makefile.in
+ grep "[ ]//server/$d\\\$(DEPDIR)/$b\\.Po" Makefile.in
done
# Sanity checks.
for i in 0 1 2 3 4 5 6 7 8 9; do
- grep "am__include.*/foobar$i\\." Makefile.in
+ grep "\$(DEPDIR)/foobar$i\\.Po" Makefile.in
done
:
diff --git a/t/subobj11c.sh b/t/subobj11c.sh
index fb60b1ff6..36bbf9c5f 100644
--- a/t/subobj11c.sh
+++ b/t/subobj11c.sh
@@ -43,6 +43,6 @@ $AUTOMAKE -a
#
# FIXME: Are we sure this is the most sensible output in our situation?
#
-grep '^[^/]*am__include[^/]*//\$(DEPDIR)/zardoz\.[^/]*$' Makefile.in
+grep 'am__depfiles_remade =.* //\$(DEPDIR)/zardoz\.Po' Makefile.in
:
diff --git a/t/wrap/automake.in b/t/wrap/automake.in
deleted file mode 100644
index 1075346a1..000000000
--- a/t/wrap/automake.in
+++ /dev/null
@@ -1,27 +0,0 @@
-#!@PERL@ -w
-# @configure_input@
-
-# Copyright (C) 2012-2017 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-BEGIN
-{
- use strict;
- @Automake::perl_libdirs = ('@abs_top_srcdir@/lib');
- unshift @Automake::perl_libdirs, '@abs_top_builddir@/lib'
- if '@srcdir@' ne '.';
- unshift @ARGV, '--libdir=@abs_top_srcdir@/lib';
-}
-require '@abs_top_builddir@/bin/automake';