Ticket #5305: build_intel_win.patch

File build_intel_win.patch, 2.6 KB (added by lelouch <lelouch.g34ss@…>, 11 years ago)

Allows build with Intel Composer Studio

  • tools/intel-win.

    old new  
    1414import toolset ;
    1515import generators ;
    1616import type ;
     17import path ;
    1718
    1819feature.extend-subfeature toolset intel : platform : win ;
    1920
     
    4445    local condition = [  common.check-init-parameters intel-win
    4546        : version $(version) : compatibility $(compatibility) ] ;
    4647
     48    local m = [ MATCH ([0-9]+).* : $(version) ] ;
     49    local major = $(m[1]) ;
     50
    4751    command = [ common.get-invocation-command intel-win : icl.exe :
    4852        $(command) ] ;
    4953
     
    5357    if $(command)
    5458    {
    5559        root = [ common.get-absolute-tool-path $(command[-1]) ] ;
     60        if $(major) >= 12
     61        {
     62            root = [ path.parent $(root) ] ;
     63        }
    5664        root = $(root)/ ;
    5765    }
    5866
     
    6169    if ! $(setup)
    6270    {
    6371       setup = $(root)/iclvars.bat ;
     72       setup = [ path.native $(setup) ] ;
     73    }
     74    local iclvars_addressmodel ;
     75    local iclvars_vs_arg ;
     76    if $(major) >= 12
     77    {
     78        iclvars_addressmodel = ia32 ;
     79        if $(compatibility) = vc10
     80        {
     81            iclvars_vs_arg = vs2010 ;
     82        }
    6483    }
    65     setup = "call \""$(setup)"\" > nul " ;
     84    else
     85    {
     86        iclvars_vs_arg = $(compatibility) ;
     87    }
     88    setup = "call \""$(setup)"\" $(iclvars_addressmodel) $(iclvars_vs_arg) > nul " ;
    6689
    6790    if [ os.name ] = NT
    6891    {
     
    7598    }
    7699
    77100    toolset.flags intel-win.compile .CC $(condition) : $(setup)icl ;
    78     toolset.flags intel-win.link .LD $(condition) : $(setup)xilink ;
    79     toolset.flags intel-win.archive .LD $(condition) : $(setup)xilink /lib ;
     101    toolset.flags intel-win.link .LD $(condition) : $(setup)xilink /nologo ;
     102    toolset.flags intel-win.archive .LD $(condition) : $(setup)xilink /lib /nologo ;
    80103    toolset.flags intel-win.link .MT $(condition) : $(setup)mt -nologo ;
    81104    toolset.flags intel-win.compile .MC $(condition) : $(setup)mc ;
    82105    toolset.flags intel-win.compile .RC $(condition) : $(setup)rc ;
    83106
    84     local m = [ MATCH (.).* : $(version) ] ;
    85     local major = $(m[1]) ;
     107   
    86108
    87109    local C++FLAGS ;
    88110
     
    96118
    97119    # Disable Microsoft "secure" overloads in Dinkumware libraries since they
    98120    # cause compile errors with Intel versions 9 and 10.
     121    if $(major) < 12
     122    {
    99123    C++FLAGS += -D_SECURE_SCL=0 ;
     124    }
    100125
    101126    if $(major) > 5
    102127    {
     
    135160
    136161    if $(compatibility) && $(compatibility) != native
    137162    {
    138         C++FLAGS += /Q$(base-vc) ;
     163        C++FLAGS += /Q$(compatibility) ;
    139164    }
    140165    else
    141166    {