Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-11-10 02:23:10

On Wednesday 10 November 2004 01:24, Toon Knapen wrote:
> In following jamfile libjpeg has no explicit dependency on libz
> (although it should). However I remarked that for the link-line for an
> executable the first library that is described in the source list (which
> is in this case libz) is put last and the last in the source list is put
> first.
> <Jamfile>
> lib libz : : <file>/usr/lib/libz.a ;
> lib libjpeg : : <file>/usr/lib/libjpeg.a ;
> exe bla : libz libjpeg ;
> </Jamfile>
> So generally writing
> exe bla : lib1 lib2 lib3 lib4 ;
> retults in the link-line:
> ld lib4 lib3 lib2 lib1 -o bla ;
> Is this intentional or ... ?

More of less intentional -- it's coded this way in jam_src/modules/order.c

The reason is that when we have dependency from a to b the algorithm which
computes first places 'b' to the result and the 'a'. In other words, it
computes *reverse* topological ordering. We need to reverse it again, and
that changes the order of targets without order dependencies, too.

- Volodya


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