5 use output qw($output);
7 ########################################################################
9 ########################################################################
19 sub directory { return $directory; }
20 sub tool { return $tool; }
21 sub file_name { return $file; }
22 sub file_line { return $line; }
23 sub message { return $message; }
25 ########################################################################
27 ########################################################################
30 $output->write("make_filter: $tool: can't parse output: '$current'\n");
34 ########################################################################
36 ########################################################################
47 my ($new_tool, $read_files, $write_files, $remove_files) = command($_);
48 if(defined($new_tool)) {
53 my $progress = "$directory: $tool: ";
54 if($#$read_files >= 0) {
55 $progress .= "read[" . join(" ", @{$read_files}) . "]";
57 if($#$write_files >= 0) {
58 if($#$read_files >= 0) {
61 $progress .= "write[" . join(" ", @{$write_files}) . "]";
63 if($#$remove_files >= 0) {
64 if($#$read_files >= 0 || $#$write_files >= 0) {
67 $progress .= "remove[" . join(" ", @{$remove_files}) . "]";
70 if($tool =~ /^cd|make$/) {
72 } elsif($tool =~ /^ld$/) {
73 $progress =~ s/read\[.*?\]/read[*.o]/; # FIXME: Kludge
74 $output->progress($progress)
76 $output->progress($progress)
82 if(/^Wine build complete\.$/) {
84 } elsif(s/^make\[(\d+)\]:\s*//) {
87 } elsif($tool eq "bison" && /^conflicts:\s+\d+\s+shift\/reduce$/) {
89 } elsif($tool eq "gcc" && /^In file included from (.+?):(\d+):$/) {
91 } elsif($tool =~ /^gcc|ld$/ && s/^(.+?\.o(?:\(.*?\))?):\s*//) {
93 } elsif($tool eq "gcc" && s/^(.+?\.[chly]):\s*//) {
95 } elsif($tool eq "winebuild" && s/^(.+?\.spec):\s*//) {
96 winebuild_output($1, $_);
97 } elsif($tool eq "wmc" && s/^(.+?\.mc):\s*//) {
99 } elsif($tool eq "wrc" && s/^(.+?\.rc):\s*//) {
101 } elsif($tool eq "cd" && s/^\/bin\/sh:\s*cd:\s*//) {
112 ########################################################################
114 ########################################################################
125 } elsif(/^\*\*\* \[(.*?)\] Error (\d+)$/) {
127 } elsif(/^\*\*\* Warning:\s+/) { #
128 if(/^File \`(.+?)\' has modification time in the future \((.+?) > \(.+?\)\)$/) {
133 } elsif(/^\`(.*?)\' is up to date.$/) {
135 } elsif(/^\[(.*?)\] Error (\d+) \(ignored\)$/) {
137 } elsif(/^(Entering|Leaving) directory \`(.*?)\'$/) {
138 if($1 eq "Entering") {
145 foreach my $component (split(/\//, $directory)) {
146 if($component eq "wine") {
149 push @components, $component;
152 $directory = join("/", @components);
153 } elsif(/^Nothing to be done for \`(.*?)\'.$/) {
155 } elsif(s/^warning:\s+//) {
156 if(/^Clock skew detected. Your build may be incomplete.$/) {
167 ########################################################################
169 ########################################################################
176 my $read_files = ["<???>"];
177 my $write_files = ["<???>"];
178 my $remove_files = [];
182 if(s/^\[\s+-d\s+(.*?)\s+\]\s+\|\|\s+//) {
188 ($read_files, $write_files) = ar_command($_);
189 } elsif(s/^as\s*//) {
191 ($read_files, $write_files) = as_command($_);
192 } elsif(s/^bison\s*//) {
194 ($read_files, $write_files) = bison_command($_);
195 } elsif(s/^cd\s*//) {
197 ($read_files, $write_files) = cd_command($_);
198 } elsif(s/^flex\s*//) {
200 ($read_files, $write_files) = flex_command($_);
201 } elsif(s/^for\s*//) {
203 ($read_files, $write_files) = for_command($_);
204 } elsif(s/^\/usr\/bin\/install\s*//) {
206 ($read_files, $write_files) = install_command($_);
207 } elsif(s/^ld\s*//) {
209 ($read_files, $write_files) = ld_command($_);
210 } elsif(s/^\/sbin\/ldconfig\s*//) {
212 ($read_files, $write_files) = ldconfig_command();
213 } elsif(s/^gcc\s*//) {
215 ($read_files, $write_files) = gcc_command($_);
216 } elsif(s/^(?:(?:\.\.\/)+|\.\/)tools\/makedep\s*//) {
218 ($read_files, $write_files) = makedep_command($_);
219 } elsif(s/^mkdir\s*//) {
221 ($read_files, $write_files) = mkdir_command($_);
222 } elsif(s/^ranlib\s*//) {
224 ($read_files, $write_files) = ranlib_command($_);
225 } elsif(s/^rm\s*//) {
227 ($read_files, $write_files, $remove_files) = rm_command($_);
228 } elsif(s/^sed\s*//) {
230 ($read_files, $write_files) = sed_command($_);
231 } elsif(s/^strip\s*//) {
233 ($read_files, $write_files) = strip_command($_);
234 } elsif(s/^LD_LIBRARY_PATH="(?:(?:\.\.\/)*unicode)?:\$LD_LIBRARY_PATH"\s+(?:\.\.\/)*tools\/winebuild\/winebuild\s*//) {
236 ($read_files, $write_files) = winebuild_command($_);
237 } elsif(s/^LD_LIBRARY_PATH="(?:(?:\.\.\/)*unicode)?:\$LD_LIBRARY_PATH"\s+(?:\.\.\/)*tools\/wmc\/wmc\s*//) {
239 ($read_files, $write_files) = wmc_command($_);
240 } elsif(s/^LD_LIBRARY_PATH="(?:(?:\.\.\/)*unicode)?:\$LD_LIBRARY_PATH"\s+(?:\.\.\/)*tools\/wrc\/wrc\s*//) {
242 ($read_files, $write_files) = wrc_command($_);
245 return ($tool, $read_files, $write_files, $remove_files);
248 ########################################################################
250 ########################################################################
258 if(/rc\s+(\S+)(\s+\S+)+$/) {
261 $read_files =~ s/^\s*//;
262 $read_files = [split(/\s+/, $read_files)];
267 return ($read_files, $write_files);
270 ########################################################################
272 ########################################################################
280 if(/-o\s+(\S+)\s+(\S+)$/) {
287 return ($read_files, $write_files);
290 ########################################################################
292 ########################################################################
300 ########################################################################
302 ########################################################################
310 ########################################################################
312 ########################################################################
317 if(/^(.*?): No such file or directory/) {
318 $message = "directory '$1' doesn't exist";
322 ########################################################################
324 ########################################################################
332 ########################################################################
334 ########################################################################
342 ########################################################################
344 ########################################################################
350 if(/-o\s+(\S+)\s+(\S+)$/) {
353 } elsif(/-o\s+(\S+)/) {
355 $read_files = ["<???>"];
356 } elsif(/^-shared.*?-o\s+(\S+)/) {
358 $read_files = ["<???>"];
363 return ($read_files, $write_files);
366 ########################################################################
368 ########################################################################
376 if(s/^warning:\s+//) {
381 } elsif(/^\(near initialization for \`(.*?)\'\)$/) {
383 } elsif(/^\`(.*?)\' defined but not used$/) {
385 } elsif(/^\`(.*?)\' is not at beginning of declaration$/) {
387 } elsif(/^\`%x\' yields only last 2 digits of year in some locales$/) {
389 } elsif(/^(.*?) format, different type arg \(arg (\d+)\)$/) {
391 } elsif(/^assignment from incompatible pointer type$/) {
393 } elsif(/^comparison between signed and unsigned$/) {
395 } elsif(/^comparison of unsigned expression < 0 is always false$/) {
397 } elsif(/^comparison of unsigned expression >= 0 is always true$/) {
399 } elsif(/^conflicting types for built-in function \`(.*?)\'$/) {
401 } elsif(/^empty body in an if-statement$/) {
403 } elsif(/^empty body in an else-statement$/) {
405 } elsif(/^implicit declaration of function \`(.*?)\'$/) {
407 } elsif(/^initialization from incompatible pointer type$/) {
409 } elsif(/^missing initializer$/) {
411 } elsif(/^ordered comparison of pointer with integer zero$/) {
413 } elsif(/^passing arg (\d+) of pointer to function from incompatible pointer type$/) {
415 } elsif(/^passing arg (\d+) of \`(\S+)\' from incompatible pointer type$/) {
417 } elsif(/^passing arg (\d+) of \`(\S+)\' makes integer from pointer without a cast$/) {
419 } elsif(/^type of \`(.*?)\' defaults to \`(.*?)\'$/) {
427 $message = "function $function: $_";
434 } elsif(/^\`(.*?)\' undeclared \(first use in this function\)$/) {
436 } elsif(/^\(Each undeclared identifier is reported only once$/) {
438 } elsif(/^for each function it appears in.\)$/) {
440 } elsif(/^parse error before `(.*?)'$/) {
447 } elsif(/^In function \`(.*?)\':$/) {
449 } elsif(/^At top level:$/) {
456 ########################################################################
458 ########################################################################
460 sub install_command {
466 ########################################################################
468 ########################################################################
476 if(/-r\s+(.*?)\s+-o\s+(\S+)$/) {
478 $read_files = [split(/\s+/, $1)];
483 return ($read_files, $write_files);
486 ########################################################################
488 ########################################################################
494 if(/^the use of \`(.+?)\' is dangerous, better use \`(.+?)\'$/) {
499 ########################################################################
501 ########################################################################
503 sub ldconfig_command {
509 ########################################################################
511 ########################################################################
513 sub makedep_command {
519 ########################################################################
521 ########################################################################
529 ########################################################################
531 ########################################################################
539 $read_files = [split(/\s+/)];
542 return ($read_files, $write_files);
545 ########################################################################
547 ########################################################################
552 return ([], [], [split(/\s+/, $_)]);
555 ########################################################################
557 ########################################################################
565 ########################################################################
567 ########################################################################
575 ########################################################################
577 ########################################################################
579 sub winebuild_command {
585 ########################################################################
587 ########################################################################
589 sub winebuild_output {
596 ########################################################################
598 ########################################################################
609 my $rc_file = $mc_file;
610 $rc_file =~ s/\.mc$/.rc/;
612 $write_files = [$rc_file];
613 $read_files = [$mc_file];
618 return ($read_files, $write_files);
621 ########################################################################
623 ########################################################################
630 ########################################################################
632 ########################################################################
643 my $o_file = $rc_file;
644 $o_file =~ s/\.rc$/.o/;
646 $write_files = [$o_file];
647 $read_files = [$rc_file];
652 return ($read_files, $write_files);
655 ########################################################################
657 ########################################################################