-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgprbuild_tc.gpr
198 lines (173 loc) · 6.08 KB
/
gprbuild_tc.gpr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
-------------------------------------------------------------------------------
-- SweetAda GPRbuild project file
-------------------------------------------------------------------------------
with "configure";
with "gprbuild_st";
with "gprbuild_wr";
abstract project Gprbuild_Tc is
----------------------------------------------------------------------------
-- Types and variables
----------------------------------------------------------------------------
Ostype := External ("OSTYPE", "");
Verbose := External ("VERBOSE", "");
----------------------------------------------------------------------------
-- Naming
----------------------------------------------------------------------------
package Naming is
for Spec_Suffix ("Asm_Cpp") use ".h";
for Body_Suffix ("Asm_Cpp") use ".S";
for Spec_Suffix ("C") use ".h";
for Body_Suffix ("C") use ".c";
for Spec_Suffix ("Ada") use ".ads";
for Body_Suffix ("Ada") use ".adb";
end Naming;
----------------------------------------------------------------------------
-- Builder
----------------------------------------------------------------------------
Builder_Switches := ();
case Verbose is
when "Y" | "y" | "1" => Builder_Switches := Builder_Switches & ("-v");
when others => null;
end case;
package Builder is
for Global_Configuration_Pragmas use Configure.GnatAdc_Filename;
for Switches ("Asm_Cpp") use Builder_Switches;
for Switches ("C") use Builder_Switches;
for Switches ("Ada") use (
"-nostdinc",
"-nostdlib",
"--RTS=" & Configure.RTS_Path
) &
Builder_Switches;
end Builder;
----------------------------------------------------------------------------
-- Compiler
----------------------------------------------------------------------------
GCC_FQExecutable :=
Configure.Toolchain_Prefix &
"/bin/" &
Configure.Toolchain_Name &
"-gcc";
Ada_Mode := "";
case Configure.Ada_Mode is
when "ADA95" => Ada_Mode := "-gnat95";
when "ADA05" => Ada_Mode := "-gnat2005";
when "ADA12" => Ada_Mode := "-gnat2012";
when "ADA20" => Ada_Mode := "-gnat2020";
when "ADA22" => Ada_Mode := "-gnat2022";
when others => null;
end case;
GCC_Wrapper_Switch := ("-wrapper", Configure.GCC_Wrapper);
No_DOS_LT_Switch := "";
case Ostype is
when "cmd" | "msys" => null;
when others => No_DOS_LT_Switch := "-gnatyd";
end case;
package Compiler is
-- Asm_Cpp
for Driver ("Asm_Cpp") use GCC_FQExecutable;
for Switches ("Asm_Cpp") use (
"-ffunction-sections",
"-fdata-sections",
"-g3", "-gdwarf-5"
) &
GCC_Wrapper_Switch &
Configure.GCC_Switches_Platform;
-- C
for Driver ("C") use GCC_FQExecutable;
for Leading_Required_Switches ("C") use (
"-ffreestanding",
"-std=c99"
);
for Switches ("C") use (
"-O" & Configure.Optimization_Level,
"-fno-omit-frame-pointer",
"-fverbose-asm",
"-ffunction-sections",
"-fdata-sections",
"-g3", "-gdwarf-5"
) &
GCC_Wrapper_Switch &
Configure.CC_Switches_RTS &
Configure.GCC_Switches_Platform &
Gprbuild_Wr.CC_Switches_Warning;
-- Ada
for Driver ("Ada") use GCC_FQExecutable;
for Mapping_Spec_Suffix ("Ada") use "%s";
for Mapping_Body_Suffix ("Ada") use "%b";
for Dependency_Kind ("Ada") use "ALI_File";
for Multi_Unit_Object_Separator ("Ada") use "~";
for Leading_Required_Switches ("Ada") use ("-x", "ada");
for Include_Switches ("Ada") use ("-I");
for Switches ("Ada") use (
Ada_Mode,
"-nostdinc",
"-nostdlib",
"-O" & Configure.Optimization_Level,
"-fno-omit-frame-pointer",
"-fverbose-asm",
"-ffunction-sections",
"-fdata-sections",
"-g3", "-gdwarf-5",
"-gnatef",
"-gnatf",
"-gnatU",
"-gnatn",
"-gnatE",
"-gnato1",
"-gnatVa",
"-gnatX",
"-fstack-usage",
"-fdump-rtl-expand",
No_DOS_LT_Switch
) &
GCC_Wrapper_Switch &
Configure.ADAC_Switches_RTS &
Configure.GCC_Switches_Platform &
Gprbuild_Wr.ADAC_Switches_Warning &
Gprbuild_St.ADAC_Switches_Style;
end Compiler;
----------------------------------------------------------------------------
-- Binder
----------------------------------------------------------------------------
Binder_Switches := ();
case Configure.Gnatbind_SecStack is
when "" =>
null;
when others =>
Binder_Switches := Binder_Switches &
("-D" & Configure.Gnatbind_SecStack);
end case;
package Binder is
for Switches ("Ada") use (
"-nostdinc",
"-nostdlib",
"-F",
"-e",
"-l",
"-n",
"-s",
"-A=gnatbind_alis.lst",
"-O=gnatbind_objs.lst"
) &
Binder_Switches;
end Binder;
----------------------------------------------------------------------------
-- Library definitions
----------------------------------------------------------------------------
AR_FQExecutable :=
Configure.Toolchain_Prefix &
"/bin/" &
Configure.Toolchain_Name &
"-ar";
Library_Kind := "static";
Library_Support := "static_only";
Library_Builder := "/libexec/gprbuild/gprlib";
case Configure.Gprbuild_Prefix is
when "" =>
Library_Builder := ".." & Library_Builder;
when others =>
Library_Builder := Configure.Gprbuild_Prefix & Library_Builder;
end case;
Archive_Builder := (AR_FQExecutable, "cr");
end Gprbuild_Tc;