Add support for <arch-and-model> in common.format-name

This commit is contained in:
Peter Dimov 2017-07-07 02:58:02 +03:00
parent ddccf2c845
commit 53869829d2

View File

@ -857,6 +857,10 @@ rule format-name ( format * : name : type ? : property-set )
result += [ join-tag $(f:G=) : [ address-model-tag $(name) :
$(type) : $(property-set) ] ] ;
case <arch-and-model> :
result += [ join-tag $(f:G=) : [ arch-and-model-tag $(name) :
$(type) : $(property-set) ] ] ;
case <version:*> :
local key = [ MATCH <version:(.*)> : $(f:G) ] ;
local version = [ $(property-set).get <$(key)> ] ;
@ -1029,6 +1033,19 @@ local rule address-model-tag ( name : type ? : property-set )
return [ $(property-set).get <address-model> ] ;
}
# Create a tag for the architecture and model
# <architecture>x86 <address-model>32 would generate "x32"
# This relies on the fact that all architectures start with
# unique letters.
local rule arch-and-model-tag ( name : type ? : property-set )
{
local architecture = [ $(property-set).get <architecture> ] ;
local address-model = [ $(property-set).get <address-model> ] ;
local arch = [ MATCH ^(.) : $(architecture) ] ;
return $(arch)$(address-model) ;
}
rule __test__ ( )
{