Ticket #166: intel-linux.jam

File intel-linux.jam, 3.4 KB (added by abachn@…, 18 years ago)

Updated version of intel-linux.jam

Line 
1# Copyright (c) 2003 Michael Stevens
2#
3# Use, modification and distribution is subject to the Boost Software
4# License Version 1.0. (See accompanying file LICENSE_1_0.txt or
5# http://www.boost.org/LICENSE_1_0.txt)
6
7import toolset ;
8import feature ;
9import toolset : flags ;
10
11import intel ;
12import gcc ;
13import common ;
14import errors ;
15import generators ;
16
17feature.extend-subfeature toolset intel : platform : linux ;
18
19toolset.inherit-generators intel-linux
20 <toolset>intel <toolset-intel:platform>linux : gcc ;
21generators.override intel-linux.prebuilt : builtin.lib-generator ;
22generators.override intel-linux.prebuilt : builtin.prebuilt ;
23generators.override intel-linux.searched-lib-generator : searched-lib-generator ;
24
25toolset.inherit-rules intel-linux : gcc ;
26toolset.inherit-flags intel-linux : gcc
27 : <inlining>off <inlining>on <inlining>full <optimization>space
28 <warnings>off <warnings>all <warnings>on
29 ;
30
31if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ]
32{
33 .debug-configuration = true ;
34}
35
36# Initializes the intel-linux toolset
37# version in mandatory
38# name (default icc) is used to invoke the specified intellinux complier
39# compile and link options allow you to specify addition command line options for each version
40rule init ( version ? : command * : options * )
41{
42 local condition = [ common.check-init-parameters intel-linux
43 : version $(version) ] ;
44
45 command = [ common.get-invocation-command intel-linux : icpc
46 : $(command) : /opt/intel_cc_80/bin ] ;
47
48 common.handle-options intel-linux : $(condition) : $(command) : $(options) ;
49
50 gcc.init-link-flags intel-linux gnu $(condition) ;
51
52 local root = [ feature.get-values <root> : $(options) ] ;
53 local bin ;
54 if $(command) || $(root)
55 {
56 bin ?= [ common.get-absolute-tool-path $(command[-1]) ] ;
57 root ?= $(bin:D) ;
58
59 if $(root)
60 {
61 local lib_path = $(root)/lib ;
62 if $(.debug-configuration)
63 {
64 ECHO notice: using intel libraries :: $(condition) :: $(lib_path) ;
65 }
66 flags intel-linux.link RUN_PATH $(condition) : $(lib_path) ;
67 }
68 }
69}
70
71SPACE = " " ;
72
73flags intel-linux.compile OPTIONS <inlining>off : "-inline-level=0" ;
74flags intel-linux.compile OPTIONS <inlining>on : "-inline-level=1" ;
75flags intel-linux.compile OPTIONS <inlining>full : "-inline-level=2" ;
76flags intel-linux.compile OPTIONS <optimization>space : "-O1" ; # no specific space optimization flag in icc
77
78flags intel-linux.compile OPTIONS <warnings>off : -w ;
79flags intel-linux.compile OPTIONS <warnings>on : -w1 ;
80flags intel-linux.compile OPTIONS <warnings>all : -w2 ;
81
82actions compile.c++
83{
84 "$(CONFIG_COMMAND)" -c -xc++ $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
85}
86
87actions compile.c
88{
89 "$(CONFIG_COMMAND)" -c -xc $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
90}
91
92actions link bind LIBRARIES
93{
94 "$(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)
95}
96
97# Differ from 'link' above only by -shared.
98actions link.dll bind LIBRARIES
99{
100 "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -o "$(<)" -Wl,-soname$(SPACE)-Wl,$(<[1]:D=) -shared "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS)
101}