File: intel-linux.jam

package info (click to toggle)
boost-build 2.0-m11-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,624 kB
  • ctags: 2,387
  • sloc: ansic: 12,978; python: 5,209; xml: 4,782; cpp: 555; yacc: 456; sh: 237; makefile: 71
file content (101 lines) | stat: -rw-r--r-- 3,462 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#  Copyright (c) 2003 Michael Stevens
#
#  Use, modification and distribution is subject to the Boost Software
#  License Version 1.0. (See accompanying file LICENSE_1_0.txt or
#  http://www.boost.org/LICENSE_1_0.txt)

import toolset ;
import feature ;
import toolset : flags ;

import intel ;
import gcc ;
import common ;
import errors ;
import generators ;

feature.extend-subfeature toolset intel : platform : linux ;

toolset.inherit-generators intel-linux 
     <toolset>intel <toolset-intel:platform>linux : gcc ;
generators.override intel-linux.prebuilt : builtin.lib-generator ;
generators.override intel-linux.prebuilt : builtin.prebuilt ;
generators.override intel-linux.searched-lib-generator : searched-lib-generator ;

toolset.inherit-rules intel-linux : gcc ;
toolset.inherit-flags intel-linux : gcc 
        : <inlining>off <inlining>on <inlining>full <optimization>space 
          <warnings>off <warnings>all <warnings>on
        ;
        
if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ]
{
    .debug-configuration = true ;
}
                       
# Initializes the intel-linux toolset
#   version in mandatory
#   name (default icc) is used to invoke the specified intellinux complier
#   compile and link options allow you to specify addition command line options for each version
rule init ( version ? :  command * : options * )
{
    local condition = [ common.check-init-parameters intel-linux
        : version $(version) ] ;
    
    command = [ common.get-invocation-command intel-linux : icpc 
        : $(command) : /opt/intel_cc_80/bin ] ;
                
    common.handle-options intel-linux : $(condition) : $(command) : $(options) ;

    gcc.init-link-flags intel-linux gnu $(condition) ;
    
    local root = [ feature.get-values <root> : $(options) ] ;
    local bin ;
    if $(command) || $(root)
    {
        bin ?= [ common.get-absolute-tool-path $(command[-1]) ] ;
        root ?= $(bin:D) ;
    
        if $(root)
        {
            local lib_path = $(root)/lib ;
            if $(.debug-configuration)
            {
                ECHO notice: using intel libraries :: $(condition) :: $(lib_path) ;
            }
            flags intel-linux.link RUN_PATH $(condition) : $(lib_path) ;
        }   
    }
}

SPACE = " " ;

flags intel-linux.compile OPTIONS <inlining>off : "-Ob0" ;
flags intel-linux.compile OPTIONS <inlining>on : "-Ob1" ;
flags intel-linux.compile OPTIONS <inlining>full : "-Ob2" ;
flags intel-linux.compile OPTIONS <optimization>space : "-O1" ; # no specific space optimization flag in icc

flags intel-linux.compile OPTIONS <warnings>off : -w0 ;
flags intel-linux.compile OPTIONS <warnings>on : -w1 ;
flags intel-linux.compile OPTIONS <warnings>all : -w2 ;

actions compile.c++
{
    "$(CONFIG_COMMAND)" -c -xc++ $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
}

actions compile.c
{
    "$(CONFIG_COMMAND)" -c -xc $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
}

actions link bind LIBRARIES
{
    "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS)
}

# Differ from 'link' above only by -shared.
actions link.dll bind LIBRARIES
{
    "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -o "$(<)" -Wl,-h$(SPACE)-Wl,$(<[1]:D=) -shared "$(>)"  "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS)
}