Boost logo

Boost-Build :

Subject: Re: [Boost-build] Where in build are the OS names set
From: Edward Diener (eldiener_at_[hidden])
Date: 2014-07-09 11:43:58


On 7/9/2014 4:02 AM, Vladimir Prus wrote:
> On 07/08/2014 10:39 AM, Edward Diener wrote:
>
>>> The problem is there are 3 variables:
>>>
>>> - The compiler that b2 was built with
>>> - The compiler that clang was built with
>>> - The execution environment - which is basically the shell where b2
>>> is invoked (either cmd.exe or mingw's sh.exe)
>>
>> So the OS that is set is the compilation environment. That does not
>> help me since the end-user on Windows could create Boost Build with,
>> let's say, VC++ and still run the MingW version of clang when using
>> clang as the toolset using a library.
>
> Right, that OS setting in b2 is at best a reasonable default.
>
>>> For all I know, there's no strong correlation between those, so a way to
>>> explicitly specify how clang is build, or,
>>> otherwise, a way for clang to report how it was build, will be
>>> necessary.
>>>
>>> What does it even matter how clang was built?
>>
>> The end-user on Windows will execute 'b2 toolset=clang' to invoke
>> clang as the toolset. This could mean clang as built with VC++ or it
>> could
>> mean clang as built with MingW. They are two totally different build
>> environments, with their own subset .jam files invoked within the
>> general clang.jam. Clang as built with VC++ needs to use the
>> clang-win.jam file which I will add to Boost Build, while clang built
>> with
>> MingW will use a very slightly modified clang-linux.jam file which I
>> can update in Boost Build. Even though both are clang under Windows
>> they are largely different environments as far as Boost Build is
>> concerned. The problem is how the end-user can distinguish between them
>> from within Boost Build so that the correct sub-clang jam file is used.
>
> I see. Could you put these files somewhere on github so that I can take
> a look and better understand the implications?

I have added these files to 'develop':

1) clang_win.jam - should be used for clang on Windows in VC++ mode
2) common_clang_vc.jam - this merely illustrates minor changes to
common.jam which assume only clang on Windows in VC++ mode. When we
figure out how to distinguish between clang on Windows in VC++ mode and
gcc/mingw mode we would need to make slightly different changes to
common.jam to support both.
3) clang-linux_mingw.jam - this merely illustrates changes to
clang-linux.jam for clang on Windows in gcc/mingw mode. Although I could
have currently updated clang-linux.jam to support this gcc/mingw mode, I
choose to be conservative and show you the minor change that has to be
made using this file. Essentially it is just changing the multithreading
option on Windows from -mthreads to -pthread.


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