diff --git a/SConstruct b/SConstruct index 99b277caae..fa321b2873 100755 --- a/SConstruct +++ b/SConstruct @@ -261,6 +261,7 @@ Targets: kconfig_actions = ( 'defconfig', + 'guiconfig', 'listnewconfig', 'menuconfig', 'setconfig', @@ -294,6 +295,13 @@ Kconfig tools: scons defconfig build/foo/bar build_opts/MIPS + guiconfig: + Opens the guiconfig editor which will let you view and edit config + values, and view help text. guiconfig runs as a graphical application. + + scons guiconfig build/foo/bar + + listnewconfig: Lists config options which are new in the Kconfig and which are not currently set in the existing config file. @@ -839,6 +847,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 == 'guiconfig': + kconfig.guiconfig(env, kconfig_file.abspath, config_file.abspath, + variant_path) elif kconfig_action == 'listnewconfig': kconfig.listnewconfig(env, kconfig_file.abspath, config_file.abspath) diff --git a/site_scons/gem5_scons/kconfig.py b/site_scons/gem5_scons/kconfig.py index a5fa471b07..5638aa7643 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", + "GUICONFIG_PY": "guiconfig.py", "LISTNEWCONFIG_PY": "listnewconfig.py", "MENUCONFIG_PY": "menuconfig.py", "SETCONFIG_PY": "setconfig.py", @@ -94,6 +95,16 @@ def defconfig(env, base_kconfig, config_in, config_out): error("Failed to run defconfig") +def guiconfig(env, base_kconfig, config_path, main_menu_text): + """ + Interface of handling guiconfig.py of Kconfiglib + """ + kconfig_env = _prep_env(env, base_kconfig, config_path) + kconfig_env["ENV"]["MAIN_MENU_TEXT"] = main_menu_text + if kconfig_env.Execute('"${GUICONFIG_PY}" "${BASE_KCONFIG}"') != 0: + error("Failed to run guiconfig") + + def listnewconfig(env, base_kconfig, config_path): """ Interface of handling listnewconfig.py of Kconfiglib