]> sourceware.org Git - automake.git/commitdiff
Fix for PR automake/30 and PR automake/23. Fixes test
authorTom Tromey <tromey@redhat.com>
Tue, 14 Dec 1999 06:11:31 +0000 (06:11 +0000)
committerTom Tromey <tromey@redhat.com>
Tue, 14 Dec 1999 06:11:31 +0000 (06:11 +0000)
suffix3.test.
* automake.in (initialize_per_input): Initialize
source_suffix_pattern.
(derive_suffix): New function.
(handle_single_transform_list): Call it.

ChangeLog
automake.in

index 17bd33301a4097ceb90b1c2c11a9625227e6ab19..7e19259094317eeaa71342d96847fa7838cd6cc8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 1999-12-13  Tom Tromey  <tromey@cygnus.com>
 
+       Fix for PR automake/30 and PR automake/23.  Fixes test
+       suffix3.test.
+       * automake.in (initialize_per_input): Initialize
+       source_suffix_pattern.
+       (derive_suffix): New function.
+       (handle_single_transform_list): Call it.
+
        * automake.in (add_depend2): Handle the no-dependency-tracking
        case.  Fixes test suffix2.test.
 
index 2afc8c9000544812e6aaf8fb236d50036fbeeef3..bf1afcfe91feec250bd6b95c6b6d31774af7a1de 100755 (executable)
@@ -1161,6 +1161,7 @@ sub handle_single_transform_list
            local ($rule) = '';
            local ($renamed) = 0;
 
+           $extension = &derive_suffix ($extension);
            local ($lang) = $extension_map{$extension};
            if ($lang)
            {
@@ -1264,11 +1265,12 @@ sub handle_single_transform_list
                                                    . ' ' . $obj_sans_ext);
                }
            }
-           elsif ($extension =~ /^$source_suffix_pattern$/) 
+           elsif ($extension eq 'o')
            {
-               # We just rewrite it.  Maybe we should do more.
-               # FIXME: what about subdir handling here?
-               $object = $base . '.' . $suffix_rules{$extension};
+               # This is probably the result of a direct suffix rule.
+               # In this case we just accept the rewrite.  FIXME:
+               # this fails if we want libtool objects.
+               $object = $base . '.' . $extension;
                $linker = '';
            }
            else
@@ -5309,6 +5311,24 @@ sub register_language
     }
 }
 
+# This function is used to find a path from a user-specified suffix to
+# `o' or to some other suffix we recognize internally, eg `cc'.
+sub derive_suffix
+{
+    local ($source_ext) = @_;
+
+    # FIXME: hard-coding `o' is a mistake.  Doing something
+    # intelligent is harder.
+    while ($extension_map{$source_ext} eq ''
+          && $source_ext ne 'o'
+          && defined $suffix_rules{$source_ext})
+    {
+       $source_ext = $suffix_rules{$source_ext};
+    }
+
+    return $source_ext;
+}
+
 
 ################################################################
 
@@ -6224,7 +6244,7 @@ sub read_am_file
            {
              $suffix_rules{$source_suffix} = $object_suffix;
              print "Sources ending in .$source_suffix become .$object_suffix\n" if $verbose;
-             $source_suffix_pattern = "(" . join('|', keys %suffix_rules) . ")";
+             $source_suffix_pattern = "(" . join ('|', keys %suffix_rules) . ")";
            }
 
            # FIXME: make sure both suffixes are in SUFFIXES? Or set
@@ -6810,6 +6830,11 @@ sub initialize_per_input
     # corresponding output extension.
     %suffix_rules = ();
 
+    # This is a regular expression which matches all the known source
+    # suffix.  A source suffix is one that appears in the first
+    # position of a suffix rule.
+    $source_suffix_pattern = '';
+
     # This is the name of the recursive `all' target to use.
     $all_target = 'all-recursive';
 
This page took 0.044647 seconds and 5 git commands to generate.