Boost logo

Boost-Build :

From: usovalx (A.S.Usov_at_[hidden])
Date: 2005-07-01 11:20:15


I think I have figured out a cleaner way to do it.

==== mgcc.jam ====
import "class" : new ;
import toolset ;
import generators ;
import common ;

toolset.register mgcc ;

import gcc ;
toolset.inherit-generators mgcc : gcc : gcc.compile.c
gcc.compile.c++ gcc.link gcc.link.dll ;
toolset.inherit-flags mgcc : gcc ;
toolset.inherit-rules mgcc : gcc ;

rule init ( version ? : command * : options * )
{
local condition = [ common.check-init-parameters mgcc : version
$(version) ] ;
local command = [ common.get-invocation-command mgcc : g++ :
$(command) ] ;

common.handle-options gcc : $(condition) : $(command) :
$(options) ;

gcc.init-link-flags gcc gnu $(condition) ;
}

generators.register-c-compiler gcc.compile.c++ : CPP : OBJ : ;
generators.register-c-compiler gcc.compile.c : C : OBJ : ;

generators.register [ new gcc-linking-generator gcc.link : LIB OBJ :
EXE
: <linker>gcc ] ;

generators.register [ new gcc-linking-generator gcc.link.dll : LIB
OBJ : SHARED_LIB
: <linker>gcc ] ;
===== mgcc.jam end =====

In addition I have added linking rules into ifort.jam.
Now it is possible to select a specific linking method just as I
described before.

However I am still trying to figure out a somewhat cleaner way to do
it: I don't like that I had to introduce new toolset for it -- I
would prefer much more to be able to simply add this "<linker>gcc"
requirement to generators (already) registered by gcc toolset. Is it
possible? Or I should modify gcc.jam from distribution?

I do not completely understand when I should use gcc or mgcc in init
fuction. Present combination works fine, but I don't really
understand why ;)

 


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