1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
5 -- M L I B . T G T. S P E C I F I C --
9 -- Copyright (C) 2003-2011, Free Software Foundation, Inc. --
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 ------------------------------------------------------------------------------
26 -- This is the bare board version of the body
29 with Types
; use Types
;
31 package body MLib
.Tgt
.Specific
is
33 -----------------------
34 -- Local Subprograms --
35 -----------------------
37 function Get_Target_Prefix
return String;
38 -- Returns the required prefix for some utilities
39 -- (such as ar and ranlib) that depend on the real target.
41 -- Non default subprograms
43 function Archive_Builder
return String;
45 function Archive_Indexer
return String;
47 procedure Build_Dynamic_Library
48 (Ofiles
: Argument_List
;
49 Options
: Argument_List
;
50 Interfaces
: Argument_List
;
51 Lib_Filename
: String;
53 Symbol_Data
: Symbol_Record
;
54 Driver_Name
: Name_Id
:= No_Name
;
55 Lib_Version
: String := "";
56 Auto_Init
: Boolean := False);
58 function DLL_Ext
return String;
60 function Dynamic_Option
return String;
62 function Library_Major_Minor_Id_Supported
return Boolean;
64 function PIC_Option
return String;
66 function Standalone_Library_Auto_Init_Is_Supported
return Boolean;
68 function Support_For_Libraries
return Library_Support
;
74 function Archive_Builder
return String is
76 return Get_Target_Prefix
& "ar";
83 function Archive_Indexer
return String is
85 return Get_Target_Prefix
& "ranlib";
88 ---------------------------
89 -- Build_Dynamic_Library --
90 ---------------------------
92 procedure Build_Dynamic_Library
93 (Ofiles
: Argument_List
;
94 Options
: Argument_List
;
95 Interfaces
: Argument_List
;
96 Lib_Filename
: String;
98 Symbol_Data
: Symbol_Record
;
99 Driver_Name
: Name_Id
:= No_Name
;
100 Lib_Version
: String := "";
101 Auto_Init
: Boolean := False)
103 pragma Unreferenced
(Ofiles
);
104 pragma Unreferenced
(Options
);
105 pragma Unreferenced
(Interfaces
);
106 pragma Unreferenced
(Lib_Filename
);
107 pragma Unreferenced
(Lib_Dir
);
108 pragma Unreferenced
(Symbol_Data
);
109 pragma Unreferenced
(Driver_Name
);
110 pragma Unreferenced
(Lib_Version
);
111 pragma Unreferenced
(Auto_Init
);
115 end Build_Dynamic_Library
;
121 function DLL_Ext
return String is
130 function Dynamic_Option
return String is
135 -----------------------
136 -- Get_Target_Prefix --
137 -----------------------
139 function Get_Target_Prefix
return String is
140 Target_Name
: constant String_Ptr
:= Sdefault
.Target_Name
;
143 -- Target_name is the program prefix without '-' but with a trailing '/'
145 return Target_Name
(Target_Name
'First .. Target_Name
'Last - 1) & '-';
146 end Get_Target_Prefix
;
148 --------------------------------------
149 -- Library_Major_Minor_Id_Supported --
150 --------------------------------------
152 function Library_Major_Minor_Id_Supported
return Boolean is
155 end Library_Major_Minor_Id_Supported
;
161 function PIC_Option
return String is
166 -----------------------------------------------
167 -- Standalone_Library_Auto_Init_Is_Supported --
168 -----------------------------------------------
170 function Standalone_Library_Auto_Init_Is_Supported
return Boolean is
173 end Standalone_Library_Auto_Init_Is_Supported
;
175 ---------------------------
176 -- Support_For_Libraries --
177 ---------------------------
179 function Support_For_Libraries
return Library_Support
is
182 end Support_For_Libraries
;
185 Archive_Builder_Ptr
:= Archive_Builder
'Access;
186 Archive_Indexer_Ptr
:= Archive_Indexer
'Access;
187 Build_Dynamic_Library_Ptr
:= Build_Dynamic_Library
'Access;
188 DLL_Ext_Ptr
:= DLL_Ext
'Access;
189 Dynamic_Option_Ptr
:= Dynamic_Option
'Access;
190 Library_Major_Minor_Id_Supported_Ptr
:=
191 Library_Major_Minor_Id_Supported
'Access;
192 PIC_Option_Ptr
:= PIC_Option
'Access;
193 Standalone_Library_Auto_Init_Is_Supported_Ptr
:=
194 Standalone_Library_Auto_Init_Is_Supported
'Access;
195 Support_For_Libraries_Ptr
:= Support_For_Libraries
'Access;
196 end MLib
.Tgt
.Specific
;