]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/tools/build/src/tools/xlcpp.jam
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / tools / build / src / tools / xlcpp.jam
CommitLineData
7c673cae
FG
1# Copyright Vladimir Prus 2004.
2# Copyright Toon Knapen 2004.
3# Copyright Catherine Morton 2015.
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#
f67539c2 9# B2 V2 toolset for the IBM XL C++ compiler
7c673cae
FG
10#
11
12import toolset : flags ;
13import feature ;
14import common ;
15import generators ;
16import os ;
17
18feature.extend toolset : xlcpp ;
19toolset.inherit xlcpp : unix ;
20generators.override xlcpp.prebuilt : builtin.prebuilt ;
21generators.override xlcpp.searched-lib-generator : searched-lib-generator ;
22
23# Configure the xlcpp toolset
24rule init ( version ? : command * : options * )
25{
f67539c2 26 local condition = [
7c673cae 27 common.check-init-parameters xlcpp : version $(version) ] ;
f67539c2 28
7c673cae
FG
29 command = [ common.get-invocation-command xlcpp : xlC
30 : $(command) : "/usr/xlcpp/bin/xlC" ] ;
f67539c2 31
7c673cae
FG
32 common.handle-options xlcpp : $(condition) : $(command) : $(options) ;
33}
34
35# Declare generators
36generators.register-c-compiler xlcpp.compile.c : C : OBJ : <toolset>xlcpp ;
37generators.register-c-compiler xlcpp.compile.c++ : CPP : OBJ : <toolset>xlcpp ;
38
39# Allow C++ style comments in C files
40flags xlcpp CFLAGS : -qnoxlcompatmacros ;
41
42# Declare flags
43flags xlcpp CFLAGS <optimization>off : -qNOOPTimize ;
44flags xlcpp CFLAGS <optimization>speed : ;
45flags xlcpp CFLAGS <optimization>space : -O2 -qcompact ;
46
47# Discretionary inlining (not recommended)
48flags xlcpp CFLAGS <inlining>off : -qnoinline ;
49flags xlcpp CFLAGS <inlining>on : -qinline ;
50#flags xlcpp CFLAGS <inlining>full : -qinline ;
51flags xlcpp CFLAGS <inlining>full : ;
52
53# Exception handling
54flags xlcpp C++FLAGS <exception-handling>off : -qnoeh ;
55flags xlcpp C++FLAGS <exception-handling>on : -qeh ;
56
57# Run-time Type Identification
58flags xlcpp C++FLAGS <rtti>off : -qnortti ;
59flags xlcpp C++FLAGS <rtti>on : -qrtti ;
60
61# Enable 64-bit memory addressing model
62flags xlcpp CFLAGS <address-model>64 : -q64 ;
63flags xlcpp LINKFLAGS <address-model>64 : -q64 ;
64flags xlcpp ARFLAGS <target-os>aix/<address-model>64 : -X 64 ;
65
66# Use absolute path when generating debug information
67flags xlcpp CFLAGS <debug-symbols>on : -g -qfullpath ;
68flags xlcpp LINKFLAGS <debug-symbols>on : -g -qfullpath ;
69flags xlcpp LINKFLAGS <debug-symbols>off : -s ;
70
71if [ os.name ] = AIX
72{
73 flags xlcpp.compile C++FLAGS : -qfuncsect ;
74
75 # The -bnoipath strips the prepending (relative) path of libraries from
76 # the loader section in the target library or executable. Hence, during
77 # load-time LIBPATH (identical to LD_LIBRARY_PATH) or a hard-coded
78 # -blibpath (*similar* to -lrpath/-lrpath-link) is searched. Without
79 # this option, the prepending (relative) path + library name is
80 # hard-coded in the loader section, causing *only* this path to be
81 # searched during load-time. Note that the AIX linker does not have an
82 # -soname equivalent, this is as close as it gets.
83 #
92f5a8d4 84 # The above options are definitely for AIX 5.x, and most likely also for
7c673cae
FG
85 # AIX 4.x and AIX 6.x. For details about the AIX linker see:
86 # http://download.boulder.ibm.com/ibmdl/pub/software/dw/aix/es-aix_ll.pdf
87 #
88 flags xlcpp.link LINKFLAGS <link>shared : -bnoipath ;
89
90 # Run-time linking
91 flags xlcpp.link EXE-LINKFLAGS <link>shared : -brtl ;
92}
93else
94{
95 # Linux PPC
96 flags xlcpp.compile CFLAGS <link>shared : -qpic=large ;
97 flags xlcpp FINDLIBS : rt ;
92f5a8d4
TL
98
99 flags xlcpp.compile OPTIONS <local-visibility>hidden : -qvisibility=hidden ;
100 flags xlcpp.compile OPTIONS <local-visibility>protected : -qvisibility=protected ;
101 flags xlcpp.compile OPTIONS <local-visibility>global : -qvisibility=default ;
7c673cae
FG
102}
103
104# Profiling
105flags xlcpp CFLAGS <profiling>on : -pg ;
106flags xlcpp LINKFLAGS <profiling>on : -pg ;
107
f67539c2
TL
108# Declare flags and actions for compilation
109flags xlcpp.compile.c++ OPTIONS <cxxstd>98 : -std=c++03 ;
110flags xlcpp.compile.c++ OPTIONS <cxxstd>03 : -std=c++03 ;
111flags xlcpp.compile.c++ OPTIONS <cxxstd>0x : -std=c++11 ;
112flags xlcpp.compile.c++ OPTIONS <cxxstd>11 : -std=c++11 ;
113flags xlcpp.compile.c++ OPTIONS <cxxstd>1y : -std=c++1y ;
114flags xlcpp.compile.c++ OPTIONS <cxxstd>14 : -std=c++1y ;
20effc67
TL
115flags xlcpp.compile.c++ OPTIONS <cxxstd>1z : -std=c++1y ;
116flags xlcpp.compile.c++ OPTIONS <cxxstd>17 : -std=c++1y ;
117flags xlcpp.compile.c++ OPTIONS <cxxstd>2a : -std=c++1y ;
118flags xlcpp.compile.c++ OPTIONS <cxxstd>20 : -std=c++1y ;
f67539c2
TL
119flags xlcpp.compile.c++ OPTIONS <cxxstd>latest : -std=c++1y ;
120
7c673cae
FG
121flags xlcpp.compile OPTIONS <cflags> ;
122flags xlcpp.compile.c++ OPTIONS <cxxflags> ;
123flags xlcpp DEFINES <define> ;
124flags xlcpp UNDEFS <undef> ;
125flags xlcpp HDRS <include> ;
126flags xlcpp STDHDRS <sysinclude> ;
127flags xlcpp.link OPTIONS <linkflags> ;
128flags xlcpp ARFLAGS <arflags> ;
129
130flags xlcpp LIBPATH <library-path> ;
131flags xlcpp NEEDLIBS <library-file> ;
132flags xlcpp FINDLIBS <find-shared-library> ;
133flags xlcpp FINDLIBS <find-static-library> ;
134
135# Select the compiler name according to the threading model.
136flags xlcpp VA_C_COMPILER <threading>single : xlc ;
137flags xlcpp VA_C_COMPILER <threading>multi : xlc ;
138flags xlcpp VA_CXX_COMPILER <threading>single : xlC ;
139flags xlcpp VA_CXX_COMPILER <threading>multi : xlC ;
140
141SPACE = " " ;
142
143flags xlcpp.link.dll HAVE_SONAME <target-os>linux : "" ;
144
145actions xlcpp.link bind NEEDLIBS
146{
147 $(VA_CXX_COMPILER) $(EXE-LINKFLAGS) $(LINKFLAGS) -o "$(<[1])" -L$(LIBPATH) -L$(STDLIBPATH) "$(>)" "$(NEEDLIBS)" "$(NEEDLIBS)" -l$(FINDLIBS) $(OPTIONS) $(USER_OPTIONS)
148}
149
150actions xlcpp.link.dll bind NEEDLIBS
151{
f67539c2 152 xlC -G $(LINKFLAGS) -o "$(<[1])" $(HAVE_SONAME)-Wl,-soname$(SPACE)-Wl,$(<[-1]:D=) -L$(LIBPATH) -L$(STDLIBPATH) "$(>)" "$(NEEDLIBS)" "$(NEEDLIBS)" -l$(FINDLIBS) $(OPTIONS) $(USER_OPTIONS)
7c673cae
FG
153}
154
155actions xlcpp.compile.c
156{
157 $(VA_C_COMPILER) -c $(OPTIONS) $(USER_OPTIONS) -I$(BOOST_ROOT) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)"
158}
159
160actions xlcpp.compile.c++
161{
162 $(VA_CXX_COMPILER) -c $(OPTIONS) $(USER_OPTIONS) -I$(BOOST_ROOT) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)"
163}
164
165actions updated together piecemeal xlcpp.archive
166{
167 ar $(ARFLAGS) ru "$(<)" "$(>)"
168}