Ticket #5305: build_intel_win_v2.patch

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

revised patch should support 64 and 32 bit

  • 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   
     75    local target_types ;
     76    local iclvars_vs_arg ;
     77    if $(major) >= 12
     78    {
     79        if $(compatibility) = vc10
     80        {
     81            iclvars_vs_arg = vs2010 ;
     82        }
     83        else if $(compatibility) = vc9
     84        {
     85            iclvars_vs_arg = vs2008 ;
     86        }
     87        else if $(compatibility) = vc8
     88        {
     89            iclvars_vs_arg = vs2005 ;
     90        }
     91       
     92        if [ MATCH ^(AMD64) : [ os.environ PROCESSOR_ARCHITECTURE ] ]
     93        {
     94            target_types = ia32 intel64 ;
     95        }
     96        else
     97        {
     98            target_types = ia32 ia32_intel64 ;
     99        }
     100    }
     101    else
     102    {
     103        target_types = default ;
     104        iclvars_vs_arg = $(compatibility) ;
     105    }
     106   
     107    for local c in $(target_types)
     108    {
     109        local cpu-conditions ;
     110        local setup-call ;
     111        if $(major) >= 12
     112        {
     113            setup-call = "call \""$(setup)"\" $(c) $(iclvars_vs_arg) > nul " ;
     114            cpu-conditions = $(condition)/$(.cpu-arch-$(c)) ;
     115        }
     116        else
     117        {
     118            setup-call = "call \""$(setup)"\" $(compatibility) > nul " ;
     119            cpu-conditions = $(condition) ;
    64120    }
    65     setup = "call \""$(setup)"\" > nul " ;
    66121
    67122    if [ os.name ] = NT
    68123    {
    69         setup = $(setup)"
     124            setup-call = $(setup-call)"
    70125" ;
    71126    }
    72127    else
    73128    {
    74         setup = "cmd /S /C "$(setup)" \"&&\" " ;
     129            setup-call = "cmd /S /C "$(setup-call)" \"&&\" " ;
    75130    }
    76131
    77     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 ;
    80     toolset.flags intel-win.link .MT $(condition) : $(setup)mt -nologo ;
    81     toolset.flags intel-win.compile .MC $(condition) : $(setup)mc ;
    82     toolset.flags intel-win.compile .RC $(condition) : $(setup)rc ;
     132        if $(.debug-configuration)
     133        {
     134            for local cpu-condition in $(cpu-conditions)
     135            {
     136                ECHO "notice: [intel-cfg] condition: '$(cpu-condition)', setup: '$(setup-call)'" ;
     137            }
     138        }
    83139
    84     local m = [ MATCH (.).* : $(version) ] ;
    85     local major = $(m[1]) ;
     140        toolset.flags intel-win.compile .CC $(cpu-conditions) : $(setup-call)icl ;
     141        toolset.flags intel-win.link .LD $(cpu-conditions) : $(setup-call)xilink /nologo ;
     142        toolset.flags intel-win.archive .LD $(cpu-conditions) : $(setup-call)xilink /lib /nologo ;
     143        toolset.flags intel-win.link .MT $(cpu-conditions) : $(setup-call)mt -nologo ;
     144        toolset.flags intel-win.compile .MC $(cpu-conditions) : $(setup-call)mc ;
     145        toolset.flags intel-win.compile .RC $(cpu-conditions) : $(setup-call)rc ;
     146    }
    86147
    87148    local C++FLAGS ;
    88149
     
    96157
    97158    # Disable Microsoft "secure" overloads in Dinkumware libraries since they
    98159    # cause compile errors with Intel versions 9 and 10.
     160    if $(major) < 12
     161    {
    99162    C++FLAGS += -D_SECURE_SCL=0 ;
     163    }
    100164
    101165    if $(major) > 5
    102166    {
     
    135199
    136200    if $(compatibility) && $(compatibility) != native
    137201    {
    138         C++FLAGS += /Q$(base-vc) ;
     202        C++FLAGS += /Q$(compatibility) ;
    139203    }
    140204    else
    141205    {
     
    178242    msvc.configure-version-specific intel-win : $(extract-version[1]) : $(condition) ;
    179243}
    180244
     245
     246if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ]
     247{
     248    .debug-configuration = true ;
     249}
     250
     251# Copied from msvc.jam
     252# Supported CPU architectures.
     253.cpu-arch-ia32 =
     254    <architecture>/<address-model>
     255    <architecture>/<address-model>32
     256    <architecture>x86/<address-model>
     257    <architecture>x86/<address-model>32 ;
     258
     259.cpu-arch-intel64 =
     260    <architecture>/<address-model>64
     261    <architecture>x86/<address-model>64 ;
     262
     263.cpu-arch-ia32_intel64 =
     264    <architecture>/<address-model>64
     265    <architecture>x86/<address-model>64 ;
     266
    181267toolset.flags intel-win.link LIBRARY_OPTION <toolset>intel : "" ;
    182268
    183269toolset.flags intel-win YLOPTION ;