Boost logo

Boost-Build :

From: Juergen Hunold (juergen.hunold_at_[hidden])
Date: 2008-02-15 14:19:52


Hi Rene !

On Friday 15 February 2008, Rene Rivera wrote:
> Juergen Hunold wrote:
> > I've been bitten by issue #83 again
> >
> > https://zigzag.cs.msu.su:7813/boost.build/ticket/83
> >
> > and decided to get a go and revive the last try recorded in
> >
> > http://svn.boost.org/trac/boost/changeset/34062

> Since I'm terrible at reading those diffs without the extra work, and
> reading the ticket did illuminate either... Could you explain *what*
> and *how* this fixes.

Well, I just dug out this two-year old patch ;-)

Okay, I'll try to explain the idea I figured out from the ticket and the
original patch:

Assume you got a Jamfile containing:

exe a : dir1/a.cpp dir2/a.cpp ;

The current Boost.Build would complain about colliding targets "a.o"
because the build/generators.jam would simply do (at line 410...)

- # Names of sources might include directory. We should strip it.
- name = $(name:D=) ;

and produce identical target names.
I've refactored the old patch to a new routine

  rule determine-target-name ( fullname : prefix ? postfix ? )

which will produce two targets
dir1/a.o
dir2/a.o

and add those two without clash.

So we get two object files
bin/gcc-4.2/debug/dir1/a.o
bin/gcc-4.2/debug/dir2/a.o

and all's well ;-))

Well, the old patch did this, but forgot to consider filename prefixes.
Let's take the Qt4-toolset for example. The "moc" toolset will convert
a.h -> moc_a.cpp and compile this to the final target moc_a.o

The patch from rev.34062 produced
dir1/a.h -> moc_dir1/a.h -> moc_dir1/a.o

which is not clearly not the intended result. I've modified the code to
add the prefix at the right place and get

dir1/a.h -> dir1/moc_a.h -> dir1/moc_a.o

which is what most Qt-related tools would expect...

> And since I've fixed this outside BBv2 in my
> own projects, which I'm posted code to that effect here before... How
> your solution differs to mine of renaming the produced object files?

Well, it seems that I somehow missed your code. This is very unfortunate
indeed.
Could you please post a pointer again, so I can investigate your
solution ?
The first try was done during the infamous v1->v2 translation period and
reverted because no one had the time (and nerves :-(( ) to get this
thing right then. I thought this would be a better occasion to get
_some_ fix into the code base right after 1.35 is out and before 1.36
is started.

I've got no internet access over the weekend, so no hurry ;-))

Yours,

Jürgen

-- 
* Dipl.-Math. Jürgen Hunold       ! Ingenieurgesellschaft für 
* voice: ++49 511 262926 57       ! Verkehrs- und Eisenbahnwesen mbH  
* fax  : ++49 511 262926 99       ! Lister Straße 15
* juergen.hunold_at_[hidden]        ! www.ivembh.de
* 
* Geschäftsführer:                ! Sitz des Unternehmens: Hannover
* Prof. Dr.-Ing. Thomas Siefer    ! Amtsgericht Hannover, HRB 56965
* PD Dr.-Ing. Alfons Radtke       !

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