]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | # Copyright Vladimir Prus 2004. |
2 | # Copyright Toon Knapen 2004. | |
3 | # Copyright Boris Gubenko 2007. | |
4 | # Distributed under the Boost Software License, Version 1.0. | |
1e59de90 TL |
5 | # (See accompanying file LICENSE.txt |
6 | # or copy at https://www.bfgroup.xyz/b2/LICENSE.txt) | |
7c673cae | 7 | |
92f5a8d4 TL |
8 | #| tag::doc[] |
9 | ||
10 | [[bbv2.reference.tools.compiler.acc]] | |
11 | = HP aC++ compiler | |
12 | ||
13 | The `acc` module supports the | |
14 | http://h21007.www2.hp.com/dspp/tech/tech_TechSoftwareDetailPage_IDX/1,1703,1740,00.html[HP | |
15 | aC++ compiler] for the HP-UX operating system. | |
16 | ||
17 | The module is initialized using the following syntax: | |
18 | ||
19 | ---- | |
20 | using acc : [version] : [c++-compile-command] : [compiler options] ; | |
21 | ---- | |
22 | ||
23 | This statement may be repeated several times, if you want to configure | |
24 | several versions of the compiler. | |
25 | ||
26 | If the command is not specified, the `aCC` binary will be searched in | |
27 | PATH. | |
28 | ||
29 | ||
30 | The following options can be provided, using | |
31 | _`<option-name>option-value syntax`_: | |
32 | ||
33 | `cflags`:: | |
34 | Specifies additional compiler flags that will be used when compiling C | |
35 | sources. | |
36 | ||
37 | `cxxflags`:: | |
38 | Specifies additional compiler flags that will be used when compiling C++ | |
39 | sources. | |
40 | ||
41 | `compileflags`:: | |
42 | Specifies additional compiler flags that will be used when compiling both C | |
43 | and C++ sources. | |
44 | ||
45 | `linkflags`:: | |
46 | Specifies additional command line options that will be passed to the linker. | |
47 | ||
48 | |# # end::doc[] | |
49 | ||
7c673cae | 50 | # |
f67539c2 | 51 | # B2 V2 toolset for the HP aC++ compiler. |
7c673cae FG |
52 | # |
53 | ||
54 | import toolset : flags ; | |
55 | import feature ; | |
56 | import generators ; | |
57 | import common ; | |
58 | ||
59 | feature.extend toolset : acc ; | |
60 | toolset.inherit acc : unix ; | |
61 | generators.override builtin.lib-generator : acc.prebuilt ; | |
62 | generators.override acc.searched-lib-generator : searched-lib-generator ; | |
63 | ||
64 | # Configures the acc toolset. | |
65 | rule init ( version ? : user-provided-command * : options * ) | |
66 | { | |
67 | local condition = [ common.check-init-parameters acc | |
68 | : version $(version) ] ; | |
69 | ||
70 | local command = [ common.get-invocation-command acc : aCC | |
71 | : $(user-provided-command) ] ; | |
72 | ||
73 | common.handle-options acc : $(condition) : $(command) : $(options) ; | |
74 | } | |
75 | ||
76 | ||
77 | # Declare generators | |
78 | generators.register-c-compiler acc.compile.c : C : OBJ : <toolset>acc ; | |
79 | generators.register-c-compiler acc.compile.c++ : CPP : OBJ : <toolset>acc ; | |
80 | ||
81 | # Declare flags. | |
82 | flags acc CFLAGS <optimization>off : ; | |
83 | flags acc CFLAGS <optimization>speed : -O3 ; | |
84 | flags acc CFLAGS <optimization>space : -O2 ; | |
85 | ||
86 | flags acc CFLAGS <inlining>off : +d ; | |
87 | flags acc CFLAGS <inlining>on : ; | |
88 | flags acc CFLAGS <inlining>full : ; | |
89 | ||
90 | flags acc C++FLAGS <exception-handling>off : ; | |
91 | flags acc C++FLAGS <exception-handling>on : ; | |
92 | ||
93 | flags acc C++FLAGS <rtti>off : ; | |
94 | flags acc C++FLAGS <rtti>on : ; | |
95 | ||
96 | # We want the full path to the sources in the debug symbols because otherwise | |
97 | # the debugger won't find the sources when we use boost.build. | |
98 | flags acc CFLAGS <debug-symbols>on : -g ; | |
99 | flags acc LINKFLAGS <debug-symbols>on : -g ; | |
100 | flags acc LINKFLAGS <debug-symbols>off : -s ; | |
101 | ||
102 | # V2 does not have <shared-linkable>, not sure what this meant in V1. | |
103 | # flags acc CFLAGS <shared-linkable>true : +Z ; | |
104 | ||
105 | flags acc CFLAGS <profiling>on : -pg ; | |
106 | flags acc LINKFLAGS <profiling>on : -pg ; | |
107 | ||
108 | flags acc CFLAGS <address-model>64 : +DD64 ; | |
109 | flags acc LINKFLAGS <address-model>64 : +DD64 ; | |
110 | ||
111 | # It is unknown if there's separate option for rpath used only | |
112 | # at link time, similar to -rpath-link in GNU. We'll use -L. | |
113 | flags acc RPATH_LINK : <xdll-path> ; | |
114 | ||
115 | flags acc CFLAGS <cflags> ; | |
116 | flags acc C++FLAGS <cxxflags> ; | |
117 | flags acc DEFINES <define> ; | |
118 | flags acc UNDEFS <undef> ; | |
119 | flags acc HDRS <include> ; | |
120 | flags acc STDHDRS <sysinclude> ; | |
121 | flags acc LINKFLAGS <linkflags> ; | |
122 | flags acc ARFLAGS <arflags> ; | |
123 | ||
124 | flags acc LIBPATH <library-path> ; | |
125 | flags acc NEEDLIBS <library-file> ; | |
126 | flags acc FINDLIBS <find-shared-library> ; | |
127 | flags acc FINDLIBS <find-static-library> ; | |
128 | ||
129 | # Select the compiler name according to the threading model. | |
130 | flags acc CFLAGS <threading>multi : -mt ; | |
131 | flags acc LINKFLAGS <threading>multi : -mt ; | |
132 | ||
133 | flags acc.compile.c++ TEMPLATE_DEPTH <c++-template-depth> ; | |
134 | ||
135 | ||
136 | actions acc.link bind NEEDLIBS | |
137 | { | |
138 | $(CONFIG_COMMAND) -AA $(LINKFLAGS) -o "$(<[1])" -L"$(RPATH_LINK)" -L$(LIBPATH) -L$(STDLIBPATH) "$(>)" "$(NEEDLIBS)" "$(NEEDLIBS)" -l$(FINDLIBS) $(OPTIONS) | |
139 | } | |
140 | ||
141 | SPACE = " " ; | |
142 | actions acc.link.dll bind NEEDLIBS | |
143 | { | |
144 | $(CONFIG_COMMAND) -AA -b $(LINKFLAGS) -o "$(<[1])" -L"$(RPATH_LINK)" -Wl,+h$(<[-1]:D=) -L$(LIBPATH) -L$(STDLIBPATH) "$(>)" "$(NEEDLIBS)" "$(NEEDLIBS)" -l$(FINDLIBS) $(OPTIONS) | |
145 | } | |
146 | ||
147 | actions acc.compile.c | |
148 | { | |
149 | cc -c -I$(BOOST_ROOT) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" $(OPTIONS) | |
150 | } | |
151 | ||
152 | actions acc.compile.c++ | |
153 | { | |
154 | $(CONFIG_COMMAND) -AA -c -Wc,--pending_instantiations=$(TEMPLATE_DEPTH) -I$(BOOST_ROOT) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" $(OPTIONS) | |
155 | } | |
156 | ||
157 | actions updated together piecemeal acc.archive | |
158 | { | |
159 | ar ru$(ARFLAGS:E="") "$(<)" "$(>)" | |
160 | } |