diff options
Diffstat (limited to 'CC/foreign/shell')
-rw-r--r-- | CC/foreign/shell/EXPRESSIONS | 363 | ||||
-rw-r--r-- | CC/foreign/shell/RULES | 624 |
2 files changed, 0 insertions, 987 deletions
diff --git a/CC/foreign/shell/EXPRESSIONS b/CC/foreign/shell/EXPRESSIONS deleted file mode 100644 index 7ca2741..0000000 --- a/CC/foreign/shell/EXPRESSIONS +++ /dev/null @@ -1,363 +0,0 @@ -{ "shell-build": - { "vars": - [ "cmds" - , "sources" - , "localbase" - , "installed_files" - , "installed_dirs" - , "CC" - , "CXX" - , "CFLAGS" - , "CXXFLAGS" - , "LDFLAGS" - , "ADD_CFLAGS" - , "ADD_CXXFLAGS" - , "ADD_LDFLAGS" - , "ENV" - , "AR" - , "PREFIX" - , "BUILD_POSITION_INDEPENDENT" - , "TIMEOUT_SCALE" - , "FOREIGN_EXECUTION_PROPERTIES" - , "resolve_symlinks" - ] - , "imports": - { "artifacts": ["", "field_artifacts"] - , "flags-cc": ["CC", "flags-cc"] - , "flags-cxx": ["CC", "flags-cxx"] - , "compiler-cc": ["CC", "compiler-cc"] - , "compiler-cxx": ["CC", "compiler-cxx"] - , "default-LDFLAGS": ["CC", "default-LDFLAGS"] - , "default-AR": ["CC", "default-AR"] - , "default-PATH": ["CC", "default-PATH"] - , "default-TOOLCHAIN": ["CC", "default-TOOLCHAIN"] - , "default-NON_SYSTEM_TOOLS": ["CC", "default-NON_SYSTEM_TOOLS"] - , "foreign-MAKE": ["CC/foreign", "default-MAKE"] - , "foreign-CMAKE": ["CC/foreign", "default-CMAKE"] - , "foreign-PATH": ["CC/foreign", "default-PATH"] - , "foreign-TOOLCHAIN": ["CC/foreign", "default-TOOLCHAIN"] - , "foreign-NON_SYSTEM_TOOLS": ["CC/foreign", "default-NON_SYSTEM_TOOLS"] - , "map_provider": ["", "field_map_provider"] - , "sh": ["shell", "sh"] - , "sh-PATH": ["shell", "PATH"] - , "sh prolog": ["shell", "prolog"] - } - , "expression": - { "type": "let*" - , "bindings": - [ ["TOOLCHAIN_DIR", "toolchain"] - , [ "shell TOOLCHAIN" - , { "type": "let*" - , "bindings": - [ ["fieldname", "shell defaults"] - , ["provider", "TOOLCHAIN"] - , ["default", {"type": "empty_map"}] - ] - , "body": {"type": "CALL_EXPRESSION", "name": "map_provider"} - } - ] - , [ "sh" - , { "type": "let*" - , "bindings": [["fieldname", "shell defaults"]] - , "body": {"type": "CALL_EXPRESSION", "name": "sh"} - } - ] - , [ "TOOLCHAIN" - , { "type": "disjoint_map_union" - , "msg": "Toolchain trees may not overlap" - , "$1": - [ {"type": "CALL_EXPRESSION", "name": "foreign-TOOLCHAIN"} - , {"type": "CALL_EXPRESSION", "name": "default-TOOLCHAIN"} - , {"type": "var", "name": "shell TOOLCHAIN"} - ] - } - ] - , [ "TOOLCHAIN" - , { "type": "to_subdir" - , "subdir": {"type": "var", "name": "TOOLCHAIN_DIR"} - , "$1": {"type": "var", "name": "TOOLCHAIN"} - } - ] - , [ "NON_SYSTEM_TOOLS" - , { "type": "map_union" - , "$1": - [ {"type": "CALL_EXPRESSION", "name": "foreign-NON_SYSTEM_TOOLS"} - , {"type": "CALL_EXPRESSION", "name": "default-NON_SYSTEM_TOOLS"} - ] - } - ] - , [ "MAKE" - , { "type": "join" - , "$1": - { "type": "++" - , "$1": - [ { "type": "if" - , "cond": - { "type": "lookup" - , "key": "MAKE" - , "map": {"type": "var", "name": "NON_SYSTEM_TOOLS"} - } - , "then": ["./", {"type": "var", "name": "TOOLCHAIN_DIR"}, "/"] - } - , {"type": "CALL_EXPRESSION", "name": "foreign-MAKE"} - ] - } - } - ] - , [ "CMAKE" - , { "type": "join" - , "$1": - { "type": "++" - , "$1": - [ { "type": "if" - , "cond": - { "type": "lookup" - , "key": "CMAKE" - , "map": {"type": "var", "name": "NON_SYSTEM_TOOLS"} - } - , "then": ["./", {"type": "var", "name": "TOOLCHAIN_DIR"}, "/"] - } - , {"type": "CALL_EXPRESSION", "name": "foreign-CMAKE"} - ] - } - } - ] - , ["CC", {"type": "CALL_EXPRESSION", "name": "compiler-cc"}] - , ["CXX", {"type": "CALL_EXPRESSION", "name": "compiler-cxx"}] - , [ "CFLAGS" - , { "type": "join" - , "separator": " " - , "$1": {"type": "CALL_EXPRESSION", "name": "flags-cc"} - } - ] - , [ "CXXFLAGS" - , { "type": "join" - , "separator": " " - , "$1": {"type": "CALL_EXPRESSION", "name": "flags-cxx"} - } - ] - , [ "LDFLAGS" - , { "type": "join" - , "separator": " " - , "$1": - { "type": "++" - , "$1": - [ ["-Wl,-rpath,$ORIGIN", "-Wl,-rpath,$ORIGIN/../lib"] - , { "type": "var" - , "name": "LDFLAGS" - , "default": - {"type": "CALL_EXPRESSION", "name": "default-LDFLAGS"} - } - , {"type": "var", "name": "ldflags", "default": []} - ] - } - } - ] - , [ "AR" - , { "type": "var" - , "name": "AR" - , "default": - { "type": "join" - , "$1": - { "type": "++" - , "$1": - [ { "type": "if" - , "cond": - { "type": "lookup" - , "key": "AR" - , "map": {"type": "var", "name": "NON_SYSTEM_TOOLS"} - } - , "then": - ["./", {"type": "var", "name": "TOOLCHAIN_DIR"}, "/"] - } - , {"type": "CALL_EXPRESSION", "name": "default-AR"} - ] - } - } - } - ] - , [ "PREFIX" - , { "type": "if" - , "cond": {"type": "var", "name": "make_prefix"} - , "then": - { "type": "join" - , "separator": "/" - , "$1": - { "type": "++" - , "$1": [[""], {"type": "var", "name": "make_prefix"}] - } - } - , "else": {"type": "var", "name": "PREFIX", "default": "/"} - } - ] - , [ "PATH" - , { "type": "join" - , "separator": ":" - , "$1": - { "type": "nub_left" - , "$1": - { "type": "++" - , "$1": - [ {"type": "CALL_EXPRESSION", "name": "foreign-PATH"} - , {"type": "CALL_EXPRESSION", "name": "default-PATH"} - , { "type": "let*" - , "bindings": [["fieldname", "shell defaults"]] - , "body": {"type": "CALL_EXPRESSION", "name": "sh-PATH"} - } - ] - } - } - } - ] - , [ "ENV" - , { "type": "map_union" - , "$1": - [ { "type": "env" - , "vars": - [ "MAKE" - , "CMAKE" - , "CC" - , "CXX" - , "CFLAGS" - , "CXXFLAGS" - , "LDFLAGS" - , "AR" - , "PREFIX" - ] - } - , {"type": "var", "name": "ENV", "default": {"type": "empty_map"}} - ] - } - ] - , [ "localbase" - , { "type": "to_subdir" - , "subdir": "localbase" - , "$1": {"type": "var", "name": "localbase"} - } - ] - , [ "work_dir" - , { "type": "to_subdir" - , "subdir": "work" - , "$1": {"type": "var", "name": "sources"} - } - ] - , [ "script" - , { "type": "singleton_map" - , "key": "run_cmds.sh" - , "value": - { "type": "BLOB" - , "data": - { "type": "join" - , "separator": "\n" - , "$1": - { "type": "++" - , "$1": - [ { "type": "let*" - , "bindings": [["fieldname", "shell defaults"]] - , "body": {"type": "CALL_EXPRESSION", "name": "sh prolog"} - } - , [ "set -eu" - , "mkdir -p scratch work install" - , "export ACTION_DIR=\"$(pwd)\"" - , "export TMPDIR=\"$(pwd)/scratch\"" - , "export WORKDIR=\"$(pwd)/work\"" - , "export TOOLCHAIN=\"$(pwd)/toolchain\"" - , "export LOCALBASE=\"$(pwd)/localbase\"" - , "export DESTDIR=\"$(pwd)/install\"" - , { "type": "if" - , "cond": - { "type": "lookup" - , "key": "CC" - , "map": {"type": "var", "name": "NON_SYSTEM_TOOLS"} - } - , "then": "export CC=$(pwd)/${CC}" - , "else": "" - } - , { "type": "if" - , "cond": - { "type": "lookup" - , "key": "CXX" - , "map": {"type": "var", "name": "NON_SYSTEM_TOOLS"} - } - , "then": "export CXX=$(pwd)/${CXX}" - , "else": "" - } - , { "type": "if" - , "cond": - { "type": "lookup" - , "key": "AR" - , "map": {"type": "var", "name": "NON_SYSTEM_TOOLS"} - } - , "then": "export AR=$(pwd)/${AR}" - , "else": "" - } - , { "type": "if" - , "cond": - { "type": "lookup" - , "key": "MAKE" - , "map": {"type": "var", "name": "NON_SYSTEM_TOOLS"} - } - , "then": "export MAKE=$(pwd)/${MAKE}" - , "else": "" - } - , { "type": "if" - , "cond": - { "type": "lookup" - , "key": "CMAKE" - , "map": {"type": "var", "name": "NON_SYSTEM_TOOLS"} - } - , "then": "export CMAKE=$(pwd)/${CMAKE}" - , "else": "" - } - , { "type": "join" - , "$1": - [ "export PATH=" - , { "type": "join_cmd" - , "$1": [{"type": "var", "name": "PATH"}] - } - , "${PATH:+:}\"${PATH}\"" - ] - } - ] - , ["(", "set --", "cd ./work"] - , {"type": "var", "name": "cmds"} - , [")"] - , { "type": "if" - , "cond": {"type": "var", "name": "resolve_symlinks"} - , "then": - [ "mv install install_with_symlinks" - , "cp -rL install_with_symlinks install >copy.log 2>&1 || (echo 'ERROR: symlink resolve failed with:' && cat copy.log && exit 1)" - ] - } - ] - } - } - } - } - ] - , [ "artifacts" - , { "type": "ACTION" - , "inputs": - { "type": "map_union" - , "$1": - [ {"type": "var", "name": "TOOLCHAIN"} - , {"type": "var", "name": "work_dir"} - , {"type": "var", "name": "localbase"} - , {"type": "var", "name": "script"} - ] - } - , "cmd": [{"type": "var", "name": "sh"}, "run_cmds.sh"] - , "outs": {"type": "var", "name": "installed_files"} - , "out_dirs": {"type": "var", "name": "installed_dirs"} - , "env": {"type": "var", "name": "ENV"} - , "timeout scaling": - {"type": "var", "name": "TIMEOUT_SCALE", "default": 10.0} - , "execution properties": - {"type": "var", "name": "FOREIGN_EXECUTION_PROPERTIES"} - } - ] - ] - , "body": {"type": "var", "name": "artifacts"} - } - } -} diff --git a/CC/foreign/shell/RULES b/CC/foreign/shell/RULES deleted file mode 100644 index 182e46a..0000000 --- a/CC/foreign/shell/RULES +++ /dev/null @@ -1,624 +0,0 @@ -{ "data": - { "doc": - [ "Data produced by generic shell commands with toolchain support." - , "" - , "All variables accessible to commands and options are: \"TMPDIR\"," - , "\"LOCALBASE\", \"WORKDIR\", \"DESTDIR\", \"CC\", \"CXX\", \"CFLAGS\"," - , "\"CXXFLAGS\", \"LDFLAGS\", and \"AR\". \"LOCALBASE\" contains the path" - , "to the staged artifacts from \"localbase\" and the installed artifacts" - , "from \"deps\". Furthermore, the variable \"ACTION_DIR\" points to the" - , "current action directory, if needed for achieving reproducibility." - ] - , "target_fields": ["project", "localbase", "deps"] - , "string_fields": ["cmds", "outs", "out_dirs", "resolve_symlinks"] - , "config_vars": - [ "CC" - , "CXX" - , "CFLAGS" - , "CXXFLAGS" - , "LDFLAGS" - , "ADD_CFLAGS" - , "ADD_CXXFLAGS" - , "ADD_LDFLAGS" - , "ENV" - , "AR" - , "PREFIX" - , "BUILD_POSITION_INDEPENDENT" - , "TIMEOUT_SCALE" - , "FOREIGN_EXECUTION_PROPERTIES" - ] - , "implicit": - { "defaults": [["CC", "defaults"]] - , "foreign-defaults": [["CC/foreign", "defaults"]] - , "shell defaults": [["shell", "defaults"]] - } - , "field_doc": - { "project": - [ "The project directory. The disjoint union of the artifacts of the" - , "targets specified here are taken as project directory." - , "Its path can be accessed via the \"WORKDIR\" variable." - ] - , "localbase": ["Artifacts to stage to \"LOCALBASE\"."] - , "deps": ["CC targets to install to \"LOCALBASE\"."] - , "cmds": - [ "List of commands to execute by \"sh\". Multiple commands will be" - , "joined with the newline character." - ] - , "resolve_symlinks": - [ "Resolve all symlinks in the install directory. This operation is" - , "performed immediately after \"cmds\" were executed." - ] - , "outs": ["Paths to the produced output files in \"DESTDIR\"."] - , "out_dirs": ["Paths to the produced output directories in \"DESTDIR\"."] - } - , "config_doc": - { "CC": - [ "The name of the C compiler to be used." - , "If null, the respective value from [\"CC\", \"defaults\"] will be taken." - ] - , "CXX": - [ "The name of the C++ compiler to be used." - , "If null, the respective value from [\"CC\", \"defaults\"] will be taken." - ] - , "CFLAGS": - [ "The flags for CC to be used instead of the default ones." - , "For libraries that should be built in a non-standard way; usually" - , "adapting the default target [\"CC\", \"defaults\"] is the better" - , "choice" - ] - , "CXXFLAGS": - [ "The flags for CXX to be used instead of the default ones." - , "For libraries that should be built in a non-standard way; usually" - , "adapting the default target [\"CC\", \"defaults\"] is the better" - , "choice." - ] - , "LDFLAGS": - [ "The linker flags to be used instead of the default ones." - , "For libraries that should be linked in a non-standard way; usually" - , "adapting the default target [\"CC\", \"defaults\"] is the better" - , "choice" - ] - , "ADD_CFLAGS": - [ "The flags to add to the default ones for CC." - , "For libraries that should be built in a non-standard way; usually" - , "adapting the default target [\"CC\", \"defaults\"] is the better" - , "choice." - ] - , "ADD_CXXFLAGS": - [ "The flags to add to the default ones for CXX." - , "For libraries that should be built in a non-standard way; usually" - , "adapting the default target [\"CC\", \"defaults\"] is the better" - , "choice." - ] - , "ADD_LDFLAGS": - [ "The linker flags to add to the default ones." - , "For libraries that should be linked in a non-standard way; usually" - , "adapting the default target [\"CC\", \"defaults\"] is the better" - , "choice." - ] - , "ENV": - [ "The environment for any action generated." - , "If null, the respective value from [\"CC\", \"defaults\"] will be taken." - ] - , "AR": - [ "The archive tool to used for creating the library." - , "If null, the respective value from [\"CC\", \"defaults\"] will be taken." - ] - , "PREFIX": - [ "The absolute path that is used as prefix inside generated pkg-config" - , "files. The default value for this variable is \"/\". This variable" - , "is ignored if the field \"prefix\" is set." - ] - , "BUILD_POSITION_INDEPENDENT": ["Build position independent code."] - , "TIMEOUT_SCALE": - [ "The scaling of the timeout for the invocation of the foreign build." - , "Defaults to 10." - ] - , "FOREIGN_EXECUTION_PROPERTIES": - [ "A map with extra remote-execution properties to be added to the foreign build action." - ] - } - , "imports": - { "artifacts": ["", "field_artifacts"] - , "stage_field": ["", "stage_singleton_field"] - , "shell-build": "shell-build" - , "install-deps": ["CC", "install-with-deps stage"] - , "strip-prefix": ["CC/foreign", "strip-prefix"] - , "for host": ["transitions", "for host"] - } - , "config_transitions": - { "defaults": - [{"type": "empty_map"}, {"type": "CALL_EXPRESSION", "name": "for host"}] - } - , "expression": - { "type": "let*" - , "bindings": - [ ["cmds", {"type": "FIELD", "name": "cmds"}] - , [ "sources" - , { "type": "let*" - , "bindings": [["fieldname", "project"]] - , "body": {"type": "CALL_EXPRESSION", "name": "artifacts"} - } - ] - , [ "localbase" - , { "type": "disjoint_map_union" - , "msg": "localbase and installed dependency files may not overlap" - , "$1": - [ { "type": "let*" - , "bindings": - [ ["pc-install-dir", "lib/pkgconfig"] - , ["targets", {"type": "FIELD", "name": "deps"}] - ] - , "body": {"type": "CALL_EXPRESSION", "name": "install-deps"} - } - , { "type": "let*" - , "bindings": [["fieldname", "localbase"]] - , "body": {"type": "CALL_EXPRESSION", "name": "artifacts"} - } - ] - } - ] - , ["outs", {"type": "FIELD", "name": "outs"}] - , ["out_dirs", {"type": "FIELD", "name": "out_dirs"}] - , ["install_prefix", "install"] - , [ "installed_files" - , { "type": "foreach" - , "var": "file_path" - , "range": {"type": "var", "name": "outs"} - , "body": - { "type": "join" - , "separator": "/" - , "$1": - [ {"type": "var", "name": "install_prefix"} - , {"type": "var", "name": "file_path"} - ] - } - } - ] - , [ "installed_dirs" - , { "type": "foreach" - , "var": "dir_path" - , "range": {"type": "var", "name": "out_dirs"} - , "body": - { "type": "join" - , "separator": "/" - , "$1": - [ {"type": "var", "name": "install_prefix"} - , {"type": "var", "name": "dir_path"} - ] - } - } - ] - , ["resolve_symlinks", {"type": "FIELD", "name": "resolve_symlinks"}] - , ["artifacts", {"type": "CALL_EXPRESSION", "name": "shell-build"}] - ] - , "body": - { "type": "RESULT" - , "artifacts": - { "type": "map_union" - , "$1": - { "type": "let*" - , "bindings": - [ ["artifacts", {"type": "var", "name": "artifacts"}] - , [ "paths" - , { "type": "++" - , "$1": - [ {"type": "var", "name": "outs"} - , {"type": "var", "name": "out_dirs"} - ] - } - ] - , ["prefix", {"type": "var", "name": "install_prefix"}] - ] - , "body": {"type": "CALL_EXPRESSION", "name": "strip-prefix"} - } - } - } - } - } -, "library": - { "doc": - [ "Library produced by generic shell commands with toolchain support." - , "" - , "All variables accessible to commands and options are: \"TMPDIR\"," - , "\"LOCALBASE\", \"WORKDIR\", \"DESTDIR\", \"CC\", \"CXX\", \"CFLAGS\"," - , "\"CXXFLAGS\", \"LDFLAGS\", and \"AR\". \"LOCALBASE\" contains the path" - , "to the staged artifacts from \"localbase\" and the installed artifacts" - , "from \"deps\". Furthermore, the variable \"ACTION_DIR\" points to the" - , "current action directory, if needed for achieving reproducibility." - ] - , "target_fields": ["project", "localbase", "deps"] - , "string_fields": - [ "name" - , "version" - , "stage" - , "cmds" - , "out_hdrs" - , "out_hdr_dirs" - , "out_libs" - , "cflags" - , "ldflags" - , "pkg-config" - , "hdr_prefix" - , "lib_prefix" - , "pc_prefix" - , "resolve_symlinks" - ] - , "config_vars": - [ "CC" - , "CXX" - , "CFLAGS" - , "CXXFLAGS" - , "LDFLAGS" - , "ADD_CFLAGS" - , "ADD_CXXFLAGS" - , "ADD_LDFLAGS" - , "ENV" - , "AR" - , "PREFIX" - , "BUILD_POSITION_INDEPENDENT" - , "TIMEOUT_SCALE" - , "FOREIGN_EXECUTION_PROPERTIES" - ] - , "implicit": - { "defaults": [["CC", "defaults"]] - , "foreign-defaults": [["CC/foreign", "defaults"]] - , "shell defaults": [["shell", "defaults"]] - , "config_reader": [["CC", "prebuilt/read_pkgconfig.py"]] - } - , "field_doc": - { "project": - [ "The project directory. The disjoint union of the artifacts of the" - , "targets specified here are taken as project directory." - , "Its path can be accessed via the \"WORKDIR\" variable." - ] - , "name": - [ "The name of the library (without leading \"lib\" or trailing file name" - , "extension), also used as name for pkg-config files." - ] - , "version": - [ "The library version, used for pkg-config files. Individual version" - , "components are joined with \".\"." - ] - , "localbase": ["Artifacts to stage to \"LOCALBASE\"."] - , "cmds": - [ "List of commands to execute by \"sh\". Multiple commands will be" - , "joined with the newline character." - ] - , "resolve_symlinks": - [ "Resolve all symlinks in the install directory. This operation is" - , "performed immediately after \"cmds\" were executed." - ] - , "out_hdrs": - [ "Paths to produced public header files. The path is considered" - , "relative to the include directory, which be set via \"hdr_prefix\"." - , "Note that \"out_hdrs\" and \"out_hdr_dirs\" may not overlap." - ] - , "out_hdr_dirs": - [ "Paths to produced public header directories. The path is considered" - , "relative to the include directory, which be set via \"hdr_prefix\"." - , "Note that \"out_hdrs\" and \"out_hdr_dirs\" may not overlap." - ] - , "out_libs": - [ "Paths to produced library files. The path is considered relative" - , "to the library directory, which be set via \"lib_prefix\"." - , "Order matters in the case of one library depending on another." - ] - , "cflags": - ["List of compile flags set for this target and its consumers."] - , "ldflags": - [ "Additional linker flags that are required for the consumer of the" - , "produced libraries." - ] - , "stage": - [ "The logical location of the public headers and library files." - , "Individual directory components are joined with \"/\"." - ] - , "deps": ["Public dependency on other CC libraries."] - , "pkg-config": - [ "Pkg-config file for optional infer of public cflags and ldflags. If" - , "multiple files are specified (e.g., one depends on the other), the" - , "first one is used as entry. Note that if this field is non-empty the" - , "tool \"pkg-config\" must be available in \"PATH\", which is taken" - , "from [\"CC\", \"defaults\"] or the \"ENV\" variable." - ] - , "hdr_prefix": - [ "Prefix where headers will be installed by Make. Individual directory" - , "components are joined with \"/\". Defaults to \"include\" if not set." - ] - , "lib_prefix": - [ "Prefix where libraries will be installed by Make. Individual" - , "directory components are joined with \"/\". Defaults to \"lib\" if" - , "not set." - ] - , "pc_prefix": - [ "Prefix where pkg-config files will be installed by Make. Individual" - , "directory components are joined with \"/\". Defaults to" - , "\"lib/pkgconfig\" if not set." - ] - } - , "config_doc": - { "CC": - [ "The name of the C compiler to be used." - , "If null, the respective value from [\"CC\", \"defaults\"] will be taken." - ] - , "CXX": - [ "The name of the C++ compiler to be used." - , "If null, the respective value from [\"CC\", \"defaults\"] will be taken." - ] - , "CFLAGS": - [ "The flags for CC to be used instead of the default ones." - , "For libraries that should be built in a non-standard way; usually" - , "adapting the default target [\"CC\", \"defaults\"] is the better" - , "choice" - ] - , "CXXFLAGS": - [ "The flags for CXX to be used instead of the default ones." - , "For libraries that should be built in a non-standard way; usually" - , "adapting the default target [\"CC\", \"defaults\"] is the better" - , "choice." - ] - , "LDFLAGS": - [ "The linker flags to be used instead of the default ones." - , "For libraries that should be linked in a non-standard way; usually" - , "adapting the default target [\"CC\", \"defaults\"] is the better" - , "choice" - ] - , "ADD_CFLAGS": - [ "The flags to add to the default ones for CC." - , "For libraries that should be built in a non-standard way; usually" - , "adapting the default target [\"CC\", \"defaults\"] is the better" - , "choice." - ] - , "ADD_CXXFLAGS": - [ "The flags to add to the default ones for CXX." - , "For libraries that should be built in a non-standard way; usually" - , "adapting the default target [\"CC\", \"defaults\"] is the better" - , "choice." - ] - , "ADD_LDFLAGS": - [ "The linker flags to add to the default ones." - , "For libraries that should be linked in a non-standard way; usually" - , "adapting the default target [\"CC\", \"defaults\"] is the better" - , "choice." - ] - , "ENV": - [ "The environment for any action generated." - , "If null, the respective value from [\"CC\", \"defaults\"] will be taken." - ] - , "AR": - [ "The archive tool to used for creating the library." - , "If null, the respective value from [\"CC\", \"defaults\"] will be taken." - ] - , "PREFIX": - [ "The absolute path that is used as prefix inside generated pkg-config" - , "files. The default value for this variable is \"/\". This variable" - , "is ignored if the field \"prefix\" is set." - ] - , "BUILD_POSITION_INDEPENDENT": ["Build position independent code."] - , "TIMEOUT_SCALE": - [ "The scaling of the timeout for the invocation of the foreign build." - , "Defaults to 10." - ] - , "FOREIGN_EXECUTION_PROPERTIES": - [ "A map with extra remote-execution properties to be added to the foreign build action." - ] - } - , "imports": - { "artifacts": ["", "field_artifacts"] - , "stage_field": ["", "stage_singleton_field"] - , "shell-build": "shell-build" - , "prebuilt result": ["CC/prebuilt", "prebuilt result"] - , "install-deps": ["CC", "install-with-deps stage"] - , "strip-prefix": ["CC/foreign", "strip-prefix"] - , "for host": ["transitions", "for host"] - } - , "config_transitions": - { "defaults": - [{"type": "empty_map"}, {"type": "CALL_EXPRESSION", "name": "for host"}] - } - , "expression": - { "type": "let*" - , "bindings": - [ [ "hdr_prefix" - , { "type": "join" - , "separator": "/" - , "$1": - { "type": "++" - , "$1": - [ ["install"] - , { "type": "if" - , "cond": {"type": "FIELD", "name": "hdr_prefix"} - , "then": {"type": "FIELD", "name": "hdr_prefix"} - , "else": ["include"] - } - ] - } - } - ] - , [ "lib_prefix" - , { "type": "join" - , "separator": "/" - , "$1": - { "type": "++" - , "$1": - [ ["install"] - , { "type": "if" - , "cond": {"type": "FIELD", "name": "lib_prefix"} - , "then": {"type": "FIELD", "name": "lib_prefix"} - , "else": ["lib"] - } - ] - } - } - ] - , [ "pc_prefix" - , { "type": "join" - , "separator": "/" - , "$1": - { "type": "++" - , "$1": - [ ["install"] - , { "type": "if" - , "cond": {"type": "FIELD", "name": "pc_prefix"} - , "then": {"type": "FIELD", "name": "pc_prefix"} - , "else": ["lib", "pkgconfig"] - } - ] - } - } - ] - , [ "sources" - , { "type": "let*" - , "bindings": [["fieldname", "project"]] - , "body": {"type": "CALL_EXPRESSION", "name": "artifacts"} - } - ] - , [ "localbase" - , { "type": "disjoint_map_union" - , "msg": "localbase and installed dependency files may not overlap" - , "$1": - [ { "type": "let*" - , "bindings": - [ ["pc-install-dir", "lib/pkgconfig"] - , ["targets", {"type": "FIELD", "name": "deps"}] - ] - , "body": {"type": "CALL_EXPRESSION", "name": "install-deps"} - } - , { "type": "let*" - , "bindings": [["fieldname", "localbase"]] - , "body": {"type": "CALL_EXPRESSION", "name": "artifacts"} - } - ] - } - ] - , [ "installed_dirs" - , { "type": "foreach" - , "var": "dir_path" - , "range": {"type": "FIELD", "name": "out_hdr_dirs"} - , "body": - { "type": "join" - , "separator": "/" - , "$1": - [ {"type": "var", "name": "hdr_prefix"} - , {"type": "var", "name": "dir_path"} - ] - } - } - ] - , [ "installed_files" - , { "type": "++" - , "$1": - [ { "type": "foreach" - , "var": "lib_path" - , "range": {"type": "FIELD", "name": "out_libs"} - , "body": - { "type": "join" - , "separator": "/" - , "$1": - [ {"type": "var", "name": "lib_prefix"} - , {"type": "var", "name": "lib_path"} - ] - } - } - , { "type": "foreach" - , "var": "hdr_path" - , "range": {"type": "FIELD", "name": "out_hdrs"} - , "body": - { "type": "join" - , "separator": "/" - , "$1": - [ {"type": "var", "name": "hdr_prefix"} - , {"type": "var", "name": "hdr_path"} - ] - } - } - , { "type": "foreach" - , "var": "pc_path" - , "range": {"type": "FIELD", "name": "pkg-config"} - , "body": - { "type": "join" - , "separator": "/" - , "$1": - [ {"type": "var", "name": "pc_prefix"} - , {"type": "var", "name": "pc_path"} - ] - } - } - ] - } - ] - , ["cmds", {"type": "FIELD", "name": "cmds"}] - , ["resolve_symlinks", {"type": "FIELD", "name": "resolve_symlinks"}] - , ["defaults-transition", {"type": "empty_map"}] - , ["install_dir", {"type": "CALL_EXPRESSION", "name": "shell-build"}] - , [ "hdrs" - , { "type": "++" - , "$1": - [ { "type": "let*" - , "bindings": - [ ["artifacts", {"type": "var", "name": "install_dir"}] - , ["paths", {"type": "FIELD", "name": "out_hdrs"}] - , ["prefix", {"type": "var", "name": "hdr_prefix"}] - ] - , "body": {"type": "CALL_EXPRESSION", "name": "strip-prefix"} - } - , { "type": "let*" - , "bindings": - [ ["artifacts", {"type": "var", "name": "install_dir"}] - , ["paths", {"type": "FIELD", "name": "out_hdr_dirs"}] - , ["prefix", {"type": "var", "name": "hdr_prefix"}] - ] - , "body": {"type": "CALL_EXPRESSION", "name": "strip-prefix"} - } - ] - } - ] - , [ "libs" - , { "type": "let*" - , "bindings": - [ ["artifacts", {"type": "var", "name": "install_dir"}] - , ["paths", {"type": "FIELD", "name": "out_libs"}] - , ["prefix", {"type": "var", "name": "lib_prefix"}] - ] - , "body": {"type": "CALL_EXPRESSION", "name": "strip-prefix"} - } - ] - , [ "config_reader" - , { "type": "let*" - , "bindings": - [["fieldname", "config_reader"], ["location", "config_reader"]] - , "body": {"type": "CALL_EXPRESSION", "name": "stage_field"} - } - ] - , [ "pkg-configs" - , { "type": "let*" - , "bindings": - [ ["artifacts", {"type": "var", "name": "install_dir"}] - , ["paths", {"type": "FIELD", "name": "pkg-config"}] - , ["prefix", {"type": "var", "name": "pc_prefix"}] - ] - , "body": {"type": "CALL_EXPRESSION", "name": "strip-prefix"} - } - ] - , [ "name" - , { "type": "assert_non_empty" - , "msg": "name is required for make library" - , "$1": {"type": "join", "$1": {"type": "FIELD", "name": "name"}} - } - ] - , ["version", {"type": "FIELD", "name": "version"}] - , ["cflags", {"type": "FIELD", "name": "cflags"}] - , ["ldflags", {"type": "FIELD", "name": "ldflags"}] - , [ "stage" - , { "type": "join" - , "separator": "/" - , "$1": {"type": "FIELD", "name": "stage"} - } - ] - , ["deps-fieldnames", ["deps", "defaults"]] - ] - , "body": {"type": "CALL_EXPRESSION", "name": "prebuilt result"} - } - } -} |