Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: dberkholz@g.o
Subject: Re: [gentoo-dev] [PATCH] autotools-utils.eclass: punt unnecessary .la files even w/ USE=static-libs.
Date: Tue, 13 Sep 2011 06:39:55
Message-Id: 20110913084059.74b410c0@pomiocik.lan
In Reply to: Re: [gentoo-dev] [PATCH] autotools-utils.eclass: punt unnecessary .la files even w/ USE=static-libs. by Donnie Berkholz
1 On Mon, 12 Sep 2011 17:10:49 -0500
2 Donnie Berkholz <dberkholz@g.o> wrote:
3
4 > On 23:58 Mon 12 Sep , Michał Górny wrote:
5 > > On Mon, 12 Sep 2011 16:00:20 -0500
6 > > Donnie Berkholz <dberkholz@g.o> wrote:
7 > > > > local f
8 > > > > for f in $(find "${D}" -type f -name '*.la'); do
9 > > > > # Keep only .la files with shouldnotlink=yes -
10 > > > > likely plugins local shouldnotlink=$(sed -ne
11 > > > > '/^shouldnotlink=yes$/p' "${f}") if [[ "$1" == 'all' || -z
12 > > > > ${shouldnotlink} ]]; then
13 > > > > + if [[ "$1" == 'only-not-required' ]];
14 > > > > then
15 > > >
16 > > > Is there a case where one of those arguments might be $2 but you'd
17 > > > still want to run this?
18 > >
19 > > Er? What are you referring to?
20 >
21 > Two things.
22 >
23 > 1. This is only reached if shouldnotlink is false. That means it's
24 > only the things that you are already assuming are plugins, right? If
25 > so, why is this even done?
26
27 That simply means that we're never removing .la files for plugins
28 (right now) because plugin loaders may need them with shared linking.
29 The other case are regular libraries where .la files are removed as
30 described above.
31
32 > 2. What happens if I call it with `remove_libtool_files all
33 > only-not-required`? Nobody ever does any checking of the # of args.
34
35 Will add.
36
37 > > > > + # remove .la files only
38 > > > > when .pc files provide the libs
39 > > > > + # already or they don't give
40 > > > > any information
41 > > > > + ! has $(basename "${f}")
42 > > > > ${pc_libs} \
43 > > > > + && [[ -n
44 > > > > "$(sed -n \
45 > > >
46 > > > The comment says "or" but I see an "and" here.
47 > >
48 > > Because everything's negated here. Boolean magic :D.
49 >
50 > OK, got it. Stop writing confusing logic. =P
51
52 It's confusing because of that 'continue', I guess ;P.
53
54 --
55 Best regards,
56 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature