Code from git://git.code.sf.net/p/winexe/winexe-waf