site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com RecurseLibs /usr/bin/xcodebuild - Kevin On Oct 6, 2005, at 11:08 AM, OpenMacNews wrote: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 hi all, i understand 'otool -L' lists the dyn libs used by a given target. the goal is to gather all dependencies in prep for creating a pkg ... thx! _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... Yes and no. Yes, you do need to inspect each dylib for additional dependencies; and no, you don't need to do it manually. Here's how we do it in DarwinBuild to find the dependencies of xcodebuild(1). ### ### Recurse through frameworks and libraries looking for dependencies ### RecurseLibs() { echo $1 >> /tmp/installXcode.seen.$$ otool -L $1 | tail -n +2 | awk '{ print $1 }' > /tmp/ installXcode.tmplibs.$$ cat /tmp/installXcode.tmplibs.$$ >> /tmp/installXcode.libs.$$ cat /tmp/installXcode.tmplibs.$$ | while read X; do if ! grep -q "^$X\$" /tmp/installXcode.seen.$$ ; then RecurseLibs $X fi done } <http://cvs.opendarwin.org/index.cgi/proj/darwinbuild/darwinbuild/ installXcodebuild?rev=1.8&content-type=text/x-cvsweb-markup> any given dyn lib can use other dyn libs ... resulting in a 'nest' of dependencies. is there a way to get a list of ALL dependencies in one step? or am i relegated to manually 'otool-ing' each listed lib, and collating the results? richard This email sent to site_archiver@lists.apple.com