Boost logo

Boost-Build :

Subject: Re: [Boost-build] cxxflags depending on tooslet and version?
From: Oliver Kowalke (oliver.kowalke_at_[hidden])
Date: 2012-03-29 13:10:53

Am 29.03.2012 17:35, schrieb Vladimir Prus:
> On 29/03/12 00:18, Juraj Ivančić wrote:
>> On 28.3.2012. 19:49, Oliver Kowalke wrote:
>>> I need to define a pre-processor macro (BOOST_USE_SPLIT_STACK) and
>>> apply
>>> a command line option for gcc (<cxxflags>-fsplit_stack) depending for
>>> gcc version greater/equal to gcc-2.6 in the Jamfile!
>>> How can I do this?
>>> <toolset>gcc,<version> > 2.6:<define>BOOST_USE_SPLIT_STACK
>>> <toolset>gcc,<version> > 2.6:<cxxflags>-fsplit_stack
>> Equal is easy:
>> <toolset>gcc,<toolset-gcc:version>2.6:<define>BOOST_USE_SPLIT_STACK
>> <toolset>gcc,<toolset-gcc:version>2.6:<cxxflags>-fsplit_stack
> Couple of quick notes:
> 1. Is this really gcc 2.6 you care about? It's very very old, I doubt it
> will be able to compile anything in Boost.

I'm sorry - it should be 4.6

> 2. There is long-standing design issue that user can specify the
> version himself,
> e.g.:
> using gcc : 2.6 : /opt/gcc4.3/bin/g++ ;
> In this case, this conditional will still thing it's gcc 2.6. There is
> no workaround,
> and we clearly need to fix this by having the two different features
> -- say, 'version',
> which is the real version as reported by g++ binary and
> 'version-alias', which is the
> version explicitly specified by the user.
> It is not a very critical issues, since most folks just do "using gcc
> ;" and the version
> is automatically detected, by I wanted to mention this just in case.
Hmm - maybe following would be a better solution:
I declare an additional property <splitstack> in my Jamfile - per
default it is disabled (value 'false').
If the user declares 'bjam splitstack=true' on command line - I'll
define an pre-processor macro BOOST_USE_SPLITSTACK and enable code using
split stacks.
If the gcc does not provide the splitstack feature the user gets linker
errors - so he is responsible for that failure.


Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at