# 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 = $_;
my $aggregate = 'AM';
$extension = &derive_suffix ($extension, $nonansi_obj);
+ print "2. $extension\n";
my $lang;
if ($extension_map{$extension} &&
($lang = $languages{$extension_map{$extension}}))
{
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}
$suffix_rules->{$src} = { $dest => [ $dest, 1 ] };
}
- # 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 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)
{
- for my $dest2 (keys %{$suffix_rules->{$dest}})
+ if ($dest =~ /\Q$suffix\E$/)
{
- 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)
+ for my $dest2 (keys %{$suffix_rules->{$suffix}})
{
- $suffix_rules->{$src}{$dest2} = [ $dest, $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 ];
+ }
}
}
}
my @dest2 = keys %{$suffix_rules->{$src}};
for my $src2 (keys %$suffix_rules)
{
- if (exists $suffix_rules->{$src2}{$src})
+ foreach my $suffix2 (keys %{$suffix_rules->{$src2}})
{
- for my $dest2 (@dest2)
+ if ($suffix2 =~ /\Q$src\E$/)
{
- 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)
+ for my $dest2 (@dest2)
{
- $suffix_rules->{$src2}{$dest2} = [ $src, $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 ];
+ }
}
}
}
echo "$me: running bison --version"
( bison --version ) || exit 77
;;
+ etags)
+ # Exuberant Ctags will create a TAGS file even
+ # when asked for --help or --version. (Emacs's etags
+ # does not have such problem.) Use -o /dev/null
+ # to make sure we do not pollute the tests/ directory.
+ echo "$me: running etags --version -o /dev/null"
+ ( etags --version -o /dev/null ) || exit 77
+ ;;
GNUmake)
# Use --version and -v, because SGI Make doesn't fail on --version.
echo "$me: running $MAKE --version -v"
#! /bin/sh
-# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
# 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 || exit 1
-$AUTOMAKE || exit 1
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+OBJEXT=bar $MAKE -e echo >stdout
+cat stdout
+grep 'BEG: foo.bar :END' stdout
# Make sure Automake has NOT recognized .cpp and .idlC as two new
# extensions.