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_1_0.txt 5# or copy at http://www.boost.org/LICENSE_1_0.txt) 6 7#| tag::doc[] 8 9[[bbv2.reference.tools.compiler.vacpp]] 10= IBM Visual Age 11 12The `vacpp` module supports the http://www.ibm.com/software/ad/vacpp[IBM 13Visual Age] C++ Compiler, for the AIX operating system. Versions 7.1 and 148.0 are known to work. 15 16The module is initialized using the following syntax: 17 18---- 19using vacpp ; 20---- 21 22The module does not accept any initialization options. The compiler 23should be installed in the `/usr/vacpp/bin` directory. 24 25Later versions of Visual Age are known as XL C/C++. They were not tested 26with the the `vacpp` module. 27 28|# # end::doc[] 29 30# 31# B2 V2 toolset for the IBM XL C++ compiler 32# 33 34import toolset : flags ; 35import feature ; 36import common ; 37import generators ; 38import os ; 39 40feature.extend toolset : vacpp ; 41toolset.inherit vacpp : unix ; 42generators.override vacpp.prebuilt : builtin.prebuilt ; 43generators.override vacpp.searched-lib-generator : searched-lib-generator ; 44 45# Configure the vacpp toolset 46rule init ( version ? : command * : options * ) 47{ 48 local condition = [ 49 common.check-init-parameters vacpp : version $(version) ] ; 50 51 command = [ common.get-invocation-command vacpp : xlC 52 : $(command) : "/usr/vacpp/bin/xlC" ] ; 53 54 common.handle-options vacpp : $(condition) : $(command) : $(options) ; 55} 56 57# Declare generators 58generators.register-c-compiler vacpp.compile.c : C : OBJ : <toolset>vacpp ; 59generators.register-c-compiler vacpp.compile.c++ : CPP : OBJ : <toolset>vacpp ; 60 61# Allow C++ style comments in C files 62flags vacpp CFLAGS : -qcpluscmt ; 63 64# Declare flags 65flags vacpp CFLAGS <optimization>off : -qNOOPTimize ; 66flags vacpp CFLAGS <optimization>speed : -O3 -qstrict ; 67flags vacpp CFLAGS <optimization>space : -O2 -qcompact ; 68 69# Discretionary inlining (not recommended) 70flags vacpp CFLAGS <inlining>off : -qnoinline ; 71flags vacpp CFLAGS <inlining>on : -qinline ; 72#flags vacpp CFLAGS <inlining>full : -qinline ; 73flags vacpp CFLAGS <inlining>full : ; 74 75# Exception handling 76flags vacpp C++FLAGS <exception-handling>off : -qnoeh ; 77flags vacpp C++FLAGS <exception-handling>on : -qeh ; 78 79# Run-time Type Identification 80flags vacpp C++FLAGS <rtti>off : -qnortti ; 81flags vacpp C++FLAGS <rtti>on : -qrtti ; 82 83# Enable 64-bit memory addressing model 84flags vacpp CFLAGS <address-model>64 : -q64 ; 85flags vacpp LINKFLAGS <address-model>64 : -q64 ; 86flags vacpp ARFLAGS <target-os>aix/<address-model>64 : -X 64 ; 87 88# Use absolute path when generating debug information 89flags vacpp CFLAGS <debug-symbols>on : -g -qfullpath ; 90flags vacpp LINKFLAGS <debug-symbols>on : -g -qfullpath ; 91flags vacpp LINKFLAGS <debug-symbols>off : -s ; 92 93if [ os.name ] = AIX 94{ 95 flags vacpp.compile C++FLAGS : -qfuncsect ; 96 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. 105 # 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 109 # 110 flags vacpp.link LINKFLAGS <link>shared : -bnoipath ; 111 112 # Run-time linking 113 flags vacpp.link EXE-LINKFLAGS <link>shared : -brtl ; 114} 115else 116{ 117 # Linux PPC 118 flags vacpp.compile CFLAGS <link>shared : -qpic=large ; 119 flags vacpp FINDLIBS : rt ; 120} 121 122# Profiling 123flags vacpp CFLAGS <profiling>on : -pg ; 124flags vacpp LINKFLAGS <profiling>on : -pg ; 125 126flags vacpp.compile OPTIONS <cflags> ; 127flags vacpp.compile.c++ OPTIONS <cxxflags> ; 128flags vacpp DEFINES <define> ; 129flags vacpp UNDEFS <undef> ; 130flags vacpp HDRS <include> ; 131flags vacpp STDHDRS <sysinclude> ; 132flags vacpp.link OPTIONS <linkflags> ; 133flags vacpp ARFLAGS <arflags> ; 134 135flags vacpp LIBPATH <library-path> ; 136flags vacpp NEEDLIBS <library-file> ; 137flags vacpp FINDLIBS <find-shared-library> ; 138flags vacpp FINDLIBS <find-static-library> ; 139 140# Select the compiler name according to the threading model. 141flags vacpp VA_C_COMPILER <threading>single : xlc ; 142flags vacpp VA_C_COMPILER <threading>multi : xlc_r ; 143flags vacpp VA_CXX_COMPILER <threading>single : xlC ; 144flags vacpp VA_CXX_COMPILER <threading>multi : xlC_r ; 145 146SPACE = " " ; 147 148flags vacpp.link.dll HAVE_SONAME <target-os>linux : "" ; 149 150actions vacpp.link bind NEEDLIBS 151{ 152 $(VA_CXX_COMPILER) $(EXE-LINKFLAGS) $(LINKFLAGS) -o "$(<[1])" -L$(LIBPATH) -L$(STDLIBPATH) "$(>)" "$(NEEDLIBS)" "$(NEEDLIBS)" -l$(FINDLIBS) $(OPTIONS) $(USER_OPTIONS) 153} 154 155actions vacpp.link.dll bind NEEDLIBS 156{ 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) 158} 159 160actions vacpp.compile.c 161{ 162 $(VA_C_COMPILER) -c $(OPTIONS) $(USER_OPTIONS) -I$(BOOST_ROOT) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" 163} 164 165actions vacpp.compile.c++ 166{ 167 $(VA_CXX_COMPILER) -c $(OPTIONS) $(USER_OPTIONS) -I$(BOOST_ROOT) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" 168} 169 170actions updated together piecemeal vacpp.archive 171{ 172 ar $(ARFLAGS) ru "$(<)" "$(>)" 173} 174