Boost logo

Boost-Build :

Subject: Re: [Boost-build] cxxflags depending on tooslet and version?
From: Vladimir Prus (ghost_at_[hidden])
Date: 2012-03-29 11:35:06


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.

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.

Thanks,
Volodya


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk