@@ -87,6 +87,14 @@ def install_sccache(build_env):
87
87
def add_target_env (env , build_platform , target_triple , build_env ):
88
88
add_env_common (env )
89
89
90
+ settings = get_target_settings (TARGETS_CONFIG , target_triple )
91
+
92
+ if settings .get ("needs_toolchain" ):
93
+ if "musl" in target_triple :
94
+ env ["CC" ] = "musl-clang"
95
+ else :
96
+ env ["CC" ] = "clang"
97
+
90
98
env ["PYBUILD_PLATFORM" ] = build_platform
91
99
env ["TOOLS_PATH" ] = build_env .tools_path
92
100
@@ -293,12 +301,9 @@ def simple_build(
293
301
build_env .copy_file (SUPPORT / ("build-%s.sh" % entry ))
294
302
295
303
env = {
296
- "CC" : "clang" ,
297
304
"TOOLCHAIN" : "clang-%s" % host_platform ,
298
305
"%s_VERSION" % entry .upper ().replace ("-" , "_" ): DOWNLOADS [entry ]["version" ],
299
306
}
300
- if "musl" in target_triple :
301
- env ["CC" ] = "musl-clang"
302
307
303
308
add_target_env (env , host_platform , target_triple , build_env )
304
309
@@ -472,14 +477,10 @@ def build_libedit(
472
477
build_env .copy_file (SUPPORT / "build-libedit.sh" )
473
478
474
479
env = {
475
- "CC" : "clang" ,
476
480
"TOOLCHAIN" : "clang-%s" % host_platform ,
477
481
"LIBEDIT_VERSION" : DOWNLOADS ["libedit" ]["version" ],
478
482
}
479
483
480
- if "musl" in target_triple :
481
- env ["CC" ] = "musl-clang"
482
-
483
484
add_target_env (env , host_platform , target_triple , build_env )
484
485
485
486
build_env .run ("build-libedit.sh" , environment = env )
@@ -508,14 +509,10 @@ def build_readline(
508
509
build_env .copy_file (SUPPORT / "build-readline.sh" )
509
510
510
511
env = {
511
- "CC" : "clang" ,
512
512
"TOOLCHAIN" : "clang-%s" % host_platform ,
513
513
"READLINE_VERSION" : DOWNLOADS ["readline" ]["version" ],
514
514
}
515
515
516
- if "musl" in target_triple :
517
- env ["CC" ] = "musl-clang"
518
-
519
516
add_target_env (env , host_platform , target_triple , build_env )
520
517
521
518
build_env .run ("build-readline.sh" , environment = env )
@@ -550,16 +547,12 @@ def build_tix(
550
547
build_env .copy_file (p )
551
548
552
549
env = {
553
- "CC" : "clang" ,
554
550
"TOOLCHAIN" : "clang-%s" % host_platform ,
555
551
"TCL_VERSION" : DOWNLOADS ["tcl" ]["version" ],
556
552
"TIX_VERSION" : DOWNLOADS ["tix" ]["version" ],
557
553
"TK_VERSION" : DOWNLOADS ["tk" ]["version" ],
558
554
}
559
555
560
- if "musl" in target_triple :
561
- env ["CC" ] = "musl-clang"
562
-
563
556
add_target_env (env , host_platform , target_triple , build_env )
564
557
565
558
build_env .run ("build-tix.sh" , environment = env )
@@ -895,17 +888,13 @@ def build_cpython(
895
888
build_env .copy_file (fh .name , dest_name = "Makefile.extra" )
896
889
897
890
env = {
898
- "CC" : "clang" ,
899
891
"PIP_VERSION" : DOWNLOADS ["pip" ]["version" ],
900
892
"PYTHON_VERSION" : entry ["version" ],
901
893
"PYTHON_MAJMIN_VERSION" : "." .join (entry ["version" ].split ("." )[0 :2 ]),
902
894
"SETUPTOOLS_VERSION" : DOWNLOADS ["setuptools" ]["version" ],
903
895
"TOOLCHAIN" : "clang-%s" % host_platform ,
904
896
}
905
897
906
- if "musl" in target_triple :
907
- env ["CC" ] = "musl-clang"
908
-
909
898
if optimizations == "debug" :
910
899
env ["CPYTHON_DEBUG" ] = "1"
911
900
if optimizations in ("pgo" , "pgo+lto" ):
0 commit comments