From 9aeeb522ca30bb076a4c752149e07b7064d3dfe4 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 14 Oct 2004 08:33:54 +0000 Subject: [PATCH] Add support for Comeau. [SVN r25723] --- src/tools/como-linux.jam | 98 +++++++++++++++++++++++++++++ src/tools/como-win.jam | 132 +++++++++++++++++++++++++++++++++++++++ src/tools/como.jam | 30 +++++++++ 3 files changed, 260 insertions(+) create mode 100644 src/tools/como-linux.jam create mode 100644 src/tools/como-win.jam create mode 100644 src/tools/como.jam diff --git a/src/tools/como-linux.jam b/src/tools/como-linux.jam new file mode 100644 index 000000000..614dd77b2 --- /dev/null +++ b/src/tools/como-linux.jam @@ -0,0 +1,98 @@ +# modify, sell and distribute this software is granted provided this +# copyright notice appears in all copies. This software is provided +# "as is" without express or implied warranty, and with no claim as +# to its suitability for any purpose. + +# The following #// line will be used by the regression test table generation +# program as the column heading for HTML tables. Must not include version number. +#//Comeau
C++
+ +import toolset ; +import feature ; +import toolset : flags ; +import common ; + +import unix ; +import como ; +feature.extend-subfeature toolset como : platform : linux ; + +toolset.inherit-generators como-linux + como linux : unix ; +toolset.inherit-flags como-linux : unix ; +toolset.inherit-rules como-linux : gcc ; + +generators.register-c-compiler como-linux.compile.c++ : CPP : OBJ + : como linux ; +generators.register-c-compiler como-linux.compile.c : C : OBJ + : como linux ; + +rule init ( version ? : command * ) +{ + local condition = [ common.check-init-parameters como-linux + : version $(version) ] ; + + command = [ common.get-invocation-command como-linux : como + : $(command) ] ; + + flags como-linux CONFIG_COMMAND $(condition) : $(command) ; +} + +flags como-linux C++FLAGS off : --no_exceptions ; +flags como-linux C++FLAGS on : --exceptions ; + +flags como-linux CFLAGS off : --no_inlining ; +flags como-linux CFLAGS on full : --inlining ; + +flags como-linux CFLAGS off : -O0 ; +flags como-linux CFLAGS speed : -O3 ; +flags como-linux CFLAGS space : -Os ; + +flags como-linux CFLAGS on : -g ; +flags como-linux LINKFLAGS on : -g ; + +flags como-linux FINDLIBS : m ; +flags como-linux FINDLIBS : rt ; + +flags como-linux CFLAGS ; +flags como-linux C++FLAGS ; +flags como-linux DEFINES ; +flags como-linux UNDEFS ; +flags como-linux HDRS ; +flags como-linux STDHDRS ; +flags como-linux LINKFLAGS ; +flags como-linux ARFLAGS ; + +flags como-linux.link LIBRARIES ; +flags como-linux.link LINKPATH ; +flags como-linux.link FINDLIBS-ST ; +flags como-linux.link FINDLIBS-SA ; + +flags como-linux.link RPATH ; +flags como-linux.link RPATH_LINK ; + + +actions link bind LIBRARIES +{ + $(CONFIG_COMMAND) $(LINKFLAGS) -o "$(<[1])" "$(>)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" "$(LIBRARIES)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) 2>&1 +} + +actions link.dll bind LIBRARIES +{ + $(CONFIG_COMMAND) $(LINKFLAGS) -shared -o "$(<[1])" "$(>)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" "$(LIBRARIES)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) 2>&1 +} + +actions compile.c +{ + $(CONFIG_COMMAND) -c --c99 --long_long -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" 2>&1 +} + +actions compile.c++ +{ + $(CONFIG_COMMAND) -tused -c --long_long -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" 2>&1 +} + +actions archive +{ + ar rcu $(<) $(>) +} + diff --git a/src/tools/como-win.jam b/src/tools/como-win.jam new file mode 100644 index 000000000..cc7c55d16 --- /dev/null +++ b/src/tools/como-win.jam @@ -0,0 +1,132 @@ +# (C) Copyright David Abrahams 2001. +# (C) Copyright MetaCommunications, Inc. 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) + +# The following #// line will be used by the regression test table generation +# program as the column heading for HTML tables. Must not include version number. +#//Comeau
C++
+ +import common ; +import como ; +import feature ; +import generators ; +import toolset : flags ; + +feature.extend-subfeature toolset como : platform : win ; + +# Initializes the Comeau toolset for windows. +# The command is the command which invokes the compiler. +# You should either set environment variable COMO_XXX_INCLUDE where +# XXX is the used backed (as described in documentation), or pass +# that as part of command, e.g: +# +# using como-win : 4.3 : "set COMO_BCC_INCLUDE=C:/include &&" como.exe ; +rule init ( version ? : command * : options * ) +{ + local condition = [ common.check-init-parameters como-win + : version $(version) ] ; + + command = [ common.get-invocation-command como-win : como.exe : + $(command) ] ; + + flags como-win CONFIG_COMMAND $(condition) : $(command) ; + local compiler-options = [ feature.get-values : $(options) ] ; + if $(compiler-options) + { + flags como-win.compile OPTIONS $(condition) : $(compiler-options) ; + } + local linker-options = [ feature.get-values : $(options) ] ; + if $(linker-options) + { + flags como-win.link OPTIONS $(condition) : $(linker-options) ; + } +} + +generators.register-c-compiler como-win.compile.c++ : CPP : OBJ + : como win ; +generators.register-c-compiler como-win.compile.c : C : OBJ + : como win ; + +generators.register-linker como-win.link + : OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB + : EXE RSP + : como win ; +# Note that status of shared libraries support is not clear, so we don't +# define the link.dll generator. +generators.register-composing como-winc.archive + : OBJ : STATIC_LIB RSP + : como win ; + +flags como-win C++FLAGS off : --no_exceptions ; +flags como-win C++FLAGS on : --exceptions ; + +flags como-win CFLAGS off : --no_inlining ; +flags como-win CFLAGS on full : --inlining ; + +# The following seems to be VC-specific options. At least, +# when I uncomment then, Comeau with bcc as backend reports +# that bcc32 invocation. +# +#flags como-win CFLAGS on : /Zi ; +#flags como-win CFLAGS off : /Od ; + +flags como-win CFLAGS ; +flags como-win CFLAGS : -D_WIN32 ; # make sure that we get the Boost Win32 platform config header. +flags como-win CFLAGS multi : -D_MT ; # make sure that our config knows that threading is on. +flags como-win C++FLAGS ; +flags como-win DEFINES ; +flags como-win UNDEFS ; +flags como-win HDRS ; +flags como-win SYSHDRS ; +flags como-win LINKFLAGS ; +flags como-win ARFLAGS ; +flags como-win NO_WARN ; + +#flags como-win STDHDRS : $(COMO_INCLUDE_PATH) ; +#flags como-win STDLIB_PATH : $(COMO_STDLIB_PATH)$(SLASH) ; + +flags como-win LIBPATH ; +flags como-win LIBRARIES ; +flags como-win FINDLIBS ; +flags como-win FINDLIBS ; + +#### Link #### + +rule link ( targets + : sources * : properties * ) +{ + common.response-file $(targets) : $(sources) : $(targets[2]) + : $(properties) ; +} + +# for como, we repeat all libraries so that dependencies are always resolved +actions link bind LIBRARIES +{ + $(CONFIG_COMMAND) --no_version --no_prelink_verbose $(LINKFLAGS) -o "$(<[1]:S=)" @"$(<[2])" "$(LIBRARIES)" "$(FINDLIBS:S=.lib)" +} + +actions compile.c +{ + $(CONFIG_COMMAND) -c --c99 -e5 --no_version --display_error_number --diag_suppress=9,21,161,748,940,962 -U$(UNDEFS) -D$(DEFINES) $(WARN) $(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -I"$(SYSHDRS)" -o "$(<:D=)" "$(>)" +} + +actions compile.c++ +{ + $(CONFIG_COMMAND) -c -e5 --no_version --no_prelink_verbose --display_error_number --long_long --diag_suppress=9,21,161,748,940,962 -D__STL_LONG_LONG -U$(UNDEFS) -D$(DEFINES) $(WARN) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -I"$(SYSHDRS)" -o "$(<)" "$(>)" +} + +#### Archive #### + +rule archive ( targets + : sources * : properties * ) +{ + common.response-file $(targets) : $(sources) : $(targets[2]) : $(properties) ; +} + +actions updated together piecemeal archive +{ + $(CONFIG_COMMAND) --no_version --no_prelink_verbose --prelink_object @"$(>)" + lib $(ARFLAGS) /nologo /out:"$(<:S=.lib)" @"$(>)" +} + diff --git a/src/tools/como.jam b/src/tools/como.jam new file mode 100644 index 000000000..633beacdc --- /dev/null +++ b/src/tools/como.jam @@ -0,0 +1,30 @@ +# 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 : como ; +feature.subfeature toolset como : platform : : propagated link-incompatible ; + +rule init ( * : * ) +{ + if [ os.name ] = LINUX + { + toolset.using como-linux : + $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ; + } + else + { + toolset.using como-win : + $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ; + + } +}