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