diff options
| author | bernard.xiong <[email protected]> | 2010-08-03 08:50:06 +0000 |
|---|---|---|
| committer | bernard.xiong <[email protected]> | 2010-08-03 08:50:06 +0000 |
| commit | 787d7681fdd01beb4531012a3d2746771117b78c (patch) | |
| tree | 42dd0cdc45bcba64d054f8c1deb9a6f55b26f8e2 /bsp/mini2440/SConstruct | |
| parent | 4b4a4f200343099c34530cfe8627f7d371ffe137 (diff) | |
fix compiling error.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@826 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'bsp/mini2440/SConstruct')
| -rw-r--r-- | bsp/mini2440/SConstruct | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/bsp/mini2440/SConstruct b/bsp/mini2440/SConstruct index e450c49ee1..462e20a79e 100644 --- a/bsp/mini2440/SConstruct +++ b/bsp/mini2440/SConstruct @@ -17,6 +17,8 @@ AddOption('--target', if GetOption('target'):
SetOption('no_exec', 1)
+TARGET = target + '.' + rtconfig.TARGET_EXT
+
env = Environment(tools = ['mingw'],
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
@@ -28,6 +30,38 @@ Export('env') Export('RTT_ROOT')
Export('rtconfig')
Export('projects')
+Export('TARGET')
+
+if env['PLATFORM'] == 'win32' and rtconfig.PLATFORM == 'gcc':
+ import win32file
+ import win32event
+ import win32process
+ import win32security
+
+ def my_spawn(sh, escape, cmd, args, spawnenv):
+ for var in spawnenv:
+ spawnenv[var] = spawnenv[var].encode('ascii', 'replace')
+
+ sAttrs = win32security.SECURITY_ATTRIBUTES()
+ StartupInfo = win32process.STARTUPINFO()
+ newargs = ' '.join(map(escape, args[1:]))
+ cmdline = cmd + " " + newargs
+
+ # check for any special operating system commands
+ if cmd == 'del':
+ for arg in args[1:]:
+ win32file.DeleteFile(arg)
+ exit_code = 0
+ else:
+ # otherwise execute the command.
+ hProcess, hThread, dwPid, dwTid = win32process.CreateProcess(None, cmdline, None, None, 1, 0, spawnenv, None, StartupInfo)
+ win32event.WaitForSingleObject(hProcess, win32event.INFINITE)
+ exit_code = win32process.GetExitCodeProcess(hProcess)
+ win32file.CloseHandle(hProcess);
+ win32file.CloseHandle(hThread);
+ return exit_code
+
+ env['SPAWN'] = my_spawn
objs = SConscript(RTT_ROOT + '/src/SConscript', variant_dir='build/src', duplicate=0)
objs = objs + SConscript(RTT_ROOT + '/libcpu/SConscript', variant_dir='build/libcpu', duplicate=0)
@@ -45,7 +79,6 @@ objs = objs + SConscript('SConscript', variant_dir='build/bsp', duplicate=0) Repository(RTT_ROOT)
objs = objs + SConscript('components/SConscript')
-TARGET = target + '.' + rtconfig.TARGET_EXT
env.Program(TARGET, objs)
env.AddPostAction(TARGET, rtconfig.POST_ACTION)
|
