diff --git a/SConstruct b/SConstruct index 5ae1080cff..99b277caae 100755 --- a/SConstruct +++ b/SConstruct @@ -261,6 +261,7 @@ Targets: kconfig_actions = ( 'defconfig', + 'listnewconfig', 'menuconfig', 'setconfig', ) @@ -293,6 +294,13 @@ Kconfig tools: scons defconfig build/foo/bar build_opts/MIPS + listnewconfig: + Lists config options which are new in the Kconfig and which are not + currently set in the existing config file. + + scons listnewconfig build/foo/bar + + menuconfig: Opens the menuconfig editor which will let you view and edit config values, and view help text. menuconfig runs in text mode. @@ -831,6 +839,9 @@ for variant_path in variant_paths: defconfig_path = makePathAbsolute(kconfig_args[0]) kconfig.defconfig(env, kconfig_file.abspath, defconfig_path, config_file.abspath) + elif kconfig_action == 'listnewconfig': + kconfig.listnewconfig(env, kconfig_file.abspath, + config_file.abspath) elif kconfig_action == 'menuconfig': kconfig.menuconfig(env, kconfig_file.abspath, config_file.abspath, variant_path) diff --git a/site_scons/gem5_scons/kconfig.py b/site_scons/gem5_scons/kconfig.py index 0251fdd8ea..a5fa471b07 100644 --- a/site_scons/gem5_scons/kconfig.py +++ b/site_scons/gem5_scons/kconfig.py @@ -30,6 +30,7 @@ import kconfiglib _kconfig_helpers = { "DEFCONFIG_PY": "defconfig.py", + "LISTNEWCONFIG_PY": "listnewconfig.py", "MENUCONFIG_PY": "menuconfig.py", "SETCONFIG_PY": "setconfig.py", } @@ -93,6 +94,18 @@ def defconfig(env, base_kconfig, config_in, config_out): error("Failed to run defconfig") +def listnewconfig(env, base_kconfig, config_path): + """ + Interface of handling listnewconfig.py of Kconfiglib + """ + kconfig_env = _prep_env(env, base_kconfig, config_path) + # Provide a little visual separation between SCons output and + # listnewconfig output. + print() + if kconfig_env.Execute('"${LISTNEWCONFIG_PY}" "${BASE_KCONFIG}"') != 0: + error("Failed to run listnewconfig") + + def menuconfig( env, base_kconfig, config_path, main_menu_text, style="aquatic" ):