[Tools] Add useconfig option for scons.

This commit is contained in:
bernard 2017-12-29 22:26:39 +08:00
parent 31b163c8fa
commit bc6703d0be
2 changed files with 11 additions and 1 deletions

View File

@ -285,6 +285,16 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
menuconfig(Rtt_Root)
exit(0)
AddOption('--useconfig',
dest = 'useconfig',
type='string',
help = 'make rtconfig.h from config file.')
configfn = GetOption('useconfig')
if configfn:
from menuconfig import mk_rtconfig
mk_rtconfig(configfn)
exit(0)
# add comstr option
AddOption('--verbose',
dest='verbose',

View File

@ -6,7 +6,7 @@ def mk_rtconfig(filename):
try:
config = file(filename)
except:
print 'open .config failed'
print('open config:%s failed' % filename)
return
rtconfig = file('rtconfig.h', 'w')