automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

106-handle-languages-morphing-6.patch


From: Akim Demaille
Subject: 106-handle-languages-morphing-6.patch
Date: Sun, 01 Apr 2001 21:57:05 +0200

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        * automake.in (&handle_languages): Use the same `%transform' for
        both `depend2.am' and `ext-compile.am'.
        Move the definition of `$flag' where it is used, and rename as
        `$flags'.
        
        
Index: automake.in
--- automake.in Sat, 31 Mar 2001 12:59:30 +0200 akim (am/f/39_automake.i 1.241 
755)
+++ automake.in Sat, 31 Mar 2001 13:08:11 +0200 akim (am/f/39_automake.i 1.241 
755)
@@ -1353,57 +1353,58 @@ sub handle_languages
         # Get information on $LANG.
        my $pfx = $lang->autodep;
        my $fpfx = ($pfx eq '') ? 'CC' : $pfx;
-       my $flag = $lang->flags || '';
 
-       # First include code for ordinary objects.
        my %transform = ('PFX'  => $pfx,
                         'FPFX' => $fpfx,
                         'LIBTOOL' => $seen_libtool,
                         'AMDEP'   => $use_dependencies ? 'AMDEP' : 'FALSE');
 
-       my $outarg = $lang->output_arg;
-       my $ltoutarg = '';
-       if ($lang->flags eq 'CFLAGS')
-         {
-           # C compilers don't always support -c -o.
-           if (defined $options{'subdir-objects'})
-             {
-               $outarg .= ' -o $@';
-             }
-           # We can always use -c -o with libtool.
-           $ltoutarg = ' -o $@';
-         }
-
-       # Generate the appropriate rules for this extension.  If
-       # dependency tracking was requested, and this extension
-       # supports it, then we don't generate the rule here.
-       if ($use_dependencies && $lang->autodep ne 'no')
-         {
-           my $compile = '$(' . $pfx . 'COMPILE)';
-           my $ltcompile = '$(LT' . $pfx . 'COMPILE)';
-
-           $output_rules .= (&file_contents ('depend2',
-                                             (%transform,
-                                              'GENERIC'   => 1,
-                                              'BASE'      => '$*',
-                                              'SOURCE'    => '$<',
-                                              'OBJ'       => '$@',
-                                              'LTOBJ'     => '$@',
-                                              'OBJOBJ'    => '$@',
-                                              'COMPILE'   => $compile,
-                                              'LTCOMPILE' => $ltcompile,
-                                              'EXT'       => $ext))
-                             . "\n");
-         }
-       elsif (defined $lang->compile)
-         {
-           $output_rules .= file_contents ('ext-compile',
-                                           ('EXT'      => $ext,
-                                            'COMPILER' => $lang->compiler,
-                                            'OUTARG'   => $outarg,
-                                            'LTOUTARG' => $ltoutarg));
-         }
+       # First include code for ordinary objects.
+       {
+         my $outarg = $lang->output_arg;
+         my $ltoutarg = '';
+         if ($lang->flags eq 'CFLAGS')
+           {
+             # C compilers don't always support -c -o.
+             if (defined $options{'subdir-objects'})
+               {
+                 $outarg .= ' -o $@';
+               }
+             # We can always use -c -o with libtool.
+             $ltoutarg = ' -o $@';
+           }
+
+         my %transform = (%transform,
+                          'GENERIC'   => 1,
+                          'EXT'       => $ext,
+
+                          'BASE'      => '$*',
+                          'SOURCE'    => '$<',
+                          'OBJ'       => '$@',
+                          'LTOBJ'     => '$@',
+                          'OBJOBJ'    => '$@',
+
+                          'COMPILER' => $lang->compiler,
+                          'COMPILE'   => '$(' . $pfx . 'COMPILE)',
+                          'LTCOMPILE' => '$(LT' . $pfx . 'COMPILE)',
+                          'OUTARG'   => $outarg,
+                          'LTOUTARG' => $ltoutarg);
+
+
+         # Generate the appropriate rules for this extension.  If
+         # dependency tracking was requested, and this extension
+         # supports it, then we don't generate the rule here.
+         if ($use_dependencies && $lang->autodep ne 'no')
+           {
+             $output_rules .= file_contents ('depend2', %transform);
+           }
+         elsif (defined $lang->compile)
+           {
+             $output_rules .= file_contents ('ext-compile', %transform);
+           }
+       }
 
+       # Then handle files with specific flags.
         if ($lang->autodep ne 'no')
          {
            # Now include code for each specially handled object with this
@@ -1418,9 +1419,10 @@ sub handle_languages
                next if defined $seen_files{$obj};
                $seen_files{$obj} = 1;
 
-               my $val = "${derived}_${flag}";
+               my $flags = $lang->flags || '';
+               my $val = "${derived}_${flags}";
 
-               (my $obj_compile = $lang->compile) =~ s/\(AM_$flag/\($val/;
+               (my $obj_compile = $lang->compile) =~ s/\(AM_$flags/\($val/;
                my $obj_ltcompile = '$(LIBTOOL) --mode=compile ' . $obj_compile;
 
                # Generate a transform which will turn suffix targets in



reply via email to

[Prev in Thread] Current Thread [Next in Thread]