Boost logo

Boost-Build :

From: Mat Marcus (mat-lists_at_[hidden])
Date: 2008-06-25 12:04:06

On Wed, Jun 25, 2008 at 4:55 AM, Andrej van der Zee <mavdzee_at_[hidden]> wrote:
> Hi,
> I am trying to build Boost in Cygwin, but with toolset
> msvc. What is the right way to do this? I tried the
> following sequence:
> 1) build bjam using in tools/jam/src
> 2) 'configure --with-toolset=msvc'
> (tools/jam/src/bin.cygwinx86/bjam is being used)
> 3) run 'make'
> The problem is that for boost_thread the Posix threads
> library is being used instead of the native Windows
> threads.
> This is not what I want. I want the comfort of Linux,
> that is why I am using cygwin, but I want to build
> everything natively on Windows, so no Posix threads.
> I also tried to build bjam using build.bat in
> tools/jam/src and then run configure (then
> tools/jam/src/bin.ntx86/bjam is being used) and make,
> but then I run into other problems (related to
> differences of directories between cygwin and Windows,
> it seems).
> What is the right way to do this?
> Cheers,
> Andrej

The right way is to fix threads so as not to be shell dependent. One
workaround that was posted here some time ago was to add some lines to
your ~/user-config.jam. Mine user-config.jam is pasted below. The main
downside of this method is that you get different build paths
according to which shell you use.

### user-config.jam for use under cygwin or cmd

import toolset ;

#forward slashes seem to work under both cygwin and cmd shells
using msvc : 9.0 : "C:/Program Files/Microsoft Visual Studio
9.0/VC/bin/cl.exe" ;
using msvc : 8.0 : "C:/Program Files/Microsoft Visual Studio 8/VC/bin/cl.exe" ;

#these lines needed to use threads with msvc under cygwin
  <toolset>msvc:<threadapi>win32 ;

using gcc : 4.3.0 : /opt/gcc-4.3.0/bin/g++.exe ;
using gcc : 4.2.0 : /opt/gcc-4.2.0/bin/g++.exe ;
using gcc : svn : /opt/conceptgcc-svn/bin/conceptg++.exe ;
using gcc : 3.4.4 : /bin/g++.exe ;

  <toolset>gcc:<threadapi>pthread ;


Hope this helps,

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