1999-06-25 13:59:14 +04:00
|
|
|
#perl
|
|
|
|
#
|
1999-11-06 06:40:37 +03:00
|
|
|
# The contents of this file are subject to the Netscape Public
|
|
|
|
# License Version 1.1 (the "License"); you may not use this file
|
|
|
|
# except in compliance with the License. You may obtain a copy of
|
|
|
|
# the License at http://www.mozilla.org/NPL/
|
1999-06-25 13:59:14 +04:00
|
|
|
#
|
1999-11-06 06:40:37 +03:00
|
|
|
# Software distributed under the License is distributed on an "AS
|
|
|
|
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
# implied. See the License for the specific language governing
|
|
|
|
# rights and limitations under the License.
|
1999-06-25 13:59:14 +04:00
|
|
|
#
|
1999-11-06 06:40:37 +03:00
|
|
|
# The Original Code is mozilla.org code.
|
|
|
|
#
|
|
|
|
# The Initial Developer of the Original Code is Netscape
|
1999-06-25 13:59:14 +04:00
|
|
|
# Communications Corporation. Portions created by Netscape are
|
1999-11-06 06:40:37 +03:00
|
|
|
# Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
# Rights Reserved.
|
|
|
|
#
|
|
|
|
# Contributor(s):
|
1999-06-25 13:59:14 +04:00
|
|
|
#
|
|
|
|
|
|
|
|
# Build BeOS intermodule dependencies
|
|
|
|
|
|
|
|
$| = 1;
|
|
|
|
|
|
|
|
@SOLIST=<dist/bin/*.so dist/bin/component/*.so dist/BeOS*/bin/*.so /boot/develop/lib/x86/*.so>;
|
|
|
|
|
|
|
|
# load defined symbols
|
|
|
|
foreach $so (@SOLIST) {
|
|
|
|
next if $so eq $name;
|
1999-07-11 15:00:46 +04:00
|
|
|
if(open(SO, "objdump --dynamic-syms $so | grep \" g \" | cut -f 2 | cut -c 10- |")) {
|
1999-06-25 13:59:14 +04:00
|
|
|
$so =~ s/\/*[^\/]*\///g;
|
|
|
|
$so =~ s/^lib//;
|
|
|
|
$so =~ s/\.so$//;
|
|
|
|
while($def = <SO>) {
|
|
|
|
chop $def;
|
1999-07-11 15:00:46 +04:00
|
|
|
#if($defsyms{$def}) {
|
|
|
|
# print "$def already defined in $defsyms{$1}\n";
|
1999-06-25 13:59:14 +04:00
|
|
|
#}
|
1999-07-11 15:00:46 +04:00
|
|
|
$defsyms{$def} = $so;
|
1999-06-25 13:59:14 +04:00
|
|
|
}
|
|
|
|
close(SO);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mkdir "dependencies.beos", 0777;
|
|
|
|
|
|
|
|
foreach $name (@ARGV) {
|
|
|
|
($libname = $name) =~ s/\/*[^\/]*\///g;
|
|
|
|
$libname =~ s/^lib//;
|
|
|
|
$libname =~ s/\.so$//;
|
|
|
|
print "Processing $libname...\n";
|
1999-07-11 15:00:46 +04:00
|
|
|
|
|
|
|
if(open(IN, "objdump --dynamic-syms $name | grep *UND* | cut -c 33- |")) {
|
1999-06-25 13:59:14 +04:00
|
|
|
@syms = <IN>;
|
|
|
|
close IN;
|
|
|
|
chop @syms;
|
|
|
|
|
|
|
|
foreach $s (@syms) {
|
|
|
|
$so = $defsyms{$s};
|
|
|
|
$deps{$so}++ if $so && $so ne $libname;
|
|
|
|
#print "$s not found\n" unless $so;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(open(OUT, ">dependencies.beos/$libname.dependencies")) {
|
|
|
|
foreach $key (sort(keys %deps)) {
|
|
|
|
print OUT " $key";
|
|
|
|
}
|
|
|
|
print OUT "\n";
|
|
|
|
close(OUT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
undef %deps;
|
|
|
|
}
|