• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2002-2005 Vladimir Prus.
2# Distributed under the Boost Software License, Version 1.0.
3#    (See accompanying file LICENSE_1_0.txt or copy at
4#         http://www.boost.org/LICENSE_1_0.txt)
5
6import os ;
7import gcc ;
8import property ;
9import toolset ;
10
11rule properties-as-path ( properties * )
12{
13    local r ;
14    for local p in $(properties)
15    {
16        if $(p:G) != <action>
17        {
18            r += $(p) ;
19        }
20    }
21    return [ property.as-path
22        [ property.remove incidental : $(r) ] ] ;
23}
24
25toolset.flags yfc-compile KNOWN-PROPERTIES : <toolset> <optimization> ;
26toolset.flags yfc-link KNOWN-PROPERTIES : <toolset> <optimization> ;
27
28rule yfc-compile ( target : sources * : property-set * )
29{
30    PROPERTIES on $(target) = [ properties-as-path $(property-set) ] ;
31}
32
33actions yfc-compile
34{
35    echo $(PROPERTIES) > $(<)
36    echo $(>) >> $(<)
37}
38
39rule yfc-link ( target : sources * : property-set * )
40{
41    PROPERTIES on $(target) = [ properties-as-path $(property-set) ] ;
42}
43
44actions yfc-link
45{
46    echo $(PROPERTIES) > $(<)
47    echo $(>) >> $(<)
48}
49
50if [ os.name ] = VMS
51{
52    actions yfc-compile
53    {
54        PIPE WRITE SYS$OUTPUT "$(PROPERTIES)" | TYPE SYS$INPUT /OUT=$(<:W)
55        PIPE WRITE SYS$OUTPUT "$(>:J= ",")" | APPEND /NEW SYS$INPUT $(<:W)
56    }
57
58    actions yfc-link
59    {
60        PIPE WRITE SYS$OUTPUT "$(PROPERTIES)" | TYPE SYS$INPUT /OUT=$(<:W)
61        OPEN /APPEND FOUT $(<:W)
62        WRITE FOUT "$(>:J= ",")"
63        CLOSE FOUT
64    }
65}
66
67IMPORT $(__name__) : yfc-compile yfc-link : : yfc-compile yfc-link ;
68