mstoolkit toolchain should use the VC toolkit linker by default. link.exe can even stand in for lib.exe if required
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6504 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
59e19c8c94
commit
d43e3a717c
4 changed files with 22 additions and 9 deletions
|
@ -38,10 +38,15 @@ if env['TARGET_ARCH'] != 'amd64' or msvc: # BUGBUG: Call-amd64.S is missing GAS
|
||||||
defs += ['SYSTEM_PARTIALCALLSUPPORT']
|
defs += ['SYSTEM_PARTIALCALLSUPPORT']
|
||||||
filename = 'Call' + srcsuff
|
filename = 'Call' + srcsuff
|
||||||
|
|
||||||
|
# When using the MS toolchain, SCons can pass .sx files to cl.exe:
|
||||||
|
# "D4024 : unrecognized source file type 'file.sx', object file assumed"
|
||||||
|
# "D4027 : source file 'file.sx' ignored"
|
||||||
|
# ...and then it returns 0!
|
||||||
|
# This only happens if TryCompile .S fails (ML/ML64 not in %PATH%?)
|
||||||
conf = env.Configure()
|
conf = env.Configure()
|
||||||
if conf.TryCompile('END', '.S'):
|
if conf.TryCompile('END', '.S'):
|
||||||
files += ['Source/'+filename+'.S']
|
files += ['Source/'+filename+'.S']
|
||||||
elif conf.TryCompile('.end', '.sx'):
|
elif (not msvc) and conf.TryCompile('.end', '.sx'):
|
||||||
files += ['Source/'+filename+'.sx']
|
files += ['Source/'+filename+'.sx']
|
||||||
else:
|
else:
|
||||||
print 'WARNING: System.dll: unable to find assembler for '+filename+'.S'
|
print 'WARNING: System.dll: unable to find assembler for '+filename+'.S'
|
||||||
|
|
|
@ -242,6 +242,7 @@ def add_file(file, obj_name=None):
|
||||||
#
|
#
|
||||||
|
|
||||||
conf = stub_env.Configure()
|
conf = stub_env.Configure()
|
||||||
|
conf.env.Append(LINKFLAGS = ['/entry:WinMain'])
|
||||||
|
|
||||||
int64test = """
|
int64test = """
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
|
@ -179,7 +179,7 @@ def win32ShlinkSources(target, source, env, for_signature):
|
||||||
# Just treat it as a generic source file.
|
# Just treat it as a generic source file.
|
||||||
listCmd.append(src)
|
listCmd.append(src)
|
||||||
return listCmd
|
return listCmd
|
||||||
|
|
||||||
def win32LibEmitter(target, source, env):
|
def win32LibEmitter(target, source, env):
|
||||||
# SCons.Tool.msvc.validate_vars(env)
|
# SCons.Tool.msvc.validate_vars(env)
|
||||||
|
|
||||||
|
@ -289,7 +289,7 @@ def generate(env):
|
||||||
include_path, lib_path, exe_path, sdk_path = "", "", "", ""
|
include_path, lib_path, exe_path, sdk_path = "", "", "", ""
|
||||||
targ_arc = env.get('TARGET_ARCH', 'x86')
|
targ_arc = env.get('TARGET_ARCH', 'x86')
|
||||||
|
|
||||||
if os.environ.has_key('MSVC_USE_SCRIPT') and "None" == os.environ['MSVC_USE_SCRIPT']:
|
if "None" == env.get('MSVC_USE_SCRIPT', '!'):
|
||||||
for x in ['INCLUDE', 'LIB', 'PATH', 'CL', 'LINK', 'ML']: env['ENV'][x] = ""
|
for x in ['INCLUDE', 'LIB', 'PATH', 'CL', 'LINK', 'ML']: env['ENV'][x] = ""
|
||||||
if not env.WhereIs('cl', os.environ['PATH']):
|
if not env.WhereIs('cl', os.environ['PATH']):
|
||||||
raise SCons.Errors.InternalError("CL not found in %s" % os.environ['PATH'])
|
raise SCons.Errors.InternalError("CL not found in %s" % os.environ['PATH'])
|
||||||
|
@ -300,12 +300,14 @@ def generate(env):
|
||||||
if not sdk_path:
|
if not sdk_path:
|
||||||
raise SCons.Errors.InternalError("windows.h not found in %s" % include_path)
|
raise SCons.Errors.InternalError("windows.h not found in %s" % include_path)
|
||||||
sdk_path = os.path.normpath(sdk_path + "\..\..")
|
sdk_path = os.path.normpath(sdk_path + "\..\..")
|
||||||
sdk_path_AR = env.WhereIs('lib', exe_path)
|
|
||||||
sdk_path_LINK = env.WhereIs('link', exe_path)
|
sdk_path_LINK = env.WhereIs('link', exe_path)
|
||||||
|
sdk_path_AR = env.WhereIs('lib', exe_path)
|
||||||
else:
|
else:
|
||||||
include_path, lib_path, exe_path, sdk_path = get_msvctoolkit_paths()
|
include_path, lib_path, exe_path, sdk_path = get_msvctoolkit_paths()
|
||||||
|
if float(env['MSVS_VERSION']) < 7.0: # Override SConstruct default
|
||||||
|
env['MSVS_VERSION'] = '7.1'
|
||||||
|
sdk_path_LINK = env.WhereIs('link', exe_path)
|
||||||
sdk_path_AR = sdk_path + '\\bin\\Win64\\lib.exe'
|
sdk_path_AR = sdk_path + '\\bin\\Win64\\lib.exe'
|
||||||
sdk_path_LINK = sdk_path + '\\bin\\Win64\\link.exe'
|
|
||||||
|
|
||||||
env.PrependENVPath('INCLUDE', include_path)
|
env.PrependENVPath('INCLUDE', include_path)
|
||||||
env.PrependENVPath('LIB', lib_path)
|
env.PrependENVPath('LIB', lib_path)
|
||||||
|
@ -327,8 +329,13 @@ def generate(env):
|
||||||
env['PCHCOM'] = '$CXX $CXXFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo${TARGETS[1]} /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS'
|
env['PCHCOM'] = '$CXX $CXXFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo${TARGETS[1]} /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS'
|
||||||
env['BUILDERS']['PCH'] = pch_builder
|
env['BUILDERS']['PCH'] = pch_builder
|
||||||
|
|
||||||
env['AR'] = '"' + sdk_path_AR + '"'
|
# VC 2003 Toolkit does not have lib.exe but we can use link.exe
|
||||||
env['ARFLAGS'] = SCons.Util.CLVar('/nologo')
|
if not sdk_path_AR or not env.File(sdk_path_AR).exists():
|
||||||
|
env['AR'] = '"' + sdk_path_LINK + '"'
|
||||||
|
env['ARFLAGS'] = '/LIB ' + env['ARFLAGS']
|
||||||
|
else:
|
||||||
|
env['AR'] = '"' + sdk_path_AR + '"'
|
||||||
|
env['ARFLAGS'] = SCons.Util.CLVar('/nologo')
|
||||||
env['ARCOM'] = "${TEMPFILE('$AR $ARFLAGS /OUT:$TARGET $SOURCES')}"
|
env['ARCOM'] = "${TEMPFILE('$AR $ARFLAGS /OUT:$TARGET $SOURCES')}"
|
||||||
|
|
||||||
if 'AMD64' in targ_arc.upper():
|
if 'AMD64' in targ_arc.upper():
|
||||||
|
@ -362,8 +369,6 @@ def generate(env):
|
||||||
env['REGSVRFLAGS'] = '/s '
|
env['REGSVRFLAGS'] = '/s '
|
||||||
env['REGSVRCOM'] = '$REGSVR $REGSVRFLAGS $TARGET'
|
env['REGSVRCOM'] = '$REGSVR $REGSVRFLAGS $TARGET'
|
||||||
|
|
||||||
if not env.has_key('MSVS_VERSION'): env['MSVS_VERSION'] = '7.1'
|
|
||||||
|
|
||||||
|
|
||||||
def exists(env):
|
def exists(env):
|
||||||
return env.Detect('cl')
|
return env.Detect('cl')
|
||||||
|
|
|
@ -446,6 +446,8 @@ def DistributeExtras(env, target, examples, docs):
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
if defenv['MSTOOLKIT']:
|
if defenv['MSTOOLKIT']:
|
||||||
|
if ARGUMENTS.get('MSVC_USE_SCRIPT', ''):
|
||||||
|
defenv['MSVC_USE_SCRIPT'] = ARGUMENTS.get('MSVC_USE_SCRIPT')
|
||||||
defenv.Tool('mstoolkit', toolpath = [Dir('SCons/Tools').rdir()])
|
defenv.Tool('mstoolkit', toolpath = [Dir('SCons/Tools').rdir()])
|
||||||
|
|
||||||
defenv.Append(CCFLAGS = Split('$APPEND_CCFLAGS'))
|
defenv.Append(CCFLAGS = Split('$APPEND_CCFLAGS'))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue