Member
Join Date: Jan 2006
|
Hi,
Is there any free utility that scans dynamic libraries (dylib) and builds a hierarchical tree diagram of all dependent modules. In Windows there is a utility called Dependency walker http://www.dependencywalker.com/ I want similar utility on Mac. Thank you. |
quote |
Member
Join Date: Jan 2006
|
I found solution to my question.
CODE: #!/usr/bin/env ruby paths = [ARGV[0]] libs = { ARGV[0] => 1 } while paths.size > 0 do path = paths.pop lines = `otool -L '#{path}'`.split("\n")[2..-1] new_libs = lines.collect do |line| line =~ /\s+(.*)\s+\(.*\)\s*/ $1 end new_libs.each do |lib| if libs[lib] then libs[lib] += 1 else libs[lib] = 1 paths << lib end end end puts libs.keys.sort.join("\n") 1. Put it in a file called libdepend.rb 2. Terminal: Make it executable with chmod +x libdepend.rb, and Run it: ./libdepend.rb /usr/lib/libxslt.dylib Thank you. |
quote |
Posting Rules | Navigation |
|
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Partial iPhoto and iTunes libraries? | chucker | Genius Bar | 2 | 2006-05-24 14:21 |
Merging iTunes Libraries | Bryson | Genius Bar | 3 | 2005-06-08 02:24 |
Dual itunes Music libraries | Leafeaterx | Genius Bar | 5 | 2004-07-14 04:04 |