* gnu/regexp/CharIndexedReader.java: Removed.
[official-gcc.git] / gcc / ada / mlib-tgt.ads
blob5d142ae9a5c476c978b53328008db2509bbc8265
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- M L I B . T G T --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 2001-2004, Ada Core Technologies, 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, 59 Temple Place - Suite 330, Boston, --
20 -- MA 02111-1307, 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 ------------------------------------------------------------------------------
27 -- This package provides a set of target dependent routines to build
28 -- static, dynamic and shared libraries.
30 -- There are several versions for the body of this package.
32 -- In the default version, libraries are not supported, so function
33 -- Support_For_Libraries return None.
35 with GNAT.OS_Lib; use GNAT.OS_Lib;
36 with Prj; use Prj;
38 package MLib.Tgt is
40 type Library_Support is (None, Static_Only, Full);
41 -- Support for Library Project File.
42 -- - None: Library Project Files are not supported at all
43 -- - Static_Only: Library Project Files are only supported for static
44 -- libraries.
45 -- - Full: Library Project Files are supported for static and dynamic
46 -- (shared) libraries.
48 function Support_For_Libraries return Library_Support;
49 -- Indicates how building libraries by gnatmake is supported by the GNAT
50 -- implementation for the platform.
52 function Standalone_Library_Auto_Init_Is_Supported return Boolean;
53 -- Indicates if when building a dynamic Standalone Library,
54 -- automatic initialization is supported. If it is, then it is the default,
55 -- unless attribute Library_Auto_Init has the value "false".
57 function Archive_Builder return String;
58 -- Returns the name of the archive builder program, usually "ar"
60 function Archive_Builder_Options return String_List_Access;
61 -- A list of options to invoke the Archive_Builder, usually "cr" for "ar"
63 function Archive_Indexer return String;
64 -- Returns the name of the program, if any, that generates an index
65 -- to the contents of an archive, usually "ranlib".
67 function Default_DLL_Address return String;
68 -- Default address for non relocatable DLL.
69 -- For OSes where a dynamic library is always relocatable,
70 -- this function returns an empty string.
72 function Dynamic_Option return String;
73 -- gcc option to create a dynamic library.
74 -- For Unix, returns "-shared", for Windows returns "-mdll".
76 function Libgnat return String;
77 -- System dependent static GNAT library
79 function Archive_Ext return String;
80 -- System dependent static library extension, without leading dot.
81 -- For Unix and Windows, return "a".
83 function Object_Ext return String;
84 -- System dependent object extension, without leadien dot.
85 -- On Unix, returns "o".
87 function DLL_Ext return String;
88 -- System dependent dynamic library extension, without leading dot.
89 -- On Windows, returns "dll". On Unix, usually returns "so", but not
90 -- always, e.g. on HP-UX the extension for shared libraries is "sl".
92 function PIC_Option return String;
93 -- Position independent code option
95 function Is_Object_Ext (Ext : String) return Boolean;
96 -- Returns True iff Ext is an object file extension
98 function Is_C_Ext (Ext : String) return Boolean;
99 -- Returns True iff Ext is a C file extension.
101 function Is_Archive_Ext (Ext : String) return Boolean;
102 -- Returns True iff Ext is an extension for a library
104 procedure Build_Dynamic_Library
105 (Ofiles : Argument_List;
106 Foreign : Argument_List;
107 Afiles : Argument_List;
108 Options : Argument_List;
109 Interfaces : Argument_List;
110 Lib_Filename : String;
111 Lib_Dir : String;
112 Symbol_Data : Symbol_Record;
113 Driver_Name : Name_Id := No_Name;
114 Lib_Address : String := "";
115 Lib_Version : String := "";
116 Relocatable : Boolean := False;
117 Auto_Init : Boolean := False);
118 -- Build a dynamic/relocatable library
120 -- Ofiles is the list of all object files in the library
122 -- Foreign is the list of non Ada object files (also included in Ofiles)
124 -- Afiles is the list of ALI files for the Ada object files
126 -- Options is a list of options to be passed to the tool (gcc or other)
127 -- that effectively builds the dynamic library.
129 -- Interfaces is the list of ALI files for the interfaces of a SAL.
130 -- It is empty if the library is not a SAL.
132 -- Lib_Filename is the name of the library, without any prefix or
133 -- extension. For example, on Unix, if Lib_Filename is "toto", the
134 -- name of the library file will be "libtoto.so".
136 -- Lib_Dir is the directory path where the library will be located
138 -- Lib_Address is the base address of the library for a non relocatable
139 -- library, given as an hexadecimal string.
141 -- For OSes that support symbolic links, Lib_Version, if non null,
142 -- is the actual file name of the library. For example on Unix, if
143 -- Lib_Filename is "toto" and Lib_Version is "libtoto.so.2.1",
144 -- "libtoto.so" will be a symbolic link to "libtoto.so.2.1" which
145 -- will be the actual library file.
147 -- Relocatable indicates if the library should be relocatable or not,
148 -- for those OSes that actually support non relocatable dynamic libraries.
149 -- Relocatable indicates that automatic elaboration/finalization must be
150 -- indicated to the linker, if possible.
152 -- Symbol_Data is used for some patforms, including VMS, to generate
153 -- the symbols to be exported by the library.
155 -- Note: Depending on the OS, some of the parameters may not be taken
156 -- into account. For example, on Linux, Foreign, Afiles Lib_Address and
157 -- Relocatable are ignored.
159 function Library_Exists_For (Project : Project_Id) return Boolean;
160 -- Return True if the library file for a library project already exists.
161 -- This function can only be called for library projects.
163 function Library_File_Name_For (Project : Project_Id) return Name_Id;
164 -- Returns the file name of the library file of a library project.
165 -- This function can only be called for library projects.
167 end MLib.Tgt;