From: stevenknight Date: Tue, 4 Feb 2003 00:32:15 +0000 (+0000) Subject: Fixes for compiling with MSVC when running cygwin Python. (Chad Austin) X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=49b85c82bc6b9e89a3b7e53290cfa44f0ed80e03;p=scons.git Fixes for compiling with MSVC when running cygwin Python. (Chad Austin) git-svn-id: http://scons.tigris.org/svn/scons/trunk@572 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/CHANGES.txt b/src/CHANGES.txt index b2581995..0dea107e 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -14,6 +14,8 @@ RELEASE 0.11 - XXX - Add support for IRIX and the SGI MIPSPro tool chain. + - Support using the MSVC tool chain when running Cygwin Python. + From Charles Crain: - Added new AddPreAction() and AddPostAction() functions that support diff --git a/src/engine/SCons/Tool/mslink.py b/src/engine/SCons/Tool/mslink.py index 2ff0838c..6ef15423 100644 --- a/src/engine/SCons/Tool/mslink.py +++ b/src/engine/SCons/Tool/mslink.py @@ -134,7 +134,10 @@ def generate(env, platform): env['SHLIBEMITTER']= win32LibEmitter env['LINK'] = 'link' env['LINKFLAGS'] = '/nologo' - env['LINKCOM'] = LinkAction + if str(platform) == 'cygwin': + env['LINKCOM'] = '$LINK $LINKFLAGS /OUT:$TARGET $( $_LIBDIRFLAGS $) $_LIBFLAGS $SOURCES' + else: + env['LINKCOM'] = LinkAction env['PROGEMITTER'] = prog_emitter env['LIBDIRPREFIX']='/LIBPATH:' env['LIBDIRSUFFIX']='' @@ -145,9 +148,10 @@ def generate(env, platform): env['WIN32DEFSUFFIX'] = '.def' env['WIN32_INSERT_DEF'] = 0 - include_path, lib_path, exe_path = get_msdev_paths() - env['ENV']['LIB'] = lib_path - env['ENV']['PATH'] = exe_path + if SCons.Util.can_read_reg: + include_path, lib_path, exe_path = get_msdev_paths() + env['ENV']['LIB'] = lib_path + env['ENV']['PATH'] = exe_path def exists(env): return env.Detect('link') diff --git a/src/engine/SCons/Tool/msvc.py b/src/engine/SCons/Tool/msvc.py index 3bae021b..70d43ade 100644 --- a/src/engine/SCons/Tool/msvc.py +++ b/src/engine/SCons/Tool/msvc.py @@ -279,10 +279,11 @@ def generate(env, platform): if CScan: CScan.add_skey('.rc') env['BUILDERS']['RES'] = res_builder - - include_path, lib_path, exe_path = get_msdev_paths() - env['ENV']['INCLUDE'] = include_path - env['ENV']['PATH'] = exe_path + + if SCons.Util.can_read_reg: + include_path, lib_path, exe_path = get_msdev_paths() + env['ENV']['INCLUDE'] = include_path + env['ENV']['PATH'] = exe_path env['CFILESUFFIX'] = '.c' env['CXXFILESUFFIX'] = '.cc'