diff --git a/tools/building.py b/tools/building.py index d855aaebdc..6660ed8187 100644 --- a/tools/building.py +++ b/tools/building.py @@ -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', diff --git a/tools/menuconfig.py b/tools/menuconfig.py index c55509068d..004a338d81 100644 --- a/tools/menuconfig.py +++ b/tools/menuconfig.py @@ -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')