From: Alexandre Duret-Lutz Date: Sun, 9 Apr 2006 07:18:33 +0000 (+0000) Subject: * automake.in (handle_single_transform): Preserve directories in X-Git-Tag: Release-1-9b~77 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f207e1361964855562080cb4db70afe14776a629;p=thirdparty%2Fautomake.git * 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. --- diff --git a/ChangeLog b/ChangeLog index ffe24c446..080802f29 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-04-09 Stepan Kasal + Ralf Wildenhues + + * 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 (tiny change) Alexandre Duret-Lutz diff --git a/THANKS b/THANKS index 269255194..f456245a8 100644 --- 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 diff --git a/automake.in b/automake.in index 69ad484b2..2ba82fc28 100755 --- a/automake.in +++ b/automake.in @@ -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"; } diff --git a/tests/Makefile.am b/tests/Makefile.am index 847ff8a2d..d987f20f1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -523,6 +523,7 @@ suffix8.test \ suffix9.test \ suffix10.test \ suffix11.test \ +suffix12.test \ symlink.test \ symlink2.test \ symlink3.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 16fdbf87b..6a825df16 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -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 index 000000000..c778c548f --- /dev/null +++ b/tests/suffix12.test @@ -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 <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