Avoid parsing the whole tree to find libwine.so.

This commit is contained in:
2001-11-06 22:22:53 +00:00 committed by Alexandre Julliard
parent 070e749cfb
commit 443904d59b
1 changed files with 25 additions and 1 deletions

View File

@ -217,7 +217,31 @@ sub Check_BaseFiles {
$level = $is_ok; $level = $is_ok;
my @output = (); my @output = ();
Do_Check("for correct .so lib config (please wait)"); Do_Check("for correct .so lib config (please wait)");
push (@output, `find / -name libwine.so 2>/dev/null`);
# Build list of library directories.
# First parse ld.so.conf to find system-wide lib directories.
my @dirlist = ();
open (LDCONF, "</etc/ld.so.conf");
while (<LDCONF>) {
s/\#.*//; # eliminate comments
chomp;
if (-d $_) { push @dirlist, $_; }
}
close (LDCONF);
# Next parse LD_LIBRARY_PATH to find user-specific lib dirs.
my (@ld_dirs) = split (/:/, $ENV{'LD_LIBRARY_PATH'});
my ($dir);
foreach $dir (@ld_dirs) {
if (-d $dir) { push @dirlist, $dir; }
}
# Now check for a libwine.so in each directory
foreach $dir (@dirlist) {
my ($target) = $dir . "/libwine.so";
if (-f $target) { push @output, $target; }
}
print "DEBUG: found libwine: @output\n";
if (@output > 1) if (@output > 1)
{ {
$level = $is_suspect; $level = $is_suspect;