Fix the GNU GCC path issue.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2241 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
bernard.xiong@gmail.com 2012-07-31 23:15:51 +00:00
parent 29846c07aa
commit dddbd5078b
1 changed files with 10 additions and 28 deletions

View File

@ -17,13 +17,9 @@ class Win32Spawn:
newargs = string.join(args[1:], ' ')
cmdline = cmd + " " + newargs
startupinfo = subprocess.STARTUPINFO()
# startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
penv = {}
for key, value in env.iteritems():
penv[key] = str(value)
proc = subprocess.Popen(cmdline, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, startupinfo=startupinfo, shell = False, env=penv)
stderr=subprocess.PIPE, startupinfo=startupinfo, shell = False)
data, err = proc.communicate()
rv = proc.wait()
if data:
@ -35,29 +31,6 @@ class Win32Spawn:
return rv
return 0
def GetVersion():
import SCons.cpp
import string
rtdef = os.path.join(Rtt_Root, 'include', 'rtdef.h')
# parse rtdef.h to get RT-Thread version
prepcessor = SCons.cpp.PreProcessor()
f = file(rtdef, 'r')
contents = f.read()
f.close()
prepcessor.process_contents(contents)
def_ns = prepcessor.cpp_namespace
version = int(filter(lambda ch: ch in '0123456789.', def_ns['RT_VERSION']))
subversion = int(filter(lambda ch: ch in '0123456789.', def_ns['RT_SUBVERSION']))
if def_ns.has_key('RT_REVISION'):
revision = int(filter(lambda ch: ch in '0123456789.', def_ns['RT_REVISION']))
return '%d.%d.%d' % (version, subversion, revision)
return '0.%d.%d' % (version, subversion)
def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = []):
import SCons.cpp
import rtconfig
@ -75,6 +48,9 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
win32_spawn = Win32Spawn()
win32_spawn.env = env
env['SPAWN'] = win32_spawn.spawn
os.environ['PATH'] = rtconfig.EXEC_PATH + ";" + os.environ['PATH']
else:
os.environ['PATH'] = rtconfig.EXEC_PATH + ":" + os.environ['PATH']
# add program path
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
@ -298,3 +274,9 @@ def GetVersion():
return '%d.%d.%d' % (version, subversion, revision)
return '0.%d.%d' % (version, subversion)
def do_copy_file(src, dst):
pass
def MakeCopy():
pass