Gentoo Archives: gentoo-dev

From: Georgi Georgiev <chutz@×××.net>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Modular X plans
Date: Thu, 11 Aug 2005 19:46:09
Message-Id: 20050811194119.GB113861@lion.gg3.net
In Reply to: Re: [gentoo-dev] Modular X plans by Donnie Berkholz
1 maillog: 11/08/2005-11:58:31(-0700): Donnie Berkholz types
2 > Donnie Berkholz wrote:
3 > > Here's a slightly better version:
4 >
5 > And here's the enhanced, scripted version. It traces libs back to their
6 > packages to really make things easy.
7 >
8 > Seems to work quite well.
9 >
10 > Thanks,
11 > Donnie
12
13 > echo "Looking for libraries ..."
14 > for libname in ${libnames}; do
15 > static=0
16 > shared=0
17 > if $(grep ' \-l[a-zA-Z]' ${1} | grep static); then
18 > static=1
19 > fi
20 > if ! $(grep ' \-l[a-zA-Z]' ${1} | grep static); then
21 > shared=1
22 > fi
23
24 Why not pull these greps out of the loop? No need to do the *same* thing
25 for every library. Or did you forget to mention $libname in there?
26
27 > staticlibname="lib${libname}.a"
28 > sharedlibname="lib${libname}.so"
29 > if [[ ${static} -eq 1 ]]; then
30 > echo " Looking for ${staticlibname}"
31 > for libdir in ${libdirs}; do
32 > if [[ -e ${libdir}/${staticlibname} ]]; then
33 > libpaths="${libpaths} ${libdir}/${staticlibname}"
34 > fi
35 > done
36 > fi
37 > if [[ ${shared} -eq 1 ]]; then
38 > echo " Looking for ${sharedlibname}"
39 > for libdir in ${libdirs}; do
40 > if [[ -e ${libdir}/${sharedlibname} ]]; then
41 > libpaths="${libpaths} ${libdir}/${sharedlibname}"
42 > fi
43 > done
44 > fi
45 > done
46 >
47
48
49 --
50 \ Georgi Georgiev \ Experience is a good teacher, but she \
51 / chutz@×××.net / sends in terrific bills. -- Minna Antrim, /
52 \ +81(90)2877-8845 \ "Naked Truth and Veiled Allusions" \

Replies

Subject Author
Re: [gentoo-dev] Modular X plans Donnie Berkholz <spyderous@g.o>