The workaround was introduced in commit '
v1.11-257-g20fb9ce' of
2010-05-14, "Work around a bug in file-inclusion mechanism of
Solaris make".
* automake.in (handle_single_transform): When calculating the name
of the dependency file, don't bother collapsing multiple slash
characters into a single one.
* t/subobj11a.sh: Adjust comments. Prefer calling "fatal_ MSG" over
"echo MSG >&2; Exit 1" for hard errors.
* t/subobj11c.sh: Remove as obsolete.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
# Transform .o or $o file into .P file (for automatic
# dependency code).
- # Properly flatten multiple adjacent slashes, as Solaris 10 make
- # might fail over them in an include statement.
- # Leading double slashes may be special, as per Posix, so deal
- # with them carefully.
if ($lang && $lang->autodep ne 'no')
- {
+ {
my $depfile = $object;
$depfile =~ s/\.([^.]*)$/.P$1/;
$depfile =~ s/\$\(OBJEXT\)$/o/;
- my $maybe_extra_leading_slash = '';
- $maybe_extra_leading_slash = '/' if $depfile =~ m,^//[^/],;
- $depfile =~ s,/+,/,g;
- my $basename = basename ($depfile);
- # This might make $dirname empty, but we account for that below.
- (my $dirname = dirname ($depfile)) =~ s/\/*$//;
- $dirname = $maybe_extra_leading_slash . $dirname;
- $dep_files{$dirname . '/$(DEPDIR)/' . $basename} = 1;
- }
+ $dep_files{dirname ($depfile) . '/$(DEPDIR)/'
+ . basename ($depfile)} = 1;
+ }
}
return @result;
# make: ... can't find '/foo.mk': No such file or directory
# make: fatal error ... read of include file '/foo.mk' failed
#
-# (even if the file 'foo.mk' exists). The error disappear by
-# collapsing the repeated slash '/' characters into a single one.
+# (even if the file 'foo.mk' exists). Our dependency tracking support
+# code used to generate include directives like that sometimes, thus
+# causing spurious failures.
#
-# GNU make shouldn't suffer from this bug; but we check for it
-# anyway -- better safe than sorry.
+# GNU make shouldn't suffer from that Solaris make bug, but we check
+# the problematic setup anyway -- better safe than sorry.
#
-# See also sister "grepping" test 'subobj11b.test', and related test
-# 'subobj11c.test'.
required=cc
. ./defs || Exit 1
if test x"$depdir" != x; then
depdir=src/$depdir
else
- echo "$me: cannot extract value of DEPDIR from Makefile" >&2
- Exit 1
+ fatal_ "cannot extract value of DEPDIR from Makefile"
fi
ls -l "$depdir"
+++ /dev/null
-#! /bin/sh
-# Copyright (C) 2010-2012 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/>.
-
-# Automatic dependency tracking with subdir-objects option active:
-# check for a pathological case of slash-collapsing in the name of
-# included makefile fragments (containing dependency info).
-# See also related test 'subobj11a.test'.
-
-. ./defs || Exit 1
-
-cat >> configure.ac << 'END'
-AC_PROG_CC
-AM_PROG_CC_C_O
-END
-
-cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS = subdir-objects
-bin_PROGRAMS = foo
-foo_SOURCES = //zardoz.c
-END
-
-$ACLOCAL
-$AUTOMAKE -a
-
-#
-# This check depends on automake internals, but presently this is
-# the only way to test the code path we are interested in.
-# Please update these checks when (and if) the relevant automake
-# internals are changed.
-#
-# Be a little lax in the regexp, to account for automake conditionals,
-# quoting, and similar stuff.
-#
-# FIXME: Are we sure this is the most sensible output in our situation?
-#
-grep '^@AMDEP_TRUE@-include [^/]*//\$(DEPDIR)/zardoz\.[^/]*$' Makefile.in
-
-: