diff options
author | William Deegan <bill@baddogconsulting.com> | 2010-11-27 03:46:17 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2010-11-27 03:46:17 (GMT) |
commit | bc60b3ee681e607eaba5f2a2a65bc635d3aa496c (patch) | |
tree | 7b77e46b76af926a4c9b462c08c9ceb3e2ecca00 /src/engine/SCons | |
parent | aa823b0722a6d7b51ea290c948e32744bf30a5ed (diff) | |
download | SCons-bc60b3ee681e607eaba5f2a2a65bc635d3aa496c.zip SCons-bc60b3ee681e607eaba5f2a2a65bc635d3aa496c.tar.gz SCons-bc60b3ee681e607eaba5f2a2a65bc635d3aa496c.tar.bz2 |
Bugfix for 2423 - mingw's emitter was passing strings instead of file nodes which was causing errors in the link tool.
This patch changes them to be file nodes.
Additionaly it will try the default install path for mingw paths if the mingw tools aren't found in either env['ENV']['PATH'] or the
users's environment's PATH.
Diffstat (limited to 'src/engine/SCons')
-rw-r--r-- | src/engine/SCons/Tool/mingw.py | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/src/engine/SCons/Tool/mingw.py b/src/engine/SCons/Tool/mingw.py index 98156dd..417f2fd 100644 --- a/src/engine/SCons/Tool/mingw.py +++ b/src/engine/SCons/Tool/mingw.py @@ -46,8 +46,22 @@ import SCons.Util key_program = 'mingw32-gcc' def find(env): - # First search in the SCons path and then the OS path: - return env.WhereIs(key_program) or SCons.Util.WhereIs(key_program) + # First search in the SCons path + path=env.WhereIs(key_program) + if (path): + return path + # then the OS path: + path=SCons.Util.WhereIs(key_program) + if (path): + return path + + # If that doesn't work try default location for mingw + save_path=env['ENV']['PATH'] + env.AppendENVPath('PATH',r'c:\MinGW\bin') + path =env.WhereIs(key_program) + if not path: + env['ENV']['PATH']=save_path + return path def shlib_generator(target, source, env, for_signature): cmd = SCons.Util.CLVar(['$SHLINK', '$SHLINKFLAGS']) @@ -77,10 +91,13 @@ def shlib_emitter(target, source, env): if not no_import_lib and \ not env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX'): - # Append an import library to the list of targets. - target.append(env.ReplaceIxes(dll, + # Create list of target libraries as strings + targetStrings=env.ReplaceIxes(dll, 'SHLIBPREFIX', 'SHLIBSUFFIX', - 'LIBPREFIX', 'LIBSUFFIX')) + 'LIBPREFIX', 'LIBSUFFIX') + + # Now add file nodes to target list + target.append(env.fs.File(targetStrings)) # Append a def file target if there isn't already a def file target # or a def file source. There is no option to disable def file @@ -89,9 +106,17 @@ def shlib_emitter(target, source, env): def_source = env.FindIxes(source, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX') def_target = env.FindIxes(target, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX') if not def_source and not def_target: - target.append(env.ReplaceIxes(dll, + # Create list of target libraries and def files as strings + targetStrings=env.ReplaceIxes(dll, 'SHLIBPREFIX', 'SHLIBSUFFIX', - 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')) + 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX') + + # Now add file nodes to target list + target.append(env.fs.File(targetStrings)) + + + print target + print source return (target, source) |