From 245577ae5cb8f588dd0993e47ae7703f83cfeb57 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 28 May 2004 12:04:36 +0000 Subject: [PATCH] Added the Intel toolset support. [SVN r22966] --- v2/tools/intel-linux.jam | 57 +++++++++++++++++++ v2/tools/intel-win.jam | 117 +++++++++++++++++++++++++++++++++++++++ v2/tools/intel.jam | 31 +++++++++++ 3 files changed, 205 insertions(+) create mode 100644 v2/tools/intel-linux.jam create mode 100644 v2/tools/intel-win.jam create mode 100644 v2/tools/intel.jam diff --git a/v2/tools/intel-linux.jam b/v2/tools/intel-linux.jam new file mode 100644 index 000000000..d81f61b1e --- /dev/null +++ b/v2/tools/intel-linux.jam @@ -0,0 +1,57 @@ +# 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 ; + +feature.extend-subfeature toolset intel : platform : linux ; +toolset.inherit-generators intel-linux + intel linux : gcc ; +toolset.inherit-flags intel-linux : gcc + : off on full space ; +toolset.inherit-rules intel-linux : gcc ; + +# 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 : name ? : compile_options * : link_options * ) +{ + name ?= "icc" ; + + feature.extend-subfeature toolset intel : version : $(version) ; + flags intel-linux CONFIG_NAME intel-linux-$(version) : $(name) ; + flags intel-linux CONFIG_COMPILE intel-linux-$(version) : $(compile_options) ; + flags intel-linux CONFIG_LINK intel-linux-$(version) : $(link_options) ; +} + +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 +actions compile.c++ +{ + $(CONFIG_NAME) -c -xc++ $(CONFIG_COMPILE) $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" +} + +actions compile.c +{ + $(CONFIG_NAME) -c -xc $(CONFIG_COMPILE) $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" +} + +actions link bind LIBRARIES +{ + $(CONFIG_NAME) $(CONFIG_LINK) $(OPTIONS) -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" "$(>)" "$(LIBRARIES)" -Wl,-Bdynamic -l$(FINDLIBS-SA) -Wl,-Bstatic -l$(FINDLIBS-ST) -Wl,-B$(LINK-RUNTIME) +} + +# Differ from 'link' above only by -shared. +actions link.dll bind LIBRARIES +{ + $(CONFIG_NAME) $(CONFIG_LINK) $(OPTIONS) -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -o "$(<)" -Wl,-h$(SPACE)-Wl,$(<[1]:D=) -shared "$(>)" "$(LIBRARIES)" -Wl,-Bdynamic -l$(FINDLIBS-SA) -Wl,-Bstatic -l$(FINDLIBS-ST) "$(LIBRARIES)" -Wl,-Bdynamic -l$(FINDLIBS-SA) -Wl,-Bstatic -l$(FINDLIBS-ST) -Wl,-B$(LINK-RUNTIME) +} diff --git a/v2/tools/intel-win.jam b/v2/tools/intel-win.jam new file mode 100644 index 000000000..f18333831 --- /dev/null +++ b/v2/tools/intel-win.jam @@ -0,0 +1,117 @@ +# Copyright Vladimir Prus 2004. +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt +# or copy at http://www.boost.org/LICENSE_1_0.txt) + +import toolset ; +import feature ; +import toolset : flags ; +import os ; + +# This is needed because the rule we import here depend on 'common' +# That's nasty. +import common ; + +import intel ; + +feature.extend-subfeature toolset intel : platform : win ; +feature.subfeature toolset intel : base-vc ; + +import msvc ; +toolset.inherit-generators intel-win intel win : msvc ; +toolset.inherit-flags intel-win : msvc ; +toolset.inherit-rules intel-win : msvc ; + +# Initializes the intel toolset for windows +rule init ( version : # version is mandatory + setup : # patch to the iclvars.bat script + base-vc ? # VC version to emulate: either 'vc6', 'vc7' or 'vc7.1' + # vc6 is used by default + ) +{ + base-vc ?= vc6 ; + feature.extend-subfeature toolset intel : base-vc : $(base-vc) ; + + feature.extend-subfeature toolset intel : version : $(version) ; + + check-setup $(version) : $(setup) ; + + setup = "call \""$(setup)"\" > nul " ; + + if [ os.name ] = NT + { + setup = $(setup)" +" ; + } + else + { + setup = "cmd /S /C "$(setup)" \"&&\" " ; + } + + local condition = intel-win-$(version)-$(base-vc) ; + flags intel-win.compile .CC $(condition) : $(setup)icl ; + flags intel-win.link .LD $(condition) : $(setup)xilink ; + flags intel-win.archive .LD $(condition) : $(setup)xilink ; + + local m = [ MATCH (.).* : $(version) ] ; + local major = $(m[1]) ; + + local C++FLAGS ; + # Reduce the number of spurious error messages + C++FLAGS += /Qwn5 /Qwd985 ; + + # Enable ADL + C++FLAGS += -Qoption,c,--arg_dep_lookup ; #"c" works for C++, too + + if $(major) > 5 + { + C++FLAGS += /Zc:forScope ; # Add support for correct for loop scoping + } + + # Add options recognized only by intel7 + if $(major) >= 7 + { + C++FLAGS += /Qansi_alias ; + } + + if $(base-vc) = vc6 + { + C++FLAGS += + # Emulate VC6 + /Qvc6 + + # no wchar_t support in vc6 dinkum library. Furthermore, in vc6 + # compatibility-mode, wchar_t is not a distinct type from unsigned + # short + -DBOOST_NO_INTRINSIC_WCHAR_T + ; + } + else + { + if $(major) > 5 + { + # Add support for wchar_t + C++FLAGS += /Zc:wchar_t + # Tell the dinkumware library about it. + -D_NATIVE_WCHAR_T_DEFINED + ; + } + } + if $(base-vc) + { + C++FLAGS += /Q$(base-vc) ; + } + flags intel-win CFLAGS $(condition) : $(C++FLAGS) ; + +} + +rule check-setup ( version : setup ) +{ + if ! [ GLOB $(setup:D) : $(setup:D=) ] + { + ECHO warning: toolset intel-win $(version) initialization: ; + ECHO warning: couldn't find compiler ; + } +} + +flags intel-win.link LIBRARY_OPTION intel : "" ; diff --git a/v2/tools/intel.jam b/v2/tools/intel.jam new file mode 100644 index 000000000..1a02d03e3 --- /dev/null +++ b/v2/tools/intel.jam @@ -0,0 +1,31 @@ +# Copyright Vladimir Prus 2004. +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt +# or copy at http://www.boost.org/LICENSE_1_0.txt) + +# This is a generic 'intel' toolset. Depending on the current +# system, it forwards either to 'intel-linux' or 'intel-win' +# modules. + +import feature ; +import os ; +import toolset ; + +feature.extend toolset : intel ; +feature.subfeature toolset intel : platform : : propagated link-incompatible ; +feature.subfeature toolset intel : version : : propagated ; + +rule init ( * : * ) +{ + if [ os.name ] = LINUX + { + toolset.using intel-linux : + $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ; + } + else + { + toolset.using intel-win : + $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ; + + } +}