#!/bin/bash if [ $# -ne 1 ] then echo "Usage : " $0 "file_name" echo "Find package dependency from dll dependency" exit 1 fi a=1 # mypath=$(echo $PATH | tr ":" " ") mypath="/usr/bin /usr/lib/lapack" windir=$(cygpath -u ${WINDIR})"/System32" for i in $(objdump -x $1 |grep "DLL Name:" |sed -e "s/\tDLL Name: //g"| tr "\r" " " ) do if [ $i = "KERNEL32.dll" ] then echo -n $i echo -n " => " echo " Windows System" else fullname=$(find ${mypath} -maxdepth 1 -name $i) if [ -z "${fullname}" ] then fullname=$(find ${windir} -maxdepth 1 -iname $i) if [ -z "${fullname}" ] then echo -n $i echo " => NOT on PATH, Unknown" else echo -n $i echo -n " => " echo " Windows System" fi else echo -n $fullname echo -n " => " package=$(cygcheck -f $fullname ) if [ -z "$package" ] then echo "NOT on ANY Package (system one?)" else echo $package fi fi fi done