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