From a7eeaf28b78bd1c18fc44a6430cadd27bf6728ea Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 4 Apr 2009 07:29:30 +0000 Subject: [PATCH] Adjust intel-linux inlining options for newer versions. Fixes #2419. [SVN r52164] --- src/tools/intel-linux.jam | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/tools/intel-linux.jam b/src/tools/intel-linux.jam index eff4b6bfe..de5bf8c7c 100644 --- a/src/tools/intel-linux.jam +++ b/src/tools/intel-linux.jam @@ -14,6 +14,7 @@ import common ; import errors ; import generators ; import type ; +import numbers ; feature.extend-subfeature toolset intel : platform : linux ; @@ -62,7 +63,27 @@ rule init ( version ? : command * : options * ) { bin ?= [ common.get-absolute-tool-path $(command[-1]) ] ; root ?= $(bin:D) ; - + + local command-string = $(command:J=" ") ; + local version-output = [ SHELL "$(command-string) --version" ] ; + local real-version = [ MATCH "([0-9.]+)" : $(version-output) ] ; + local major = [ MATCH "([0-9]+).*" : $(real-version) ] ; + + # If we failed to determine major version, use the behaviour for + # the current compiler. + if $(major) && [ numbers.less $(major) 10 ] + { + flags intel-linux.compile OPTIONS $(condition)/off : "-Ob0" ; + flags intel-linux.compile OPTIONS $(condition)/on : "-Ob1" ; + flags intel-linux.compile OPTIONS $(condition)/full : "-Ob2" ; + } + else + { + flags intel-linux.compile OPTIONS $(condition)/off : "-inline-level=0" ; + flags intel-linux.compile OPTIONS $(condition)/on : "-inline-level=1" ; + flags intel-linux.compile OPTIONS $(condition)/full : "-inline-level=2" ; + } + if $(root) { # Libraries required to run the executable may be in either @@ -81,9 +102,6 @@ rule init ( version ? : command * : options * ) SPACE = " " ; -flags intel-linux.compile OPTIONS off : "-Ob0" ; -flags intel-linux.compile OPTIONS on : "-Ob1" ; -flags intel-linux.compile OPTIONS full : "-Ob2" ; flags intel-linux.compile OPTIONS space : "-O1" ; # no specific space optimization flag in icc flags intel-linux.compile OPTIONS off : -w0 ;