1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
5 -- M L I B . T G T. S P E C I F I C --
6 -- (Bare Board Version) --
10 -- Copyright (C) 2003-2008, 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 3, 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 COPYING3. If not, go to --
20 -- http://www.gnu.org/licenses for a complete copy of the license. --
22 -- GNAT was originally developed by the GNAT team at New York University. --
23 -- Extensive contributions were provided by Ada Core Technologies Inc. --
25 ------------------------------------------------------------------------------
27 -- This is the bare board version of the body
30 with Types; use Types;
32 package body MLib.Tgt.Specific is
34 -----------------------
35 -- Local Subprograms --
36 -----------------------
38 function Get_Target_Prefix return String;
39 -- Returns the required prefix for some utilities
40 -- (such as ar and ranlib) that depend on the real target.
42 -- Non default subprograms
44 function Archive_Builder return String;
46 function Archive_Indexer return String;
48 procedure Build_Dynamic_Library
49 (Ofiles : Argument_List;
50 Options : Argument_List;
51 Interfaces : Argument_List;
52 Lib_Filename : String;
54 Symbol_Data : Symbol_Record;
55 Driver_Name : Name_Id := No_Name;
56 Lib_Version : String := "";
57 Auto_Init : Boolean := False);
59 function DLL_Ext return String;
61 function Dynamic_Option return String;
63 function Library_Major_Minor_Id_Supported return Boolean;
65 function PIC_Option return String;
67 function Standalone_Library_Auto_Init_Is_Supported return Boolean;
69 function Support_For_Libraries return Library_Support;
75 function Archive_Builder return String is
77 return Get_Target_Prefix & "ar";
84 function Archive_Indexer return String is
86 return Get_Target_Prefix & "ranlib";
89 ---------------------------
90 -- Build_Dynamic_Library --
91 ---------------------------
93 procedure Build_Dynamic_Library
94 (Ofiles : Argument_List;
95 Options : Argument_List;
96 Interfaces : Argument_List;
97 Lib_Filename : String;
99 Symbol_Data : Symbol_Record;
100 Driver_Name : Name_Id := No_Name;
101 Lib_Version : String := "";
102 Auto_Init : Boolean := False)
104 pragma Unreferenced (Ofiles);
105 pragma Unreferenced (Options);
106 pragma Unreferenced (Interfaces);
107 pragma Unreferenced (Lib_Filename);
108 pragma Unreferenced (Lib_Dir);
109 pragma Unreferenced (Symbol_Data);
110 pragma Unreferenced (Driver_Name);
111 pragma Unreferenced (Lib_Version);
112 pragma Unreferenced (Auto_Init);
116 end Build_Dynamic_Library;
122 function DLL_Ext return String is
131 function Dynamic_Option return String is
136 -----------------------
137 -- Get_Target_Prefix --
138 -----------------------
140 function Get_Target_Prefix return String is
141 Target_Name : constant String_Ptr := Sdefault.Target_Name;
142 Index : Positive := Target_Name'First;
145 while Index < Target_Name'Last
146 and then Target_Name (Index + 1) /= '-'
151 if Target_Name (Target_Name'First .. Index) = "avr" then
153 elsif Target_Name (Target_Name'First .. Index) = "erc32" then
155 elsif Target_Name (Target_Name'First .. Index) = "leon" then
157 elsif Target_Name (Target_Name'First .. Index) = "powerpc" then
158 if Target_Name'Length >= 23 and then
159 Target_Name (Target_Name'First .. Target_Name'First + 22) =
160 "powerpc-unknown-eabispe"
162 return "powerpc-eabispe-";
164 return "powerpc-elf-";
169 end Get_Target_Prefix;
171 --------------------------------------
172 -- Library_Major_Minor_Id_Supported --
173 --------------------------------------
175 function Library_Major_Minor_Id_Supported return Boolean is
178 end Library_Major_Minor_Id_Supported;
184 function PIC_Option return String is
189 -----------------------------------------------
190 -- Standalone_Library_Auto_Init_Is_Supported --
191 -----------------------------------------------
193 function Standalone_Library_Auto_Init_Is_Supported return Boolean is
196 end Standalone_Library_Auto_Init_Is_Supported;
198 ---------------------------
199 -- Support_For_Libraries --
200 ---------------------------
202 function Support_For_Libraries return Library_Support is
205 end Support_For_Libraries;
208 Archive_Builder_Ptr := Archive_Builder'Access;
209 Archive_Indexer_Ptr := Archive_Indexer'Access;
210 Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access;
211 DLL_Ext_Ptr := DLL_Ext'Access;
212 Dynamic_Option_Ptr := Dynamic_Option'Access;
213 Library_Major_Minor_Id_Supported_Ptr :=
214 Library_Major_Minor_Id_Supported'Access;
215 PIC_Option_Ptr := PIC_Option'Access;
216 Standalone_Library_Auto_Init_Is_Supported_Ptr :=
217 Standalone_Library_Auto_Init_Is_Supported'Access;
218 Support_For_Libraries_Ptr := Support_For_Libraries'Access;
219 end MLib.Tgt.Specific;