Boost logo

Boost-Build :

From: David Abrahams (dave_at_[hidden])
Date: 2002-08-30 13:42:48

David Abrahams * Boost Consulting
dave_at_[hidden] *

----- Original Message -----
From: "Dan Muller" <gclbb-jamboost_at_[hidden]>
To: <jamboost_at_[hidden]>
Sent: Friday, August 30, 2002 2:18 PM
Subject: [jamboost] Q's regarding general use of bjam

> I'm new to Jam. I just spent a couple of days struggling with it, and
> have a few questions about using bjam with Boost.Build to build
> non-Boost projects. I'm using the prebuilt bjam and Boost 1.28.0.
> Here's how I've set things up so far. In the root of my project, I have
> a boost-build.jam file with these two lines:
> BOOST_ROOT = $(.boost-build-file:D) ;
> boost-build tools/boost_1_28_0/tools/build ;
> (I have boost installed in a subdirectory of my project work area.) I
> have a subdirectory with a simple subproject Jamfile.
> I build using MinGW and STLport on WinXP. I copied gcc-stlport-tools.jam
> to mingw-stlport-tools.jam and hacked it a bit, mostly by replacing
> "gcc-" with "mingw-".
> I've gotten this all to work, by looking at a lot of jam files in
> tools\build. :-) But I still have a number of small questions.
> 1. Is it possible to have a single rule invocation in my project Jamfile
> that will build either a static library or a DLL?

No, but it's possible to have a single rule that builds both.

> Or do I have to invoke
> both the 'lib' and 'dll' rules? (They would both get the same target and
> sources.) I'm assuming that the 'dll' rule is a no-op on UNIX systems.

No, it builds a shared library (.so).

> 2. After building a dll, what grist do I use to refer separately to the
> module and link libraries? I'd like to copy them to different locations
> using 'stage'.

Heh, to determine that you might need to look at the -d+10 output.

> 3. I tried at one point to invoke the File rule directly, but this
> caused the forward-slashes that I used in the rule invocation to appear
> directly in the 'copy' shell command line, making Windows' 'copy'
> unhappy. How does one get the Boost.Build system to translate path
> separators appropriately? Surely I don't have to build literal paths
> using $(SLASH).

Mostly you can just us "/".
Build actions which need backslashes have mostly been adjusted to
backslashify them.

> 4. As mentioned earlier, I'm using the prebuilt bjam and Build.Boost
> from 1.28. Would my life be significantly easier if I used Boost.Build
> v2 from the head of CVS?

No, v2 isn't ready yet. The CVS bjam sources have some enhancements, but I
don't think they'd help you much.

> Other interesting notes on problems that I solved:
> 1. I had trouble doing a statically-linked build. The link step picks
> the wrong STLport library: stlport_mingw32_stldebug instead of
> stlport_mingw32_stldebug_static. I modified these lines to add the
> _static suffix in my mingw-stlport-tools.jam:
> flags mingw-stlport FINDLIBS <runtime-link>static/<runtime-build>debug
> : stlport_$(GCC_STLPORT_LIB_ID)_stldebug_static ;
> flags mingw-stlport FINDLIBS
> <runtime-link>static/<runtime-build>release :
> stlport_$(GCC_STLPORT_LIB_ID)_static ;
> Apparently, this problem occured because of differences in STLport's
> makefiles for gcc-cygwin and gcc-mingw.

Since there's no mingw-stlport toolset in Boost, I'm not sure this is
something we can "fix".

> 2. Originally, I had my mingw-stlport-tools.jam file in Boost's
> tools/build directory, but I didn't like this. It took me a while to
> figure out how to correctly set BOOST_BUILD_PATH, because I tried the
> more complicated techniques first. :-) For instance, I tried invoking
> boost-build in boost-build.jam twice, or with two arguments. Who
> would've thunk that I could just augment this path in Jamrules with a
> simple '+='. :-)

Ida Thunkit. ;-)



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