Gentoo Archives: gentoo-dev

From: justin <jlec@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] demanual update
Date: Tue, 28 Jun 2011 20:41:38
Message-Id: 4E0A0355.5090306@gentoo.org
In Reply to: Re: [gentoo-dev] demanual update (was: Don't use / when applying sed with CFLAGS) by Mike Frysinger
1 On 6/28/11 6:23 PM, Mike Frysinger wrote:
2 > On Tuesday, June 28, 2011 02:54:03 Michał Górny wrote:
3 >> On Tue, 28 Jun 2011 10:16:06 +0400 Peter Volkov wrote:
4 >>> But still our documentation explicitly suggests ':' for CFLAGS cases
5 >>> and example allows bash substitution.
6 >>>
7 >>> http://devmanual.gentoo.org/ebuild-writing/functions/src_compile/building
8 >>> /index.html see example in "Fixing Compiler Usage" section and text
9 >>> below:
10 >>> sed -i -e "s:cc -O2:$(tc-getCC) ${CFLAGS} ${LDFLAGS}:" build.sh
11 >>>
12 >>> Are there any objections to suggest '|' for CFLAGS, LDFLAGS (see
13 >>> attachment)?
14 >>
15 >> I think that also a good idea may be to provide an Makefile example,
16 >> showing that often sed is unnecessary, and it's enough to do things
17 >> like:
18 >>
19 >> emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"...
20 >
21 > this is easily dangerous when it comes to packages (and many do) that append
22 > in the Makefile. specifying on the command line blocks those while passing
23 > via env works fine. i'm not sure it's appropriate to provide as an example.
24 > -mike
25
26 There are cases and cases. You are right with what you said. But cases
27 where the makefile appends stuff are not the typical cases where a sed
28 is applied. Normally sed is used if upstream hardcodes FLAGS we don't
29 want. And there the passing with emake is the appropriate safer way for
30 a fix.
31
32 justin

Attachments

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

Replies

Subject Author
Re: [gentoo-dev] demanual update Mike Frysinger <vapier@g.o>