2008-05-30 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / ada / mlib-tgt-specific-xi.adb
blob9d179ff0e6b65e37f2e482bb4e2c3d49c9e24fe9
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- M L I B . T G T. S P E C I F I C --
6 -- (Bare Board Version) --
7 -- --
8 -- B o d y --
9 -- --
10 -- Copyright (C) 2003-2007, Free Software Foundation, Inc. --
11 -- --
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. --
21 -- --
22 -- GNAT was originally developed by the GNAT team at New York University. --
23 -- Extensive contributions were provided by Ada Core Technologies Inc. --
24 -- --
25 ------------------------------------------------------------------------------
27 -- This is the bare board version of the body
29 with Sdefault;
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;
53 Lib_Dir : 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;
71 ---------------------
72 -- Archive_Builder --
73 ---------------------
75 function Archive_Builder return String is
76 begin
77 return Get_Target_Prefix & "ar";
78 end Archive_Builder;
80 ---------------------
81 -- Archive_Indexer --
82 ---------------------
84 function Archive_Indexer return String is
85 begin
86 return Get_Target_Prefix & "ranlib";
87 end Archive_Indexer;
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;
98 Lib_Dir : 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);
114 begin
115 null;
116 end Build_Dynamic_Library;
118 -------------
119 -- DLL_Ext --
120 -------------
122 function DLL_Ext return String is
123 begin
124 return "";
125 end DLL_Ext;
127 --------------------
128 -- Dynamic_Option --
129 --------------------
131 function Dynamic_Option return String is
132 begin
133 return "";
134 end Dynamic_Option;
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;
144 begin
145 while Index < Target_Name'Last
146 and then Target_Name (Index + 1) /= '-'
147 loop
148 Index := Index + 1;
149 end loop;
151 if Target_Name (Target_Name'First .. Index) = "erc32" then
152 return "erc32-elf-";
153 elsif Target_Name (Target_Name'First .. Index) = "leon" then
154 return "leon-elf-";
155 elsif Target_Name (Target_Name'First .. Index) = "powerpc" then
156 return "powerpc-elf-";
157 else
158 return "";
159 end if;
160 end Get_Target_Prefix;
162 --------------------------------------
163 -- Library_Major_Minor_Id_Supported --
164 --------------------------------------
166 function Library_Major_Minor_Id_Supported return Boolean is
167 begin
168 return False;
169 end Library_Major_Minor_Id_Supported;
171 ----------------
172 -- PIC_Option --
173 ----------------
175 function PIC_Option return String is
176 begin
177 return "";
178 end PIC_Option;
180 -----------------------------------------------
181 -- Standalone_Library_Auto_Init_Is_Supported --
182 -----------------------------------------------
184 function Standalone_Library_Auto_Init_Is_Supported return Boolean is
185 begin
186 return False;
187 end Standalone_Library_Auto_Init_Is_Supported;
189 ---------------------------
190 -- Support_For_Libraries --
191 ---------------------------
193 function Support_For_Libraries return Library_Support is
194 begin
195 return Static_Only;
196 end Support_For_Libraries;
198 begin
199 Archive_Builder_Ptr := Archive_Builder'Access;
200 Archive_Indexer_Ptr := Archive_Indexer'Access;
201 Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access;
202 DLL_Ext_Ptr := DLL_Ext'Access;
203 Dynamic_Option_Ptr := Dynamic_Option'Access;
204 Library_Major_Minor_Id_Supported_Ptr :=
205 Library_Major_Minor_Id_Supported'Access;
206 PIC_Option_Ptr := PIC_Option'Access;
207 Standalone_Library_Auto_Init_Is_Supported_Ptr :=
208 Standalone_Library_Auto_Init_Is_Supported'Access;
209 Support_For_Libraries_Ptr := Support_For_Libraries'Access;
210 end MLib.Tgt.Specific;