1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 2001, Ada Core Technologies, Inc. --
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. --
22 -- GNAT was originally developed by the GNAT team at New York University. --
23 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
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 -- Libraries_Are_Supported returns False.
35 with GNAT
.OS_Lib
; use GNAT
.OS_Lib
;
36 with Types
; use Types
;
40 function Libraries_Are_Supported
return Boolean;
41 -- Indicates if building libraries by gnatmake and gnatmlib
42 -- are supported by the GNAT implementation for the OS.
44 function Default_DLL_Address
return String;
45 -- default address for non relocatable DLL
47 function Dynamic_Option
return String;
48 -- gcc option to create a dynamic library
50 function Base_Option
return String;
52 function Libgnat
return String;
53 -- System dependent static GNAT library
55 function Archive_Ext
return String;
56 -- System dependent static library extension
58 function Object_Ext
return String;
59 -- System dependent object extension
61 function DLL_Ext
return String;
62 -- System dependent dynamic library extension
64 function PIC_Option
return String;
65 -- Position independent code option
67 function Is_Object_Ext
(Ext
: String) return Boolean;
68 -- Returns True iff Ext is an object file extension
70 function Is_C_Ext
(Ext
: String) return Boolean;
71 -- Returns True iff Ext is a C file extension.
73 function Is_Archive_Ext
(Ext
: String) return Boolean;
74 -- Returns True iff Ext is an extension for a library
76 procedure Copy_ALI_Files
79 -- Copy all ALI files from directory From to directory To
81 function Linker_Library_Path_Option
84 -- Linker option to specify the library directory path
86 procedure Build_Dynamic_Library
87 (Ofiles
: Argument_List
;
88 Foreign
: Argument_List
;
89 Afiles
: Argument_List
;
90 Options
: Argument_List
;
91 Lib_Filename
: String;
93 Lib_Address
: String := "";
94 Lib_Version
: String := "";
95 Relocatable
: Boolean := False);
96 -- Build a dynamic/relocatable library