version 1.11, 2008/09/16 23:28:53 |
version 1.12, 2008/09/16 23:38:04 |
|
|
#!/usr/bin/perl |
#!/usr/bin/perl |
# $RedRiver: find_depends,v 1.10 2008/09/16 22:15:03 andrew Exp $ |
# $RedRiver: find_depends,v 1.11 2008/09/16 22:28:53 andrew Exp $ |
use strict; |
use strict; |
use warnings; |
use warnings; |
|
|
|
|
foreach (@libs) { |
foreach (@libs) { |
my $spec; |
my $spec; |
|
|
if (/\/ld\.so$/) { |
if ($_ eq $file) { |
$spec = $_; |
# We don't want to include the file we are looking in |
|
next; |
} |
} |
else { |
elsif ( my ($name, $maj, $min) = $_ =~ /lib([^\/]+)\.so\.(\d+)\.(\d+)$/ ) { |
if ( my ($name, $maj, $min) = $_ =~ /lib([^\/]+)\.so\.(\d+)\.(\d+)$/ ) { |
$spec = 'l' . $name . '.' . $maj . '.' . $min; |
$spec = 'l' . $name . '.' . $maj . '.' . $min; |
if ($ld->{$spec}) { |
|
$locs->{$spec} = $ld->{$spec}; |
} |
} |
} |
} |
|
elsif (-e $_) { |
next if ! $spec; |
$spec = $_; |
next if exists $locs->{$spec}; |
$locs->{$spec} = $spec; |
|
|
print " Found spec '$spec'\n" if $opts{v}; |
|
|
|
if (-e $spec) { |
|
$locs->{$spec} = $spec; |
|
} |
} |
else { |
else { |
$locs->{$spec} = $ld->{$spec}; |
next; |
} |
} |
|
|
if (! $locs->{$spec}) { |
if (! $locs->{$spec}) { |
print STDERR "Couldn't find location for '$_' (file '$file')\n"; |
print STDERR "Couldn't find location for '$_' (file '$file')\n"; |
next; |
next; |
} |
} |
|
|
|
print " Found '$spec' => '$locs->{$spec}'\n" if $opts{v}; |
|
|
$locs = find_libs($locs->{$spec}, $ld, $locs); |
$locs = find_libs($locs->{$spec}, $ld, $locs); |
|
|