5 # Synopsis: Generate a list of the libraries in which a symbol is defined or
8 # Syntax: GenLibDeps.pl <directory_with_libraries_in_it> <symbol>
11 # Give first option a name.
12 my $Directory = $ARGV[0];
13 my $Symbol = $ARGV[1];
16 # Open the directory and read its contents, sorting by name and differentiating
17 # by whether its a library (.a) or an object file (.o)
18 opendir DIR
,$Directory;
19 my @files = readdir DIR
;
21 @objects = grep(/l?i?b?LLVM.*\.[oa]$/,sort(@files));
23 # Gather definitions from the libraries
24 foreach $lib (@objects) {
27 "nm $Directory/$lib | grep '$Symbol' | sort --key=3 | uniq |";
29 if (!$head) { print "$lib:\n"; $head = 1; }