@@ -40,14 +40,14 @@ def is_pkg_special_config(config_str):
|
||||
return True
|
||||
return False
|
||||
|
||||
def mk_rtconfig(filename):
|
||||
def mk_rtconfig(filename, cfg_head = 'rtconfig.h'):
|
||||
try:
|
||||
config = open(filename, 'r')
|
||||
except:
|
||||
print('open config:%s failed' % filename)
|
||||
return
|
||||
|
||||
rtconfig = open('rtconfig.h', 'w')
|
||||
rtconfig = open(cfg_head, 'w')
|
||||
rtconfig.write('#ifndef RT_CONFIG_H__\n')
|
||||
rtconfig.write('#define RT_CONFIG_H__\n\n')
|
||||
|
||||
@@ -233,12 +233,12 @@ def exclude_utestcases(RTT_ROOT):
|
||||
f.write(line)
|
||||
|
||||
# menuconfig for Linux
|
||||
def menuconfig(RTT_ROOT):
|
||||
def menuconfig(RTT_TOOLS, cfg_head):
|
||||
|
||||
# Exclude utestcases
|
||||
exclude_utestcases(RTT_ROOT)
|
||||
exclude_utestcases(RTT_TOOLS)
|
||||
|
||||
kconfig_dir = os.path.join(RTT_ROOT, 'tools', 'kconfig-frontends')
|
||||
kconfig_dir = os.path.join(RTT_TOOLS, 'kconfig-frontends')
|
||||
os.system('scons -C ' + kconfig_dir)
|
||||
|
||||
touch_env()
|
||||
@@ -249,7 +249,7 @@ def menuconfig(RTT_ROOT):
|
||||
fn = '.config'
|
||||
fn_old = '.config.old'
|
||||
|
||||
kconfig_cmd = os.path.join(RTT_ROOT, 'tools', 'kconfig-frontends', 'kconfig-mconf')
|
||||
kconfig_cmd = os.path.join(RTT_TOOLS, 'kconfig-frontends', 'kconfig-mconf')
|
||||
os.system(kconfig_cmd + ' Kconfig')
|
||||
|
||||
if os.path.isfile(fn):
|
||||
@@ -263,14 +263,14 @@ def menuconfig(RTT_ROOT):
|
||||
# make rtconfig.h
|
||||
if diff_eq == False:
|
||||
shutil.copyfile(fn, fn_old)
|
||||
mk_rtconfig(fn)
|
||||
mk_rtconfig(fn, cfg_head)
|
||||
|
||||
# guiconfig for windows and linux
|
||||
def guiconfig(RTT_ROOT):
|
||||
def guiconfig(RTT_TOOLS, cfg_head):
|
||||
import pyguiconfig
|
||||
|
||||
# Exclude utestcases
|
||||
exclude_utestcases(RTT_ROOT)
|
||||
exclude_utestcases(RTT_TOOLS)
|
||||
|
||||
if sys.platform != 'win32':
|
||||
touch_env()
|
||||
@@ -296,15 +296,15 @@ def guiconfig(RTT_ROOT):
|
||||
# make rtconfig.h
|
||||
if diff_eq == False:
|
||||
shutil.copyfile(fn, fn_old)
|
||||
mk_rtconfig(fn)
|
||||
mk_rtconfig(fn, cfg_head)
|
||||
|
||||
|
||||
# guiconfig for windows and linux
|
||||
def guiconfig_silent(RTT_ROOT):
|
||||
def guiconfig_silent(RTT_TOOLS, cfg_head):
|
||||
import defconfig
|
||||
|
||||
# Exclude utestcases
|
||||
exclude_utestcases(RTT_ROOT)
|
||||
exclude_utestcases(RTT_TOOLS)
|
||||
|
||||
if sys.platform != 'win32':
|
||||
touch_env()
|
||||
@@ -319,4 +319,4 @@ def guiconfig_silent(RTT_ROOT):
|
||||
defconfig.main()
|
||||
|
||||
# silent mode, force to make rtconfig.h
|
||||
mk_rtconfig(fn)
|
||||
mk_rtconfig(fn, cfg_head)
|
||||
|
Reference in New Issue
Block a user