summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CC/EXPRESSIONS4
-rw-r--r--CC/RULES45
-rw-r--r--transitions/EXPRESSIONS21
3 files changed, 46 insertions, 24 deletions
diff --git a/CC/EXPRESSIONS b/CC/EXPRESSIONS
index 938c342..081fb31 100644
--- a/CC/EXPRESSIONS
+++ b/CC/EXPRESSIONS
@@ -1184,6 +1184,8 @@
, "extra-provides"
, "public-fieldnames"
, "private-fieldnames"
+ , "deps-transition"
+ , "defaults-transition"
]
, "imports":
{ "compile-deps": "compile-deps"
@@ -1863,6 +1865,8 @@
, "extra-provides"
, "public-fieldnames"
, "private-fieldnames"
+ , "deps-transition"
+ , "defaults-transition"
]
, "imports":
{ "compile-deps": "compile-deps"
diff --git a/CC/RULES b/CC/RULES
index e5d887a..a8bcfb7 100644
--- a/CC/RULES
+++ b/CC/RULES
@@ -398,7 +398,7 @@
, "soversion"
, "pkg-name"
]
- , "config_fields": ["shared", "object_only"]
+ , "config_fields": ["shared"]
, "config_vars":
[ "CC"
, "CXX"
@@ -411,6 +411,7 @@
, "AR"
, "ENV"
, "BUILD_POSITION_INDEPENDENT"
+ , "BUILD_OBJECT_ONLY"
, "DEBUG"
]
, "implicit": {"defaults": ["defaults"]}
@@ -473,15 +474,7 @@
, "duplicate work will be carried out, even if the same proto library"
, "is used at various places)."
]
- , "shared":
- [ "If non-empty, produce a shared instead of a static library. Setting"
- , "this option is mutually exclusive to the \"object_only\" option."
- ]
- , "object_only":
- [ "If non-empty, produce an object library, resulting in object files"
- , "added to the linker line of all depending targets. Setting this option"
- , "is mutually exclusive to the \"shared\" option."
- ]
+ , "shared": ["If non-empty, produce a shared instead of a static library."]
, "soversion":
[ "The SOVERSION for shared libraries. Individual version components are"
, "joined with \".\"."
@@ -544,6 +537,12 @@
, "ENV": ["The environment for any action generated."]
, "BUILD_POSITION_INDEPENDENT": ["Build with -fPIC."]
, "DEBUG": ["Compute the debug-stage, needed for local debugging."]
+ , "BUILD_OBJECT_ONLY":
+ [ "If true, produce an object library, resulting in object files"
+ , "added to the linker line of all depending targets. If this"
+ , "configuration is set, the \"shared\" option is ignored. This"
+ , "variable is cleared for all dependencies."
+ ]
}
, "artifacts_doc":
["The actual library (libname.a) staged in the specified directory"]
@@ -587,7 +586,7 @@
, "static result": "lib result"
, "shared result": "shared result"
, "object result": "object result"
- , "fPIC transition": ["transitions", "with fPIC"]
+ , "fPIC transition": ["transitions", "with fPIC, not object-only"]
}
, "config_transitions":
{ "deps": [{"type": "CALL_EXPRESSION", "name": "fPIC transition"}]
@@ -690,24 +689,24 @@
, "defaults"
]
]
+ , [ "shared"
+ , { "type": "and"
+ , "$1":
+ [ {"type": "FIELD", "name": "shared"}
+ , { "type": "not"
+ , "$1": {"type": "var", "name": "BUILD_OBJECT_ONLY"}
+ }
+ ]
+ }
+ ]
]
, "body":
{ "type": "cond"
, "cond":
- [ [ { "type": "and"
- , "$1":
- [ {"type": "FIELD", "name": "shared"}
- , {"type": "FIELD", "name": "object_only"}
- ]
- }
- , { "type": "fail"
- , "msg": "Fields \"shared\" and \"object_only\" are mutually exclusive."
- }
- ]
- , [ {"type": "FIELD", "name": "shared"}
+ [ [ {"type": "var", "name": "shared"}
, {"type": "CALL_EXPRESSION", "name": "shared result"}
]
- , [ {"type": "FIELD", "name": "object_only"}
+ , [ {"type": "var", "name": "BUILD_OBJECT_ONLY"}
, {"type": "CALL_EXPRESSION", "name": "object result"}
]
]
diff --git a/transitions/EXPRESSIONS b/transitions/EXPRESSIONS
index fef8542..18c5dbc 100644
--- a/transitions/EXPRESSIONS
+++ b/transitions/EXPRESSIONS
@@ -24,9 +24,16 @@
[ "Transition that enables BUILD_POSITION_INDEPENDENT if config_field"
, "\"shared\" is not empty."
]
+ , "var": ["BUILD_OBJECT_ONLY"]
, "expression":
{ "type": "if"
- , "cond": {"type": "FIELD", "name": "shared"}
+ , "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"
@@ -35,6 +42,18 @@
, "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}
+ ]
+ }
+ }
, "target properties":
{ "vars": ["ARCH", "TARGET_ARCH", "ARCH_DISPATCH"]
, "expression":