automake: simplify '&saw_sources_p'
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 7 Jun 2012 17:12:43 +0000 (19:12 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 8 Jun 2012 20:01:53 +0000 (22:01 +0200)
This is just a minor cleanup.  No semantic change is intended.

* automake.in (saw_sources_p): Since its now-only caller calls it with
the '0' argument, remove the code paths that assumed the argument could
be '1', and assume no arguments.
(handle_languages): Drop the arguments '0' in the '&saw_sources_p'
invocation.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
automake.in

index 0f29412..af9fb5b 100644 (file)
@@ -1301,7 +1301,7 @@ sub handle_languages
     {
        # Include auto-dep code.  Don't include it if DEP_FILES would
        # be empty.
-       if (&saw_sources_p (0) && keys %dep_files)
+       if (&saw_sources_p && keys %dep_files)
        {
            # Set location of depcomp.
            &define_variable ('depcomp',
@@ -6076,25 +6076,10 @@ sub count_files_for_language
     return $r
 }
 
-# Called to ask whether source files have been seen . If HEADERS is 1,
-# headers can be included.
+# Called to ask whether source files (not headers) have been seen.
 sub saw_sources_p
 {
-    my ($headers) = @_;
-
-    # count all the sources
-    my $count = 0;
-    foreach my $val (values %extension_seen)
-    {
-       $count += $val;
-    }
-
-    if (!$headers)
-    {
-       $count -= count_files_for_language ('header');
-    }
-
-    return $count > 0;
+    return scalar keys %extension_seen;
 }