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 ########################################################################
35 if(!defined($where)) {
43 $context .= "<$where>";
47 $context = "<$where>";
54 $output->write("$directory: $context: can't parse output: '$current'\n");
56 $output->write("$directory: $context: can't parse output: '$current'\n");
61 ########################################################################
63 ########################################################################
74 my ($new_tool, $read_files, $write_files, $remove_files) = command($_);
75 if(defined($new_tool)) {
81 if($directory && $directory ne ".") {
82 $progress .= "$directory: ";
84 $progress .= "$tool: ";
86 if($tool =~ /^cd|make$/) {
88 } elsif($tool =~ /^ld$/) {
89 foreach my $file (@{$read_files}) {
90 $output->lazy_progress("$progress: reading '$file'");
92 my $file = $$write_files[0];
93 $output->progress("$progress: writing '$file'");
94 } elsif($tool =~ /^rm$/) {
95 foreach my $file (@{$remove_files}) {
96 $output->lazy_progress("$progress: removing '$file'");
99 if($#$read_files >= 0) {
100 $progress .= "read[" . join(" ", @{$read_files}) . "]";
102 if($#$write_files >= 0) {
103 if($#$read_files >= 0) {
106 $progress .= "write[" . join(" ", @{$write_files}) . "]";
108 if($#$remove_files >= 0) {
109 if($#$read_files >= 0 || $#$write_files >= 0) {
112 $progress .= "remove[" . join(" ", @{$remove_files}) . "]";
115 $output->progress($progress);
121 if(/^Wine build complete\.$/) {
123 } elsif(/^(.*?) is newer than (.*?), please rerun (.*?)\!$/) {
125 } elsif(/^(.*?) is older than (.*?), please rerun (.*?)$/) {
127 } elsif(s/^make(?:\[(\d+)\])?:\s*//) {
130 } elsif(!defined($tool)) {
132 } elsif($tool eq "bison" && /^conflicts:\s+\d+\s+shift\/reduce$/) {
134 } elsif($tool eq "gcc" && /^(?:In file included |\s*)from (.+?):(\d+)[,:]$/) {
136 } elsif($tool =~ /^gcc|ld$/ && s/^(.+?\.s?o)(?:\(.*?\))?:\s*//) {
139 } elsif($tool =~ /^gcc|ld$/ && s/^collect2:\s*//) {
141 ld_output("collect2", $_);
142 } elsif($tool eq "gcc" && s/^(.+?\.[chly]):\s*//) {
144 } elsif($tool eq "winebuild" && s/^(.+?\.spec):\s*//) {
145 winebuild_output($1, $_);
146 } elsif($tool eq "wmc" && s/^(.+?\.mc):\s*//) {
148 } elsif($tool eq "wrc" && s/^(.+?\.rc):\s*//) {
150 } elsif($tool eq "cd" && s/^\/bin\/sh:\s*cd:\s*//) {
161 ########################################################################
163 ########################################################################
174 } elsif(/^\*\*\* \[(.*?)\] Error (\d+)$/) {
176 } elsif(/^\*\*\* Warning:\s+/) { #
177 if(/^File \`(.+?)\' has modification time in the future \((.+?) > \(.+?\)\)$/) {
180 error("make_output");
182 } elsif(/^\`(.*?)\' is up to date.$/) {
184 } elsif(/^\[(.*?)\] Error (\d+) \(ignored\)$/) {
186 } elsif(/^(Entering|Leaving) directory \`(.*?)\'$/) {
187 if($1 eq "Entering") {
194 foreach my $component (split(/\//, $directory)) {
195 if($component eq "wine") {
198 push @components, $component;
201 $directory = join("/", @components);
202 } elsif(/^(.*?) is older than (.*?), please rerun (.*?)\$/) {
204 } elsif(/^Nothing to be done for \`(.*?)\'\.$/) {
206 } elsif(s/^warning:\s+//) {
207 if(/^Clock skew detected. Your build may be incomplete.$/) {
210 error("make_output");
213 error("make_output");
218 ########################################################################
220 ########################################################################
227 my $read_files = ["<???>"];
228 my $write_files = ["<???>"];
229 my $remove_files = [];
233 if(s/^\[\s+-d\s+(.*?)\s+\]\s+\|\|\s+//) {
239 ($read_files, $write_files) = ar_command($_);
240 } elsif(s/^as\s+//) {
242 ($read_files, $write_files) = as_command($_);
243 } elsif(s/^bison\s+//) {
245 ($read_files, $write_files) = bison_command($_);
246 } elsif(s/^cd\s+//) {
248 ($read_files, $write_files) = cd_command($_);
249 } elsif(s/^flex\s+//) {
251 ($read_files, $write_files) = flex_command($_);
252 } elsif(s/^for\s+//) {
254 ($read_files, $write_files) = for_command($_);
255 } elsif(s/^\/usr\/bin\/install\s+//) {
257 ($read_files, $write_files) = install_command($_);
258 } elsif(s/^ld\s+//) {
260 ($read_files, $write_files) = ld_command($_);
261 } elsif(s/^\/sbin\/ldconfig\s+//) {
263 ($read_files, $write_files) = ldconfig_command();
264 } elsif(s/^gcc\s+//) {
266 ($read_files, $write_files) = gcc_command($_);
267 } elsif(s/^(?:(?:\.\.\/)+|\.\/)tools\/makedep\s+//) {
269 ($read_files, $write_files) = makedep_command($_);
270 } elsif(s/^mkdir\s+//) {
272 ($read_files, $write_files) = mkdir_command($_);
273 } elsif(s/^ranlib\s+//) {
275 ($read_files, $write_files) = ranlib_command($_);
276 } elsif(s/^rm\s+//) {
278 ($read_files, $write_files, $remove_files) = rm_command($_);
279 } elsif(s/^sed\s+//) {
281 ($read_files, $write_files) = sed_command($_);
282 } elsif(s/^strip\s+//) {
284 ($read_files, $write_files) = strip_command($_);
285 } elsif(s/^LD_LIBRARY_PATH="(?:(?:\.\.\/)*unicode)?:\$LD_LIBRARY_PATH"\s+(?:\.\.\/)*tools\/winebuild\/winebuild\s+//) {
287 ($read_files, $write_files) = winebuild_command($_);
288 } elsif(s/^LD_LIBRARY_PATH="(?:(?:\.\.\/)*unicode)?:\$LD_LIBRARY_PATH"\s+(?:\.\.\/)*tools\/wmc\/wmc\s+//) {
290 ($read_files, $write_files) = wmc_command($_);
291 } elsif(s/^LD_LIBRARY_PATH="(?:(?:\.\.\/)*unicode)?:\$LD_LIBRARY_PATH"\s+(?:\.\.\/)*tools\/wrc\/wrc\s+//) {
293 ($read_files, $write_files) = wrc_command($_);
296 return ($tool, $read_files, $write_files, $remove_files);
299 ########################################################################
301 ########################################################################
309 if(/rc\s+(\S+)(\s+\S+)+$/) {
312 $read_files =~ s/^\s*//;
313 $read_files = [split(/\s+/, $read_files)];
318 return ($read_files, $write_files);
321 ########################################################################
323 ########################################################################
331 if(/-o\s+(\S+)\s+(\S+)$/) {
338 return ($read_files, $write_files);
341 ########################################################################
343 ########################################################################
351 ########################################################################
353 ########################################################################
361 ########################################################################
363 ########################################################################
368 if(/^(.*?): No such file or directory/) {
369 $message = "directory '$1' doesn't exist";
373 ########################################################################
375 ########################################################################
383 ########################################################################
385 ########################################################################
393 ########################################################################
395 ########################################################################
401 if(/-o\s+(\S+)\s+(\S+)$/) {
404 } elsif(/-o\s+(\S+)/) {
406 $read_files = ["<???>"];
407 } elsif(/^-shared.*?-o\s+(\S+)/) {
409 $read_files = ["<???>"];
411 error("gcc_command");
414 return ($read_files, $write_files);
417 ########################################################################
419 ########################################################################
427 if(s/^warning:\s+//) {
432 } elsif(/^((?:signed |unsigned )?(?:int|long)) format, (different type|\S+) arg \(arg (\d+)\)$/) {
435 HACCEL|HACMDRIVER|HANDLE|HBITMAP|HBRUSH|HCALL|HCURSOR|HDC|HDRVR|HDESK|HDRAWDIB
436 HGDIOBJ|HKL|HGLOBAL|HIMC|HINSTANCE|HKEY|HLOCAL|
437 HMENU|HMIDISTRM|HMIDIIN|HMIDIOUT|HMIXER|HMIXEROBJ|HMMIO|HMODULE|
438 HLINE|HPEN|HPHONE|HPHONEAPP|
439 HRASCONN|HRGN|HRSRC|HWAVEIN|HWAVEOUT|HWINSTA|HWND|
440 SC_HANDLE|WSAEVENT|handle_t|pointer)$/x)
446 } elsif(/^\(near initialization for \`(.*?)\'\)$/) {
448 } elsif(/^\`(.*?)\' defined but not used$/) {
450 } elsif(/^\`(.*?)\' is not at beginning of declaration$/) {
452 } elsif(/^\`%x\' yields only last 2 digits of year in some locales$/) {
454 } elsif(/^assignment makes integer from pointer without a cast$/) {
456 } elsif(/^assignment makes pointer from integer without a cast$/) {
458 } elsif(/^assignment from incompatible pointer type$/) {
460 } elsif(/^cast from pointer to integer of different size$/) {
462 } elsif(/^comparison between pointer and integer$/) {
464 } elsif(/^comparison between signed and unsigned$/) {
466 } elsif(/^comparison of unsigned expression < 0 is always false$/) {
468 } elsif(/^comparison of unsigned expression >= 0 is always true$/) {
470 } elsif(/^conflicting types for built-in function \`(.*?)\'$/) {
472 } elsif(/^empty body in an if-statement$/) {
474 } elsif(/^empty body in an else-statement$/) {
476 } elsif(/^implicit declaration of function \`(.*?)\'$/) {
478 } elsif(/^initialization from incompatible pointer type$/) {
480 } elsif(/^initialization makes pointer from integer without a cast$/) {
482 } elsif(/^missing initializer$/) {
484 } elsif(/^ordered comparison of pointer with integer zero$/) {
486 } elsif(/^passing arg (\d+) of (?:pointer to function|\`(\S+)\') from incompatible pointer type$/) {
489 if(defined($name) && $name =~ /^GDI_AllocObject$/) {
494 } elsif(/^passing arg (\d+) of (?:pointer to function|\`(\S+)\') makes integer from pointer without a cast$/) {
496 } elsif(/^passing arg (\d+) of (?:pointer to function|\`(\S+)\') makes pointer from integer without a cast$/) {
498 } elsif(/^return makes integer from pointer without a cast$/) {
500 } elsif(/^return makes pointer from integer without a cast$/) {
502 } elsif(/^type of \`(.*?)\' defaults to \`(.*?)\'$/) {
504 } elsif(/^unused variable \`(.*?)\'$/) {
506 } elsif(!$options->pedantic) {
514 $message = "function $function: warning: $_";
516 $message = "warning: $_";
521 } elsif(/^\`(.*?)\' undeclared \(first use in this function\)$/) {
523 } elsif(/^\(Each undeclared identifier is reported only once$/) {
525 } elsif(/^conflicting types for \`(.*?)\'$/) {
527 } elsif(/^for each function it appears in.\)$/) {
529 } elsif(/^too many arguments to function$/) {
531 } elsif(/^previous declaration of \`(.*?)\'$/) {
533 } elsif(/^parse error before `(.*?)'$/) {
535 } elsif(!$options->pedantic) {
540 } elsif(/^In function \`(.*?)\':$/) {
542 } elsif(/^At top level:$/) {
549 ########################################################################
551 ########################################################################
553 sub install_command {
559 ########################################################################
561 ########################################################################
569 if(/-r\s+(.*?)\s+-o\s+(\S+)$/) {
571 $read_files = [split(/\s+/, $1)];
576 return ($read_files, $write_files);
579 ########################################################################
581 ########################################################################
589 } elsif(/^In function \`(.*?)\':$/) {
591 } elsif(0 && /^the use of \`(.+?)\' is dangerous, better use \`(.+?)\'$/) {
598 ########################################################################
600 ########################################################################
602 sub ldconfig_command {
608 ########################################################################
610 ########################################################################
612 sub makedep_command {
618 ########################################################################
620 ########################################################################
628 ########################################################################
630 ########################################################################
638 $read_files = [split(/\s+/)];
641 return ($read_files, $write_files);
644 ########################################################################
646 ########################################################################
651 return ([], [], [split(/\s+/, $_)]);
654 ########################################################################
656 ########################################################################
664 ########################################################################
666 ########################################################################
674 ########################################################################
676 ########################################################################
678 sub winebuild_command {
684 ########################################################################
686 ########################################################################
688 sub winebuild_output {
695 ########################################################################
697 ########################################################################
708 my $rc_file = $mc_file;
709 $rc_file =~ s/\.mc$/.rc/;
711 $write_files = [$rc_file];
712 $read_files = [$mc_file];
714 error("wmc_command");
717 return ($read_files, $write_files);
720 ########################################################################
722 ########################################################################
729 ########################################################################
731 ########################################################################
742 my $o_file = $rc_file;
743 $o_file =~ s/\.rc$/.o/;
745 $write_files = [$o_file];
746 $read_files = [$rc_file];
748 error("wrc_command");
751 return ($read_files, $write_files);
754 ########################################################################
756 ########################################################################