Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 243752

Summary: app-text/sloccount: CC variable not respected
Product: Gentoo Linux Reporter: Diego Elio Pettenò (RETIRED) <flameeyes>
Component: New packagesAssignee: Robin Johnson <robbat2>
Status: RESOLVED FIXED    
Severity: normal CC: jer
Priority: High Flags: robbat2: Bugday+
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 243502    
Attachments: Untested patch to fix CC issue with sloccount-2.26-r1.ebuild

Description Diego Elio Pettenò (RETIRED) gentoo-dev 2008-10-24 01:03:48 UTC
I'm filing this bug (from a template, mind you) because the ebuild I'm reporting it against failed to build once I removed my /usr/bin/{gcc,cc,c++,c99} binaries. This means that the ebuild is relying on gcc or cc as compiler, while it should use "$(tc-getCC)" so that user choices are respected, and cross-compiling works as intended.

This usually comes down to one of these tasks:

- use emake CC="$(tc-getCC)" for building, to ovewrite make's CC variable (defaults to "cc", some upstream rewrites it);
- the above plus replacing explicit "gcc" (or similar) calls with $(CC) so that the variable is actually respected;
- tc-export CC in src_compile before eventual econf.

For C++, you'd have to replace CC with CXX everywhere above, of course.

If your package is a special case on this, please let me know.

Thanks,
Diego
Comment 1 Kevin Pyle 2010-03-31 03:42:03 UTC
Created attachment 225909 [details, diff]
Untested patch to fix CC issue with sloccount-2.26-r1.ebuild

The upstream makefile sets "CC=gcc -Wall".  The Gentoo ebuild already patched that directive to include user $CFLAGS, but left the use of an unqualified gcc.  This patch changes the sed expression to rewrite the entire line, using the result of $(tc-getCC) to look up the relevant compiler.  Due to a limitation in the upstream Makefile, the CFLAGS must be appended to CC, since the upstream rules do not use CFLAGS directly.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2010-10-12 20:52:28 UTC
Fixed in -r2. Oh sorry, Kevin, didn't see your patch there.