OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [ada/] [mlib-tgt-specific-xi.adb] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 281 jeremybenn
------------------------------------------------------------------------------
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-2008, 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
------------------------------------------------------------------------------
26
 
27
--  This is the bare board version of the body
28
 
29
with Sdefault;
30
with Types; use Types;
31
 
32
package body MLib.Tgt.Specific is
33
 
34
   -----------------------
35
   -- Local Subprograms --
36
   -----------------------
37
 
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.
41
 
42
   --  Non default subprograms
43
 
44
   function Archive_Builder return String;
45
 
46
   function Archive_Indexer return String;
47
 
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);
58
 
59
   function DLL_Ext return String;
60
 
61
   function Dynamic_Option return String;
62
 
63
   function Library_Major_Minor_Id_Supported return Boolean;
64
 
65
   function PIC_Option return String;
66
 
67
   function Standalone_Library_Auto_Init_Is_Supported return Boolean;
68
 
69
   function Support_For_Libraries return Library_Support;
70
 
71
   ---------------------
72
   -- Archive_Builder --
73
   ---------------------
74
 
75
   function Archive_Builder return String is
76
   begin
77
      return Get_Target_Prefix & "ar";
78
   end Archive_Builder;
79
 
80
   ---------------------
81
   -- Archive_Indexer --
82
   ---------------------
83
 
84
   function Archive_Indexer return String is
85
   begin
86
      return Get_Target_Prefix & "ranlib";
87
   end Archive_Indexer;
88
 
89
   ---------------------------
90
   -- Build_Dynamic_Library --
91
   ---------------------------
92
 
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)
103
   is
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);
113
 
114
   begin
115
      null;
116
   end Build_Dynamic_Library;
117
 
118
   -------------
119
   -- DLL_Ext --
120
   -------------
121
 
122
   function DLL_Ext return String is
123
   begin
124
      return "";
125
   end DLL_Ext;
126
 
127
   --------------------
128
   -- Dynamic_Option --
129
   --------------------
130
 
131
   function Dynamic_Option return String is
132
   begin
133
      return "";
134
   end Dynamic_Option;
135
 
136
   -----------------------
137
   -- Get_Target_Prefix --
138
   -----------------------
139
 
140
   function Get_Target_Prefix return String is
141
      Target_Name : constant String_Ptr := Sdefault.Target_Name;
142
      Index       : Positive            := Target_Name'First;
143
 
144
   begin
145
      while Index < Target_Name'Last
146
        and then Target_Name (Index + 1) /= '-'
147
      loop
148
         Index := Index + 1;
149
      end loop;
150
 
151
      if Target_Name (Target_Name'First .. Index) = "avr" then
152
         return "avr-";
153
      elsif Target_Name (Target_Name'First .. Index) = "erc32" then
154
         return "erc32-elf-";
155
      elsif Target_Name (Target_Name'First .. Index) = "leon" then
156
         return "leon-elf-";
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"
161
         then
162
            return "powerpc-eabispe-";
163
         else
164
            return "powerpc-elf-";
165
         end if;
166
      else
167
         return "";
168
      end if;
169
   end Get_Target_Prefix;
170
 
171
   --------------------------------------
172
   -- Library_Major_Minor_Id_Supported --
173
   --------------------------------------
174
 
175
   function Library_Major_Minor_Id_Supported return Boolean is
176
   begin
177
      return False;
178
   end Library_Major_Minor_Id_Supported;
179
 
180
   ----------------
181
   -- PIC_Option --
182
   ----------------
183
 
184
   function PIC_Option return String is
185
   begin
186
      return "";
187
   end PIC_Option;
188
 
189
   -----------------------------------------------
190
   -- Standalone_Library_Auto_Init_Is_Supported --
191
   -----------------------------------------------
192
 
193
   function Standalone_Library_Auto_Init_Is_Supported return Boolean is
194
   begin
195
      return False;
196
   end Standalone_Library_Auto_Init_Is_Supported;
197
 
198
   ---------------------------
199
   -- Support_For_Libraries --
200
   ---------------------------
201
 
202
   function Support_For_Libraries return Library_Support is
203
   begin
204
      return Static_Only;
205
   end Support_For_Libraries;
206
 
207
begin
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;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.