]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/src/tools/pgi.jam
update sources to v12.2.3
[ceph.git] / ceph / src / boost / tools / build / src / tools / pgi.jam
1 # Copyright Noel Belcourt 2007.
2 # Copyright 2017, NVIDIA CORPORATION.
3 # Distributed under the Boost Software License, Version 1.0.
4 # (See accompanying file LICENSE_1_0.txt or copy at
5 # http://www.boost.org/LICENSE_1_0.txt)
6
7 import property ;
8 import generators ;
9 import os ;
10 import toolset : flags ;
11 import feature ;
12 import fortran ;
13 import type ;
14 import common ;
15 import gcc ;
16
17 feature.extend toolset : pgi ;
18 toolset.inherit pgi : unix ;
19 generators.override pgi.prebuilt : builtin.lib-generator ;
20 generators.override pgi.searched-lib-generator : searched-lib-generator ;
21
22 # Documentation and toolchain description located
23 # http://www.pgroup.com/resources/docs.htm
24
25 rule init ( version ? : command * : options * )
26 {
27 local condition = [ common.check-init-parameters pgi : version $(version) ] ;
28
29 local l_command = [ common.get-invocation-command pgi : pgc++ : $(command) ] ;
30
31 common.handle-options pgi : $(condition) : $(l_command) : $(options) ;
32
33 command_c = $(command_c[1--2]) $(l_command[-1]:B=pgcc) ;
34
35 toolset.flags pgi CONFIG_C_COMMAND $(condition) : $(command_c) ;
36
37 flags pgi.compile DEFINES $(condition) :
38 [ feature.get-values <define> : $(options) ] : unchecked ;
39
40 # set link flags
41 flags pgi.link FINDLIBS-ST : [
42 feature.get-values <find-static-library> : $(options) ] : unchecked ;
43
44 gcc.init-link-flags pgi gnu $(condition) ;
45 }
46
47 # Declare generators
48 generators.register-c-compiler pgi.compile.c : C : OBJ : <toolset>pgi ;
49 generators.register-c-compiler pgi.compile.c++ : CPP : OBJ : <toolset>pgi ;
50 generators.register-fortran-compiler pgi.compile.fortran : FORTRAN : OBJ : <toolset>pgi ;
51
52 # Declare flags and actions for compilation
53 flags pgi.compile OPTIONS <link>shared : -fpic ;
54 flags pgi.compile OPTIONS <debug-symbols>on : -gopt ;
55 flags pgi.compile OPTIONS <optimization>off : -O0 ;
56 flags pgi.compile OPTIONS <optimization>speed : -fast ;
57 flags pgi.compile OPTIONS <optimization>space : -fast ;
58
59 flags pgi.compile OPTIONS <warnings>off : -Minform=severe ;
60 flags pgi.compile OPTIONS <warnings>on : -Minform=warn ;
61 flags pgi.compile OPTIONS <warnings-as-errors>on : -Werror ;
62
63 flags pgi.compile.c++ OPTIONS <rtti>off : --no_rtti ;
64 flags pgi.compile.c++ OPTIONS <exception-handling>off : --no_exceptions ;
65
66 flags pgi.compile OPTIONS <cflags> ;
67 flags pgi.compile.c++ OPTIONS <cxxflags> ;
68 flags pgi.compile DEFINES <define> ;
69 flags pgi.compile INCLUDES <include> ;
70
71 flags pgi.compile.fortran OPTIONS <fflags> ;
72
73 actions compile.c
74 {
75 "$(CONFIG_C_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
76 }
77
78 actions compile.c++
79 {
80 "$(CONFIG_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
81 }
82
83 actions compile.fortran
84 {
85 "$(CONFIG_F_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
86 }
87
88 # Declare flags and actions for linking
89 flags pgi.link OPTIONS <debug-symbols>on : -gopt ;
90 # Strip the binary when no debugging is needed
91 flags pgi.link OPTIONS <debug-symbols>off : -s ;
92 flags pgi.link OPTIONS <linkflags> ;
93 flags pgi.link OPTIONS <link>shared : -fpic ;
94 flags pgi.link LINKPATH <library-path> ;
95 flags pgi.link FINDLIBS-ST <find-static-library> ;
96 flags pgi.link FINDLIBS-SA <find-shared-library> ;
97 flags pgi.link FINDLIBS-SA <threading>multi : pthread rt ;
98 flags pgi.link LIBRARIES <library-file> ;
99 flags pgi.link LINK-RUNTIME <runtime-link>static : static ;
100 flags pgi.link LINK-RUNTIME <runtime-link>shared : dynamic ;
101 flags pgi.link RPATH <dll-path> ;
102
103 rule link ( targets * : sources * : properties * )
104 {
105 SPACE on $(targets) = " " ;
106 }
107
108 actions link bind LIBRARIES
109 {
110 "$(CONFIG_COMMAND)" $(OPTIONS) -L"$(LINKPATH)" -R"$(RPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA)
111 }
112
113 # Slight mods for dlls
114 rule link.dll ( targets * : sources * : properties * )
115 {
116 SPACE on $(targets) = " " ;
117 }
118
119 actions link.dll bind LIBRARIES
120 {
121 "$(CONFIG_COMMAND)" $(OPTIONS) -shared -L"$(LINKPATH)" -R"$(RPATH)" -soname $(<[-1]:D=) -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST)
122 }
123
124 actions updated together piecemeal pgi.archive
125 {
126 ar -rc$(ARFLAGS:E=) "$(<)" "$(>)"
127 }
128