1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
11 -- Copyright (C) 2001, Ada Core Technologies, Inc. --
13 -- GNAT is free software; you can redistribute it and/or modify it under --
14 -- terms of the GNU General Public License as published by the Free Soft- --
15 -- ware Foundation; either version 2, or (at your option) any later ver- --
16 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
17 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
18 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
19 -- for more details. You should have received a copy of the GNU General --
20 -- Public License distributed with GNAT; see file COPYING. If not, write --
21 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
22 -- MA 02111-1307, USA. --
24 -- GNAT was originally developed by the GNAT team at New York University. --
25 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
27 ------------------------------------------------------------------------------
29 -- This package provides a set of target dependent routines to build
30 -- static, dynamic and shared libraries.
32 -- There are several versions for the body of this package.
34 -- In the default version, libraries are not supported, so function
35 -- Libraries_Are_Supported returns False.
37 with GNAT
.OS_Lib
; use GNAT
.OS_Lib
;
38 with Types
; use Types
;
42 function Libraries_Are_Supported
return Boolean;
43 -- Indicates if building libraries by gnatmake and gnatmlib
44 -- are supported by the GNAT implementation for the OS.
46 function Default_DLL_Address
return String;
47 -- default address for non relocatable DLL
49 function Dynamic_Option
return String;
50 -- gcc option to create a dynamic library
52 function Base_Option
return String;
54 function Libgnat
return String;
55 -- System dependent static GNAT library
57 function Archive_Ext
return String;
58 -- System dependent static library extension
60 function Object_Ext
return String;
61 -- System dependent object extension
63 function DLL_Ext
return String;
64 -- System dependent dynamic library extension
66 function PIC_Option
return String;
67 -- Position independent code option
69 function Is_Object_Ext
(Ext
: String) return Boolean;
70 -- Returns True iff Ext is an object file extension
72 function Is_C_Ext
(Ext
: String) return Boolean;
73 -- Returns True iff Ext is a C file extension.
75 function Is_Archive_Ext
(Ext
: String) return Boolean;
76 -- Returns True iff Ext is an extension for a library
78 procedure Copy_ALI_Files
81 -- Copy all ALI files from directory From to directory To
83 function Linker_Library_Path_Option
86 -- Linker option to specify the library directory path
88 procedure Build_Dynamic_Library
89 (Ofiles
: Argument_List
;
90 Foreign
: Argument_List
;
91 Afiles
: Argument_List
;
92 Options
: Argument_List
;
93 Lib_Filename
: String;
95 Lib_Address
: String := "";
96 Lib_Version
: String := "";
97 Relocatable
: Boolean := False);
98 -- Build a dynamic/relocatable library