OSDN Git Service

* config/pa/fptr.c: Update license header.
[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 PIC_Option return String;
48
49    -----------------
50    -- Archive_Ext --
51    -----------------
52
53    function Archive_Ext return String is
54    begin
55       return "olb";
56    end Archive_Ext;
57
58    ------------------------------
59    -- Default_Symbol_File_Name --
60    ------------------------------
61
62    function Default_Symbol_File_Name return String is
63    begin
64       return "symvec.opt";
65    end Default_Symbol_File_Name;
66
67    -------------
68    -- DLL_Ext --
69    -------------
70
71    function DLL_Ext return String is
72    begin
73       return "exe";
74    end DLL_Ext;
75
76    -------------------
77    -- Is_Object_Ext --
78    -------------------
79
80    function Is_Object_Ext (Ext : String) return Boolean is
81    begin
82       return Ext = ".obj";
83    end Is_Object_Ext;
84
85    --------------------
86    -- Is_Archive_Ext --
87    --------------------
88
89    function Is_Archive_Ext (Ext : String) return Boolean is
90    begin
91       return Ext = ".olb" or else Ext = ".exe";
92    end Is_Archive_Ext;
93
94    -------------
95    -- Libgnat --
96    -------------
97
98    function Libgnat return String is
99       Libgnat_A : constant String := "libgnat.a";
100       Libgnat_Olb : constant String := "libgnat.olb";
101
102    begin
103       Name_Len := Libgnat_A'Length;
104       Name_Buffer (1 .. Name_Len) := Libgnat_A;
105
106       if Osint.Find_File (Name_Enter, Osint.Library) /= No_File then
107          return Libgnat_A;
108       else
109          return Libgnat_Olb;
110       end if;
111    end Libgnat;
112
113    ----------------
114    -- Object_Ext --
115    ----------------
116
117    function Object_Ext return String is
118    begin
119       return "obj";
120    end Object_Ext;
121
122    ----------------
123    -- PIC_Option --
124    ----------------
125
126    function PIC_Option return String is
127    begin
128       return "";
129    end PIC_Option;
130
131 --  Package initialization
132
133 begin
134    Archive_Ext_Ptr              := Archive_Ext'Access;
135    Default_Symbol_File_Name_Ptr := Default_Symbol_File_Name'Access;
136    DLL_Ext_Ptr                  := DLL_Ext'Access;
137    Is_Object_Ext_Ptr            := Is_Object_Ext'Access;
138    Is_Archive_Ext_Ptr           := Is_Archive_Ext'Access;
139    Libgnat_Ptr                  := Libgnat'Access;
140    Object_Ext_Ptr               := Object_Ext'Access;
141    PIC_Option_Ptr               := PIC_Option'Access;
142 end MLib.Tgt.VMS;