* automake.in (handle_single_transform): Preserve directories in
authorAlexandre Duret-Lutz <adl@gnu.org>
Sun, 9 Apr 2006 07:18:33 +0000 (07:18 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Sun, 9 Apr 2006 07:18:33 +0000 (07:18 +0000)
direct suffix rules.
* tests/suffix12.test: New test.
* tests/Makefile.am (TESTS): Add it.
Report from John Ratliff.

ChangeLog
THANKS
automake.in
tests/Makefile.am
tests/Makefile.in
tests/suffix12.test [new file with mode: 0755]

index ffe24c4..080802f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-04-09  Stepan Kasal  <kasal@ucw.cz>
+           Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * automake.in (handle_single_transform): Preserve directories in
+       direct suffix rules.
+       * tests/suffix12.test: New test.
+       * tests/Makefile.am (TESTS): Add it.
+       Report from John Ratliff.
+
 2006-03-25  Mike Frysinger  <vapier@gentoo.org>  (tiny change)
            Alexandre Duret-Lutz  <adl@gnu.org>
 
diff --git a/THANKS b/THANKS
index 2692551..f456245 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -121,6 +121,7 @@ Joerg-Martin Schwarz        jms@jms.prima.ruhr.de
 Johan Danielsson       joda@pdc.kth.se
 Johannes Nicolai       johannes.nicolai@student.hpi.uni-potsdam.de
 John Pierce            hawkfan@pyrotechnics.com
+John Ratliff           autoconf@technoplaza.net
 John W. Coomes         jcoomes@eng.Sun.COM
 Josh MacDonald         jmacd@cs.berkeley.edu
 Joshua Cowan           jcowan@jcowan.reslife.okstate.edu
index 69ad484..2ba82fc 100755 (executable)
@@ -1790,6 +1790,7 @@ sub handle_single_transform ($$$$$%)
             # This is probably the result of a direct suffix rule.
             # In this case we just accept the rewrite.
             $object = "$base$extension";
+            $object = "$directory/$object" if $directory ne '';
             $linker = '';
         }
         else
@@ -1859,7 +1860,7 @@ sub handle_single_transform ($$$$$%)
 
                # For Java, the way we're handling it right now, a
                # `..' component doesn't make sense.
-                if ($lang->name eq 'java' && $object =~ /(\/|^)\.\.\//)
+                if ($lang && $lang->name eq 'java' && $object =~ /(\/|^)\.\.\//)
                  {
                    err_am "`$full' should not contain a `..' component";
                  }
index 847ff8a..d987f20 100644 (file)
@@ -523,6 +523,7 @@ suffix8.test \
 suffix9.test \
 suffix10.test \
 suffix11.test \
+suffix12.test \
 symlink.test \
 symlink2.test \
 symlink3.test \
index 16fdbf8..6a825df 100644 (file)
@@ -147,22 +147,22 @@ TESTS = aclibobj.test aclocal.test aclocal3.test aclocal4.test \
        substtarg.test suffix.test suffix2.test suffix3.test \
        suffix4.test suffix5.test suffix6.test suffix7.test \
        suffix8.test suffix9.test suffix10.test suffix11.test \
-       symlink.test symlink2.test symlink3.test syntax.test tags.test \
-       tagsub.test tar.test tar2.test tar3.test target-cflags.test \
-       targetclash.test txinfo.test txinfo2.test txinfo3.test \
-       txinfo4.test txinfo5.test txinfo6.test txinfo7.test \
-       txinfo8.test txinfo9.test txinfo10.test txinfo13.test \
-       txinfo16.test txinfo17.test txinfo18.test txinfo19.test \
-       txinfo20.test txinfo21.test txinfo22.test txinfo23.test \
-       txinfo24.test txinfo25.test txinfo26.test txinfo27.test \
-       txinfo28.test txinfo29.test txinfo30.test transform.test \
-       unused.test vars.test vars3.test vartar.test version.test \
-       version2.test version3.test version4.test version6.test \
-       version7.test version8.test vpath.test vtexi.test vtexi2.test \
-       warnopts.test werror.test werror2.test whoami.test \
-       xsource.test yacc.test yacc2.test yacc3.test yacc4.test \
-       yacc5.test yacc6.test yacc7.test yacc8.test yaccpp.test \
-       yaccvpath.test
+       suffix12.test symlink.test symlink2.test symlink3.test \
+       syntax.test tags.test tagsub.test tar.test tar2.test tar3.test \
+       target-cflags.test targetclash.test txinfo.test txinfo2.test \
+       txinfo3.test txinfo4.test txinfo5.test txinfo6.test \
+       txinfo7.test txinfo8.test txinfo9.test txinfo10.test \
+       txinfo13.test txinfo16.test txinfo17.test txinfo18.test \
+       txinfo19.test txinfo20.test txinfo21.test txinfo22.test \
+       txinfo23.test txinfo24.test txinfo25.test txinfo26.test \
+       txinfo27.test txinfo28.test txinfo29.test txinfo30.test \
+       transform.test unused.test vars.test vars3.test vartar.test \
+       version.test version2.test version3.test version4.test \
+       version6.test version7.test version8.test vpath.test \
+       vtexi.test vtexi2.test warnopts.test werror.test werror2.test \
+       whoami.test xsource.test yacc.test yacc2.test yacc3.test \
+       yacc4.test yacc5.test yacc6.test yacc7.test yacc8.test \
+       yaccpp.test yaccvpath.test
 subdir = tests
 DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
        $(srcdir)/aclocal.in $(srcdir)/automake.in $(srcdir)/defs.in
diff --git a/tests/suffix12.test b/tests/suffix12.test
new file mode 100755 (executable)
index 0000000..c778c54
--- /dev/null
@@ -0,0 +1,56 @@
+#! /bin/sh
+# Copyright (C) 2002, 2003, 2006  Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake 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.
+#
+# GNU Automake 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 Automake; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+# Tests that Automake understands suffix rules with subdir objects.
+# Reported by John Ratliff.
+
+. ./defs || exit 1
+
+set -e
+
+cat >>configure.in <<EOF
+AC_PROG_CC
+AC_OUTPUT
+EOF
+
+cat >Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
+SUFFIXES = .baz .o
+# we fake here:
+.baz.o:
+       cp $< $@
+
+bin_PROGRAMS = foo
+foo_SOURCES = foo.c sub/bar.baz
+print:
+       @echo BEGIN: $(foo_OBJECTS) :END
+END
+
+mkdir sub
+: > sub/bar.baz
+: > foo.c
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+./configure
+env OBJEXT=OBJ $MAKE -e print >stdout
+cat stdout
+grep 'BEGIN: foo.OBJ sub/bar.OBJ :END' stdout