mfplat: Read queue subscriber within the critical section.
[wine/zf.git] / tools / winapi / make_filter
blobf080706dfb376644e82d3380201d56d87240eabe
1 #!/usr/bin/perl
3 # Copyright 1999, 2000, 2001 Patrik Stridvall
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 use strict;
21 use warnings 'all';
23 BEGIN {
24 $0 =~ m%^(.*?/?tools)/winapi/make_filter$%;
25 require "$1/winapi/setup.pm";
28 use config qw(
29 file_absolutize file_normalize
30 $current_dir $wine_dir
32 use output qw($output);
33 use make_filter_options qw($options);
35 use make_parser qw($directory $tool $file $line $message);
37 if($options->progress) {
38 $output->enable_progress;
39 } else {
40 $output->disable_progress;
43 ########################################################################
44 # main
45 ########################################################################
47 my $command = $options->make . " " . join(" ", $options->arguments);
48 open(IN, "($command) 2>&1 |") || die "Cannot execute command $command: $!";
50 while(<IN>) {
51 chomp;
53 if(!make_parser::line($_)) {
54 next;
57 if($message) {
58 if($file && $line) {
59 if($directory && $directory ne "." && $file !~ m%^/%) {
60 $output->write(file_normalize("$directory/$file") . ":$line: $message\n");
61 } else {
62 $output->write("$file:$line: $message\n");
64 } elsif($file) {
65 if($directory && $directory ne "." && $file !~ m%^/%) {
66 $output->write(file_normalize("$directory/$file") . ": $message\n");
67 } else {
68 $output->write("$file: $message\n");
70 } else {
71 if($directory && $directory ne ".") {
72 $output->write("$directory: $tool: $message\n");
73 } elsif($tool) {
74 $output->write("$tool: $message\n");
75 } else {
76 $output->write("$message\n");
79 } elsif($tool eq "make") {
80 if($directory && $directory ne ".") {
81 $output->progress("$directory: make");
86 close(IN);
88 $output->hide_progress();