automake-commit
[Top][All Lists]
Advanced

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

[Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.11-257-g


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.11-257-g20fb9ce
Date: Thu, 23 Dec 2010 22:37:57 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=20fb9cebd5ca7c48c0eeba32d6ea42bab1f5b912

The branch, maint has been updated
       via  20fb9cebd5ca7c48c0eeba32d6ea42bab1f5b912 (commit)
      from  9552ab180a2ecbccd8a2439ad860838a497315aa (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                             |   17 ++++++
 NEWS                                  |    4 ++
 automake.in                           |   26 +++++++---
 tests/Makefile.am                     |    5 ++
 tests/Makefile.in                     |    5 ++
 tests/depcomp8a.test                  |   79 ++++++++++++++++++++++++++++++
 tests/depcomp8b.test                  |   73 +++++++++++++++++++++++++++
 tests/subobj11a.test                  |   82 +++++++++++++++++++++++++++++++
 tests/subobj11b.test                  |   87 +++++++++++++++++++++++++++++++++
 tests/{strip2.test => subobj11c.test} |   39 +++++++--------
 10 files changed, 389 insertions(+), 28 deletions(-)
 create mode 100755 tests/depcomp8a.test
 create mode 100755 tests/depcomp8b.test
 create mode 100755 tests/subobj11a.test
 create mode 100755 tests/subobj11b.test
 copy tests/{strip2.test => subobj11c.test} (51%)

diff --git a/ChangeLog b/ChangeLog
index 84b9d8d..224c3e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2010-12-23  Ralf Wildenhues  <address@hidden>
+           Stefano Lattarini  <address@hidden>
+
+       Work around a bug in file-inclusion mechanism of Solaris make.
+       * automake.in (handle_single_transform): In the name of the
+       dependency file: collapse multiple slash characters into a single
+       one.
+       * tests/subobj11a.test: New test.
+       * tests/subobj11b.test: Likewise.
+       * tests/subobj11c.test: Likewise.
+       * tests/depcomp8a.test: Likewise.
+       * tests/depcomp8b.test: Likewise.
+       * tests/Makefile.am (TESTS): Updated.
+       * NEWS: Updated.
+       Report by Stefano Lattarini, quick fix by Ralf Wildenhues, final
+       patch and tests by Stefano Lattarini.
+
 2010-12-22  Stefano Lattarini  <address@hidden>
 
        Fix two spurious testsuite failures on IRIX 6.5.
diff --git a/NEWS b/NEWS
index 6bc0d6f..5f1fd5b 100644
--- a/NEWS
+++ b/NEWS
@@ -49,6 +49,10 @@ Bugs fixed in 1.11.0a:
   - Rules generated by Automake now try harder to not change any files when
     `make -n' is invoked.  Fixes include compilation of Emacs Lisp, Vala, or
     Yacc source files and the rule to update config.h.
+
+  - The code for automatic dependency tracking works around a Solaris
+    make bug triggered by sources containing repeated slashes when the
+    `subdir-objects' was used.
 
 New in 1.11:
 
diff --git a/automake.in b/automake.in
index 8f3edde..bf45fa7 100755
--- a/automake.in
+++ b/automake.in
@@ -2108,14 +2108,24 @@ sub handle_single_transform ($$$$$%)
 
        # Transform .o or $o file into .P file (for automatic
        # dependency code).
-       if ($lang && $lang->autodep ne 'no')
-       {
-           my $depfile = $object;
-           $depfile =~ s/\.([^.]*)$/.P$1/;
-           $depfile =~ s/\$\(OBJEXT\)$/o/;
-           $dep_files{dirname ($depfile) . '/$(DEPDIR)/'
-                        . basename ($depfile)} = 1;
-       }
+        # 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;
+        }
     }
 
     return @result;
diff --git a/tests/Makefile.am b/tests/Makefile.am
index dab04e3..8842be3 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -262,6 +262,8 @@ depcomp4.test \
 depcomp5.test \
 depcomp6.test \
 depcomp7.test \
+depcomp8a.test \
+depcomp8b.test \
 depdist.test \
 depend.test \
 depend2.test \
