--- tools/intel-win.jam_ 2011-07-21 15:45:12.000000000 +0200 +++ tools/intel-win.jam 2011-08-02 19:11:32.504857741 +0200 @@ -14,6 +14,7 @@ import toolset ; import generators ; import type ; +import path ; feature.extend-subfeature toolset intel : platform : win ; @@ -44,6 +45,9 @@ local condition = [ common.check-init-parameters intel-win : version $(version) : compatibility $(compatibility) ] ; + local m = [ MATCH ([0-9]+).* : $(version) ] ; + local major = $(m[1]) ; + command = [ common.get-invocation-command intel-win : icl.exe : $(command) ] ; @@ -53,6 +57,10 @@ if $(command) { root = [ common.get-absolute-tool-path $(command[-1]) ] ; + if $(major) >= 12 + { + root = [ path.parent $(root) ] ; + } root = $(root)/ ; } @@ -61,28 +69,81 @@ if ! $(setup) { setup = $(root)/iclvars.bat ; + setup = [ path.native $(setup) ] ; + } + + local target_types ; + local iclvars_vs_arg ; + if $(major) >= 12 + { + if $(compatibility) = vc10 + { + iclvars_vs_arg = vs2010 ; + } + else if $(compatibility) = vc9 + { + iclvars_vs_arg = vs2008 ; + } + else if $(compatibility) = vc8 + { + iclvars_vs_arg = vs2005 ; + } + + if [ MATCH ^(AMD64) : [ os.environ PROCESSOR_ARCHITECTURE ] ] + { + target_types = ia32 intel64 ; + } + else + { + target_types = ia32 ia32_intel64 ; + } + } + else + { + target_types = default ; + iclvars_vs_arg = $(compatibility) ; + } + + for local c in $(target_types) + { + local cpu-conditions ; + local setup-call ; + if $(major) >= 12 + { + setup-call = "call \""$(setup)"\" $(c) $(iclvars_vs_arg) > nul " ; + cpu-conditions = $(condition)/$(.cpu-arch-$(c)) ; + } + else + { + setup-call = "call \""$(setup)"\" $(compatibility) > nul " ; + cpu-conditions = $(condition) ; } - setup = "call \""$(setup)"\" > nul " ; if [ os.name ] = NT { - setup = $(setup)" + setup-call = $(setup-call)" " ; } else { - setup = "cmd /S /C "$(setup)" \"&&\" " ; + setup-call = "cmd /S /C "$(setup-call)" \"&&\" " ; } - toolset.flags intel-win.compile .CC $(condition) : $(setup)icl ; - toolset.flags intel-win.link .LD $(condition) : $(setup)xilink ; - toolset.flags intel-win.archive .LD $(condition) : $(setup)xilink /lib ; - toolset.flags intel-win.link .MT $(condition) : $(setup)mt -nologo ; - toolset.flags intel-win.compile .MC $(condition) : $(setup)mc ; - toolset.flags intel-win.compile .RC $(condition) : $(setup)rc ; + if $(.debug-configuration) + { + for local cpu-condition in $(cpu-conditions) + { + ECHO "notice: [intel-cfg] condition: '$(cpu-condition)', setup: '$(setup-call)'" ; + } + } - local m = [ MATCH (.).* : $(version) ] ; - local major = $(m[1]) ; + toolset.flags intel-win.compile .CC $(cpu-conditions) : $(setup-call)icl ; + toolset.flags intel-win.link .LD $(cpu-conditions) : $(setup-call)xilink /nologo ; + toolset.flags intel-win.archive .LD $(cpu-conditions) : $(setup-call)xilink /lib /nologo ; + toolset.flags intel-win.link .MT $(cpu-conditions) : $(setup-call)mt -nologo ; + toolset.flags intel-win.compile .MC $(cpu-conditions) : $(setup-call)mc ; + toolset.flags intel-win.compile .RC $(cpu-conditions) : $(setup-call)rc ; + } local C++FLAGS ; @@ -96,7 +157,10 @@ # Disable Microsoft "secure" overloads in Dinkumware libraries since they # cause compile errors with Intel versions 9 and 10. + if $(major) < 12 + { C++FLAGS += -D_SECURE_SCL=0 ; + } if $(major) > 5 { @@ -135,7 +199,7 @@ if $(compatibility) && $(compatibility) != native { - C++FLAGS += /Q$(base-vc) ; + C++FLAGS += /Q$(compatibility) ; } else { @@ -178,6 +242,28 @@ msvc.configure-version-specific intel-win : $(extract-version[1]) : $(condition) ; } + +if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] +{ + .debug-configuration = true ; +} + +# Copied from msvc.jam +# Supported CPU architectures. +.cpu-arch-ia32 = + / + /32 + x86/ + x86/32 ; + +.cpu-arch-intel64 = + /64 + x86/64 ; + +.cpu-arch-ia32_intel64 = + /64 + x86/64 ; + toolset.flags intel-win.link LIBRARY_OPTION intel : "" ; toolset.flags intel-win YLOPTION ;