summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2014-12-28 19:13:40 +0100
committerStefano Lattarini <stefano.lattarini@gmail.com>2014-12-28 19:13:40 +0100
commit8e29fa6bb50d9ab4a8a263c96c51efaa98b169e3 (patch)
tree5949a611b1a24e5df42021cc2ec74fed0039cb9c
parent85aae58a93a52ce848346797690cf42b73ca9566 (diff)
parentadc17cc491e2b6b1d5e0e966c6f03fed3573b980 (diff)
downloadautomake-8e29fa6bb50d9ab4a8a263c96c51efaa98b169e3.tar.gz
Merge branch 'master' into ng/master
* master: tests: make script 'shell-no-trail-bslash' simpler and more robust texinfo: remove hack about info files in CLEANFILES variables Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
-rw-r--r--NEWS22
-rw-r--r--bin/automake.in66
-rw-r--r--t/ax/shell-no-trail-bslash.in8
-rw-r--r--t/mdate5.sh51
-rw-r--r--t/self-check-shell-no-trail-bslash.sh32
-rw-r--r--t/txinfo-clean.sh1
-rw-r--r--t/txinfo23.sh69
-rw-r--r--t/txinfo24.sh83
-rw-r--r--t/txinfo25.sh116
-rw-r--r--t/txinfo28.sh89
10 files changed, 100 insertions, 437 deletions
diff --git a/NEWS b/NEWS
index 3d8b363b9..bb011a882 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,26 @@ New in 2.0:
and later will *unconditionally* behave as older Automake versions did
when the 'subdir-objects' option was given.
+* Texinfo support:
+
+ - Automake used to implement an undocumented hack causing '.info' files
+ that appeared to be cleaned (by e.g. being listed in the CLEANFILES
+ variable) to also be built in the builddir rather than in the srcdir;
+ this was for backward compatibility with packages such as Texinfo,
+ which did things like:
+
+ info_TEXINFOS = texinfo.txi info-stnd.texi info.texi
+ DISTCLEANFILES = texinfo texinfo-* info*.info*
+ # Do not create info files for distribution.
+ dist-info:
+ @:
+
+ in order not to distribute .info files.
+
+ Now that we have the 'info-in-builddir' option that explicitly causes
+ generated '.info' files to be placed in the builddir, this hack is no
+ longer necessary. We have thus removed\ it.
+
* Aclocal search path:
- Third-party m4 files located in the system-wide aclocal directory,
@@ -308,7 +328,7 @@ New in 1.14:
Now that we have the 'info-in-builddir' option that explicitly causes
generated '.info' files to be placed in the builddir, this hack should
be longer necessary, so we deprecate it with runtime warnings. It will
- likely be removed altogether in Automake 2.0.
+ be removed altogether in Automake 2.0.
* Relative directory in Makefile fragments:
diff --git a/bin/automake.in b/bin/automake.in
index d699ec6ee..6f08c4b99 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -2560,15 +2560,6 @@ sub handle_texinfo_helper
my %versions;
my $done = 0;
- # Build a regex matching user-cleaned files.
- my $d = var 'DISTCLEANFILES';
- my $c = var 'CLEANFILES';
- my @f = ();
- push @f, $d->value_as_list_recursive (inner_expand => 1) if $d;
- push @f, $c->value_as_list_recursive (inner_expand => 1) if $c;
- @f = map { s|[^A-Za-z_0-9*\[\]\-]|\\$&|g; s|\*|[^/]*|g; $_; } @f;
- my $user_cleaned_files = '^(?:' . join ('|', @f) . ')$';
-
foreach my $texi
($info_texinfos->value_as_list_recursive (inner_expand => 1))
{
@@ -2599,6 +2590,7 @@ sub handle_texinfo_helper
# generic rules.
my $outdir = dirname ($texi) . '/';
$outdir = "" if $outdir eq './';
+ my $src_outdir = '$(srcdir)/'. $outdir;
$out_file = $outdir . $out_file;
# Until Automake 1.6.3, .info files were built in the
@@ -2689,54 +2681,22 @@ sub handle_texinfo_helper
# Consequently, starting with Automake 1.8, .info files are
# built in the source tree again. Because we still plan to
# support non-distributed .info files at some point, we
- # have a single variable ($INSRC) that controls whether
+ # have a single variable ('$insrc') that controls whether
# the current .info file must be built in the source tree
# or in the build tree. Actually this variable is switched
- # off in two cases:
- # (1) For '.info' files that appear to be cleaned; this is for
- # backward compatibility with package such as Texinfo,
- # which do things like
- # info_TEXINFOS = texinfo.txi info-stnd.texi info.texi
- # DISTCLEANFILES = texinfo texinfo-* info*.info*
- # # Do not create info files for distribution.
- # dist-info:
- # in order not to distribute .info files.
- # (2) When the undocumented option 'info-in-builddir' is given.
- # This is done to allow the developers of GCC, GDB, GNU
- # binutils and the GNU bfd library to force the '.info' files
- # to be generated in the builddir rather than the srcdir, as
- # was once done when the (now removed) 'cygnus' option was
- # given. See automake bug#11034 for more discussion.
- my $insrc = 1;
- my $soutdir = '$(srcdir)/' . $outdir;
-
- if (option 'info-in-builddir')
- {
- $insrc = 0;
- }
- elsif ($out_file =~ $user_cleaned_files)
- {
- $insrc = 0;
- msg 'obsolete', "$am_file.am", <<EOF;
-Oops!
- It appears this file (or files included by it) are triggering
- an undocumented, soon-to-be-removed automake hack.
- Future automake versions will no longer place in the builddir
- (rather than in the srcdir) the generated '.info' files that
- appear to be cleaned, by e.g. being listed in CLEANFILES or
- DISTCLEANFILES.
- If you want your '.info' files to be placed in the builddir
- rather than in the srcdir, you have to use the shiny new
- 'info-in-builddir' automake option.
-EOF
- }
-
- $outdir = $soutdir if $insrc;
+ # off when the automake option 'info-in-builddir' is given.
+ # This is done to allow the developers of GCC, GDB, GNU
+ # binutils and the GNU bfd library to force the '.info' files
+ # to be generated in the builddir rather than the srcdir, as
+ # was once done when the (now removed) 'cygnus' option was
+ # given. See automake bug#11034 for more discussion.
+ my $insrc = ! option 'info-in-builddir';
+ $outdir = $src_outdir if $insrc;
# If user specified file_TEXINFOS, then use that as explicit
# dependency list.
@texi_deps = ();
- push (@texi_deps, "${soutdir}${vtexi}") if $vtexi;
+ push (@texi_deps, "${src_outdir}${vtexi}") if $vtexi;
my $canonical = canonicalize ($infobase);
if (var ($canonical . "_TEXINFOS"))
@@ -2783,8 +2743,8 @@ EOF
new Automake::Location,
TEXI => $texi,
VTI => $vti,
- STAMPVTI => "${soutdir}stamp-$vti",
- VTEXI => "${soutdir}${vtexi}");
+ STAMPVTI => "${src_outdir}stamp-$vti",
+ VTEXI => "${src_outdir}$vtexi");
}
}
diff --git a/t/ax/shell-no-trail-bslash.in b/t/ax/shell-no-trail-bslash.in
index 82217e564..353d4cde1 100644
--- a/t/ax/shell-no-trail-bslash.in
+++ b/t/ax/shell-no-trail-bslash.in
@@ -58,10 +58,10 @@ am_SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'}
case "$shell_command" in
*\\)
- printf '%s\n' "$0: recipe ends with backslash character" >&2
- printf '%s\n' "=== BEGIN recipe" >&2
- printf '%s\n' "${am_shell_command-}" >&2
- printf '%s\n' "=== END recipe" >&2
+ printf '%s\n' "$0: recipe/script ends with backslash character" >&2
+ printf '%s\n' "=== BEGIN recipe/script" >&2
+ printf '%s\n' "${shell_command-???}" >&2
+ printf '%s\n' "=== END recipe/script" >&2
exit 1
;;
esac
diff --git a/t/mdate5.sh b/t/mdate5.sh
index 89ee0c439..108569ea9 100644
--- a/t/mdate5.sh
+++ b/t/mdate5.sh
@@ -21,25 +21,36 @@ am_create_testdir=empty
get_shell_script mdate-sh
-set x $(./mdate-sh mdate-sh)
-shift
-echo "$*" # For debugging.
-
-# Check that mdate output looks like a date:
-test $# = 3
-case $1$3 in *[!0-9]*) exit 1;; esac
-test $1 -lt 32
-# Hopefully automake will be obsolete in 80 years ;-)
-case $3 in 20[0-9][0-9]) :;; *) exit 1;; esac
-case $2 in
- January|February|March|April|May|June|July|August) ;;
- September|October|November|December) ;;
- *) exit 1
-esac
-
-# Stricter checks on the year required a POSIX date(1) command.
-if year=$(date +%Y) && test $year -gt 2010; then
- test $year = $3 || exit 1
-fi
+year=$(date +%Y) && test $year -gt 2010 || year=NONE
+
+do_checks ()
+{
+ set x $(./mdate-sh mdate-sh)
+ shift
+ echo "$*" # For debugging.
+
+ # Check that mdate output looks like a date.
+ test $# = 3 || exit 1
+ case $1$3 in *[!0-9]*) exit 1;; esac
+ test $1 -lt 32 || exit 1
+ # Hopefully automake will be obsolete in 80 years ;-)
+ case $3 in 20[0-9][0-9]) :;; *) exit 1;; esac
+ case $2 in
+ January|February|March|April|May|June|July|August) ;;
+ September|October|November|December) ;;
+ *) exit 1
+ esac
+
+ # Stricter checks on the year require a POSIX date(1) command.
+ test $year = NONE || test $year = $3 || exit 1
+}
+
+TIME_STYLE=; unset TIME_STYLE
+do_checks
+
+# This setting, when honored by GNU ls, used to cause an infinite
+# loop in mdate-sh.
+TIME_STYLE="+%Y-%m-%d %H:%M:%S"; export TIME_STYLE
+do_checks
:
diff --git a/t/self-check-shell-no-trail-bslash.sh b/t/self-check-shell-no-trail-bslash.sh
index 75732a2fb..b5a1896ba 100644
--- a/t/self-check-shell-no-trail-bslash.sh
+++ b/t/self-check-shell-no-trail-bslash.sh
@@ -31,12 +31,42 @@ bad:
END
SHELL=$am_testaux_builddir/shell-no-trail-bslash
+
$SHELL -c 'exit 0'
test "$($SHELL -c 'echo is o\k')" = "is ok"
+echo 'echo is ok\"' > ok.sh
+$SHELL ./ok.sh
+test "$($SHELL ./ok.sh)" = "is ok\""
+
+tab=' '
+nl='
+'
+for sfx in \
+ '\' \
+ '\\' \
+ '\\\\\' \
+ '\ ' \
+ "\\$tab" \
+ "\\ $tab$tab " \
+ "\\$nl" \
+ "\\ $nl " \
+ "\\$nl$nl$nl" \
+; do
+ for pfx in "" "echo bad" ": a${nl}# multine${nl}: text"; do
+ cmd=${pfx}${sfx}
+ printf '%s\n' "$cmd" > bad.sh
+ for args in '-c "$cmd"' './bad.sh'; do
+ eval "\$SHELL $args 2>stderr && { cat stderr >&2; exit 1; }; :"
+ cat stderr >&2
+ $FGREP "recipe/script ends with backslash character" stderr
+ done
+ done
+done
+
$MAKE good
run_make -E -e FAIL bad SHELL="$SHELL"
-$FGREP "recipe ends with backslash character" stderr
+$FGREP "recipe/script ends with backslash character" stderr
:
diff --git a/t/txinfo-clean.sh b/t/txinfo-clean.sh
index b936e410e..f5e874565 100644
--- a/t/txinfo-clean.sh
+++ b/t/txinfo-clean.sh
@@ -15,7 +15,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# DVIS, PDFS, PSS, HTMLS should not be cleaned upon 'mostlyclean'.
-# Similar to txinfo25.sh.
required='makeinfo tex texi2dvi dvips'
. test-init.sh
diff --git a/t/txinfo23.sh b/t/txinfo23.sh
deleted file mode 100644
index e71fc5745..000000000
--- a/t/txinfo23.sh
+++ /dev/null
@@ -1,69 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2002-2014 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/>.
-
-# Check that info files are built in builddir when needed.
-# Test with subdir Texinfo.
-# (Similar to txinfo13.sh, plus DISTCLEANFILES).
-# (See also txinfo24.sh and txinfo25.sh).
-
-required='makeinfo tex texi2dvi'
-. test-init.sh
-
-cat >> configure.ac << 'END'
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-DISTCLEANFILES = subdir/*.info*
-info_TEXINFOS = subdir/main.texi
-subdir_main_TEXINFOS = subdir/inc.texi
-
-installcheck-local:
- test -f "$(infodir)/main.info"
-END
-
-mkdir subdir
-
-cat > subdir/main.texi << 'END'
-\input texinfo
-@setfilename main.info
-@settitle main
-@node Top
-Hello walls.
-@include version.texi
-@include inc.texi
-@bye
-END
-
-cat > subdir/inc.texi << 'END'
-I'm included.
-END
-
-$ACLOCAL
-$AUTOCONF
-
-AUTOMAKE_run --add-missing -Wno-error
-grep "Makefile\.am:.*undocumented.* automake hack" stderr
-grep "Makefile\.am:.*'info-in-builddir' automake option" stderr
-
-mkdir build
-cd build
-../configure
-$MAKE distcheck
-test -f subdir/main.info
-test ! -e ../subdir/main.info
-
-:
diff --git a/t/txinfo24.sh b/t/txinfo24.sh
deleted file mode 100644
index df202a8fa..000000000
--- a/t/txinfo24.sh
+++ /dev/null
@@ -1,83 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2002-2014 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/>.
-
-# Check that info files are built in builddir when needed.
-# (Similar to txinfo16.sh, plus CLEANFILES).
-# (See also txinfo23.sh and txinfo25.sh).
-
-required='makeinfo tex texi2dvi'
-. test-init.sh
-
-cat >> configure.ac << 'END'
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-CLEANFILES = main.info
-info_TEXINFOS = main.texi
-END
-
-cat > main.texi << 'END'
-\input texinfo
-@setfilename main.info
-@settitle main
-@node Top
-Hello walls.
-@include version.texi
-@bye
-END
-
-$ACLOCAL
-$AUTOMAKE --add-missing -Wno-obsolete
-$AUTOCONF
-
-mkdir build
-cd build
-../configure
-$MAKE
-test ! -e ../main.info
-test -f main.info
-
-cd ..
-rm -rf build
-./configure
-$MAKE
-test -f main.info
-
-# Make sure stamp-vti is older that version.texi.
-# (A common situation in a real tree).
-test -f stamp-vti
-test -f version.texi
-$sleep
-touch stamp-vti
-
-$MAKE distclean
-test -f stamp-vti
-test -f version.texi
-
-mkdir build
-cd build
-../configure
-$MAKE
-# main.info should be rebuilt in the current directory.
-test -f main.info
-test ! -e ../main.info
-$MAKE dvi
-test -f main.dvi
-
-$MAKE distcheck
-
-:
diff --git a/t/txinfo25.sh b/t/txinfo25.sh
deleted file mode 100644
index 8d7f12748..000000000
--- a/t/txinfo25.sh
+++ /dev/null
@@ -1,116 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2003-2014 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/>.
-
-# Check that info files are built in builddir and in srcdir can safely
-# co-exist. This setup is obtained by having two info files, only one
-# of which being cleaned.
-# (Similar to txinfo16.sh, plus CLEANFILES).
-# (See also txinfo23.sh and txinfo24.sh).
-
-required='makeinfo tex texi2dvi'
-. test-init.sh
-
-cat >> configure.ac << 'END'
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-CLEANFILES = [a-m]*.info
-info_TEXINFOS = main.texi other.texi
-END
-
-cat > main.texi << 'END'
-\input texinfo
-@setfilename main.info
-@settitle main
-@node Top
-Hello walls.
-@include version.texi
-@bye
-END
-
-cat > other.texi << 'END'
-\input texinfo
-@setfilename other.info
-@settitle other
-@node Top
-Hello walls.
-@include version2.texi
-@bye
-END
-
-$ACLOCAL
-$AUTOCONF
-
-AUTOMAKE_fails --add-missing
-grep "Makefile\.am:.*undocumented.* automake hack" stderr
-grep "Makefile\.am:.*'info-in-builddir' automake option" stderr
-
-$AUTOMAKE --add-missing -Wno-obsolete
-
-mkdir build
-cd build
-../configure
-$MAKE
-test -f main.info
-test ! -e ../main.info
-test ! -e other.info
-test -f ../other.info
-
-cd ..
-rm -rf build
-./configure
-$MAKE
-test -f main.info
-test -f other.info
-
-# Make sure stamp-vti is older that version.texi.
-# (A common situation in a real tree).
-# This is needed to test the "subtle" issue described below.
-test -f stamp-vti
-test -f version.texi
-test -f stamp-1
-test -f version2.texi
-$sleep
-touch stamp-vti
-touch stamp-1
-
-$MAKE distclean
-test -f stamp-vti
-test -f stamp-1
-test -f version.texi
-test -f version2.texi
-
-mkdir build
-cd build
-../configure
-$MAKE
-# other.info should not be rebuilt in the current directory, since
-# it's up-to-date in $(srcdir).
-# This can be caused by a subtle issue related to VPATH handling
-# of version.texi (see also the comment in texi-vers.am): because
-# stamp-vti is newer than version.texi, the 'version.texi: stamp-vti'
-# rule is always triggered. Still that's not a reason for 'make'
-# to think 'version.texi' has been created...
-test -f main.info
-test ! -e other.info
-$MAKE dvi
-test -f main.dvi
-test -f other.dvi
-
-$MAKE distcheck
-
-:
diff --git a/t/txinfo28.sh b/t/txinfo28.sh
deleted file mode 100644
index 93929c3e3..000000000
--- a/t/txinfo28.sh
+++ /dev/null
@@ -1,89 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2002-2014 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/>.
-
-# Check that info files are built in builddir when needed.
-# Similar to txinfo24.sh, but obfuscating filenames with variable
-# references.
-# Report from Ralf Corsepius.
-
-required='makeinfo tex texi2dvi'
-. test-init.sh
-
-# This setting, when honored by GNU ls, used to cause an infinite loop
-# in mdate-sh.
-TIME_STYLE="+%Y-%m-%d %H:%M:%S"
-export TIME_STYLE
-
-echo AC_OUTPUT >> configure.ac
-
-cat > Makefile.am << 'END'
-MA = ma
-IN = in
-PROJ = $(MA)$(IN)
-include fragment.mk
-info_TEXINFOS = ma$(IN).texi
-END
-
-echo 'CLEANFILES = $(PROJ).info' > fragment.mk
-
-cat > main.texi << 'END'
-\input texinfo
-@setfilename main.info
-@settitle main
-@node Top
-Hello walls.
-@include version.texi
-@bye
-END
-
-$ACLOCAL
-$AUTOMAKE --add-missing -Wno-error
-$AUTOCONF
-
-mkdir build
-cd build
-../configure
-$MAKE
-test -f main.info
-
-cd ..
-rm -rf build
-./configure
-$MAKE
-test -f main.info
-
-# Make sure stamp-vti is older that version.texi.
-# (A common situation in a real tree).
-test -f stamp-vti
-test -f version.texi
-$sleep
-touch stamp-vti
-
-$MAKE distclean
-test -f stamp-vti
-test -f version.texi
-
-mkdir build
-cd build
-../configure
-$MAKE
-# main.info should be rebuilt in the current directory.
-test -f main.info
-test ! -e ../main.info
-$MAKE dvi
-test -f main.dvi
-
-$MAKE distcheck