Boost logo

Boost-Build :

Subject: Re: [Boost-build] Remove <flavor>mingw from gcc
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2014-04-10 13:18:50


AMDG

On 04/10/2014 05:59 AM, Moritz Hassert wrote:
>
> I cannot comment on consequences for the Boost tree itself but I
> currently rely on the flavor for our own projects. So while I find the
> current mechanism rather imperfect please don't just remove it
> completely.

I'm not removing it entirely. Just the
automatic part.

> <snip>
>
> For cross compiling to Windows 64-bit I run:
> "b2 toolset=gcc-4.6 toolset-gcc:flavor=mingw64 target-os=windows
> address-model=64"
>
> This is awkward in several ways:
>
> <snip>
>
> 2) I extended tools/gcc.jam, adding the following two lines to the
> flavor logic:
> case i?86*mingw* : flavor ?= mingw32 ;
> case x86_64*mingw* : flavor ?= mingw64 ;
> As an alternative, I could have added "<flavor>mingw64" and
> "<flavor>mingw32" in user-config.jam.
> Otherwise both compilers get the flavor "mingw" which leads to an error.
>

If you're already editing gcc.jam, you can
keep the lines that I'm removing. If you
handle it in user-config.jam is will still
work without any changes.

> 3) Both "toolset-gcc:flavor=mingw64" and "target-os=windows" are
> basically saying the same thing. One should be enough. I prefer
> "target-os=windows" because I find it more intuitive.
>
> <snip>
>
>
> Another thing not directly related to <flavor>:
> In my opinion toolset selection is somewhat surprisingly different to
> target alternative handling:
> When two alternatives for one target exist, the one with best matching
> feature values is chosen.
> <snip>
>

It isn't really different. When choosing a target
alternative, all the properties are required to
match (except when there is only a single alternative).

All of these problems can be solved by setting up
global conditionals with toolset.add-requirements.
(Warning: toolset.add-requirements is broken in 1.55.)

using gcc : : : <flavor>host ;
using gcc : 4.6 : i686-w64-mingw32-g++ : <flavor>mingw32 ;
using gcc : 4.6 : x86_64-w64-mingw32-g++ : <flavor>mingw64 ;

toolset.add-requirements
  <target-os>windows,<address-model>32:<toolset>gcc-4.6-mingw32
  <target-os>windows,<address-model>64:<toolset>gcc-4.6-mingw64
;

I used to use something like this for MinGW/Cygwin.

In Christ,
Steven Watanabe


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