1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
10 -- Copyright (C) 2003-2005 Free Software Foundation, Inc. --
12 -- GNAT is free software; you can redistribute it and/or modify it under --
13 -- terms of the GNU General Public License as published by the Free Soft- --
14 -- ware Foundation; either version 2, or (at your option) any later ver- --
15 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
16 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
17 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
18 -- for more details. You should have received a copy of the GNU General --
19 -- Public License distributed with GNAT; see file COPYING. If not, write --
20 -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
21 -- Boston, MA 02110-1301, USA. --
23 -- GNAT was originally developed by the GNAT team at New York University. --
24 -- Extensive contributions were provided by Ada Core Technologies Inc. --
26 ------------------------------------------------------------------------------
28 -- This package provides a set of target dependent routines to build
31 -- This is the LynxOS version of the body
34 with Namet
; use Namet
;
37 package body MLib
.Tgt
is
43 function Archive_Builder
return String is
48 -----------------------------
49 -- Archive_Builder_Options --
50 -----------------------------
52 function Archive_Builder_Options
return String_List_Access
is
54 return new String_List
'(1 => new String'("cr"));
55 end Archive_Builder_Options
;
61 function Archive_Ext
return String is
70 function Archive_Indexer
return String is
75 -----------------------------
76 -- Archive_Indexer_Options --
77 -----------------------------
79 function Archive_Indexer_Options
return String_List_Access
is
81 return new String_List
(1 .. 0);
82 end Archive_Indexer_Options
;
84 ---------------------------
85 -- Build_Dynamic_Library --
86 ---------------------------
88 procedure Build_Dynamic_Library
89 (Ofiles
: Argument_List
;
90 Foreign
: Argument_List
;
91 Afiles
: Argument_List
;
92 Options
: Argument_List
;
93 Options_2
: Argument_List
;
94 Interfaces
: Argument_List
;
95 Lib_Filename
: String;
97 Symbol_Data
: Symbol_Record
;
98 Driver_Name
: Name_Id
:= No_Name
;
99 Lib_Version
: String := "";
100 Auto_Init
: Boolean := False)
102 pragma Unreferenced
(Ofiles
);
103 pragma Unreferenced
(Foreign
);
104 pragma Unreferenced
(Afiles
);
105 pragma Unreferenced
(Options
);
106 pragma Unreferenced
(Options_2
);
107 pragma Unreferenced
(Interfaces
);
108 pragma Unreferenced
(Lib_Filename
);
109 pragma Unreferenced
(Lib_Dir
);
110 pragma Unreferenced
(Symbol_Data
);
111 pragma Unreferenced
(Driver_Name
);
112 pragma Unreferenced
(Lib_Version
);
113 pragma Unreferenced
(Auto_Init
);
117 end Build_Dynamic_Library
;
123 function DLL_Ext
return String is
132 function Dynamic_Option
return String is
141 function Is_Object_Ext
(Ext
: String) return Boolean is
150 function Is_C_Ext
(Ext
: String) return Boolean is
159 function Is_Archive_Ext
(Ext
: String) return Boolean is
168 function Libgnat
return String is
173 ------------------------
174 -- Library_Exists_For --
175 ------------------------
177 function Library_Exists_For
178 (Project
: Project_Id
; In_Tree
: Project_Tree_Ref
) return Boolean
181 if not In_Tree
.Projects
.Table
(Project
).Library
then
182 Prj
.Com
.Fail
("INTERNAL ERROR: Library_Exists_For called " &
183 "for non library project");
188 Lib_Dir
: constant String :=
190 (In_Tree
.Projects
.Table
(Project
).Library_Dir
);
191 Lib_Name
: constant String :=
193 (In_Tree
.Projects
.Table
(Project
).Library_Name
);
196 if In_Tree
.Projects
.Table
(Project
).Library_Kind
=
199 return Is_Regular_File
200 (Lib_Dir
& Directory_Separator
& "lib" &
201 Fil
.Ext_To
(Lib_Name
, Archive_Ext
));
204 return Is_Regular_File
205 (Lib_Dir
& Directory_Separator
& "lib" &
206 Fil
.Ext_To
(Lib_Name
, DLL_Ext
));
210 end Library_Exists_For
;
212 ---------------------------
213 -- Library_File_Name_For --
214 ---------------------------
216 function Library_File_Name_For
217 (Project
: Project_Id
;
218 In_Tree
: Project_Tree_Ref
) return Name_Id
221 if not In_Tree
.Projects
.Table
(Project
).Library
then
222 Prj
.Com
.Fail
("INTERNAL ERROR: Library_File_Name_For called " &
223 "for non library project");
228 Lib_Name
: constant String :=
230 (In_Tree
.Projects
.Table
(Project
).Library_Name
);
234 Name_Buffer
(1 .. Name_Len
) := "lib";
236 if In_Tree
.Projects
.Table
(Project
).Library_Kind
=
239 Add_Str_To_Name_Buffer
(Fil
.Ext_To
(Lib_Name
, Archive_Ext
));
242 Add_Str_To_Name_Buffer
(Fil
.Ext_To
(Lib_Name
, DLL_Ext
));
248 end Library_File_Name_For
;
254 function Object_Ext
return String is
263 function PIC_Option
return String is
268 -----------------------------------------------
269 -- Standalone_Library_Auto_Init_Is_Supported --
270 -----------------------------------------------
272 function Standalone_Library_Auto_Init_Is_Supported
return Boolean is
275 end Standalone_Library_Auto_Init_Is_Supported
;
277 ---------------------------
278 -- Support_For_Libraries --
279 ---------------------------
281 function Support_For_Libraries
return Library_Support
is
284 end Support_For_Libraries
;