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. 5# (See accompanying file LICENSE_1_0.txt 6# or copy at http://www.boost.org/LICENSE_1_0.txt) 7 8#| tag::doc[] 9 10[[bbv2.reference.tools.compiler.acc]] 11= HP aC++ compiler 12 13The `acc` module supports the 14http://h21007.www2.hp.com/dspp/tech/tech_TechSoftwareDetailPage_IDX/1,1703,1740,00.html[HP 15aC++ compiler] for the HP-UX operating system. 16 17The module is initialized using the following syntax: 18 19---- 20using acc : [version] : [c++-compile-command] : [compiler options] ; 21---- 22 23This statement may be repeated several times, if you want to configure 24several versions of the compiler. 25 26If the command is not specified, the `aCC` binary will be searched in 27PATH. 28 29 30The following options can be provided, using 31_`<option-name>option-value syntax`_: 32 33`cflags`:: 34Specifies additional compiler flags that will be used when compiling C 35sources. 36 37`cxxflags`:: 38Specifies additional compiler flags that will be used when compiling C++ 39sources. 40 41`compileflags`:: 42Specifies additional compiler flags that will be used when compiling both C 43and C++ sources. 44 45`linkflags`:: 46Specifies additional command line options that will be passed to the linker. 47 48|# # end::doc[] 49 50# 51# B2 V2 toolset for the HP aC++ compiler. 52# 53 54import toolset : flags ; 55import feature ; 56import generators ; 57import common ; 58 59feature.extend toolset : acc ; 60toolset.inherit acc : unix ; 61generators.override builtin.lib-generator : acc.prebuilt ; 62generators.override acc.searched-lib-generator : searched-lib-generator ; 63 64# Configures the acc toolset. 65rule 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 78generators.register-c-compiler acc.compile.c : C : OBJ : <toolset>acc ; 79generators.register-c-compiler acc.compile.c++ : CPP : OBJ : <toolset>acc ; 80 81# Declare flags. 82flags acc CFLAGS <optimization>off : ; 83flags acc CFLAGS <optimization>speed : -O3 ; 84flags acc CFLAGS <optimization>space : -O2 ; 85 86flags acc CFLAGS <inlining>off : +d ; 87flags acc CFLAGS <inlining>on : ; 88flags acc CFLAGS <inlining>full : ; 89 90flags acc C++FLAGS <exception-handling>off : ; 91flags acc C++FLAGS <exception-handling>on : ; 92 93flags acc C++FLAGS <rtti>off : ; 94flags 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. 98flags acc CFLAGS <debug-symbols>on : -g ; 99flags acc LINKFLAGS <debug-symbols>on : -g ; 100flags 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 105flags acc CFLAGS <profiling>on : -pg ; 106flags acc LINKFLAGS <profiling>on : -pg ; 107 108flags acc CFLAGS <address-model>64 : +DD64 ; 109flags 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. 113flags acc RPATH_LINK : <xdll-path> ; 114 115flags acc CFLAGS <cflags> ; 116flags acc C++FLAGS <cxxflags> ; 117flags acc DEFINES <define> ; 118flags acc UNDEFS <undef> ; 119flags acc HDRS <include> ; 120flags acc STDHDRS <sysinclude> ; 121flags acc LINKFLAGS <linkflags> ; 122flags acc ARFLAGS <arflags> ; 123 124flags acc LIBPATH <library-path> ; 125flags acc NEEDLIBS <library-file> ; 126flags acc FINDLIBS <find-shared-library> ; 127flags acc FINDLIBS <find-static-library> ; 128 129# Select the compiler name according to the threading model. 130flags acc CFLAGS <threading>multi : -mt ; 131flags acc LINKFLAGS <threading>multi : -mt ; 132 133flags acc.compile.c++ TEMPLATE_DEPTH <c++-template-depth> ; 134 135 136actions 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 141SPACE = " " ; 142actions 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 147actions acc.compile.c 148{ 149 cc -c -I$(BOOST_ROOT) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" $(OPTIONS) 150} 151 152actions 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 157actions updated together piecemeal acc.archive 158{ 159 ar ru$(ARFLAGS:E="") "$(<)" "$(>)" 160} 161