automake-ng
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-NG] [PATCH 02/12] [ng] cleanup: remove a workaround only neede


From: Stefano Lattarini
Subject: [Automake-NG] [PATCH 02/12] [ng] cleanup: remove a workaround only needed by Solaris make
Date: Mon, 21 May 2012 09:36:19 +0200

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 <address@hidden>
---
 automake.in    |   18 ++++--------------
 t/subobj11a.sh |   14 ++++++--------
 t/subobj11c.sh |   51 ---------------------------------------------------
 3 files changed, 10 insertions(+), 73 deletions(-)
 delete mode 100755 t/subobj11c.sh

diff --git a/automake.in b/automake.in
index 239c247..5a14d8a 100644
--- a/automake.in
+++ b/automake.in
@@ -1921,24 +1921,14 @@ sub handle_single_transform ($$$$$%)
 
        # 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;
diff --git a/t/subobj11a.sh b/t/subobj11a.sh
index e3666ef..ae02e59 100755
--- a/t/subobj11a.sh
+++ b/t/subobj11a.sh
@@ -23,14 +23,13 @@
 #   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
@@ -68,8 +67,7 @@ depdir=`sed -n 's/^ *DEPDIR *= *//p' Makefile`
 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"
diff --git a/t/subobj11c.sh b/t/subobj11c.sh
deleted file mode 100755
index 8891ad2..0000000
--- a/t/subobj11c.sh
+++ /dev/null
@@ -1,51 +0,0 @@
-#! /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 'address@hidden@-include [^/]*//\$(DEPDIR)/zardoz\.[^/]*$' Makefile.in
-
-:
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]