maillog: 11/08/2005-11:58:31(-0700): Donnie Berkholz types
> Donnie Berkholz wrote:
> > Here's a slightly better version:
> 
> And here's the enhanced, scripted version. It traces libs back to their
> packages to really make things easy.
> 
> Seems to work quite well.
> 
> Thanks,
> Donnie

> echo "Looking for libraries ..."
> for libname in ${libnames}; do
>       static=0
>       shared=0
>       if $(grep ' \-l[a-zA-Z]' ${1} | grep static); then
>               static=1
>       fi
>       if ! $(grep ' \-l[a-zA-Z]' ${1} | grep static); then
>               shared=1
>       fi

Why not pull these greps out of the loop? No need to do the *same* thing
for every library. Or did you forget to mention $libname in there?

>       staticlibname="lib${libname}.a"
>       sharedlibname="lib${libname}.so"
>       if [[ ${static} -eq 1 ]]; then
>               echo "  Looking for ${staticlibname}"
>               for libdir in ${libdirs}; do
>                       if [[ -e ${libdir}/${staticlibname} ]]; then
>                               libpaths="${libpaths} 
> ${libdir}/${staticlibname}"
>                       fi
>               done
>       fi
>       if [[ ${shared} -eq 1 ]]; then
>               echo "  Looking for ${sharedlibname}"
>               for libdir in ${libdirs}; do
>                       if [[ -e ${libdir}/${sharedlibname} ]]; then
>                               libpaths="${libpaths} 
> ${libdir}/${sharedlibname}"
>                       fi
>               done
>       fi
> done
> 


-- 
\    Georgi Georgiev   \  Experience is a good teacher, but she        \
 /    [EMAIL PROTECTED]     / sends in terrific bills. -- Minna Antrim,     /
\   +81(90)2877-8845   \  "Naked Truth and Veiled Allusions"           \

Attachment: pgpRX8VjT3v5L.pgp
Description: PGP signature

Reply via email to