-# Fix me!
-#if platform == 'win32-mingw':
-if 0:
- try:
- import win32file
- import win32event
- import win32process
- import win32security
- import string
-
- slash= re.compile(r"\\")
-
- def myesc(b):
- if b[0]!= "-":
- b = slash.sub(r"\\\\", b[1:-1])
- return "\"" + b + "\""
- else:
- return b
-
- 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()
- if cmd=='ar' and args[1]=='r':
- args[1] = '-r'
- newargs = string.join(map(myesc, 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
- except:
- print "install win32all from http://sourceforge.net/project/showfiles.php?group_id=78018"