From dd3359863729803d2167c04271968be3c8627293 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Tue, 15 Oct 2002 08:38:55 +0000 Subject: [PATCH] * automake.in (handle_single_transform_list) : New variable. Use this to record correct dependencies about deansifiable files which are using per-program flags or are in a subdirectory. * tests/ansi9.test: New file. * tests/Makefile.am (TESTS): Add ansi9.test. Reported by Paul D. Smith --- ChangeLog | 9 +++++++++ automake.in | 10 ++++++++-- tests/Makefile.am | 1 + tests/Makefile.in | 1 + tests/ansi9.test | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 66 insertions(+), 2 deletions(-) create mode 100755 tests/ansi9.test diff --git a/ChangeLog b/ChangeLog index 82aa56a..41bc9f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2002-10-15 Alexandre Duret-Lutz + + * automake.in (handle_single_transform_list) : New variable. + Use this to record correct dependencies about deansifiable files which + are using per-program flags or are in a subdirectory. + * tests/ansi9.test: New file. + * tests/Makefile.am (TESTS): Add ansi9.test. + Reported by Paul D. Smith + 2002-10-12 Alexandre Duret-Lutz * aclocal.in (ac_defun_rx, ac_require_rx): If the macro name is diff --git a/automake.in b/automake.in index bf757b5..21b87ad 100755 --- a/automake.in +++ b/automake.in @@ -2329,6 +2329,7 @@ sub handle_single_transform_list ($$$$@) my $directory = $1 || ''; my $base = $2; my $extension = $3; + my $full_ansi = $full; # We'll add `$U' if needed. # We must generate a rule for the object if it requires its own flags. my $renamed = 0; @@ -2448,7 +2449,12 @@ sub handle_single_transform_list ($$$$@) { my $obj_sans_ext = substr ($object, 0, - length ($this_obj_ext)); - my $val = ("$full $obj_sans_ext " + if ($lang->ansi && defined $options{'ansi2knr'}) + { + $full_ansi =~ s/$KNOWN_EXTENSIONS_PATTERN$/\$U$&/; + } + + my $val = ("$full_ansi $obj_sans_ext " # Only use $this_obj_ext in the derived # source case because in the other case we # *don't* want $(OBJEXT) to appear here. @@ -2545,7 +2551,7 @@ sub handle_single_transform_list ($$$$@) # dependency. if ($directory ne '' || $renamed) { - push (@dep_list, $full); + push (@dep_list, $full_ansi); } # If resulting object is in subdir, we need to make diff --git a/tests/Makefile.am b/tests/Makefile.am index 760eedb..8408d60 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -30,6 +30,7 @@ ansi5.test \ ansi6.test \ ansi7.test \ ansi8.test \ +ansi9.test \ ar.test \ asm.test \ autoheader.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 058c4aa..12b81bb 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -122,6 +122,7 @@ ansi5.test \ ansi6.test \ ansi7.test \ ansi8.test \ +ansi9.test \ ar.test \ asm.test \ autoheader.test \ diff --git a/tests/ansi9.test b/tests/ansi9.test new file mode 100755 index 0000000..5c3cccd --- /dev/null +++ b/tests/ansi9.test @@ -0,0 +1,47 @@ +#! /bin/sh +# Copyright (C) 2002 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 autoconf; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# Check that subdir sources, and file compiled using per-target flags +# can still be deansified. +# Report from Paul D. Smith. + +. ./defs || exit 1 + +set -e + +cat >>configure.in < Makefile.am << 'END' +AUTOMAKE_OPTIONS = ansi2knr subdir-objects +noinst_PROGRAMS = loadavg sub/sub +loadavg_SOURCES = loadavg.c +loadavg_CFLAGS = -DTEST +sub_sub_SOURCES = sub/sub.c +END + +$ACLOCAL +$AUTOMAKE --add-missing + +$FGREP 'loadavg-loadavg$U.o: loadavg$U.c' Makefile.in +$FGREP 'sub/sub$U.o: sub/sub$U.c' Makefile.in -- 2.7.4