From a635114b738eeae556ca1f86947e030bb9ea89b4 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Fri, 18 Apr 2003 20:05:31 +0000 Subject: [PATCH] back out mistaken commit --- automake.in | 47 ++++++++++++++++++---------------------------- tests/suffix7.test | 27 ++++---------------------- 2 files changed, 22 insertions(+), 52 deletions(-) diff --git a/automake.in b/automake.in index 81fde4f8..38e18557 100755 --- a/automake.in +++ b/automake.in @@ -2195,7 +2195,6 @@ sub handle_single_transform_list ($$$$@) # into the current directory, unless the subdir-objects option # is in effect. - print "1. $_\n"; # Split file name into base and extension. next if ! /^(?:(.*)\/)?([^\/]*)($KNOWN_EXTENSIONS_PATTERN)$/; my $full = $_; @@ -2219,7 +2218,6 @@ sub handle_single_transform_list ($$$$@) my $aggregate = 'AM'; $extension = &derive_suffix ($extension, $nonansi_obj); - print "2. $extension\n"; my $lang; if ($extension_map{$extension} && ($lang = $languages{$extension_map{$extension}})) @@ -5925,9 +5923,6 @@ sub derive_suffix ($$) { my ($source_ext, $obj) = @_; - print "3. @{[keys %{$suffix_rules->{$source_ext}}]}\n"; - print "3. @{[$suffix_rules->{$source_ext}{$obj}]}\n"; - while (! $extension_map{$source_ext} && $source_ext ne $obj && exists $suffix_rules->{$source_ext} @@ -7067,22 +7062,19 @@ sub register_suffix_rule ($$$) $suffix_rules->{$src} = { $dest => [ $dest, 1 ] }; } - # If we know how to transform any suffix of $dest into something else, - # then we know how to transform $src in that "something else". - foreach my $suffix (keys %$suffix_rules) + # If we know how to transform $dest in something else, then + # we know how to transform $src in that "something else". + if (exists $suffix_rules->{$dest}) { - if ($dest =~ /\Q$suffix\E$/) + for my $dest2 (keys %{$suffix_rules->{$dest}}) { - for my $dest2 (keys %{$suffix_rules->{$suffix}}) + my $dist = $suffix_rules->{$dest}{$dest2}[1] + 1; + # Overwrite an existing $src->$dest2 path only if + # the path via $dest which is shorter. + if (! exists $suffix_rules->{$src}{$dest2} + || $suffix_rules->{$src}{$dest2}[1] > $dist) { - my $dist = $suffix_rules->{$suffix}{$dest2}[1] + 1; - # Overwrite an existing $src->$dest2 path only if - # the path via $suffix which is shorter. - if (! exists $suffix_rules->{$src}{$dest2} - || $suffix_rules->{$src}{$dest2}[1] > $dist) - { - $suffix_rules->{$src}{$dest2} = [ $suffix, $dist ]; - } + $suffix_rules->{$src}{$dest2} = [ $dest, $dist ]; } } } @@ -7092,20 +7084,17 @@ sub register_suffix_rule ($$$) my @dest2 = keys %{$suffix_rules->{$src}}; for my $src2 (keys %$suffix_rules) { - foreach my $suffix2 (keys %{$suffix_rules->{$src2}}) + if (exists $suffix_rules->{$src2}{$src}) { - if ($suffix2 =~ /\Q$src\E$/) + for my $dest2 (@dest2) { - for my $dest2 (@dest2) + my $dist = $suffix_rules->{$src}{$dest2} + 1; + # Overwrite an existing $src2->$dest2 path only if + # the path via $src is shorter. + if (! exists $suffix_rules->{$src2}{$dest2} + || $suffix_rules->{$src2}{$dest2}[1] > $dist) { - my $dist = $suffix_rules->{$src}{$dest2} + 1; - # Overwrite an existing $src2->$dest2 path only if - # the path via $src is shorter. - if (! exists $suffix_rules->{$src2}{$dest2} - || $suffix_rules->{$src2}{$dest2}[1] > $dist) - { - $suffix_rules->{$src2}{$dest2} = [ $src, $dist ]; - } + $suffix_rules->{$src2}{$dest2} = [ $src, $dist ]; } } } diff --git a/tests/suffix7.test b/tests/suffix7.test index d28ceb2b..d5d82c82 100755 --- a/tests/suffix7.test +++ b/tests/suffix7.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002 Free Software Foundation, Inc. # # This file is part of GNU Automake. # @@ -19,40 +19,21 @@ # Boston, MA 02111-1307, USA. # Test to make sure Automake supports implicit rules "confusing" -# extensions. Inspired by a mail from Alex Hornby. +# extensions. Inspired by a mail from Alex Hornby. -required=gcc . ./defs || exit 1 -set -e - -cat >> configure.in << 'END' -AC_PROG_CXX -AC_OUTPUT -END - cat > Makefile.am << 'END' SUFFIXES = .idl S.cpp C.h SUFFIXES += C.cpp S.h .idlC.cpp: cp $< $@ - -bin_PROGRAMS = foo -foo_SOURCES = foo.idl - -echo: - @echo 'BEG: $(foo_OBJECTS) :END' END : > fooa -$ACLOCAL -$AUTOCONF -$AUTOMAKE -./configure -OBJEXT=bar $MAKE -e echo >stdout -cat stdout -grep 'BEG: foo.bar :END' stdout +$ACLOCAL || exit 1 +$AUTOMAKE || exit 1 # Make sure Automake has NOT recognized .cpp and .idlC as two new # extensions. -- 2.43.5