]> git.pld-linux.org Git - projects/cleanbuild.git/blame - findbr
findbr: check errors from mkmf.log as well
[projects/cleanbuild.git] / findbr
CommitLineData
c494424e 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5use IPC::Open2;
c728428f 6use Cwd;
73f04dab 7use constant DOCKER => -e '/.dockerenv';
c494424e 8
c728428f 9my $pwd = getcwd();
c494424e 10# how to run poldek
11my @ignore = qw(vserver-packages python-devel-src);
ce96f77c
ER
12my @poldek;
13if (DOCKER) {
110507d2 14 push(@poldek, qw[poldek]);
ce96f77c 15} else {
fe1f4ce2 16 push(@poldek, qw[sudo poldek -n th-x86_64-ready],
ce96f77c
ER
17 "--cachedir=$pwd/poldekcache",
18 "--conf=$pwd/poldekconf/poldek.conf",
19 );
20}
21push(@poldek, (
fe1f4ce2 22 "--skip-installed",
c494424e 23 "-O", "ignore=" . (join " ", @ignore)
ce96f77c 24));
c494424e 25
26# if multiple packages provide some funcionality those will be selected:
27my %preferred = (
28 "automake" => +1,
29 "autoconf" => +1,
30 "pkgconfig" => +1,
31
32 "python" => +1,
33 "python-modules" => +1,
9ac658a4 34 "python-setuptools" => +1,
c494424e 35
36 "perl-modules" => +1,
37 "perl-Encode" => +2,
38
39 "zlib-devel" => +1,
40 "libstdc++-devel" => +1,
a75e2ecf 41 "libusb-compat-devel" => +1,
022b6e5b 42 "libjpeg-devel" => +1,
c728428f 43 "libpng-devel" => +1,
022b6e5b 44 "libsamplerate-devel" => +1,
45 "pulseaudio-devel" => +1,
46 "xorg-lib-libXrandr-devel" => +1,
c728428f 47 "sqlite-devel" => +1,
a896e84e 48
49 "ice-devel" => -1,
c494424e 50);
51
44dfaf2a 52# translate package name to provides name
c494424e 53my %translate = (
a896e84e 54 "gcc-c++" => "libstdc++-devel",
c494424e 55 "rarian-compat" => "scrollkeeper",
022b6e5b 56 "Mesa-libGL" => "OpenGL",
57 "Mesa-libGL-devel" => "OpenGL-devel",
c494424e 58 "Mesa-libGLU-devel" => "OpenGL-GLU-devel",
59);
60
a896e84e 61my @skip = qw(hostname git svn svnversion mt gawk);
a6c4aafb 62my %skip;
63@skip{ @skip } = (1) x scalar @skip;
64
c494424e 65# for m4 in *.m4; do R=$(rpm -qf $m4); R=${R%-*-*}; \
66# awk -vr=$R '/^\s*(AC_DEFUN|AU_ALIAS)/ { gsub(/\].*/,""); gsub(/.*\[/,""); print r " " $0}' $m4; \
67# done | sort | awk '{print "\t\"" $2 "\" => \"" $1 "\","}'
b91f88a4 68my %ac2br = do (DOCKER ? './cleanbuild/findbr-ac2br' : './findbr-ac2br');
c494424e 69
70my %cmake2br = (
71 "findkde4:44" => "kde4-kdelibs",
cb582ba6 72 "findmsgfmt" => "gettext-tools",
c494424e 73 "findpythoninterp" => "python",
74);
75
76BEGIN {
77 $SIG{__WARN__} = sub
78 {
79 local $_ = shift;
80 chomp;
81 print STDERR "\033[31;1m" . $_ . "\033[0m\n"
82 };
83}
84
85my $builddir = shift @ARGV;
86my @lines = <ARGV>;
87
88my $reason;
89
90my %out;
91sub add_br
92{
93 my $pkg = shift;
94 my $msg = shift || $reason;
95 if ( ref $pkg ) {
96 foreach my $p ( @$pkg ) {
97 add_br( $p, $msg );
98 }
99 return;
100 }
101
102 $msg =~ s/\n/ # /sg;
103
104 $pkg = $translate{ $pkg } || $pkg;
105
106 return if exists $out{ $pkg };
107 $out{ $pkg } = $msg;
108 print STDERR "\033[33;1madding: $pkg => $msg\033[0m\n";
109}
110
111sub poldek_cmd
112{
113 my $cmd = shift;
110507d2 114
c494424e 115 warn "Poldek: $cmd\n";
c494424e 116
110507d2
ER
117 my @cmd = (@poldek, "--shcmd=".$cmd);
118 open my $fh, '-|', @cmd or die "$!: @cmd";
119 my @read = <$fh>;
120 close $fh or die $!;
c494424e 121
110507d2 122 return wantarray ? @read : \@read;
c494424e 123}
124
125my $check_ac = 0;
c728428f 126my $check_config_log = undef;
d35930ef 127my $check_mkmf_log = undef;
c494424e 128
129my %checked_files;
130sub poldek_file
131{
132 my @files;
133 foreach ( @_ ) {
134 next if $checked_files{ $_ };
135 $checked_files{ $_ } = 1;
136 push @files, $_;
137 }
138 return unless @files;
139
140 my $search = join "; ", map "search -f $_", @files;
141 warn "Reason: $reason\n";
142 my @read = poldek_cmd( $search );
143
144 local $_;
145 my @found;
146 while ( $_ = shift @read ) {
147 if ( /(\d+) package\(s\) found:$/ ) {
148 foreach my $i ( 1..$1 ) {
149 $_ = shift @read;
150 chomp;
151 $_ =~ /^(.*)-.*?-.*?$/;
152 push @found, $1;
153 }
154 }
155 }
156
157 return unless @found;
158
159 my $found = $found[0];
160 if ( @found > 1 ) {
161 my $i = 0.0;
162 my %pts = map { ( $_ => ( ($i += 0.001) + ( $preferred{ $_ } || 0 ) ) ) }
163 reverse @found;
164 my @pref = sort { $pts{$b} <=> $pts{$a} } @found;
165 my $pref = join ", ", map "$_ => $pts{$_}", @pref;
166 warn "Multiple found: $pref\n";
167 $found = $pref[0];
168 }
169
170 $found = $translate{ $found } if $translate{ $found };
171
172 add_br( $found );
173}
174
175my $pkglist;
176sub get_pkglist
177{
178 my %pkglist;
179 my $read = poldek_cmd( "ls" );
180 foreach ( @$read ) {
181 chomp;
182 next unless /(\S+)-.*?-.*?\.[a-z0-9_]+$/;
183 my $pkg = $1;
184 $pkglist{ lc $pkg } = $pkg;
185 }
186 $pkglist = \%pkglist;
187}
188
189sub guess_package
190{
191 my $origname = shift;
192 get_pkglist() unless $pkglist;
193 return unless defined $origname;
194 my $name = lc $origname;
195 my @try = (
196 "lib$name-devel",
197 "$name-devel",
198 "$name",
199 "lib$name-.*-devel",
200 "$name-.*-devel",
201 ".*-lib$name-devel",
202 ".*-$name-devel",
203 ".*-lib$name-.*-devel",
204 ".*-$name-.*-devel",
205 );
206 my @select;
207 for my $k ( keys %$pkglist ) {
208 if ( $k =~ /$name/ ) {
209 push @select, $k;
210 }
211 }
212 @select = sort @select;
213
214 foreach my $try ( @try ) {
215 foreach my $pkg ( @select ) {
216 if ( $pkg =~ /^$try$/ ) {
217 warn "guessed: $origname => $pkglist->{ $pkg }\n";
218 return $pkglist->{ $pkg };
219 }
220 }
221 }
222 warn "$origname not guessed\n";
223 return undef;
224}
225
022b6e5b 226start_check:
227
c494424e 228my %checked;
229my $cmake_get_call = 0;
230my $cmake_pkg_list = 0;
572fe114 231my $py_ver = undef;
c494424e 232while ( $_ = shift @lines ) {
233 chomp;
234 #next if $checked{ $_ };
235 #$checked{ $_ } = 1;
236
572fe114
ER
237 # try to extract current python version from setup.py run
238 if (m{^copying .+ -> build-(\d+)/lib/}) {
239 $py_ver = $1;
240 warn "py_ver set to '$py_ver'\n";
241 }
242
c494424e 243 $reason = $_;
244 if ( /^\S+: (\S+): (?:Command )?not found$/ or /.*configure\[\d+\]: (\S+): not found$/
245 or m{which: no (\S+) in \(.*/bin.*\)}
246 or m{\S+: (\S+): command not found$}
024ede0e 247 or m{(?:/usr/bin/)?env: (\S+): No such file or directory}
11e3764f 248 or m{flock: (\S+): No such file or directory}
c494424e 249 or m{Can't exec "(\S+)": No such file or directory} ) {
250 my $exec = $1;
c728428f 251 $exec = $1 if $exec =~ m{^"(.*)"$};
a6c4aafb 252 next if $skip{ $exec };
c494424e 253 warn "Looking for executable $exec\n";
254 if ( $exec =~ m#^/# ) {
255 poldek_file( $exec );
256 }
257 poldek_file( "/usr/bin/$exec", "/bin/$exec" );
258 }
c494424e 259
bfe0e7d5 260 if ( /\S+\.[ch](?:pp|xx|c)?:\d+:\d+: error: (\S+): No such file or directory$/ or
42b8c385
ER
261 /\S+\.[ch](?:pp|xx|c)?:\d+:\d+: fatal error: (\S+): No such file or directory$/ or
262 /Can't find the '(\S+\.h)'? header/
263 ) {
c494424e 264 my $h = $1;
265 warn "Looking for C(++) header $h\n";
266 poldek_file( "/usr/include*/$h" );
267 }
0587f322
ER
268
269 if (m{^ImportError: No module named (\S+)$}
270 or m{^ERROR: Cannot find .+: No module named (\S+)$}
271 or m{^ERROR: Failed to import the ".+" module: No module named (\S+)$}
272 or m{^distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse\('([^'>=]+).*'\)}
572fe114 273 or m{^error: Could not find suitable distribution for Requirement.parse\('([^'>=]+).*'\)}
bfc5ded7 274 or m{^Couldn't find index page for '(\S+)'}
a7c421e2 275 ) {
c494424e 276 my $mod = $1;
277 $mod =~ s#\.#/#g;
572fe114 278 warn "Looking for Python$py_ver module $mod\n";
3a07fe6f 279 poldek_file(
a77393a6 280 "/usr/share/python$py_ver*/site-packages/$mod/__init__.py*",
572fe114 281 "/usr/share/python$py_ver*/$mod/__init__.py*",
a77393a6 282 "/usr/share/python$py_ver*/site-packages/$mod.py*",
572fe114 283 "/usr/share/python$py_ver*/$mod.py*",
a77393a6 284 "/usr/lib*/python$py_ver*/site-packages/$mod/__init__.py*",
572fe114 285 "/usr/lib*/python$py_ver*/$mod/__init__.py*",
a77393a6 286 "/usr/lib*/python$py_ver*/site-packages/$mod.py*",
572fe114 287 "/usr/lib*/python$py_ver*/$mod.py*",
a77393a6 288 "/usr/lib*/python$py_ver*/site-packages/_$mod.so",
572fe114 289 "/usr/lib*/python$py_ver*/_$mod.so",
a77393a6
ER
290 "/usr/lib*/python$py_ver*/site-packages/$mod.so",
291 "/usr/lib*/python$py_ver*/$mod.so",
292 );
c494424e 293 }
711787d1 294
94ac4b2b
ER
295 if (
296 m{^-- Could NOT find Sphinx \(missing: SPHINX_EXECUTABLE\)}
297 ) {
298 add_br("sphinx-pdg");
299 next;
300 }
301
6b04039f
ER
302 if (
303 m{^You need to install the (\S+) module} or
304 m{\*\*\*Error\*\*\*: You must have (\S+) >= (\S+) installed}
305 ) {
306 add_br($1);
307 next;
308 }
309
711787d1
ER
310 if (
311 m{^cannot load such file -- (\S+)} or
312 m{in `require': cannot load such file -- (\S+) \(LoadError\)}
313 ) {
314 my $mod = $1;
315 warn "Looking for ruby module $mod\n";
316 poldek_file(
317 "/usr/share/ruby/*/$mod.rb",
318 "/usr/share/ruby/vendor_ruby/*/$mod.rb",
319 "/usr/lib64/ruby/vendor_ruby/*/$mod.so",
320 );
321 }
322
a7c421e2 323 if ( /configure(?:\.in|\.ac)?:\d+: error: possibly undefined macro: (\S+)/
e6da4d63 324 or m{configure(?:\.in|\.ac)?:\d+: error: m4 macro `(\S+)' is not defined}
325 or m{warning: macro `(\S+)' not found in library} ) {
c494424e 326 my $macro = $1;
327 warn "Looking for autotools macro $macro\n";
328 if ( my $br = $ac2br{ $macro } ) {
329 add_br( $br );
330 next;
c728428f 331 } else {
332 $check_ac = 1;
c494424e 333 }
334 }
335 if ( /^No package '(\S+)' found$/ or
336 /Package (\S+) was not found in the pkg-config search path/
337 or m{None of the required '(\S+?)(?:[<>=].*)?' found}
338 or m{--\s+package '(\S+?)(?:[<>=].*)?' not found}
a7c421e2 339 or m{ERROR: cannot find a valid pkg-config package for \['(\S+?)(?:[<>=].*)?'\]}
c494424e 340 ) {
341 my $pkg = $1;
342 warn "Looking for package $pkg\n";
e785e639 343 poldek_file( "/usr/lib*/pkgconfig/$pkg.pc", "/usr/share/pkgconfig/$pkg.pc" );
c494424e 344 }
b0405c02
ER
345
346 if (/^ocamlfind: Package `(\S+)' not found - required by/
347 or m{Camlp4: Uncaught exception: DynLoader.Error \("(\S+)", "file not found in path"\)}
348 ) {
349 my $pkg = $1;
350 warn "Looking for ocaml package $pkg\n";
351 poldek_file( "/usr/lib*/ocaml/*/$pkg.a", "/usr/lib*/ocaml/*/$pkg");
352 }
353
c494424e 354 if ( m{^cp: cannot stat `(/.*)': No such file or directory$} ) {
355 my $f = $1;
356 warn "Looking for file $f\n";
357 poldek_file( $f );
358 }
b0405c02 359
bfc5ded7
ER
360 if ( m{ERROR: Could not find KDE4 (kde4-config)}) {
361 my $f = "/usr/bin/$1";
362 warn "Looking for file $f\n";
363 poldek_file( $f );
364 }
365
366 if (m{Ragel State Machine Compiler not found}) {
367 add_br( "ragel" );
368 next;
369 }
370
42b8c385
ER
371 if (m{ERROR: CMake is required to build}) {
372 add_br("cmake");
373 next;
374 }
375
376 # lucky guessing
377 if (m{'yum install (\S+)'}) {
378 add_br($1);
379 next;
380 }
381
c494424e 382 if ( m{^find-lang.sh: Error: international files not found for '}
383 or m{ gettext tools not found}
384 ) {
cb582ba6 385 add_br( "gettext-tools" );
c494424e 386 next;
387 }
711787d1 388
c494424e 389 if ( m{ pkg-config .*not .*found}
399a92dd
ER
390 or m{^checking for pkg-config\.\.\. no}
391 or m{^pkg-config unavailable, build terminated}
ed258c51 392 or m{^\*\*\*Error\*\*\*: You must have pkg-config >= .* installed}
bfc5ded7 393 or m{^-- Could NOT find PkgConfig \(missing: PKG_CONFIG_EXECUTABLE\)}
6b04039f 394 or m{exec: "pkg-config": executable file not found in \$PATH}
399a92dd 395 ) {
c494424e 396 add_br( "pkgconfig" );
c494424e 397 next;
398 }
711787d1 399
94ac4b2b 400 if ( m{Can't locate (.*?\.pm) in \@INC} ) {
c494424e 401 my $mod = $1;
402 warn "Looking for perl module $mod\n";
403 poldek_file( "/usr/lib*/perl*/$mod", "/usr/share/perl*/$mod" );
404 }
711787d1 405
04173c40
ER
406 if (
407 m{^(?:/usr/bin/ld: )?cannot find -l(.*?)$}
408 ) {
c494424e 409 my $lib = $1;
410 warn "Looking for library $lib\n";
c728428f 411 poldek_file( "/usr/lib64/lib$lib.so", "/usr/lib/lib$lib.so",
412 "/usr/lib*/lib$lib.so" );
c494424e 413 }
04173c40
ER
414
415 # full path to ldd files
416 if (
417 m{^WARNING; can.*t resolve .* dependency: (.*?)$}
418 ) {
419 my $lib = $1;
420 warn "Looking for library '$lib'\n";
421 poldek_file( "/usr/lib64/$lib", "/usr/lib/$lib", "/lib64/$lib", "/lib/$lib");
422 }
423
424 if ( m{^error: Couldn't exec (/\S+): No such file or directory$}
c494424e 425 or m{^Can't open perl script "(/\S+)": No such file or directory$}
426 or m{unable to open (/\S+) \(No such file or directory\)$}
427 or m{GConf-CRITICAL \*\*: No such file `(/.\S+?)'$}
428 or m{make.*: \*\*\* No rule to make target `(/\S+)'}
429 or m{g(?:cc|\+\+): (/\S+): No such file or directory$}
c728428f 430 or m{env: (/\S+): No such file or directory$}
c494424e 431 ) {
432 my $file = $1;
433 warn "Looking for file $file\n";
434 poldek_file( $file );
435 }
711787d1 436
c728428f 437 if ( m{^ValueError: Couldn't find include '(.*\.gir)'} ) {
438 my $file = $1;
439 warn "Looking for gir file $file\n";
440 poldek_file( "/usr/share/gir-1.0/" . $file );
441 }
711787d1
ER
442
443 if ( m{^error: Package `(\S+)' not found in specified Vala API directories or GObject-Introspection GIR directories}
444 ) {
445 my $file = $1;
446 warn "Looking for gir file $file\n";
447 poldek_file( "/usr/share/vala/vapi/$file.vapi");
448 }
449
c494424e 450 if ( m{failed.*http://www\.oasis-open\.org/docbook/xml/([\d\.]+/\S+\.dtd)} ) {
451 my $dtd = $1;
452 warn "Looking for docbook file $dtd\n";
453 poldek_file( "/usr/share/sgml/docbook/xml-dtd-$dtd" );
454 }
455 if ( m{http://docbook.sourceforge.net/release/xsl/current/(\S+\.xsl)} ) {
456 my $db = $1;
457 next if m{^\s*(/usr/bin/)?xsltproc };
458 warn "Looking for docbook file $db\n";
459 poldek_file( "/usr/share/sgml/*/$db" );
460 }
e7ee7564
ER
461 if (m{Could not find HTML docbook.xsl}) {
462 add_br("docbook-style-xsl");
463 }
a755261c 464
465 if ( m{LaTeX Error: File `(\S+)' not found} ) {
466 my $tex = $1;
467 warn "Looking for tex file $tex\n";
468 poldek_file( "/usr/share/tex*/$tex" );
469 }
470 if ( m{mv: cannot move `\S+' to `(/var/lib/texmf.*?)':} ) {
471 my $tex = $1;
472 warn "Looking for tex file $tex\n";
473 poldek_file( $tex );
474 }
475
c494424e 476 if ( m{configure: error: C\+\+ preprocessor "/lib/cpp" fails sanity check} ) {
477 add_br( "gcc-c++", "try: %undefine\t__cxx" );
478 }
479 if ( m{configure: error: C\+\+ compiler cannot create executables} ) {
480 add_br( "libstdc++-devel", "maybe try: %undefine\t__cxx" );
481 }
84dce524
ER
482 if ( m{ccache: error: Could not find compiler ".+-g\+\+" in PATH}) {
483 add_br("libstdc++-devel");
484 }
c494424e 485 if ( m{configure: error: XML::Parser perl module is required for intltool} ) {
486 add_br( "perl-XML-Parser" );
487 }
9ffdd22c 488 if ( m{iconv: conversion from `\S+' is not supported} ) {
489 add_br( "iconv" );
490 }
c494424e 491
e785e639
ER
492 if (m{rst2man \(python-docutils\) is required to build man pages}) {
493 add_br("docutils");
494 }
495
bfe0e7d5 496 if ( m{ (\S+) does not appear in AM_CONDITIONAL$} ) {
497 my $macro = $1;
498 warn "Looking for autotools macro $macro\n";
499 if ( my $br = $ac2br{ $macro } ) {
500 add_br( $br );
501 next;
502 } else {
503 $check_ac = 1;
504 }
505 }
506
c494424e 507 if ( m{configure\[\d+\]: syntax error: }
a75e2ecf 508 or m{\./configure\[\d+\]: \S+_\S+: not found}
509 or m{./configure\[\d+\]: .*unexpected}
510 or m{does not appear in AM_CONDITIONAL$}
511 ) {
c494424e 512 warn "Need to check configure source: $reason\n";
513 $check_ac = 1;
514 }
022b6e5b 515 if ( m{^configure: error:} ) {
516 $check_config_log = 1 unless defined $check_config_log;
517 }
c494424e 518
d35930ef
ER
519 if ( m{Check the mkmf.log file for more details} ) {
520 $check_mkmf_log = 1 unless defined $check_mkmf_log;
521 }
522
e785e639 523 if ( m{^CMake (?:Error|Warning) at (?:\S+/)?(\S+?)\.cmake:(\d+) } ) {
c494424e 524 my ( $module, $line ) = ( lc $1, $2 );
525 my $br;
526 if ( $module eq "findqt4" ) {
527 my $l = $lines[0];
528 chomp $l;
529 if ( $l =~ /qmake/ ) {
530 add_br( "qt4-qmake", $l );
531 } elsif ( $l =~ /rcc/ ) {
532 add_br( "qt4-build", $l );
533 } elsif ( $l =~ /Could NOT find (Qt\S+) header/ ) {
534 add_br( "$1-devel", $l );
535 } else {
536 warn "unrecognized Qt requirement: $l\n";
537 }
538 } elsif ( $module eq "cmakedeterminecxxcompiler" ) {
539 add_br( "libstdc++-devel",
540 '"try: -DCMAKE_CXX_COMPILER_WORKS=1 -DCMAKE_CXX_COMPILER="%{__cc}"' );
541 } elsif ( $br = $cmake2br{ $module . ":" . $line } ) {
542 add_br( $br );
543 } elsif ( $br = $cmake2br{ $module } ) {
544 add_br( $br );
545 } elsif ( $br = guess_package( $module =~ /find(.+)/ ) ) {
546 add_br( $br );
547 } else {
548 $cmake_get_call = 1;
549 warn "Unrecognized cmake error: $reason\n";
550 }
551 }
552 if ( m{^\s*ERROR: (?:\S+/)?(\S+?\.cmake) not found} ) {
553 my $cmake = $1;
554 warn "Looking for cmake file: $cmake\n";
555 poldek_file( "/usr/*/cmake/*/$cmake" )
556 }
557 if ( $cmake_get_call ) {
558 if ( m{^\s*/\S+/(\S+)\.cmake:(\d+) } ) {
559 my ( $module, $line ) = ( lc $1, $2 );
560 my $br;
561 if ( $br = $cmake2br{ $module . ":" . $line } ) {
562 add_br( $br );
563 $cmake_get_call = 0;
564 } elsif ( $br = $cmake2br{ $module } ) {
565 add_br( $br );
566 $cmake_get_call = 0;
567 } elsif ( $br = guess_package( $module =~ /find(.+)/ ) ) {
568 add_br( $br );
569 $cmake_get_call = 0;
570 }
e785e639
ER
571 } elsif (m{Can not use "(.+)" module which has not yet been found}
572 or m{Could not find a package configuration file provided by "(.+)"}) {
573 my $cmake = $1;
574
575 warn "Looking for cmake file: $cmake\n";
576 poldek_file(
577 "/usr/*/cmake/*/$cmake.cmake",
578 "/usr/*/cmake/*/${cmake}Config.cmake",
579 "/usr/*/cmake/*/${cmake}-config.cmake",
580 );
581 $cmake_get_call = 0;
c494424e 582 }
583 }
584 if ( m{^-- WARNING: you are using the obsolete 'PKGCONFIG' macro} ) {
585 add_br( "pkgconfig" );
586 }
e785e639 587 if ( m{QT_(QT\S+)_LIBRARY \(ADVANCED\)}
c494424e 588 or m{X11_(\S+)_LIB \(ADVANCED\)}
589 or m{Qt (\S+) library not found} ) {
590 my $find = $1;
591 my $pkg = guess_package( $find );
592 if ( $pkg ) {
593 add_br( $pkg );
594 } else {
595 warn "Cannot quess qt package: $find\n";
596 }
597 }
598
e6da4d63 599 if ( m{Unable to find a javac compiler;$} ) {
600 add_br( "jdk" );
601 }
9ffdd22c 602 if ( m{Could not find (\S+) Java extension for this JVM$} ) {
603 my $jar = $1;
604 warn "Looking for jar file: $jar\n";
605 poldek_file( "/usr/share/java/$jar.jar", "*/$jar.jar" )
606 }
e6da4d63 607
608
c494424e 609 if ( m{^-- The following OPTIONAL packages could NOT be located on your system} ) {
610 $cmake_pkg_list = 1;
611 }
612 if ( $cmake_pkg_list ) {
613 if ( /\s+\* (\S+) / ) {
614 my $find = $1;
615 my $pkg = guess_package( $find );
616 if ( $pkg ) {
617 add_br( $pkg );
618 } else {
619 warn "Cannot quess optional package: $find\n";
620 }
621 } elsif ( /^\s*$/ ) {
622 $cmake_pkg_list = 0;
623 }
624 }
c728428f 625
e785e639
ER
626 # CMake Error at CMakeLists.txt:86 (find_package):
627 # By not providing "FindQt5LinguistTools.cmake" in CMAKE_MODULE_PATH this
628 # project has asked CMake to find a package configuration file provided by
629 # "Qt5LinguistTools", but CMake did not find one.
630 #
631 # Could not find a package configuration file provided by "Qt5LinguistTools"
632 # with any of the following names:
633 #
634 # Qt5LinguistToolsConfig.cmake
635 # qt5linguisttools-config.cmake
636 #
637 # Add the installation prefix of "Qt5LinguistTools" to CMAKE_PREFIX_PATH or
638 # set "Qt5LinguistTools_DIR" to a directory containing one of the above
639 # files. If "Qt5LinguistTools" provides a separate development package or
640 # SDK, be sure it has been installed.
641 # ---
642 #CMake Warning at /usr/lib64/cmake/Qt5Core/Qt5CoreMacros.cmake:273 (find_package):
643 # Could not find a package configuration file provided by "Qt5Network" with
644 # any of the following names:
645 #
646 # Qt5NetworkConfig.cmake
647 # qt5network-config.cmake
648 #
649 # Add the installation prefix of "Qt5Network" to CMAKE_PREFIX_PATH or set
650 # "Qt5Network_DIR" to a directory containing one of the above files. If
651 # "Qt5Network" provides a separate development package or SDK, be sure it has
652 # been installed.
653 # Can not use "Network" module which has not yet been found.
654
655 if (m{By not providing "Find(.+)\.cmake" in CMAKE_MODULE_PATH}
656 or m{Could not find a package configuration file provided by "(.+)"
657 }) {
658 my $cmake = $1;
f08ffe39 659 my $lcmake = lc $cmake;
e785e639
ER
660
661 warn "Looking for cmake file: $cmake\n";
662 poldek_file(
663 "/usr/*/cmake/*/$cmake.cmake",
664 "/usr/*/cmake/*/${cmake}Config.cmake",
665 "/usr/*/cmake/*/${cmake}-config.cmake",
f08ffe39
ER
666 "/usr/*/cmake/*/${lcmake}Config.cmake",
667 "/usr/*/cmake/*/${lcmake}-config.cmake",
e785e639
ER
668 )
669 }
670
c728428f 671 if ( m{^configure:\d+: checking for (?:"(\S+)"|(\S+))$} ) {
672 my $exec = $1 || $2;
673 if ( @lines and $lines[0] =~ m{^configure:\d+: result: no$} ) {
a6c4aafb 674 next if $skip{ $exec };
c728428f 675 warn "Looking for executable $exec\n";
676 poldek_file( $exec ) if $exec =~ m#^/#;
677 poldek_file( "/usr/bin/$exec", "/bin/$exec" );
678 }
679 }
e7ee7564
ER
680
681
682 if (
683 m{Could not find (\S+)}
684 ) {
685 my $exec = $1;
686 poldek_file("/usr/bin/$exec", "/bin/$exec" );
687 }
c494424e 688}
689
690
691
d35930ef 692sub find_configure
c494424e 693{
694 return unless /^configure(\.(?:ac|in|in\.in))?$/;
695 return unless -r;
696
697 warn "$File::Find::name\n";
698 open F_IN, "<", $_;
699 my $file = $_;
700 while ( <F_IN> ) {
701 chomp;
702 if ( m{^\s*([A-Za-z0-9_]+)\s*(\(.*)?$} ) {
703 my $def = $1;
704 if ( my $br = $ac2br{ $def } ) {
705 add_br( $br, "$file: $_" );
706 } elsif ( $def !~ /^A[CM]_/ and $def =~ /^_?[A-Z]+_[A-Z_0-9a-z]+$/ ) {
707 #warn "Possible macro unrecognized: $def [[[$_]]]\n";
708 }
709 }
710 }
711 close F_IN;
712}
713
714use File::Find;
715if ( $check_ac ) {
d35930ef 716 find( \&find_configure, $builddir );
c494424e 717}
718
d35930ef 719sub find_config_log
022b6e5b 720{
721 return unless /^config\.log$/;
722 return unless -r;
723
724 warn "$File::Find::name\n";
725 open F_IN, "<", $_;
726 push @lines, <F_IN>;
727 close F_IN;
728}
729
730if ( $check_config_log ) {
731 $check_config_log = 0;
d35930ef
ER
732 find( \&find_config_log, $builddir );
733 goto start_check if @lines;
734}
735
736if ($check_mkmf_log) {
737 $check_mkmf_log = 0;
738 find(sub {
739 return unless /^mkmf\.log$/;
740 return unless -r;
741
742 warn "$File::Find::name\n";
743 open F_IN, "<", $_;
744 push @lines, <F_IN>;
745 close F_IN;
746 }, $builddir);
022b6e5b 747 goto start_check if @lines;
748}
749
c494424e 750foreach my $pkg ( sort keys %out ) {
751 print "$pkg -- $out{$pkg}\n";
752}
753# vim: ts=4 sw=4
This page took 0.207854 seconds and 4 git commands to generate.