]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/tools/build/src/tools/xlcpp.jam
Add patch for failing prerm scripts
[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#
9# Boost.Build V2 toolset for the IBM XL C++ compiler
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{
26 local condition = [
27 common.check-init-parameters xlcpp : version $(version) ] ;
28
29 command = [ common.get-invocation-command xlcpp : xlC
30 : $(command) : "/usr/xlcpp/bin/xlC" ] ;
31
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 #
84 # The above options are definately for AIX 5.x, and most likely also for
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 ;
98}
99
100# Profiling
101flags xlcpp CFLAGS <profiling>on : -pg ;
102flags xlcpp LINKFLAGS <profiling>on : -pg ;
103
104flags xlcpp.compile OPTIONS <cflags> ;
105flags xlcpp.compile.c++ OPTIONS <cxxflags> ;
106flags xlcpp DEFINES <define> ;
107flags xlcpp UNDEFS <undef> ;
108flags xlcpp HDRS <include> ;
109flags xlcpp STDHDRS <sysinclude> ;
110flags xlcpp.link OPTIONS <linkflags> ;
111flags xlcpp ARFLAGS <arflags> ;
112
113flags xlcpp LIBPATH <library-path> ;
114flags xlcpp NEEDLIBS <library-file> ;
115flags xlcpp FINDLIBS <find-shared-library> ;
116flags xlcpp FINDLIBS <find-static-library> ;
117
118# Select the compiler name according to the threading model.
119flags xlcpp VA_C_COMPILER <threading>single : xlc ;
120flags xlcpp VA_C_COMPILER <threading>multi : xlc ;
121flags xlcpp VA_CXX_COMPILER <threading>single : xlC ;
122flags xlcpp VA_CXX_COMPILER <threading>multi : xlC ;
123
124SPACE = " " ;
125
126flags xlcpp.link.dll HAVE_SONAME <target-os>linux : "" ;
127
128actions xlcpp.link bind NEEDLIBS
129{
130 $(VA_CXX_COMPILER) $(EXE-LINKFLAGS) $(LINKFLAGS) -o "$(<[1])" -L$(LIBPATH) -L$(STDLIBPATH) "$(>)" "$(NEEDLIBS)" "$(NEEDLIBS)" -l$(FINDLIBS) $(OPTIONS) $(USER_OPTIONS)
131}
132
133actions xlcpp.link.dll bind NEEDLIBS
134{
135 xlC -G $(LINKFLAGS) -o "$(<[1])" $(HAVE_SONAME)-Wl,-soname$(SPACE)-Wl,$(<[-1]:D=) -L$(LIBPATH) -L$(STDLIBPATH) "$(>)" "$(NEEDLIBS)" "$(NEEDLIBS)" -l$(FINDLIBS) $(OPTIONS) $(USER_OPTIONS)
136}
137
138actions xlcpp.compile.c
139{
140 $(VA_C_COMPILER) -c $(OPTIONS) $(USER_OPTIONS) -I$(BOOST_ROOT) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)"
141}
142
143actions xlcpp.compile.c++
144{
145 $(VA_CXX_COMPILER) -c $(OPTIONS) $(USER_OPTIONS) -I$(BOOST_ROOT) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)"
146}
147
148actions updated together piecemeal xlcpp.archive
149{
150 ar $(ARFLAGS) ru "$(<)" "$(>)"
151}