List Info

Thread: Different actions for different versions of the same toolset




Different actions for different versions of the same toolset
country flaguser name
Switzerland
2007-10-16 09:32:27
Hello

I use boost.build to build Code for VxWorks, therefore I
created a toolset which
inherits from the gcc toolset. This works fine. Now I have
to also support a
newer version of VxWorks and I would like to do this with
the version support of
the toolset. My Problem is now that its not enough to change
some variables for
the actions but I need completely different actions for
compiling and linking
but I couldn't figure out how I would define different
actions for different
toolset versions.

I would like to do something like this:

# vxworks.jam 
...
actions link.v5 bind LIBRARIES  # linking with version 5
{
   A B C;
} 

actions link.v6 bind LIBRARIES # linking with version 6
{
   X Y Z;
}     
...
 
Is this possible or do I need to create separate toolsets
for each version?
I would like to only use one toolset because then I would
not need to change all
the usages like

lib   my_lib : $(sources) $(vx_sources)  :
<toolset>vxworks ;
lib   my_lib : $(sources) $(win_sources) :                 
;

Because if I use two toolsets I have to change this to:

lib   my_lib : $(sources) $(vx_sources)  :
<toolset>vxworks5 ;
lib   my_lib : $(sources) $(vx_sources)  :
<toolset>vxworks6 ;
lib   my_lib : $(sources) $(win_sources) :                  
;

Thanks,

- Franz   

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Re: Different actions for different versions of the same toolset
country flaguser name
Russian Federation
2007-10-16 11:25:07
On Tuesday 16 October 2007 18:32:27 Franz wrote:
> Hello
> 
> I use boost.build to build Code for VxWorks, therefore
I created a toolset which
> inherits from the gcc toolset. This works fine. Now I
have to also support a
> newer version of VxWorks and I would like to do this
with the version support of
> the toolset. My Problem is now that its not enough to
change some variables for
> the actions but I need completely different actions for
compiling and linking
> but I couldn't figure out how I would define different
actions for different
> toolset versions.
> 
> I would like to do something like this:
> 
> # vxworks.jam 
> ...
> actions link.v5 bind LIBRARIES  # linking with version
5
> {
>    A B C;
> } 
> 
> actions link.v6 bind LIBRARIES # linking with version
6
> {
>    X Y Z;
> }  

First, your toolset should have a 'version' subfeature that
can be set in 'using'. Please see how gcc handles that,
using common.check-init-parameters.

Then, write a rule that will redirect, like this:

	rule link ( targets * : sources * : properties * )
	{
		if <toolset-vxworks:version>XXX in $(properties)
		{
			link.v5 $(targets) : $(sources) : $(properties) ;
		}
		...........
	}


HTH,
Volodya
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )