Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/56949 )

Change subject: scons: Add a mechanism to manually defconfig a build dir.
......................................................................

scons: Add a mechanism to manually defconfig a build dir.

This will let you specify *any* defconfig file, instead of implicitly
selecting one from the defconfig directory based on the variant name.

Change-Id: I74c981b206849f08e60c2df702c06534c670cc7c
---
M SConstruct
1 file changed, 23 insertions(+), 1 deletion(-)



diff --git a/SConstruct b/SConstruct
index 14586ce..8ccddee 100755
--- a/SConstruct
+++ b/SConstruct
@@ -209,7 +209,10 @@
 # doesn't work (obviously!).
 BUILD_TARGETS[:] = makePathListAbsolute(BUILD_TARGETS)

-kconfig_actions = ('menuconfig',)
+kconfig_actions = (
+    'menuconfig',
+    'defconfig',
+)

 # From itertools-recipes:
 # docs.python.org/dev/library/itertools.html#itertools-recipes
@@ -632,6 +635,13 @@
         if kconfig_action == 'menuconfig':
kconfig.menuconfig(env, kconfig_file.abspath, config_file.abspath,
                     variant_path)
+        elif kconfig_action == 'defconfig':
+            defconfig_key = 'DEFCONFIG'
+            defconfig_path = ARGUMENTS.get(defconfig_key, None)
+            if not defconfig_path:
+                error(f'Tried to defconfig, but {defconfig_key} not set.')
+            kconfig.defconfig(env, kconfig_file.abspath,
+                    defconfig_path, config_file.abspath)
         else:
             error(f'Unrecognized kconfig action {kconfig_action}')
         Exit(0)

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/56949
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I74c981b206849f08e60c2df702c06534c670cc7c
Gerrit-Change-Number: 56949
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to