| 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 |
|
|---|
| 7 | import toolset ;
|
|---|
| 8 | import feature ;
|
|---|
| 9 | import toolset : flags ;
|
|---|
| 10 |
|
|---|
| 11 | import intel ;
|
|---|
| 12 | import gcc ;
|
|---|
| 13 | import common ;
|
|---|
| 14 | import errors ;
|
|---|
| 15 | import generators ;
|
|---|
| 16 |
|
|---|
| 17 | feature.extend-subfeature toolset intel : platform : linux ;
|
|---|
| 18 |
|
|---|
| 19 | toolset.inherit-generators intel-linux
|
|---|
| 20 | <toolset>intel <toolset-intel:platform>linux : gcc ;
|
|---|
| 21 | generators.override intel-linux.prebuilt : builtin.lib-generator ;
|
|---|
| 22 | generators.override intel-linux.prebuilt : builtin.prebuilt ;
|
|---|
| 23 | generators.override intel-linux.searched-lib-generator : searched-lib-generator ;
|
|---|
| 24 |
|
|---|
| 25 | toolset.inherit-rules intel-linux : gcc ;
|
|---|
| 26 | toolset.inherit-flags intel-linux : gcc
|
|---|
| 27 | : <inlining>off <inlining>on <inlining>full <optimization>space
|
|---|
| 28 | <warnings>off <warnings>all <warnings>on
|
|---|
| 29 | ;
|
|---|
| 30 |
|
|---|
| 31 | if [ 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
|
|---|
| 40 | rule 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 |
|
|---|
| 71 | SPACE = " " ;
|
|---|
| 72 |
|
|---|
| 73 | flags intel-linux.compile OPTIONS <inlining>off : "-inline-level=0" ;
|
|---|
| 74 | flags intel-linux.compile OPTIONS <inlining>on : "-inline-level=1" ;
|
|---|
| 75 | flags intel-linux.compile OPTIONS <inlining>full : "-inline-level=2" ;
|
|---|
| 76 | flags intel-linux.compile OPTIONS <optimization>space : "-O1" ; # no specific space optimization flag in icc
|
|---|
| 77 |
|
|---|
| 78 | flags intel-linux.compile OPTIONS <warnings>off : -w ;
|
|---|
| 79 | flags intel-linux.compile OPTIONS <warnings>on : -w1 ;
|
|---|
| 80 | flags intel-linux.compile OPTIONS <warnings>all : -w2 ;
|
|---|
| 81 |
|
|---|
| 82 | actions compile.c++
|
|---|
| 83 | {
|
|---|
| 84 | "$(CONFIG_COMMAND)" -c -xc++ $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
|
|---|
| 85 | }
|
|---|
| 86 |
|
|---|
| 87 | actions compile.c
|
|---|
| 88 | {
|
|---|
| 89 | "$(CONFIG_COMMAND)" -c -xc $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
|
|---|
| 90 | }
|
|---|
| 91 |
|
|---|
| 92 | actions 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.
|
|---|
| 98 | actions 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 | }
|
|---|