1 # Copyright Vladimir Prus 2004.
2 # Copyright Toon Knapen 2004.
3 # Distributed under the Boost Software License, Version 1.0.
4 # (See accompanying file LICENSE.txt
5 # or copy at https://www.bfgroup.xyz/b2/LICENSE.txt)
9 [[bbv2.reference.tools.compiler.vacpp]]
12 The `vacpp` module supports the http://www.ibm.com/software/ad/vacpp[IBM
13 Visual Age] C++ Compiler, for the AIX operating system. Versions 7.1 and
14 8.0 are known to work.
16 The module is initialized using the following syntax:
22 The module does not accept any initialization options. The compiler
23 should be installed in the `/usr/vacpp/bin` directory.
25 Later versions of Visual Age are known as XL C/C++. They were not tested
26 with the the `vacpp` module.
31 # B2 V2 toolset for the IBM XL C++ compiler
34 import toolset : flags ;
40 feature.extend toolset : vacpp ;
41 toolset.inherit vacpp : unix ;
42 generators.override vacpp.prebuilt : builtin.prebuilt ;
43 generators.override vacpp.searched-lib-generator : searched-lib-generator ;
45 # Configure the vacpp toolset
46 rule init ( version ? : command * : options * )
49 common.check-init-parameters vacpp : version $(version) ] ;
51 command = [ common.get-invocation-command vacpp : xlC
52 : $(command) : "/usr/vacpp/bin/xlC" ] ;
54 common.handle-options vacpp : $(condition) : $(command) : $(options) ;
58 generators.register-c-compiler vacpp.compile.c : C : OBJ : <toolset>vacpp ;
59 generators.register-c-compiler vacpp.compile.c++ : CPP : OBJ : <toolset>vacpp ;
61 # Allow C++ style comments in C files
62 flags vacpp CFLAGS : -qcpluscmt ;
65 flags vacpp CFLAGS <optimization>off : -qNOOPTimize ;
66 flags vacpp CFLAGS <optimization>speed : -O3 -qstrict ;
67 flags vacpp CFLAGS <optimization>space : -O2 -qcompact ;
69 # Discretionary inlining (not recommended)
70 flags vacpp CFLAGS <inlining>off : -qnoinline ;
71 flags vacpp CFLAGS <inlining>on : -qinline ;
72 #flags vacpp CFLAGS <inlining>full : -qinline ;
73 flags vacpp CFLAGS <inlining>full : ;
76 flags vacpp C++FLAGS <exception-handling>off : -qnoeh ;
77 flags vacpp C++FLAGS <exception-handling>on : -qeh ;
79 # Run-time Type Identification
80 flags vacpp C++FLAGS <rtti>off : -qnortti ;
81 flags vacpp C++FLAGS <rtti>on : -qrtti ;
83 # Enable 64-bit memory addressing model
84 flags vacpp CFLAGS <address-model>64 : -q64 ;
85 flags vacpp LINKFLAGS <address-model>64 : -q64 ;
86 flags vacpp ARFLAGS <target-os>aix/<address-model>64 : -X 64 ;
88 # Use absolute path when generating debug information
89 flags vacpp CFLAGS <debug-symbols>on : -g -qfullpath ;
90 flags vacpp LINKFLAGS <debug-symbols>on : -g -qfullpath ;
91 flags vacpp LINKFLAGS <debug-symbols>off : -s ;
95 flags vacpp.compile C++FLAGS : -qfuncsect ;
97 # The -bnoipath strips the prepending (relative) path of libraries from
98 # the loader section in the target library or executable. Hence, during
99 # load-time LIBPATH (identical to LD_LIBRARY_PATH) or a hard-coded
100 # -blibpath (*similar* to -lrpath/-lrpath-link) is searched. Without
101 # this option, the prepending (relative) path + library name is
102 # hard-coded in the loader section, causing *only* this path to be
103 # searched during load-time. Note that the AIX linker does not have an
104 # -soname equivalent, this is as close as it gets.
106 # The above options are definitely for AIX 5.x, and most likely also for
107 # AIX 4.x and AIX 6.x. For details about the AIX linker see:
108 # http://download.boulder.ibm.com/ibmdl/pub/software/dw/aix/es-aix_ll.pdf
110 flags vacpp.link LINKFLAGS <link>shared : -bnoipath ;
113 flags vacpp.link EXE-LINKFLAGS <link>shared : -brtl ;
118 flags vacpp.compile CFLAGS <link>shared : -qpic=large ;
119 flags vacpp FINDLIBS : rt ;
123 flags vacpp CFLAGS <profiling>on : -pg ;
124 flags vacpp LINKFLAGS <profiling>on : -pg ;
126 flags vacpp.compile OPTIONS <cflags> ;
127 flags vacpp.compile.c++ OPTIONS <cxxflags> ;
128 flags vacpp DEFINES <define> ;
129 flags vacpp UNDEFS <undef> ;
130 flags vacpp HDRS <include> ;
131 flags vacpp STDHDRS <sysinclude> ;
132 flags vacpp.link OPTIONS <linkflags> ;
133 flags vacpp ARFLAGS <arflags> ;
135 flags vacpp LIBPATH <library-path> ;
136 flags vacpp NEEDLIBS <library-file> ;
137 flags vacpp FINDLIBS <find-shared-library> ;
138 flags vacpp FINDLIBS <find-static-library> ;
140 # Select the compiler name according to the threading model.
141 flags vacpp VA_C_COMPILER <threading>single : xlc ;
142 flags vacpp VA_C_COMPILER <threading>multi : xlc_r ;
143 flags vacpp VA_CXX_COMPILER <threading>single : xlC ;
144 flags vacpp VA_CXX_COMPILER <threading>multi : xlC_r ;
148 flags vacpp.link.dll HAVE_SONAME <target-os>linux : "" ;
150 actions vacpp.link bind NEEDLIBS
152 $(VA_CXX_COMPILER) $(EXE-LINKFLAGS) $(LINKFLAGS) -o "$(<[1])" -L$(LIBPATH) -L$(STDLIBPATH) "$(>)" "$(NEEDLIBS)" "$(NEEDLIBS)" -l$(FINDLIBS) $(OPTIONS) $(USER_OPTIONS)
155 actions vacpp.link.dll bind NEEDLIBS
157 xlC_r -G $(LINKFLAGS) -o "$(<[1])" $(HAVE_SONAME)-Wl,-soname$(SPACE)-Wl,$(<[-1]:D=) -L$(LIBPATH) -L$(STDLIBPATH) "$(>)" "$(NEEDLIBS)" "$(NEEDLIBS)" -l$(FINDLIBS) $(OPTIONS) $(USER_OPTIONS)
160 actions vacpp.compile.c
162 $(VA_C_COMPILER) -c $(OPTIONS) $(USER_OPTIONS) -I$(BOOST_ROOT) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)"
165 actions vacpp.compile.c++
167 $(VA_CXX_COMPILER) -c $(OPTIONS) $(USER_OPTIONS) -I$(BOOST_ROOT) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)"
170 actions updated together piecemeal vacpp.archive
172 ar $(ARFLAGS) ru "$(<)" "$(>)"