diff options
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) |