Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 243642 - app-misc/gcal: CC variable not respected
Summary: app-misc/gcal: CC variable not respected
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Shell Tools Herd Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: tc-directly
  Show dependency tree
 
Reported: 2008-10-24 00:36 UTC by Diego Elio Pettenò (RETIRED)
Modified: 2009-04-01 17:37 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Elio Pettenò (RETIRED) gentoo-dev 2008-10-24 00:36:26 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 Ulrich Müller gentoo-dev 2009-04-01 15:35:53 UTC
src_unpack contains the following:

    find -name Makefile.in -print0 | \
        xargs -0 -n1 sed -i "s:\(^CC = \).*:\1$(tc-getCC):"

Maybe not the most elegant way, but as far as I can see, it does its job.

False positive?
Comment 2 solar (RETIRED) gentoo-dev 2009-04-01 17:01:56 UTC
This is how I made it work locally. xcompile too :)


checking for C compiler
checking for gcc... gcc
checking whether the C compiler (gcc -Os -pipe -march=armv4t -mtune=arm920t -marm -mthumb-interwork -fomit-frame-pointer -I/usr/armv4tl-softfloat-linux-gnueabi/usr/include/ -I/usr/armv4tl-softfloat-linux-gnueabi/include/ -Wa,--noexecstack -D_GNU_SOURCE -L/usr/armv4tl-softfloat-linux-gnueabi/lib -L/usr/armv4tl-softfloat-linux-gnueabi/usr/lib -Wl,-z,noexecstack) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.

!!! Please attach the following file when seeking support:
!!! /usr/armv4tl-softfloat-linux-gnueabi/tmp/portage/app-misc/gcal-3.01-r3/work/gcal-3.01/config.log
 * 
 * ERROR: app-misc/gcal-3.01-r3 failed.


..

wizdev gcal # diff -u gcal-3.01-r3.ebuild.orig gcal-3.01-r3.ebuild
--- gcal-3.01-r3.ebuild.orig    2009-04-01 17:00:03.000000000 +0000
+++ gcal-3.01-r3.ebuild 2009-04-01 16:59:12.000000000 +0000
@@ -11,7 +11,7 @@
 
 LICENSE="GPL-2"
 SLOT="0"
-KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86"
+KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86 ~arm"
 IUSE="ncurses nls"
 
 DEPEND="nls? ( >=sys-devel/gettext-0.17 )"
@@ -29,6 +29,7 @@
 }
 
 src_compile() {
+       tc-export CC
        append-flags -D_GNU_SOURCE
        econf $(use_enable nls) $(use_enable ncurses)
        emake || die


...

checking for C compiler
checking for gcc... armv4tl-softfloat-linux-gnueabi-gcc
checking whether the C compiler (armv4tl-softfloat-linux-gnueabi-gcc -Os -pipe -march=armv4t -mtune=arm920t -marm -mthumb-interwork -fomit-frame-pointer -I/usr/armv4tl-softfloat-linux-gnueabi/usr/include/ -I/usr/armv4tl-softfloat-linux-gnueabi/include/ -Wa,--noexecstack -D_GNU_SOURCE -L/usr/armv4tl-softfloat-linux-gnueabi/lib -L/usr/armv4tl-softfloat-linux-gnueabi/usr/lib -Wl,-z,noexecstack) works... yes
checking whether the C compiler (armv4tl-softfloat-linux-gnueabi-gcc -Os -pipe -march=armv4t -mtune=arm920t -marm -mthumb-interwork -fomit-frame-pointer -I/usr/armv4tl-softfloat-linux-gnueabi/usr/include/ -I/usr/armv4tl-softfloat-linux-gnueabi/include/ -Wa,--noexecstack -D_GNU_SOURCE -L/usr/armv4tl-softfloat-linux-gnueabi/lib -L/usr/armv4tl-softfloat-linux-gnueabi/usr/lib -Wl,-z,noexecstack) is a cross-compiler... yes
checking whether we are using GNU C... yes
checking whether armv4tl-softfloat-linux-gnueabi-gcc accepts -g... yes
checking how to run the C preprocessor... armv4tl-softfloat-linux-gnueabi-gcc -E
checking whether armv4tl-softfloat-linux-gnueabi-gcc needs -traditional... no

Comment 3 Ulrich Müller gentoo-dev 2009-04-01 17:37:49 UTC
Right. Patching the Makefile cannot cure configure issues.
Should be fixed now (using tc-export).