summaryrefslogtreecommitdiff
path: root/transitions/EXPRESSIONS
blob: d1ecefada9cd7c574a585deae457f164c2fe7e54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
{ "for host":
  { "vars": ["ARCH", "HOST_ARCH", "TARGET_ARCH"]
  , "expression":
    { "type": "let*"
    , "bindings":
      [ [ "BUILD_ARCH"
        , { "type": "var"
          , "name": "TARGET_ARCH"
          , "default": {"type": "var", "name": "ARCH"}
          }
        ]
      , [ "TARGET_ARCH"
        , { "type": "var"
          , "name": "HOST_ARCH"
          , "default": {"type": "var", "name": "ARCH"}
          }
        ]
      ]
    , "body": {"type": "env", "vars": ["BUILD_ARCH", "TARGET_ARCH"]}
    }
  }
, "with fPIC":
  { "doc":
    [ "Transition that enables BUILD_POSITION_INDEPENDENT if config_field"
    , "\"shared\" is not empty."
    ]
  , "var": ["BUILD_OBJECT_ONLY"]
  , "expression":
    { "type": "if"
    , "cond":
      { "type": "and"
      , "$1":
        [ {"type": "FIELD", "name": "shared"}
        , {"type": "not", "$1": {"type": "var", "name": "BUILD_OBJECT_ONLY"}}
        ]
      }
    , "then":
      { "type": "singleton_map"
      , "key": "BUILD_POSITION_INDEPENDENT"
      , "value": true
      }
    , "else": {"type": "empty_map"}
    }
  }
, "with fPIC, not object-only":
  { "doc": ["Like \"with fPIC\", but also clearing BUILD_OBJECT_ONLY"]
  , "var": ["BUILD_OBJECT_ONLY"]
  , "imports": {"with fPIC": "with fPIC"}
  , "expression":
    { "type": "map_union"
    , "$1":
      [ {"type": "CALL_EXPRESSION", "name": "with fPIC"}
      , {"type": "singleton_map", "key": "BUILD_OBJECT_ONLY", "value": null}
      , { "type": "singleton_map"
        , "key": "BUILD_OBJECT_ONLY_DROP_OBJECT_LINKING"
        , "value": null
        }
      ]
    }
  }
, "with fPIC, object-only":
  { "doc":
    ["Like \"with fPIC\", but also unconditionally setting BUILD_OBJECT_ONLY"]
  , "var": ["BUILD_OBJECT_ONLY"]
  , "imports": {"with fPIC": "with fPIC"}
  , "expression":
    { "type": "map_union"
    , "$1":
      [ {"type": "CALL_EXPRESSION", "name": "with fPIC"}
      , {"type": "singleton_map", "key": "BUILD_OBJECT_ONLY", "value": true}
      , { "type": "singleton_map"
        , "key": "BUILD_OBJECT_ONLY_DROP_OBJECT_LINKING"
        , "value": true
        }
      ]
    }
  }
, "target properties":
  { "vars": ["ARCH", "TARGET_ARCH", "ARCH_DISPATCH"]
  , "expression":
    { "type": "let*"
    , "bindings":
      [ [ "TARGET_ARCH"
        , { "type": "var"
          , "name": "TARGET_ARCH"
          , "default": {"type": "var", "name": "ARCH"}
          }
        ]
      ]
    , "body":
      { "type": "if"
      , "cond":
        { "type": "=="
        , "$1": {"type": "var", "name": "TARGET_ARCH"}
        , "$2": null
        }
      , "then": {"type": "empty_map"}
      , "else":
        { "type": "lookup"
        , "map":
          { "type": "var"
          , "name": "ARCH_DISPATCH"
          , "default": {"type": "empty_map"}
          }
        , "key": {"type": "var", "name": "TARGET_ARCH"}
        , "default": {"type": "empty_map"}
        }
      }
    }
  }
, "maybe for host":
  { "vars": ["ARCH", "HOST_ARCH", "TARGET_ARCH", "ARCH_DISPATCH"]
  , "imports":
    {"target properties": "target properties", "for host": "for host"}
  , "expression":
    { "type": "if"
    , "cond": {"type": "CALL_EXPRESSION", "name": "target properties"}
    , "then": {"type": "empty_map"}
    , "else": {"type": "CALL_EXPRESSION", "name": "for host"}
    }
  }
}