build: cope with empty source lists for libs
authorAndrew Tridgell <tridge@samba.org>
Fri, 26 Feb 2010 09:11:52 +0000 (20:11 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 6 Apr 2010 10:26:38 +0000 (20:26 +1000)
buildtools/mktowscript/mktowscript.pl
buildtools/wafsamba/wafsamba.py [moved from lib/replace/wafsamba.py with 100% similarity]

index 68fb7c69d3ebb4e84453e1e3181e36d2d6c2cab7..5b3926065a6f935d655471080610072800f38090 100755 (executable)
@@ -263,6 +263,7 @@ sub process_results($)
                        printf "\nbld.SAMBA_%s('%s'", $sec->{TYPE}, $s;
                        my $trailer="";
                        my $got_src = 0;
+                       my $got_private_deps = 0;
 
                        foreach my $k (keys %{$sec}) {
                                #print "key=$k\n";
@@ -293,6 +294,7 @@ sub process_results($)
                                }
                                if ($k eq "PRIVATE_DEPENDENCIES") {
                                        $trailer .= sprintf(",\n\tdeps='%s'", strlist($sec->{$k}));
+                                       $got_private_deps = 1;
                                        next;
                                }
                                if ($k eq "PUBLIC_DEPENDENCIES") {
@@ -422,7 +424,10 @@ sub process_results($)
                                }
                                die("Unknown keyword $k in $s\n");
                        }
-                       die("No source list in $s\n") unless $got_src;
+                       die("No source list in $s\n") unless $got_src or $got_private_deps;
+                       if (! $got_src) {
+                               printf(",''\n\t");
+                       }
                        printf("%s\n\t)\n\n", $trailer);
                }
        }