Get needed libraries for an application

To get a nice printout of which libraries are required by a given application, cut and paste the text below into your .profile. Once you’ve done that, you can just type

getlibs appname

(where appname is the name of the application you want to investigate) in your Terminal to find the needed libraries.

getlibs()
{
        if [ "$#" = "0" ]; then
                echo "No executable specified."
                return 1
        fi
        if [ -f "$1" ]; then
                objdump --all-headers "$1" | grep NEEDED | awk '{
print $2 }'
        else
                echo "Can't find executable '$1'."
                return 1
        fi
        return 0
}
 

Comments

No comments so far.

(comments are closed)

 
Blogroll
Tags

Haiku

Resources