1# (C) Copyright David Abrahams 2001.
2# (C) Copyright MetaCommunications, Inc. 2004.
3
4# Distributed under the Boost Software License, Version 1.0. (See
5# accompanying file LICENSE_1_0.txt or copy at
6# http://www.boost.org/LICENSE_1_0.txt)
7
8# The following #// line will be used by the regression test table generation
9# program as the column heading for HTML tables. Must not include a version
10# number.
11#//<a href="http://www.comeaucomputing.com/">Comeau<br>C++</a>
12
13import common ;
14import como ;
15import feature ;
16import generators ;
17import toolset : flags ;
18
19feature.extend-subfeature toolset como : platform : win ;
20
21
22# Initializes the Comeau toolset for windows. The command is the command which
23# invokes the compiler. You should either set environment variable
24# COMO_XXX_INCLUDE where XXX is the used backend (as described in the
25# documentation), or pass that as part of command, e.g:
26#
27#   using como-win : 4.3 : "set COMO_BCC_INCLUDE=C:/include &&" como.exe ;
28#
29rule init ( version ? : command * : options * )
30{
31    local condition = [  common.check-init-parameters como-win
32        : version $(version) ] ;
33
34    command = [ common.get-invocation-command como-win : como.exe :
35        $(command) ] ;
36
37    common.handle-options como-win : $(condition) : $(command) : $(options) ;
38}
39
40generators.register-c-compiler como-win.compile.c++ : CPP : OBJ
41    : <toolset>como <toolset-como:platform>win ;
42generators.register-c-compiler como-win.compile.c : C : OBJ
43    : <toolset>como <toolset-como:platform>win ;
44
45
46generators.register-linker como-win.link
47    : OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB
48    : EXE
49    : <toolset>como <toolset-como:platform>win ;
50
51# Note that status of shared libraries support is not clear, so we do not define
52# the link.dll generator.
53generators.register-archiver como-win.archive
54    : OBJ : STATIC_LIB
55    : <toolset>como <toolset-como:platform>win ;
56
57
58flags como-win C++FLAGS <exception-handling>off : --no_exceptions ;
59flags como-win C++FLAGS <exception-handling>on : --exceptions ;
60
61flags como-win CFLAGS <inlining>off : --no_inlining ;
62flags como-win CFLAGS <inlining>on <inlining>full : --inlining ;
63
64
65# The following seems to be VC-specific options. At least, when I uncomment
66# then, Comeau with bcc as backend reports that bcc32 invocation failed.
67#
68#flags como-win CFLAGS <debug-symbols>on : /Zi ;
69#flags como-win CFLAGS <optimization>off : /Od ;
70
71
72flags como-win CFLAGS <cflags> ;
73flags como-win CFLAGS : -D_WIN32 ;  # Make sure that we get the Boost Win32 platform config header.
74flags como-win CFLAGS <threading>multi : -D_MT ;  # Make sure that our config knows that threading is on.
75flags como-win C++FLAGS <cxxflags> ;
76flags como-win DEFINES <define> ;
77flags como-win UNDEFS <undef> ;
78flags como-win HDRS <include> ;
79flags como-win SYSHDRS <sysinclude> ;
80flags como-win LINKFLAGS <linkflags> ;
81flags como-win ARFLAGS <arflags> ;
82flags como-win NO_WARN <no-warn> ;
83
84#flags como-win STDHDRS : $(COMO_INCLUDE_PATH) ;
85#flags como-win STDLIB_PATH : $(COMO_STDLIB_PATH)$(SLASH) ;
86
87flags como-win LIBPATH <library-path> ;
88flags como-win LIBRARIES <library-file> ;
89flags como-win FINDLIBS <find-shared-library> ;
90flags como-win FINDLIBS <find-static-library> ;
91
92nl = "
93" ;
94
95
96# For como, we repeat all libraries so that dependencies are always resolved.
97#
98actions link bind LIBRARIES
99{
100    $(CONFIG_COMMAND) --no_version --no_prelink_verbose $(LINKFLAGS) -o "$(<[1]:S=)" @"@($(<[1]:W).rsp:E=$(nl)"$(>)")" "$(LIBRARIES)" "$(FINDLIBS:S=.lib)"
101}
102
103actions compile.c
104{
105    $(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=)" "$(>)"
106}
107
108actions compile.c++
109{
110    $(CONFIG_COMMAND) -c -e5 --no_version --no_prelink_verbose --display_error_number --long_long --diag_suppress=9,21,161,748,940,962 --diag_error=461 -D__STL_LONG_LONG -U$(UNDEFS) -D$(DEFINES) $(WARN) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -I"$(SYSHDRS)" -o "$(<)" "$(>)"
111}
112
113actions archive
114{
115    $(CONFIG_COMMAND) --no_version --no_prelink_verbose --prelink_object @"@($(<[1]:W).rsp:E=$(nl)"$(>)")"
116    lib $(ARFLAGS) /nologo /out:"$(<:S=.lib)" @"@($(<[1]:W).rsp:E=$(nl)"$(>)")"
117}
118