7 use setup qw($current_dir $wine_dir $winapi_dir $winapi_check_dir);
9 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
14 @EXPORT_OK = qw($directory $tool $file $line $message);
16 use vars qw($directory $tool $file $line $message);
18 use output qw($output);
19 use options qw($options);
21 ########################################################################
23 ########################################################################
28 ########################################################################
30 ########################################################################
34 $output->write("make_filter: $tool: can't parse output: '$current'\n");
36 $output->write("make_filter: <>: can't parse output: '$current'\n");
41 ########################################################################
43 ########################################################################
54 my ($new_tool, $read_files, $write_files, $remove_files) = command($_);
55 if(defined($new_tool)) {
60 if($tool =~ /^cd|make$/) {
62 } elsif($tool =~ /^ld$/) {
63 foreach my $file (@{$read_files}) {
64 $output->lazy_progress("$directory: ld: reading '$file'");
66 my $file = $$write_files[0];
67 $output->progress("$directory: ld: writing '$file'");
68 } elsif($tool =~ /^rm$/) {
69 foreach my $file (@{$remove_files}) {
70 $output->lazy_progress("$directory: rm: removing '$file'");
73 my $progress = "$directory: $tool: ";
74 if($#$read_files >= 0) {
75 $progress .= "read[" . join(" ", @{$read_files}) . "]";
77 if($#$write_files >= 0) {
78 if($#$read_files >= 0) {
81 $progress .= "write[" . join(" ", @{$write_files}) . "]";
83 if($#$remove_files >= 0) {
84 if($#$read_files >= 0 || $#$write_files >= 0) {
87 $progress .= "remove[" . join(" ", @{$remove_files}) . "]";
90 $output->progress($progress);
95 if(/^Wine build complete\.$/) {
97 } elsif(/^(.*?) is newer than (.*?), please rerun (.*?)\!$/) {
99 } elsif(/^(.*?) is older than (.*?), please rerun (.*?)$/) {
101 } elsif(s/^make(?:\[(\d+)\])?:\s*//) {
104 } elsif(!defined($tool)) {
106 } elsif($tool eq "bison" && /^conflicts:\s+\d+\s+shift\/reduce$/) {
108 } elsif($tool eq "gcc" && /^In file included from (.+?):(\d+):$/) {
110 } elsif($tool =~ /^gcc|ld$/ && s/^(.+?\.o(?:\(.*?\))?):\s*//) {
112 } elsif($tool eq "gcc" && s/^(.+?\.[chly]):\s*//) {
114 } elsif($tool eq "winebuild" && s/^(.+?\.spec):\s*//) {
115 winebuild_output($1, $_);
116 } elsif($tool eq "wmc" && s/^(.+?\.mc):\s*//) {
118 } elsif($tool eq "wrc" && s/^(.+?\.rc):\s*//) {
120 } elsif($tool eq "cd" && s/^\/bin\/sh:\s*cd:\s*//) {
131 ########################################################################
133 ########################################################################
144 } elsif(/^\*\*\* \[(.*?)\] Error (\d+)$/) {
146 } elsif(/^\*\*\* Warning:\s+/) { #
147 if(/^File \`(.+?)\' has modification time in the future \((.+?) > \(.+?\)\)$/) {
152 } elsif(/^\`(.*?)\' is up to date.$/) {
154 } elsif(/^\[(.*?)\] Error (\d+) \(ignored\)$/) {
156 } elsif(/^(Entering|Leaving) directory \`(.*?)\'$/) {
157 if($1 eq "Entering") {
164 foreach my $component (split(/\//, $directory)) {
165 if($component eq "wine") {
168 push @components, $component;
171 $directory = join("/", @components);
172 } elsif(/^(.*?) is older than (.*?), please rerun (.*?)\$/) {
174 } elsif(/^Nothing to be done for \`(.*?)\'\.$/) {
176 } elsif(s/^warning:\s+//) {
177 if(/^Clock skew detected. Your build may be incomplete.$/) {
188 ########################################################################
190 ########################################################################
197 my $read_files = ["<???>"];
198 my $write_files = ["<???>"];
199 my $remove_files = [];
203 if(s/^\[\s+-d\s+(.*?)\s+\]\s+\|\|\s+//) {
209 ($read_files, $write_files) = ar_command($_);
210 } elsif(s/^as\s*//) {
212 ($read_files, $write_files) = as_command($_);
213 } elsif(s/^bison\s*//) {
215 ($read_files, $write_files) = bison_command($_);
216 } elsif(s/^cd\s*//) {
218 ($read_files, $write_files) = cd_command($_);
219 } elsif(s/^flex\s*//) {
221 ($read_files, $write_files) = flex_command($_);
222 } elsif(s/^for\s*//) {
224 ($read_files, $write_files) = for_command($_);
225 } elsif(s/^\/usr\/bin\/install\s*//) {
227 ($read_files, $write_files) = install_command($_);
228 } elsif(s/^ld\s*//) {
230 ($read_files, $write_files) = ld_command($_);
231 } elsif(s/^\/sbin\/ldconfig\s*//) {
233 ($read_files, $write_files) = ldconfig_command();
234 } elsif(s/^gcc\s*//) {
236 ($read_files, $write_files) = gcc_command($_);
237 } elsif(s/^(?:(?:\.\.\/)+|\.\/)tools\/makedep\s*//) {
239 ($read_files, $write_files) = makedep_command($_);
240 } elsif(s/^mkdir\s*//) {
242 ($read_files, $write_files) = mkdir_command($_);
243 } elsif(s/^ranlib\s*//) {
245 ($read_files, $write_files) = ranlib_command($_);
246 } elsif(s/^rm\s*//) {
248 ($read_files, $write_files, $remove_files) = rm_command($_);
249 } elsif(s/^sed\s*//) {
251 ($read_files, $write_files) = sed_command($_);
252 } elsif(s/^strip\s*//) {
254 ($read_files, $write_files) = strip_command($_);
255 } elsif(s/^LD_LIBRARY_PATH="(?:(?:\.\.\/)*unicode)?:\$LD_LIBRARY_PATH"\s+(?:\.\.\/)*tools\/winebuild\/winebuild\s*//) {
257 ($read_files, $write_files) = winebuild_command($_);
258 } elsif(s/^LD_LIBRARY_PATH="(?:(?:\.\.\/)*unicode)?:\$LD_LIBRARY_PATH"\s+(?:\.\.\/)*tools\/wmc\/wmc\s*//) {
260 ($read_files, $write_files) = wmc_command($_);
261 } elsif(s/^LD_LIBRARY_PATH="(?:(?:\.\.\/)*unicode)?:\$LD_LIBRARY_PATH"\s+(?:\.\.\/)*tools\/wrc\/wrc\s*//) {
263 ($read_files, $write_files) = wrc_command($_);
266 return ($tool, $read_files, $write_files, $remove_files);
269 ########################################################################
271 ########################################################################
279 if(/rc\s+(\S+)(\s+\S+)+$/) {
282 $read_files =~ s/^\s*//;
283 $read_files = [split(/\s+/, $read_files)];
288 return ($read_files, $write_files);
291 ########################################################################
293 ########################################################################
301 if(/-o\s+(\S+)\s+(\S+)$/) {
308 return ($read_files, $write_files);
311 ########################################################################
313 ########################################################################
321 ########################################################################
323 ########################################################################
331 ########################################################################
333 ########################################################################
338 if(/^(.*?): No such file or directory/) {
339 $message = "directory '$1' doesn't exist";
343 ########################################################################
345 ########################################################################
353 ########################################################################
355 ########################################################################
363 ########################################################################
365 ########################################################################
371 if(/-o\s+(\S+)\s+(\S+)$/) {
374 } elsif(/-o\s+(\S+)/) {
376 $read_files = ["<???>"];
377 } elsif(/^-shared.*?-o\s+(\S+)/) {
379 $read_files = ["<???>"];
384 return ($read_files, $write_files);
387 ########################################################################
389 ########################################################################
397 if(s/^warning:\s+//) {
402 } elsif(/^((?:signed |unsigned )?(?:int|long)) format, (different type|\S+) arg \(arg (\d+)\)$/) {
404 } elsif(/^\(near initialization for \`(.*?)\'\)$/) {
406 } elsif(/^\`(.*?)\' defined but not used$/) {
408 } elsif(/^\`(.*?)\' is not at beginning of declaration$/) {
410 } elsif(/^\`%x\' yields only last 2 digits of year in some locales$/) {
412 } elsif(/^assignment makes integer from pointer without a cast$/) {
414 } elsif(/^assignment makes pointer from integer without a cast$/) {
416 } elsif(/^assignment from incompatible pointer type$/) {
418 } elsif(/^cast from pointer to integer of different size$/) {
420 } elsif(/^comparison between pointer and integer$/) {
422 } elsif(/^comparison between signed and unsigned$/) {
424 } elsif(/^comparison of unsigned expression < 0 is always false$/) {
426 } elsif(/^comparison of unsigned expression >= 0 is always true$/) {
428 } elsif(/^conflicting types for built-in function \`(.*?)\'$/) {
430 } elsif(/^empty body in an if-statement$/) {
432 } elsif(/^empty body in an else-statement$/) {
434 } elsif(/^implicit declaration of function \`(.*?)\'$/) {
436 } elsif(/^initialization from incompatible pointer type$/) {
438 } elsif(/^initialization makes pointer from integer without a cast$/) {
440 } elsif(/^missing initializer$/) {
442 } elsif(/^ordered comparison of pointer with integer zero$/) {
444 } elsif(/^passing arg (\d+) of (?:pointer to function|\`(\S+)\') from incompatible pointer type$/) {
446 } elsif(/^passing arg (\d+) of (?:pointer to function|\`(\S+)\') makes integer from pointer without a cast$/) {
448 } elsif(/^passing arg (\d+) of (?:pointer to function|\`(\S+)\') makes pointer from integer without a cast$/) {
450 } elsif(/^return makes integer from pointer without a cast$/) {
452 } elsif(/^return makes pointer from integer without a cast$/) {
454 } elsif(/^type of \`(.*?)\' defaults to \`(.*?)\'$/) {
456 } elsif(/^unused variable \`(.*?)\'$/) {
458 } elsif(!$options->pedantic) {
466 $message = "function $function: $_";
473 } elsif(/^\`(.*?)\' undeclared \(first use in this function\)$/) {
475 } elsif(/^\(Each undeclared identifier is reported only once$/) {
477 } elsif(/^conflicting types for \`(.*?)\'$/) {
479 } elsif(/^for each function it appears in.\)$/) {
481 } elsif(/^too many arguments to function$/) {
483 } elsif(/^previous declaration of \`(.*?)\'$/) {
485 } elsif(/^parse error before `(.*?)'$/) {
487 } elsif(!$options->pedantic) {
492 } elsif(/^In function \`(.*?)\':$/) {
494 } elsif(/^At top level:$/) {
501 ########################################################################
503 ########################################################################
505 sub install_command {
511 ########################################################################
513 ########################################################################
521 if(/-r\s+(.*?)\s+-o\s+(\S+)$/) {
523 $read_files = [split(/\s+/, $1)];
528 return ($read_files, $write_files);
531 ########################################################################
533 ########################################################################
539 if(/^the use of \`(.+?)\' is dangerous, better use \`(.+?)\'$/) {
544 ########################################################################
546 ########################################################################
548 sub ldconfig_command {
554 ########################################################################
556 ########################################################################
558 sub makedep_command {
564 ########################################################################
566 ########################################################################
574 ########################################################################
576 ########################################################################
584 $read_files = [split(/\s+/)];
587 return ($read_files, $write_files);
590 ########################################################################
592 ########################################################################
597 return ([], [], [split(/\s+/, $_)]);
600 ########################################################################
602 ########################################################################
610 ########################################################################
612 ########################################################################
620 ########################################################################
622 ########################################################################
624 sub winebuild_command {
630 ########################################################################
632 ########################################################################
634 sub winebuild_output {
641 ########################################################################
643 ########################################################################
654 my $rc_file = $mc_file;
655 $rc_file =~ s/\.mc$/.rc/;
657 $write_files = [$rc_file];
658 $read_files = [$mc_file];
663 return ($read_files, $write_files);
666 ########################################################################
668 ########################################################################
675 ########################################################################
677 ########################################################################
688 my $o_file = $rc_file;
689 $o_file =~ s/\.rc$/.o/;
691 $write_files = [$o_file];
692 $read_files = [$rc_file];
697 return ($read_files, $write_files);
700 ########################################################################
702 ########################################################################