@@ -692,6 +694,9 @@ subobj7.test \
 subobj8.test \
 subobj9.test \
 subobj10.test \
+subobj11a.test \
+subobj11b.test \
+subobj11c.test \
 subobjname.test \
 subpkg.test \
 subpkg2.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index de21f43..a9d1fd1 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -529,6 +529,8 @@ depcomp4.test \
 depcomp5.test \
 depcomp6.test \
 depcomp7.test \
+depcomp8a.test \
+depcomp8b.test \
 depdist.test \
 depend.test \
 depend2.test \
@@ -959,6 +961,9 @@ subobj7.test \
 subobj8.test \
 subobj9.test \
 subobj10.test \
+subobj11a.test \
+subobj11b.test \
+subobj11c.test \
 subobjname.test \
 subpkg.test \
 subpkg2.test \
diff --git a/tests/depcomp8a.test b/tests/depcomp8a.test
new file mode 100755
index 0000000..b4a0e3a
--- /dev/null
+++ b/tests/depcomp8a.test
@@ -0,0 +1,79 @@
+#! /bin/sh
+# Copyright (C) 2010 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/>.
+
+# Test for regressions in computation of names of .Po files for
+# automatic dependency tracking.
+# Keep this in sync with sister test `depcomp8b.test', which checks the
+# same thing for libtool objects.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = zardoz
+zardoz_SOURCES = foo.c sub/bar.c
+END
+
+mkdir sub
+cat > foo.c << 'END'
+int main(void)
+{
+  extern int bar;
+  return bar;
+}
+END
+cat > sub/bar.c << 'END'
+extern int bar = 0;
+END
+
+$ACLOCAL
+$AUTOMAKE -a
+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
+
+$AUTOCONF
+./configure
+$MAKE
+./zardoz
+$MAKE distcheck
+
+# Try again with subdir-objects option.
+
+echo AM_PROG_CC_C_O >> configure.in
+echo AUTOMAKE_OPTIONS = subdir-objects >> Makefile.am
+
+$ACLOCAL
+$AUTOMAKE -a
+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
+
+$AUTOCONF
+./configure
+$MAKE
+./zardoz
+$MAKE distcheck
+
+:
diff --git a/tests/depcomp8b.test b/tests/depcomp8b.test
new file mode 100755
index 0000000..1ae7459
--- /dev/null
+++ b/tests/depcomp8b.test
@@ -0,0 +1,73 @@
+#! /bin/sh
+# Copyright (C) 2010 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/>.
+
+# Test for regressions in computation of names of .Plo files for
+# automatic dependency tracking.
+# Keep this in sync with sister test `depcomp8a.test', which checks the
+# same thing for non-libtool objects.
+
+required=libtoolize
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_LIBTOOL
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+lib_LTLIBRARIES = libzardoz.la
+libzardoz_la_SOURCES = foo.c sub/bar.c
+END
+
+mkdir sub
+echo 'extern int foo = 0;' > foo.c
+echo 'extern int bar = 0;' > sub/bar.c
+
+libtoolize
+
+$ACLOCAL
+$AUTOMAKE -a
+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
+
+$AUTOCONF
+./configure
+$MAKE
+$MAKE distcheck
+
+# Try again with subdir-objects option.
+
+echo AM_PROG_CC_C_O >> configure.in
+echo AUTOMAKE_OPTIONS = subdir-objects >> Makefile.am
+
+$ACLOCAL
+$AUTOMAKE -a
+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
+
+$AUTOCONF
+./configure
+$MAKE
+$MAKE distcheck
+
+:
diff --git a/tests/subobj11a.test b/tests/subobj11a.test
new file mode 100755
index 0000000..c39e67c
--- /dev/null
+++ b/tests/subobj11a.test
@@ -0,0 +1,82 @@
+#! /bin/sh
+# Copyright (C) 2010 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/>.
+
+# Test that automake works around a bug of Solaris Make. The bug is the
+# following.  If we have a Makefile containg a file inclusion like this:
+#   include .//foo.mk
+# Solaris make fails with a message like:
+#   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.
+#
+# See also sister "grepping" test `subobj11b.test', and related test
+# `subobj11c.test'.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
+bin_PROGRAMS = foo
+## the `.//' is meant
+foo_SOURCES = .//src/foo.c
+END
+
+mkdir src
+
+cat > src/foo.c << 'END'
+int main(void)
+{
+  return 0;
+}
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure --enable-dependency-tracking
+
+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
+fi
+
+ls -l "$depdir"
+test -f "$depdir"/foo.Po
+
+echo 'quux:; echo "address@hidden@z" >$@' >> "$depdir"/foo.Po
+
+$MAKE quux
+$FGREP "address@hidden@z" quux
+
+$MAKE
+
+$MAKE DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' distcheck
+$MAKE DISTCHECK_CONFIGURE_FLAGS='--disable-dependency-tracking' distcheck
+
+:
diff --git a/tests/subobj11b.test b/tests/subobj11b.test
new file mode 100755
index 0000000..1db5fab
--- /dev/null
+++ b/tests/subobj11b.test
@@ -0,0 +1,87 @@
+#! /bin/sh
+# Copyright (C) 2010 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/>.
+
+# Test that automake works around a bug of Solaris Make. The bug is the
+# following.  If we have a Makefile containg a file inclusion like this:
+#   include .//foo.mk
+# Solaris make fails with a message like:
+#   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.
+#
+# See also "semantic" sister test `subobj11a.test', and related test
+# `subobj11c.test'.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AM_PROG_CC_C_O
+END
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
+bin_PROGRAMS = foo
+## The `zardoz' sources should activate a code paths in Automake that
+## cannot be sensibly tested by sister test `subobj11a.test'.  The other
+## sources provide some sort of stress testing.
+foo_SOURCES = \
+  //server/zardoz0.c \
+  //server//zardoz1.c \
+  //server/path/to/zardoz2.c \
+  //server/another//path///to////zardoz3.c \
+  /foobar0.c \
+  ///foobar1.c \
+  ////foobar2.c \
+  /sub///foobar3.c \
+  ///sub/foobar4.c \
+  .//foobar5.c \
+  .//sub/foobar6.c \
+  ./sub//foobar7.c \
+  .//sub//foobar8.c \
+  sub/sub//sub///sub////foobar9.c
+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
+
+# These checks depend 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.
+for x in zardoz0 zardoz1 path/to/zardoz2 another/path/to/zardoz3; do
+  case $x in
+   */*) d=`echo $x | sed 's,[^/]*$,,'`; b=`echo $x | sed 's,^.*/,,'`;;
+     *) d=''; b=$x;;
+  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
+done
+
+# Sanity checks.
+for i in 0 1 2 3 4 5 6 7 8 9; do
+  grep "am__include.*/foobar$i\\." Makefile.in
+done
+
+:
diff --git a/tests/strip2.test b/tests/subobj11c.test
similarity index 51%
copy from tests/strip2.test
copy to tests/subobj11c.test
index 5786ded..9262d15 100755
--- a/tests/strip2.test
+++ b/tests/subobj11c.test
@@ -14,41 +14,40 @@
 # 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 install-strip works when STRIP consists of more than one word.
-# This test needs GNU binutils strip.  See sister test strip3.
+# 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 tests `subobj11a.test' and `subobj11b.test'
 
-required=strip
 . ./defs || Exit 1
 
 set -e
 
 cat >> configure.in << 'END'
 AC_PROG_CC
-AC_PROG_RANLIB
-AC_OUTPUT
+AM_PROG_CC_C_O
 END
 
 cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
 bin_PROGRAMS = foo
-lib_LIBRARIES = libfoo.a
+foo_SOURCES = //zardoz.c
 END
 
-cat > foo.c << 'END'
-int main () { return 0; }
-END
-
-cat > libfoo.c << 'END'
-int foo () { return 0; }
-END
-
-
 $ACLOCAL
-$AUTOCONF
 $AUTOMAKE -a
 
-prefix=`pwd`/inst
-./configure --prefix="$prefix" STRIP='strip --verbose'
-$MAKE
-$MAKE install-strip
+#
+# 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 '^[^/]*am__include[^/]*//\$(DEPDIR)/zardoz\.[^/]*$' Makefile.in
 
 :


hooks/post-receive
-- 
GNU Automake



reply via email to

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