Skip to content

CCVERSION / CXXVERSION ignore prior setting of CC / CXX #1723

@bdbaddog

Description

@bdbaddog

This issue was originally created at: 2007-09-04 08:58:58.
This issue was reported by: quaestor.
quaestor said at 2007-09-04 08:58:58

I am trying to specify which compiler to use (as I have multiple versions of gcc
installed) by doing

env = Environment(tools=..., toolpath=..., CXX='g++-4.2')

This uses the correct compiler for the actual compilation; however I'm also
using env['CXXVERSION'] to selectively enable features, but this is returning
the version of the default g++ rather than the one I selected.

It looks to me like this line in g++.py...

env['CXX'] = env.Detect(compilers)

...overrides the prior setting, and it then goes on to use that value instead of
mine to determine CXXVERSION (amongst other things). The same thing happens in
gcc.py with env['CC']

Am I using the wrong method to choose a compiler? I couldn't find any reference
to this in the documentation, but I'd think it's a fairly common requirement.
Either way, shouldn't gcc.py and g++.py honour any pre-set value of CC/CXX?

Thanks
Ben

gregnoel said at 2008-06-05 17:46:54

Bug party triage: part of revamping platform and toolchain configuration;
setting CC or CXX does not specify the compile to be selected.

gregnoel said at 2008-07-27 03:44:59

Change all toolchain issues to enhancements scheduled for future p1.

gregnoel said at 2008-11-21 16:38:26

Consolidate toolchain issues as 2.x p3.

gregnoel said at 2008-12-26 13:20:23

Adjust triage of issues.

haubi said at 2014-05-07 08:23:26

Created an attachment (id=934)
Eventually something like this patch would help here?

haubi said at 2014-05-13 01:13:55

Created an attachment (id=935)
test/CC/CCVERSION.py to test for proper CCVERSION variable

haubi said at 2014-05-13 01:20:39

Created an attachment (id=936)
test/CXX/CXXVERSION.py to test for proper CXXVERSION variable

haubi said at 2014-05-13 01:23:45

Erm, attachment#934 leads test/CC/CC.py to hang on AIX.
Ok then, attachment#935 and attachment#936 are testcases for this bug.

haubi said at 2014-05-13 04:23:01

Provided as pull-request#137.

haubi said at 2014-05-15 01:25:58

Re-submitted as pull-request#138.

dirkbaechle said at 2014-05-18 10:37:49

*** Issue 2016 has been marked as a duplicate of this issue. ***

j_ff said at 2016-01-31 12:42:04

Please can give someone a statment about this bug?

Many thanks

Jörg Frings-Fürst
Maintainer of scons at Debian

bdbaddog said at 2016-01-31 13:48:05

Fixed in SCons 2.3.2
Merged to default branch on : 2014-05-18

See:
https://bitbucket.org/scons/scons/pull-requests/138/issue-1723-respect-users-cc-cxx-values-in/diff

For details.

haubi attached scons-issue1723.diff at 2014-05-07 08:23:26.

Eventually something like this patch would help here?

haubi attached CCVERSION.py at 2014-05-13 01:13:55.

test/CC/CCVERSION.py to test for proper CCVERSION variable

haubi attached CXXVERSION.py at 2014-05-13 01:20:38.

test/CXX/CXXVERSION.py to test for proper CXXVERSION variable

dirkbaechle said this issue is duplicated by #2016 at 2014-05-18 10:37:49.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions