OSDN Git Service

2007-08-16 Robert Dewar <dewar@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / mlib-tgt-vms.adb
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --                         M L I B . T G T . V M S                          --
6 --                                                                          --
7 --                                 B o d y                                  --
8 --                                                                          --
9 --          Copyright (C) 2003-2007, Free Software Foundation, Inc.         --
10 --                                                                          --
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 2,  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 COPYING.  If not, write --
19 -- to  the  Free Software Foundation,  51  Franklin  Street,  Fifth  Floor, --
20 -- Boston, MA 02110-1301, USA.                                              --
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 part of MLib.Tgt.Specific common to both VMS versions
28
29 package body MLib.Tgt.VMS is
30
31    --  Non default subprograms. See comments in mlib-tgt.ads
32
33    function Archive_Ext return String;
34
35    function Default_Symbol_File_Name return String;
36
37    function DLL_Ext return String;
38
39    function Is_Object_Ext (Ext : String) return Boolean;
40
41    function Is_Archive_Ext (Ext : String) return Boolean;
42
43    function Libgnat return String;
44
45    function Object_Ext return String;
46
47    function Library_Major_Minor_Id_Supported return Boolean;
48
49    function PIC_Option return String;
50
51    -----------------
52    -- Archive_Ext --
53    -----------------
54
55    function Archive_Ext return String is
56    begin
57       return "olb";
58    end Archive_Ext;
59
60    ------------------------------
61    -- Default_Symbol_File_Name --
62    ------------------------------
63
64    function Default_Symbol_File_Name return String is
65    begin
66       return "symvec.opt";
67    end Default_Symbol_File_Name;
68
69    -------------
70    -- DLL_Ext --
71    -------------
72
73    function DLL_Ext return String is
74    begin
75       return "exe";
76    end DLL_Ext;
77
78    -------------------
79    -- Is_Object_Ext --
80    -------------------
81
82    function Is_Object_Ext (Ext : String) return Boolean is
83    begin
84       return Ext = ".obj";
85    end Is_Object_Ext;
86
87    --------------------
88    -- Is_Archive_Ext --
89    --------------------
90
91    function Is_Archive_Ext (Ext : String) return Boolean is
92    begin
93       return Ext = ".olb" or else Ext = ".exe";
94    end Is_Archive_Ext;
95
96    -------------
97    -- Libgnat --
98    -------------
99
100    function Libgnat return String is
101       Libgnat_A : constant String := "libgnat.a";
102       Libgnat_Olb : constant String := "libgnat.olb";
103
104    begin
105       Name_Len := Libgnat_A'Length;
106       Name_Buffer (1 .. Name_Len) := Libgnat_A;
107
108       if Osint.Find_File (Name_Enter, Osint.Library) /= No_File then
109          return Libgnat_A;
110       else
111          return Libgnat_Olb;
112       end if;
113    end Libgnat;
114
115    --------------------------------------
116    -- Library_Major_Minor_Id_Supported --
117    --------------------------------------
118
119    function Library_Major_Minor_Id_Supported return Boolean is
120    begin
121       return False;
122    end Library_Major_Minor_Id_Supported;
123
124    ----------------
125    -- Object_Ext --
126    ----------------
127
128    function Object_Ext return String is
129    begin
130       return "obj";
131    end Object_Ext;
132
133    ----------------
134    -- PIC_Option --
135    ----------------
136
137    function PIC_Option return String is
138    begin
139       return "";
140    end PIC_Option;
141
142 --  Package initialization
143
144 begin
145    Archive_Ext_Ptr              := Archive_Ext'Access;
146    Default_Symbol_File_Name_Ptr := Default_Symbol_File_Name'Access;
147    DLL_Ext_Ptr                  := DLL_Ext'Access;
148    Is_Object_Ext_Ptr            := Is_Object_Ext'Access;
149    Is_Archive_Ext_Ptr           := Is_Archive_Ext'Access;
150    Libgnat_Ptr                  := Libgnat'Access;
151    Object_Ext_Ptr               := Object_Ext'Access;
152    PIC_Option_Ptr               := PIC_Option'Access;
153    Library_Major_Minor_Id_Supported_Ptr :=
154                                    Library_Major_Minor_Id_Supported'Access;
155
156 end MLib.Tgt.VMS;