make_parser.pm 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824
  1. #
  2. # Copyright 1999, 2000, 2001 Patrik Stridvall
  3. #
  4. # This library is free software; you can redistribute it and/or
  5. # modify it under the terms of the GNU Lesser General Public
  6. # License as published by the Free Software Foundation; either
  7. # version 2.1 of the License, or (at your option) any later version.
  8. #
  9. # This library is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. # Lesser General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU Lesser General Public
  15. # License along with this library; if not, write to the Free Software
  16. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  17. #
  18. package make_parser;
  19. use strict;
  20. use warnings 'all';
  21. use setup qw($current_dir $wine_dir $winapi_dir);
  22. use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
  23. require Exporter;
  24. @ISA = qw(Exporter);
  25. @EXPORT = qw();
  26. @EXPORT_OK = qw($directory $tool $file $line $message);
  27. use vars qw($directory $tool $file $line $message);
  28. use output qw($output);
  29. use options qw($options);
  30. #sub command($);
  31. #sub gcc_output($$);
  32. #sub ld_output($$);
  33. #sub make_output($$);
  34. #sub winebuild_output($$);
  35. #sub wmc_output($$);
  36. #sub wrc_output($$);
  37. ########################################################################
  38. # global
  39. ########################################################################
  40. my $current;
  41. my $function;
  42. ########################################################################
  43. # error
  44. ########################################################################
  45. sub error($) {
  46. my $where = shift;
  47. if(!defined($where)) {
  48. $where = "";
  49. }
  50. my $context;
  51. if($tool) {
  52. $context = "$tool";
  53. if($where) {
  54. $context .= "<$where>";
  55. }
  56. } else {
  57. if($where) {
  58. $context = "<$where>";
  59. } else {
  60. $context = "<>";
  61. }
  62. }
  63. if(defined($tool)) {
  64. $output->write("$directory: $context: can't parse output: '$current'\n");
  65. } else {
  66. $output->write("$directory: $context: can't parse output: '$current'\n");
  67. }
  68. exit 1;
  69. }
  70. ########################################################################
  71. # make_output
  72. ########################################################################
  73. sub make_output($$) {
  74. my $level = shift;
  75. local $_ = shift;
  76. $file = "";
  77. $message = "";
  78. if(/^\*\*\* \[(.*?)\] Error (\d+)$/) {
  79. # Nothing
  80. } elsif(/^\*\*\* Error code (\d+)$/) {
  81. # Nothing
  82. } elsif(/^\*\*\* Warning:\s+/) { #
  83. if(/^File \`(.+?)\' has modification time in the future \((.+?) > \(.+?\)\)$/) {
  84. # Nothing
  85. } else {
  86. error("make_output");
  87. }
  88. } elsif(/^\`(.*?)\' is up to date.$/) {
  89. # Nothing
  90. } elsif(/^\[(.*?)\] Error (\d+) \(ignored\)$/) {
  91. # Nothing
  92. } elsif(/^don\'t know how to make (.*?)\. Stop$/) {
  93. $message = "$_";
  94. } elsif(/^(Entering|Leaving) directory \`(.*?)\'$/) {
  95. if($1 eq "Entering") {
  96. $directory = $2;
  97. } else {
  98. $directory = "";
  99. }
  100. my @components;
  101. foreach my $component (split(/\//, $directory)) {
  102. if($component eq "wine") {
  103. @components = ();
  104. } else {
  105. push @components, $component;
  106. }
  107. }
  108. $directory = join("/", @components);
  109. } elsif(/^(.*?) is older than (.*?), please rerun (.*?)\$/) {
  110. # Nothing
  111. } elsif(/^Nothing to be done for \`(.*?)\'\.$/) {
  112. # Nothing
  113. } elsif(s/^warning:\s+//) {
  114. if(/^Clock skew detected. Your build may be incomplete.$/) {
  115. # Nothing
  116. } else {
  117. error("make_output");
  118. }
  119. } elsif(/^Stop in (.*?)\.$/) {
  120. # Nothing
  121. } elsif(/^\s*$/) {
  122. # Nothing
  123. } else {
  124. error("make_output");
  125. }
  126. }
  127. ########################################################################
  128. # ar_command
  129. ########################################################################
  130. sub ar_command($) {
  131. local $_ = shift;
  132. my $read_files;
  133. my $write_files;
  134. if(/rc\s+(\S+)(\s+\S+)+$/) {
  135. $write_files = [$1];
  136. $read_files = $2;
  137. $read_files =~ s/^\s*//;
  138. $read_files = [split(/\s+/, $read_files)];
  139. } else {
  140. error("ar_command");
  141. }
  142. return ($read_files, $write_files);
  143. }
  144. ########################################################################
  145. # as_command
  146. ########################################################################
  147. sub as_command($) {
  148. local $_ = shift;
  149. my $read_files;
  150. my $write_files;
  151. if(/-o\s+(\S+)\s+(\S+)$/) {
  152. $write_files = [$1];
  153. $read_files = [$2];
  154. } else {
  155. error("as_command");
  156. }
  157. return ($read_files, $write_files);
  158. }
  159. ########################################################################
  160. # bision_command
  161. ########################################################################
  162. sub bison_command($) {
  163. local $_ = shift;
  164. return ([], []);
  165. }
  166. ########################################################################
  167. # cd_command
  168. ########################################################################
  169. sub cd_command($) {
  170. local $_ = shift;
  171. return ([], []);
  172. }
  173. ########################################################################
  174. # cd_output
  175. ########################################################################
  176. sub cd_output($) {
  177. local $_ = shift;
  178. if(/^(.*?): No such file or directory/) {
  179. $message = "directory '$1' doesn't exist";
  180. }
  181. }
  182. ########################################################################
  183. # flex_command
  184. ########################################################################
  185. sub flex_command($) {
  186. local $_ = shift;
  187. return ([], []);
  188. }
  189. ########################################################################
  190. # for_command
  191. ########################################################################
  192. sub for_command($) {
  193. local $_ = shift;
  194. return ([], []);
  195. }
  196. ########################################################################
  197. # gcc_command
  198. ########################################################################
  199. sub gcc_command($) {
  200. my $read_files;
  201. my $write_files;
  202. if(/-o\s+(\S+)\s+(\S+)$/) {
  203. my $write_file = $1;
  204. my $read_file = $2;
  205. $write_file =~ s%^\./%%;
  206. $read_file =~ s%^\./%%;
  207. $write_files = [$write_file];
  208. $read_files = [$read_file];
  209. } elsif(/-o\s+(\S+)/) {
  210. my $write_file = $1;
  211. $write_file =~ s%^\./%%;
  212. $write_files = [$write_file];
  213. $read_files = ["<???>"];
  214. } elsif(/^-shared.*?-o\s+(\S+)/) {
  215. my $write_file = $1;
  216. $write_file =~ s%^\./%%;
  217. $write_files = [$write_file];
  218. $read_files = ["<???>"];
  219. } else {
  220. error("gcc_command");
  221. }
  222. return ($read_files, $write_files);
  223. }
  224. ########################################################################
  225. # gcc_output
  226. ########################################################################
  227. sub gcc_output($$) {
  228. $file = shift;
  229. local $_ = shift;
  230. if(s/^(\d+):\s+//) {
  231. $line = $1;
  232. if(s/^warning:\s+//) {
  233. my $suppress = 0;
  234. if(/^((?:signed |unsigned )?(?:int|long)) format, (different type|\S+) arg \(arg (\d+)\)$/) {
  235. my $type = $2;
  236. if($type =~ /^(?:
  237. HACCEL|HACMDRIVER|HANDLE|HBITMAP|HBRUSH|HCALL|HCURSOR|HDC|HDRVR|HDESK|HDRAWDIB
  238. HGDIOBJ|HKL|HGLOBAL|HIMC|HINSTANCE|HKEY|HLOCAL|
  239. HMENU|HMIDISTRM|HMIDIIN|HMIDIOUT|HMIXER|HMIXEROBJ|HMMIO|HMODULE|
  240. HLINE|HPEN|HPHONE|HPHONEAPP|
  241. HRASCONN|HRGN|HRSRC|HWAVEIN|HWAVEOUT|HWINSTA|HWND|
  242. SC_HANDLE|WSAEVENT|handle_t|pointer)$/x)
  243. {
  244. $suppress = 1;
  245. } else {
  246. $suppress = 0;
  247. }
  248. } elsif(/^\(near initialization for \`(.*?)\'\)$/) {
  249. $suppress = 0;
  250. } elsif(/^\`(.*?)\' defined but not used$/) {
  251. $suppress = 0;
  252. } elsif(/^\`(.*?)\' is not at beginning of declaration$/) {
  253. $suppress = 0;
  254. } elsif(/^\`%x\' yields only last 2 digits of year in some locales$/) {
  255. $suppress = 1;
  256. } elsif(/^assignment makes integer from pointer without a cast$/) {
  257. $suppress = 0;
  258. } elsif(/^assignment makes pointer from integer without a cast$/) {
  259. $suppress = 0;
  260. } elsif(/^assignment from incompatible pointer type$/) {
  261. $suppress = 0;
  262. } elsif(/^cast from pointer to integer of different size$/) {
  263. $suppress = 0;
  264. } elsif(/^comparison between pointer and integer$/) {
  265. $suppress = 0;
  266. } elsif(/^comparison between signed and unsigned$/) {
  267. $suppress = 0;
  268. } elsif(/^comparison of unsigned expression < 0 is always false$/) {
  269. $suppress = 0;
  270. } elsif(/^comparison of unsigned expression >= 0 is always true$/) {
  271. $suppress = 0;
  272. } elsif(/^conflicting types for built-in function \`(.*?)\'$/) {
  273. $suppress = 0;
  274. } elsif(/^empty body in an if-statement$/) {
  275. $suppress = 0;
  276. } elsif(/^empty body in an else-statement$/) {
  277. $suppress = 0;
  278. } elsif(/^implicit declaration of function \`(.*?)\'$/) {
  279. $suppress = 0;
  280. } elsif(/^initialization from incompatible pointer type$/) {
  281. $suppress = 0;
  282. } elsif(/^initialization makes pointer from integer without a cast$/) {
  283. $suppress = 0;
  284. } elsif(/^missing initializer$/) {
  285. $suppress = 0;
  286. } elsif(/^ordered comparison of pointer with integer zero$/) {
  287. $suppress = 0;
  288. } elsif(/^passing arg (\d+) of (?:pointer to function|\`(\S+)\') from incompatible pointer type$/) {
  289. $suppress = 0;
  290. } elsif(/^passing arg (\d+) of (?:pointer to function|\`(\S+)\') makes integer from pointer without a cast$/) {
  291. $suppress = 0;
  292. } elsif(/^passing arg (\d+) of (?:pointer to function|\`(\S+)\') makes pointer from integer without a cast$/) {
  293. $suppress = 0;
  294. } elsif(/^return makes integer from pointer without a cast$/) {
  295. $suppress = 0;
  296. } elsif(/^return makes pointer from integer without a cast$/) {
  297. $suppress = 0;
  298. } elsif(/^type of \`(.*?)\' defaults to \`(.*?)\'$/) {
  299. $suppress = 0;
  300. } elsif(/^unused variable \`(.*?)\'$/) {
  301. $suppress = 0;
  302. } elsif(!$options->pedantic) {
  303. $suppress = 0;
  304. } else {
  305. error("gcc_output");
  306. }
  307. if(!$suppress) {
  308. if($function) {
  309. $message = "function $function: warning: $_";
  310. } else {
  311. $message = "warning: $_";
  312. }
  313. } else {
  314. $message = "";
  315. }
  316. } elsif(/^\`(.*?)\' undeclared \(first use in this function\)$/) {
  317. $message = "$_";
  318. } elsif(/^\(Each undeclared identifier is reported only once$/) {
  319. $message = "$_";
  320. } elsif(/^conflicting types for \`(.*?)\'$/) {
  321. $message = "$_";
  322. } elsif(/^for each function it appears in.\)$/) {
  323. $message = "$_";
  324. } elsif(/^too many arguments to function$/) {
  325. $message = "$_";
  326. } elsif(/^previous declaration of \`(.*?)\'$/) {
  327. $message = "$_";
  328. } elsif(/^parse error before `(.*?)'$/) {
  329. $message = "$_";
  330. } elsif(!$options->pedantic) {
  331. $message = "$_";
  332. } else {
  333. error("gcc_output");
  334. }
  335. } elsif(/^In function \`(.*?)\':$/) {
  336. $function = $1;
  337. } elsif(/^At top level:$/) {
  338. $function = "";
  339. } else {
  340. error("gcc_output");
  341. }
  342. }
  343. ########################################################################
  344. # install_command
  345. ########################################################################
  346. sub install_command($) {
  347. local $_ = shift;
  348. return ([], []);
  349. }
  350. ########################################################################
  351. # ld_command
  352. ########################################################################
  353. sub ld_command($) {
  354. local $_ = shift;
  355. my $read_files;
  356. my $write_files;
  357. if(/-r\s+(.*?)\s+-o\s+(\S+)$/) {
  358. $write_files = [$2];
  359. $read_files = [split(/\s+/, $1)];
  360. } else {
  361. error("ld_command");
  362. }
  363. return ($read_files, $write_files);
  364. }
  365. ########################################################################
  366. # ld_output
  367. ########################################################################
  368. sub ld_output($$) {
  369. $file = shift;
  370. local $_ = shift;
  371. if(/^In function \`(.*?)\':$/) {
  372. $function = $1;
  373. } elsif(/^more undefined references to \`(.*?)\' follow$/) {
  374. # Nothing
  375. } elsif(/^the use of \`(.+?)\' is dangerous, better use \`(.+?)\'$/) {
  376. # Nothing
  377. } elsif(/^undefined reference to \`(.*?)\'$/) {
  378. # Nothing
  379. } elsif(/^warning: (.*?)\(\) possibly used unsafely; consider using (.*?)\(\)$/) {
  380. # Nothing
  381. } elsif(/^warning: type and size of dynamic symbol \`(.*?)\' are not defined$/) {
  382. $message = "$_";
  383. } else {
  384. $message = "$_";
  385. }
  386. }
  387. ########################################################################
  388. # ldconfig_command
  389. ########################################################################
  390. sub ldconfig_command($) {
  391. local $_ = shift;
  392. return ([], []);
  393. }
  394. ########################################################################
  395. # makedep_command
  396. ########################################################################
  397. sub makedep_command($) {
  398. local $_ = shift;
  399. return ([], []);
  400. }
  401. ########################################################################
  402. # mkdir_command
  403. ########################################################################
  404. sub mkdir_command($) {
  405. local $_ = shift;
  406. return ([], []);
  407. }
  408. ########################################################################
  409. # ranlib_command
  410. ########################################################################
  411. sub ranlib_command($) {
  412. local $_ = shift;
  413. my $read_files;
  414. my $write_files;
  415. $read_files = [split(/\s+/)];
  416. $write_files = [];
  417. return ($read_files, $write_files);
  418. }
  419. ########################################################################
  420. # rm_command
  421. ########################################################################
  422. sub rm_command($) {
  423. local $_ = shift;
  424. s/^-f\s*//;
  425. return ([], [], [split(/\s+/, $_)]);
  426. }
  427. ########################################################################
  428. # sed_command
  429. ########################################################################
  430. sub sed_command($) {
  431. local $_ = shift;
  432. return ([], []);
  433. }
  434. ########################################################################
  435. # strip_command
  436. ########################################################################
  437. sub strip_command($) {
  438. local $_ = shift;
  439. return ([], []);
  440. }
  441. ########################################################################
  442. # winebuild_command
  443. ########################################################################
  444. sub winebuild_command($) {
  445. local $_ = shift;
  446. return ([], []);
  447. }
  448. ########################################################################
  449. # winebuild_output
  450. ########################################################################
  451. sub winebuild_output($$) {
  452. $file = shift;
  453. local $_ = shift;
  454. $message = $_;
  455. }
  456. ########################################################################
  457. # wmc_command
  458. ########################################################################
  459. sub wmc_command($) {
  460. local $_ = shift;
  461. my $read_files;
  462. my $write_files;
  463. if(/\s+(\S+)$/) {
  464. my $mc_file = $1;
  465. my $rc_file = $mc_file;
  466. $rc_file =~ s/\.mc$/.rc/;
  467. $write_files = [$rc_file];
  468. $read_files = [$mc_file];
  469. } else {
  470. error("wmc_command");
  471. }
  472. return ($read_files, $write_files);
  473. }
  474. ########################################################################
  475. # wmc_output
  476. ########################################################################
  477. sub wmc_output($$) {
  478. $file = shift;
  479. local $_ = shift;
  480. }
  481. ########################################################################
  482. # wrc_command
  483. ########################################################################
  484. sub wrc_command($) {
  485. local $_ = shift;
  486. my $read_files;
  487. my $write_files;
  488. if(/\s+(\S+)$/) {
  489. my $rc_file = $1;
  490. my $o_file = $rc_file;
  491. $o_file =~ s/\.rc$/.o/;
  492. $write_files = [$o_file];
  493. $read_files = [$rc_file];
  494. } else {
  495. error("wrc_command");
  496. }
  497. return ($read_files, $write_files);
  498. }
  499. ########################################################################
  500. # wrc_output
  501. ########################################################################
  502. sub wrc_output($$) {
  503. $file = shift;
  504. local $_ = shift;
  505. }
  506. ########################################################################
  507. # command
  508. ########################################################################
  509. sub command($) {
  510. local $_ = shift;
  511. my $tool;
  512. my $file;
  513. my $read_files = ["<???>"];
  514. my $write_files = ["<???>"];
  515. my $remove_files = [];
  516. s/^\s*(.*?)\s*$/$1/;
  517. if(s/^\[\s+-d\s+(.*?)\s+\]\s+\|\|\s+//) {
  518. # Nothing
  519. }
  520. if(s/^ar\s+//) {
  521. $tool = "ar";
  522. ($read_files, $write_files) = ar_command($_);
  523. } elsif(s/^as\s+//) {
  524. $tool = "as";
  525. ($read_files, $write_files) = as_command($_);
  526. } elsif(s/^bison\s+//) {
  527. $tool = "bison";
  528. ($read_files, $write_files) = bison_command($_);
  529. } elsif(s/^cd\s+//) {
  530. $tool = "cd";
  531. ($read_files, $write_files) = cd_command($_);
  532. } elsif(s/^flex\s+//) {
  533. $tool = "flex";
  534. ($read_files, $write_files) = flex_command($_);
  535. } elsif(s/^for\s+//) {
  536. $tool = "for";
  537. ($read_files, $write_files) = for_command($_);
  538. } elsif(s/^\/usr\/bin\/install\s+//) {
  539. $tool = "install";
  540. ($read_files, $write_files) = install_command($_);
  541. } elsif(s/^ld\s+//) {
  542. $tool = "ld";
  543. ($read_files, $write_files) = ld_command($_);
  544. } elsif(s/^\/sbin\/ldconfig\s+//) {
  545. $tool = "ldconfig";
  546. ($read_files, $write_files) = ldconfig_command();
  547. } elsif(s/^gcc\s+//) {
  548. $tool = "gcc";
  549. ($read_files, $write_files) = gcc_command($_);
  550. } elsif(s/^(?:(?:\.\.\/)+|\.\/)tools\/makedep\s+//) {
  551. $tool = "makedep";
  552. ($read_files, $write_files) = makedep_command($_);
  553. } elsif(s/^mkdir\s+//) {
  554. $tool = "mkdir";
  555. ($read_files, $write_files) = mkdir_command($_);
  556. } elsif(s/^ranlib\s+//) {
  557. $tool = "ranlib";
  558. ($read_files, $write_files) = ranlib_command($_);
  559. } elsif(s/^rm\s+//) {
  560. $tool = "rm";
  561. ($read_files, $write_files, $remove_files) = rm_command($_);
  562. } elsif(s/^sed\s+//) {
  563. $tool = "sed";
  564. ($read_files, $write_files) = sed_command($_);
  565. } elsif(s/^strip\s+//) {
  566. $tool = "sed";
  567. ($read_files, $write_files) = strip_command($_);
  568. } elsif(s/^LD_LIBRARY_PATH="(?:(?:\.\.\/)*unicode)?:\$LD_LIBRARY_PATH"\s+(?:\.\.\/)*tools\/winebuild\/winebuild\s+//) {
  569. $tool = "winebuild";
  570. ($read_files, $write_files) = winebuild_command($_);
  571. } elsif(s/^LD_LIBRARY_PATH="(?:(?:\.\.\/)*unicode)?:\$LD_LIBRARY_PATH"\s+(?:\.\.\/)*tools\/wmc\/wmc\s+//) {
  572. $tool = "wmc";
  573. ($read_files, $write_files) = wmc_command($_);
  574. } elsif(s/^LD_LIBRARY_PATH="(?:(?:\.\.\/)*unicode)?:\$LD_LIBRARY_PATH"\s+(?:\.\.\/)*tools\/wrc\/wrc\s+//) {
  575. $tool = "wrc";
  576. ($read_files, $write_files) = wrc_command($_);
  577. }
  578. return ($tool, $read_files, $write_files, $remove_files);
  579. }
  580. ########################################################################
  581. # line
  582. ########################################################################
  583. sub line($) {
  584. local $_ = shift;
  585. $file = "";
  586. $line = "";
  587. $message = "";
  588. $current = $_;
  589. my ($new_tool, $read_files, $write_files, $remove_files) = command($_);
  590. if(defined($new_tool)) {
  591. $tool = $new_tool;
  592. $function = "";
  593. my $progress = "";
  594. if($directory && $directory ne ".") {
  595. $progress .= "$directory: ";
  596. }
  597. if($tool) {
  598. $progress .= "$tool: ";
  599. }
  600. if($tool =~ /^(?:cd|make)$/) {
  601. # Nothing
  602. } elsif($tool eq "ld"/) {
  603. foreach my $file (@{$read_files}) {
  604. $output->lazy_progress("${progress}reading '$file'");
  605. }
  606. my $file = $$write_files[0];
  607. $output->progress("$progress: writing '$file'");
  608. } elsif($tool eq "rm") {
  609. foreach my $file (@{$remove_files}) {
  610. $output->lazy_progress("${progress}removing '$file'");
  611. }
  612. } else {
  613. if($#$read_files >= 0) {
  614. $progress .= "read[" . join(" ", @{$read_files}) . "]";
  615. }
  616. if($#$write_files >= 0) {
  617. if($#$read_files >= 0) {
  618. $progress .= ", ";
  619. }
  620. $progress .= "write[" . join(" ", @{$write_files}) . "]";
  621. }
  622. if($#$remove_files >= 0) {
  623. if($#$read_files >= 0 || $#$write_files >= 0) {
  624. $progress .= ", ";
  625. }
  626. $progress .= "remove[" . join(" ", @{$remove_files}) . "]";
  627. }
  628. $output->progress($progress);
  629. }
  630. return 0;
  631. }
  632. my $make = $options->make;
  633. if(/^Wine build complete\.$/) {
  634. # Nothing
  635. } elsif(/^(.*?) is newer than (.*?), please rerun (.*?)\!$/) {
  636. $message = "$_";
  637. } elsif(/^(.*?) is older than (.*?), please rerun (.*?)$/) {
  638. $message = "$_";
  639. } elsif(/^\`(.*?)\' is up to date.$/) {
  640. $tool = "make";
  641. make_output($1, $_);
  642. } elsif(s/^$make(?:\[(\d+)\])?:\s*//) {
  643. $tool = "make";
  644. make_output($1, $_);
  645. } elsif(!defined($tool)) {
  646. error("line");
  647. } elsif($tool eq "make") {
  648. make_output($1, $_);
  649. } elsif($tool eq "bison" && /^conflicts:\s+\d+\s+shift\/reduce$/) {
  650. # Nothing
  651. } elsif($tool eq "gcc" && /^(?:In file included |\s*)from (.+?):(\d+)[,:]$/) {
  652. # Nothing
  653. } elsif($tool =~ /^(?:gcc|ld)$/ && s/^(.+?\.s?o)(?:\(.*?\))?:\s*//) {
  654. $tool = "ld";
  655. ld_output($1, $_)
  656. } elsif($tool =~ /^(?:gcc|ld)$/ && s/^(.*?)ld:\s*//) {
  657. $tool = "ld";
  658. ld_output("", $_)
  659. } elsif($tool =~ /^(?:gcc|ld)$/ && s/^collect2:\s*//) {
  660. $tool = "ld";
  661. ld_output("collect2", $_);
  662. } elsif($tool eq "gcc" && s/^(.+?\.[chly]):\s*//) {
  663. gcc_output($1, $_);
  664. } elsif($tool eq "ld" && s/^(.+?\.c):(?:\d+:)?\s*//) {
  665. ld_output($1, $_);
  666. } elsif($tool eq "winebuild" && s/^(.+?\.spec):\s*//) {
  667. winebuild_output($1, $_);
  668. } elsif($tool eq "wmc" && s/^(.+?\.mc):\s*//) {
  669. wmc_output($1, $_);
  670. } elsif($tool eq "wrc" && s/^(.+?\.rc):\s*//) {
  671. wrc_output($1, $_);
  672. } elsif($tool eq "cd" && s/^\/bin\/sh:\s*cd:\s*//) {
  673. parse_cd_output($_);
  674. } elsif(/^\s*$/) {
  675. # Nothing
  676. } else {
  677. error("line");
  678. }
  679. $file =~ s/^\.\///;
  680. return 1;
  681. }
  682. 1;