@@ -250,6 +250,7 @@ def configure( # pylint: disable=too-many-arguments,too-many-locals
250
250
extra_cflags = None ,
251
251
delete_intermediates = False ,
252
252
boards_only = False ,
253
+ static_version = False ,
253
254
):
254
255
"""Locate and configure the specified projects."""
255
256
# Resolve build_dir if needed.
@@ -281,6 +282,7 @@ def configure( # pylint: disable=too-many-arguments,too-many-locals
281
282
extra_cflags = extra_cflags ,
282
283
multiproject = len (projects ) > 1 ,
283
284
delete_intermediates = delete_intermediates ,
285
+ static_version = static_version ,
284
286
)
285
287
)
286
288
if self ._sequential :
@@ -326,6 +328,7 @@ def build( # pylint: disable=too-many-arguments
326
328
extra_cflags = None ,
327
329
delete_intermediates = False ,
328
330
boards_only = False ,
331
+ static_version = False ,
329
332
):
330
333
"""Locate and build the specified projects."""
331
334
return self .configure (
@@ -342,6 +345,7 @@ def build( # pylint: disable=too-many-arguments
342
345
build_after_configure = True ,
343
346
delete_intermediates = delete_intermediates ,
344
347
boards_only = boards_only ,
348
+ static_version = static_version ,
345
349
)
346
350
347
351
def test ( # pylint: disable=too-many-arguments,too-many-locals
@@ -359,6 +363,7 @@ def test( # pylint: disable=too-many-arguments,too-many-locals
359
363
no_rebuild = False ,
360
364
delete_intermediates = False ,
361
365
boards_only = False ,
366
+ static_version = False ,
362
367
):
363
368
"""Locate and build the specified projects."""
364
369
if not no_rebuild :
@@ -376,6 +381,7 @@ def test( # pylint: disable=too-many-arguments,too-many-locals
376
381
test_after_configure = True ,
377
382
delete_intermediates = delete_intermediates ,
378
383
boards_only = boards_only ,
384
+ static_version = static_version ,
379
385
)
380
386
# Resolve build_dir if needed.
381
387
if not build_dir :
@@ -435,6 +441,7 @@ def testall( # pylint: disable=too-many-arguments
435
441
bringup = False ,
436
442
coverage = False ,
437
443
allow_warnings = False ,
444
+ static_version = False ,
438
445
):
439
446
"""Locate and build all the projects."""
440
447
return self .test (
@@ -446,6 +453,7 @@ def testall( # pylint: disable=too-many-arguments
446
453
coverage = coverage ,
447
454
allow_warnings = allow_warnings ,
448
455
all_projects = True ,
456
+ static_version = static_version ,
449
457
)
450
458
451
459
def _configure (
@@ -462,6 +470,7 @@ def _configure(
462
470
extra_cflags = None ,
463
471
multiproject = False ,
464
472
delete_intermediates = False ,
473
+ static_version = False ,
465
474
):
466
475
# pylint: disable=too-many-arguments,too-many-locals,too-many-branches
467
476
# pylint: disable=too-many-statements
@@ -497,6 +506,11 @@ def _configure(
497
506
),
498
507
"ZMAKE_INCLUDE_DIR" : str (generated_include_dir ),
499
508
"ZMAKE_PROJECT_NAME" : project .config .project_name ,
509
+ ** (
510
+ {"EXTRA_EC_VERSION_FLAGS" : "--static" }
511
+ if static_version
512
+ else {}
513
+ ),
500
514
},
501
515
)
502
516
@@ -645,6 +659,7 @@ def _configure(
645
659
coverage = coverage ,
646
660
output_files_out = output_files ,
647
661
multiproject = multiproject ,
662
+ static_version = static_version ,
648
663
)
649
664
if result :
650
665
self .failed_projects .append (project .config .project_name )
@@ -687,6 +702,7 @@ def _build( # pylint: disable=too-many-arguments
687
702
output_files_out = None ,
688
703
coverage = False ,
689
704
multiproject = False ,
705
+ static_version = False ,
690
706
):
691
707
# pylint: disable=too-many-locals,too-many-branches
692
708
"""Build a pre-configured build directory."""
@@ -730,13 +746,17 @@ def wait_and_check_success(procs, writers):
730
746
project .config .project_name ,
731
747
build_dir / "zephyr_base" ,
732
748
zmake .modules .locate_from_directory (build_dir / "modules" ),
749
+ static = static_version ,
733
750
)
734
751
735
752
# The version header needs to generated during the build phase
736
753
# instead of configure, as the tree may have changed since
737
754
# configure was run.
738
755
zmake .version .write_version_header (
739
- version_string , build_dir / "include" / "ec_version.h" , "zmake"
756
+ version_string ,
757
+ build_dir / "include" / "ec_version.h" ,
758
+ "zmake" ,
759
+ static = static_version ,
740
760
)
741
761
742
762
gcov = "gcov.sh-not-found"
0 commit comments