>>>>> "Akim" == Akim Demaille <[EMAIL PROTECTED]> writes:

Akim> I'm stuck.  I tried to produce the single big patch which
Akim> consists of them all, but after having fought with patch, I
Akim> realized I must have forgotten a patch: that introducing
Akim> handle_languages.

Groumph.  This patch was incorrectly numbered as 09...

It groups things which are related together (languages and
dependencies).  It is the first step to completely unify the languages
handling process.  In the long run, it somewhat simplifies the code.

src/am/patches % grep -c '^+' {97.5,98*2,{100..110}}*patch | awk -F: '{ sum += $2 } 
END { print sum}'
572
src/am/patches % grep -c '^-' {97.5,98*2,{100..110}}*patch | awk -F: '{ sum += $2 } 
END { print sum}'       
645


Index: ChangeLog
from  Akim Demaille  <[EMAIL PROTECTED]>
        
        * automake.in (&finish_languages): Rename as...
        (&handle_languages): this.
        Include the body of...
        (&handle_dependency): this.
        Remove.
        
Index: automake.in
--- automake.in Wed, 28 Mar 2001 22:43:17 +0200 akim (am/f/39_automake.i 1.226 755)
+++ automake.in Thu, 29 Mar 2001 01:30:41 +0200 akim (am/f/39_automake.i 1.226 755)
@@ -1086,7 +1086,7 @@ sub generate_makefile
     &handle_scripts;
 
     # This must be run after all the sources are scanned.
-    &finish_languages;
+    &handle_languages;
     &handle_compile;
 
     # Re-init SOURCES and OBJECTS.  FIXME: other code shouldn't depend
@@ -1108,7 +1108,6 @@ sub generate_makefile
     &handle_subdirs;
     &handle_tags;
     &handle_minor_options;
-    &handle_dependencies;
     &handle_tests;
 
     # This must come after most other rules.
@@ -1287,8 +1286,9 @@ sub get_object_extension
     return $extension;
 }
 
+
 # Call finish function for each language that was used.
-sub finish_languages
+sub handle_languages
 {
     my ($ltcompile, $ltlink) = &libtool_compiler;
 
@@ -1382,6 +1382,65 @@ sub finish_languages
        &define_variable ('LINK',
                          $ltlink . '$(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) 
$(LDFLAGS) -o $@');
     }
+
+    if ($use_dependencies)
+    {
+       # Include auto-dep code.  Don't include it if DEP_FILES would
+       # be empty.
+       if (&saw_sources_p (0) && keys %dep_files)
+       {
+           my $config_aux_dir_specified = ($config_aux_dir ne '.'
+                                           && $config_aux_dir ne '');
+
+           # Set $require_file_found{'depcomp'} if the depcomp file exists,
+           # before calling require_config_file on `depcomp'.  This makes
+           # require_file_internal skip its buggy existence test that would
+           # make automake fail (with `required file `lib/depcomp' not found')
+           # when AC_CONFIG_AUX_DIR is not set.  See tests/subdir4.test.
+           my $depcomp_dir = ($config_aux_dir_specified ? $config_aux_dir
+                              : '.');
+           $require_file_found{'depcomp'} = 1 if -f "$depcomp_dir/depcomp";
+
+           # Set location of depcomp.
+           my $prefix = ($config_aux_dir_specified ? $config_aux_dir
+                         : '$(top_srcdir)');
+
+           &define_variable ('depcomp', "\$(SHELL) $prefix/depcomp");
+
+           &require_config_file ($FOREIGN, 'depcomp');
+
+           my @deplist = sort keys %dep_files;
+
+           # We define this as a conditional variable because BSD
+           # make can't handle backslashes for continuing comments on
+           # the following line.
+           &define_pretty_variable ('DEP_FILES', 'AMDEP_TRUE', @deplist);
+
+           # Generate each `include' individually.  Irix 6 make will
+           # not properly include several files resulting from a
+           # variable expansion; generating many separate includes
+           # seems safest.
+           $output_rules .= "\n";
+           foreach my $iter (@deplist)
+           {
+               $output_rules .= '@AMDEP_TRUE@@_am_include@ ' . $iter . "\n";
+           }
+
+           $output_rules .= &file_contents ('depend');
+       }
+    }
+    else
+    {
+       &define_variable ('depcomp', '');
+    }
+
+    foreach my $lang (values %languages)
+    {
+        if ($lang->autodep ne 'no')
+         {
+           add_depend2 ($lang);
+         }
+    }
 }
 
 # Output a rule to build from a YACC source.  The output from YACC is
@@ -3058,64 +3117,6 @@ sub add_depend2
 # Handle auto-dependency code.
 sub handle_dependencies
 {
-    if ($use_dependencies)
-    {
-       # Include auto-dep code.  Don't include it if DEP_FILES would
-       # be empty.
-       if (&saw_sources_p (0) && keys %dep_files)
-       {
-           my $config_aux_dir_specified = ($config_aux_dir ne '.'
-                                           && $config_aux_dir ne '');
-
-           # Set $require_file_found{'depcomp'} if the depcomp file exists,
-           # before calling require_config_file on `depcomp'.  This makes
-           # require_file_internal skip its buggy existence test that would
-           # make automake fail (with `required file `lib/depcomp' not found')
-           # when AC_CONFIG_AUX_DIR is not set.  See tests/subdir4.test.
-           my $depcomp_dir = ($config_aux_dir_specified ? $config_aux_dir
-                              : '.');
-           $require_file_found{'depcomp'} = 1 if -f "$depcomp_dir/depcomp";
-
-           # Set location of depcomp.
-           my $prefix = ($config_aux_dir_specified ? $config_aux_dir
-                         : '$(top_srcdir)');
-
-           &define_variable ('depcomp', "\$(SHELL) $prefix/depcomp");
-
-           &require_config_file ($FOREIGN, 'depcomp');
-
-           my @deplist = sort keys %dep_files;
-
-           # We define this as a conditional variable because BSD
-           # make can't handle backslashes for continuing comments on
-           # the following line.
-           &define_pretty_variable ('DEP_FILES', 'AMDEP_TRUE', @deplist);
-
-           # Generate each `include' individually.  Irix 6 make will
-           # not properly include several files resulting from a
-           # variable expansion; generating many separate includes
-           # seems safest.
-           $output_rules .= "\n";
-           foreach my $iter (@deplist)
-           {
-               $output_rules .= '@AMDEP_TRUE@@_am_include@ ' . $iter . "\n";
-           }
-
-           $output_rules .= &file_contents ('depend');
-       }
-    }
-    else
-    {
-       &define_variable ('depcomp', '');
-    }
-
-    foreach my $lang (values %languages)
-    {
-        if ($lang->autodep ne 'no')
-         {
-           add_depend2 ($lang);
-         }
-    }
 }
 
 # Handle subdirectories.

Reply via email to