1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 2001-2009, AdaCore --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING3. If not, go to --
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
24 ------------------------------------------------------------------------------
29 with MLib
.Tgt
.Specific
;
30 pragma Warnings
(Off
, MLib
.Tgt
.Specific
);
31 -- MLib.Tgt.Specific is with'ed only for elaboration purposes
33 package body MLib
.Tgt
is
39 function Archive_Builder
return String is
41 return Archive_Builder_Ptr
.all;
44 -----------------------------
45 -- Archive_Builder_Default --
46 -----------------------------
48 function Archive_Builder_Default
return String is
51 end Archive_Builder_Default
;
53 -----------------------------
54 -- Archive_Builder_Options --
55 -----------------------------
57 function Archive_Builder_Options
return String_List_Access
is
59 return Archive_Builder_Options_Ptr
.all;
60 end Archive_Builder_Options
;
62 -------------------------------------
63 -- Archive_Builder_Options_Default --
64 -------------------------------------
66 function Archive_Builder_Options_Default
return String_List_Access
is
68 return new String_List
'(1 => new String'("cr"));
69 end Archive_Builder_Options_Default
;
71 ------------------------------------
72 -- Archive_Builder_Append_Options --
73 ------------------------------------
75 function Archive_Builder_Append_Options
return String_List_Access
is
77 return Archive_Builder_Append_Options_Ptr
.all;
78 end Archive_Builder_Append_Options
;
80 --------------------------------------------
81 -- Archive_Builder_Append_Options_Default --
82 --------------------------------------------
84 function Archive_Builder_Append_Options_Default
return String_List_Access
is
86 return new String_List
'(1 => new String'("q"));
87 end Archive_Builder_Append_Options_Default
;
93 function Archive_Ext
return String is
95 return Archive_Ext_Ptr
.all;
98 -------------------------
99 -- Archive_Ext_Default --
100 -------------------------
102 function Archive_Ext_Default
return String is
105 end Archive_Ext_Default
;
107 ---------------------
108 -- Archive_Indexer --
109 ---------------------
111 function Archive_Indexer
return String is
113 return Archive_Indexer_Ptr
.all;
116 -----------------------------
117 -- Archive_Indexer_Default --
118 -----------------------------
120 function Archive_Indexer_Default
return String is
123 end Archive_Indexer_Default
;
125 -----------------------------
126 -- Archive_Indexer_Options --
127 -----------------------------
129 function Archive_Indexer_Options
return String_List_Access
is
131 return Archive_Indexer_Options_Ptr
.all;
132 end Archive_Indexer_Options
;
134 -------------------------------------
135 -- Archive_Indexer_Options_Default --
136 -------------------------------------
138 function Archive_Indexer_Options_Default
return String_List_Access
is
140 return new String_List
(1 .. 0);
141 end Archive_Indexer_Options_Default
;
143 ---------------------------
144 -- Build_Dynamic_Library --
145 ---------------------------
147 procedure Build_Dynamic_Library
148 (Ofiles
: Argument_List
;
149 Options
: Argument_List
;
150 Interfaces
: Argument_List
;
151 Lib_Filename
: String;
153 Symbol_Data
: Symbol_Record
;
154 Driver_Name
: Name_Id
:= No_Name
;
155 Lib_Version
: String := "";
156 Auto_Init
: Boolean := False)
159 Build_Dynamic_Library_Ptr
169 end Build_Dynamic_Library
;
171 ------------------------------
172 -- Default_Symbol_File_Name --
173 ------------------------------
175 function Default_Symbol_File_Name
return String is
177 return Default_Symbol_File_Name_Ptr
.all;
178 end Default_Symbol_File_Name
;
180 --------------------------------------
181 -- Default_Symbol_File_Name_Default --
182 --------------------------------------
184 function Default_Symbol_File_Name_Default
return String is
187 end Default_Symbol_File_Name_Default
;
193 function DLL_Ext
return String is
195 return DLL_Ext_Ptr
.all;
198 ---------------------
199 -- DLL_Ext_Default --
200 ---------------------
202 function DLL_Ext_Default
return String is
211 function DLL_Prefix
return String is
213 return DLL_Prefix_Ptr
.all;
216 ------------------------
217 -- DLL_Prefix_Default --
218 ------------------------
220 function DLL_Prefix_Default
return String is
223 end DLL_Prefix_Default
;
229 function Dynamic_Option
return String is
231 return Dynamic_Option_Ptr
.all;
234 ----------------------------
235 -- Dynamic_Option_Default --
236 ----------------------------
238 function Dynamic_Option_Default
return String is
241 end Dynamic_Option_Default
;
247 function Is_Object_Ext
(Ext
: String) return Boolean is
249 return Is_Object_Ext_Ptr
(Ext
);
252 ---------------------------
253 -- Is_Object_Ext_Default --
254 ---------------------------
256 function Is_Object_Ext_Default
(Ext
: String) return Boolean is
259 end Is_Object_Ext_Default
;
265 function Is_C_Ext
(Ext
: String) return Boolean is
267 return Is_C_Ext_Ptr
(Ext
);
270 ----------------------
271 -- Is_C_Ext_Default --
272 ----------------------
274 function Is_C_Ext_Default
(Ext
: String) return Boolean is
277 end Is_C_Ext_Default
;
283 function Is_Archive_Ext
(Ext
: String) return Boolean is
285 return Is_Archive_Ext_Ptr
(Ext
);
288 ----------------------------
289 -- Is_Archive_Ext_Default --
290 ----------------------------
292 function Is_Archive_Ext_Default
(Ext
: String) return Boolean is
295 end Is_Archive_Ext_Default
;
301 function Libgnat
return String is
303 return Libgnat_Ptr
.all;
306 ---------------------
307 -- Libgnat_Default --
308 ---------------------
310 function Libgnat_Default
return String is
315 ------------------------
316 -- Library_Exists_For --
317 ------------------------
319 function Library_Exists_For
320 (Project
: Project_Id
;
321 In_Tree
: Project_Tree_Ref
) return Boolean
324 return Library_Exists_For_Ptr
(Project
, In_Tree
);
325 end Library_Exists_For
;
327 --------------------------------
328 -- Library_Exists_For_Default --
329 --------------------------------
331 function Library_Exists_For_Default
332 (Project
: Project_Id
;
333 In_Tree
: Project_Tree_Ref
) return Boolean
335 pragma Unreferenced
(In_Tree
);
338 if not Project
.Library
then
339 Prj
.Com
.Fail
("INTERNAL ERROR: Library_Exists_For called " &
340 "for non library project");
345 Lib_Dir
: constant String :=
346 Get_Name_String
(Project
.Library_Dir
.Name
);
347 Lib_Name
: constant String :=
348 Get_Name_String
(Project
.Library_Name
);
351 if Project
.Library_Kind
= Static
then
352 return Is_Regular_File
353 (Lib_Dir
& Directory_Separator
& "lib" &
354 Fil
.Append_To
(Lib_Name
, Archive_Ext
));
357 return Is_Regular_File
358 (Lib_Dir
& Directory_Separator
& DLL_Prefix
&
359 Fil
.Append_To
(Lib_Name
, DLL_Ext
));
363 end Library_Exists_For_Default
;
365 ---------------------------
366 -- Library_File_Name_For --
367 ---------------------------
369 function Library_File_Name_For
370 (Project
: Project_Id
;
371 In_Tree
: Project_Tree_Ref
) return File_Name_Type
374 return Library_File_Name_For_Ptr
(Project
, In_Tree
);
375 end Library_File_Name_For
;
377 -----------------------------------
378 -- Library_File_Name_For_Default --
379 -----------------------------------
381 function Library_File_Name_For_Default
382 (Project
: Project_Id
;
383 In_Tree
: Project_Tree_Ref
) return File_Name_Type
385 pragma Unreferenced
(In_Tree
);
387 if not Project
.Library
then
388 Prj
.Com
.Fail
("INTERNAL ERROR: Library_File_Name_For called " &
389 "for non library project");
394 Lib_Name
: constant String :=
395 Get_Name_String
(Project
.Library_Name
);
398 if Project
.Library_Kind
=
402 Name_Buffer
(1 .. Name_Len
) := "lib";
403 Add_Str_To_Name_Buffer
(Fil
.Append_To
(Lib_Name
, Archive_Ext
));
406 Add_Str_To_Name_Buffer
(DLL_Prefix
);
407 Add_Str_To_Name_Buffer
(Fil
.Append_To
(Lib_Name
, DLL_Ext
));
413 end Library_File_Name_For_Default
;
415 --------------------------------------
416 -- Library_Major_Minor_Id_Supported --
417 --------------------------------------
419 function Library_Major_Minor_Id_Supported
return Boolean is
421 return Library_Major_Minor_Id_Supported_Ptr
.all;
422 end Library_Major_Minor_Id_Supported
;
424 ----------------------------------------------
425 -- Library_Major_Minor_Id_Supported_Default --
426 ----------------------------------------------
428 function Library_Major_Minor_Id_Supported_Default
return Boolean is
431 end Library_Major_Minor_Id_Supported_Default
;
437 function Object_Ext
return String is
439 return Object_Ext_Ptr
.all;
442 ------------------------
443 -- Object_Ext_Default --
444 ------------------------
446 function Object_Ext_Default
return String is
449 end Object_Ext_Default
;
455 function PIC_Option
return String is
457 return PIC_Option_Ptr
.all;
460 ------------------------
461 -- PIC_Option_Default --
462 ------------------------
464 function PIC_Option_Default
return String is
467 end PIC_Option_Default
;
469 -----------------------------------------------
470 -- Standalone_Library_Auto_Init_Is_Supported --
471 -----------------------------------------------
473 function Standalone_Library_Auto_Init_Is_Supported
return Boolean is
475 return Standalone_Library_Auto_Init_Is_Supported_Ptr
.all;
476 end Standalone_Library_Auto_Init_Is_Supported
;
478 -------------------------------------------------------
479 -- Standalone_Library_Auto_Init_Is_Supported_Default --
480 -------------------------------------------------------
482 function Standalone_Library_Auto_Init_Is_Supported_Default
return Boolean is
485 end Standalone_Library_Auto_Init_Is_Supported_Default
;
487 ---------------------------
488 -- Support_For_Libraries --
489 ---------------------------
491 function Support_For_Libraries
return Library_Support
is
493 return Support_For_Libraries_Ptr
.all;
494 end Support_For_Libraries
;
496 -----------------------------------
497 -- Support_For_Libraries_Default --
498 -----------------------------------
500 function Support_For_Libraries_Default
return Library_Support
is
503 end Support_For_Libraries_Default
;