diff options
-rw-r--r-- | INSTALL.md | 4 | ||||
-rw-r--r-- | TARGETS | 9 | ||||
-rw-r--r-- | etc/defaults/CC/TARGETS | 13 | ||||
-rw-r--r-- | src/buildtool/main/TARGETS | 6 | ||||
-rw-r--r-- | src/other_tools/just_mr/TARGETS | 6 |
5 files changed, 20 insertions, 18 deletions
@@ -31,9 +31,9 @@ variables. The full list can be obtained via `just-mr describe`. | ARCH | x86, x86_64, arm, arm64 | x86_64 | | HOST_ARCH | x86, x86_64, arm, arm64 | *derived from ARCH* | | TARGET_ARCH | x86, x86_64, arm, arm64 | *derived from ARCH* | -| TOOLCHAIN_CONFIG["FAMILY"] | gnu, clang, unknown | unknown | | DEBUG | true, false | false | -| BUILD_STATIC_BINARY | true, false | false | +| TOOLCHAIN_CONFIG["FAMILY"] | gnu, clang, unknown | unknown | +| TOOLCHAIN_CONFIG["BUILD_STATIC"] | true, false | false | Note that you can choose a different stack size for resulting binaries by adding `"-Wl,-z,stack-size=<size-in-bytes>"` to variable `"FINAL_LDFLAGS"` @@ -7,7 +7,6 @@ , "ADD_CXXFLAGS" , "AR" , "ARCH" - , "BUILD_STATIC_BINARY" , "FINAL_LDFLAGS" , "CC" , "CXX" @@ -39,14 +38,14 @@ , "used C and C++ compilers and uses the generic \"cc\" and \"c++\" as" , "names for the respective compilers; typically used in conjunction with" , "setting \"CC\" and \"CXX\" explicitly and building for host." + , "" + , "Use field \"BUILD_STATIC\" to specify that binaries should be" + , "statically linked. Boolean, default false." ] , "ENV": [ "Map from strings to strings. The build environment ot be used for" , "build actions. Typically used to include an unusual value of PATH." ] - , "BUILD_STATIC_BINARY": - [ "Boolean, default false. If set, try to build a (mainly) static binary." - ] , "FINAL_LDFLAGS": ["Compiler flags for linking the final binary."] , "DEBUG": ["Boolean, default false. Whether to build a debug version."] , "OS": @@ -85,7 +84,6 @@ , "ADD_CFLAGS" , "AR" , "ENV" - , "BUILD_STATIC_BINARY" , "FINAL_LDFLAGS" , "SOURCE_DATE_EPOCH" , "VERSION_EXTRA_SUFFIX" @@ -136,7 +134,6 @@ , "ADD_CFLAGS" , "AR" , "ENV" - , "BUILD_STATIC_BINARY" , "FINAL_LDFLAGS" , "SOURCE_DATE_EPOCH" , "VERSION_EXTRA_SUFFIX" diff --git a/etc/defaults/CC/TARGETS b/etc/defaults/CC/TARGETS index f6e13ea6..97ca6ae8 100644 --- a/etc/defaults/CC/TARGETS +++ b/etc/defaults/CC/TARGETS @@ -56,5 +56,18 @@ , "else": ["-O2", "-DNDEBUG"] } } + , "ADD_LDFLAGS": + { "type": "if" + , "cond": + { "type": "lookup" + , "map": + { "type": "var" + , "name": "TOOLCHAIN_CONFIG" + , "default": {"type": "empty_map"} + } + , "key": "BUILD_STATIC" + } + , "then": ["-static"] + } } } diff --git a/src/buildtool/main/TARGETS b/src/buildtool/main/TARGETS index b44f4ebc..944f94dc 100644 --- a/src/buildtool/main/TARGETS +++ b/src/buildtool/main/TARGETS @@ -1,6 +1,6 @@ { "just": { "type": ["@", "rules", "CC", "binary"] - , "arguments_config": ["BUILD_STATIC_BINARY", "FINAL_LDFLAGS"] + , "arguments_config": ["FINAL_LDFLAGS"] , "name": ["just"] , "srcs": ["main.cpp"] , "private-deps": @@ -42,10 +42,6 @@ { "type": "++" , "$1": [ ["-Wl,-z,stack-size=8388608"] - , { "type": "if" - , "cond": {"type": "var", "name": "BUILD_STATIC_BINARY"} - , "then": ["-static"] - } , {"type": "var", "name": "FINAL_LDFLAGS", "default": []} ] } diff --git a/src/other_tools/just_mr/TARGETS b/src/other_tools/just_mr/TARGETS index 359b1443..4b9cf071 100644 --- a/src/other_tools/just_mr/TARGETS +++ b/src/other_tools/just_mr/TARGETS @@ -1,6 +1,6 @@ { "just-mr": { "type": ["@", "rules", "CC", "binary"] - , "arguments_config": ["BUILD_STATIC_BINARY", "FINAL_LDFLAGS"] + , "arguments_config": ["FINAL_LDFLAGS"] , "name": ["just-mr"] , "srcs": ["main.cpp"] , "private-deps": @@ -28,10 +28,6 @@ { "type": "++" , "$1": [ ["-Wl,-z,stack-size=8388608"] - , { "type": "if" - , "cond": {"type": "var", "name": "BUILD_STATIC_BINARY"} - , "then": ["-static"] - } , {"type": "var", "name": "FINAL_LDFLAGS", "default": []} ] } |