| 1 |
------------------------------------------------------------------------------ |
| 2 |
-- -- |
| 3 |
-- GNAT COMPILER COMPONENTS -- |
| 4 |
-- -- |
| 5 |
-- M D L L -- |
| 6 |
-- -- |
| 7 |
-- S p e c -- |
| 8 |
-- -- |
| 9 |
-- Copyright (C) 1992-2025, 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 3, 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 COPYING3. If not, go to -- |
| 19 |
-- http://www.gnu.org/licenses for a complete copy of the license. -- |
| 20 |
-- -- |
| 21 |
-- GNAT was originally developed by the GNAT team at New York University. -- |
| 22 |
-- Extensive contributions were provided by Ada Core Technologies Inc. -- |
| 23 |
-- -- |
| 24 |
------------------------------------------------------------------------------ |
| 25 |
|
| 26 |
-- This package provides the core high level routines used by GNATDLL |
| 27 |
-- to build Windows DLL |
| 28 |
|
| 29 |
with GNAT.OS_Lib; |
| 30 |
|
| 31 |
package MDLL is |
| 32 |
|
| 33 |
subtype Argument_List is GNAT.OS_Lib.Argument_List; |
| 34 |
subtype Argument_List_Access is GNAT.OS_Lib.Argument_List_Access; |
| 35 |
|
| 36 |
Null_Argument_List : constant Argument_List := (1 .. 0 => new String'("")); |
| 37 |
|
| 38 |
Null_Argument_List_Access : Argument_List_Access := |
| 39 |
new Argument_List (1 .. 0); |
| 40 |
|
| 41 |
Tools_Error : exception; |
| 42 |
-- Comment required |
| 43 |
|
| 44 |
Verbose : Boolean := False; |
| 45 |
Quiet : Boolean := False; |
| 46 |
-- Comment required ??? |
| 47 |
|
| 48 |
Kill_Suffix : Boolean := False; |
| 49 |
-- Kill_Suffix is used by dlltool to know whether or not the @nn suffix |
| 50 |
-- should be removed from the exported names. When Kill_Suffix is set to |
| 51 |
-- True then dlltool -k option is used. |
| 52 |
|
| 53 |
procedure Build_Dynamic_Library |
| 54 |
(Ofiles : Argument_List; |
| 55 |
Afiles : Argument_List; |
| 56 |
Options : Argument_List; |
| 57 |
Bargs_Options : Argument_List; |
| 58 |
Largs_Options : Argument_List; |
| 59 |
Lib_Filename : String; |
| 60 |
Def_Filename : String; |
| 61 |
Lib_Address : String := ""; |
| 62 |
Build_Import : Boolean := False; |
| 63 |
Relocatable : Boolean := False; |
| 64 |
Map_File : Boolean := False); |
| 65 |
-- Build a DLL and the import library to link against the DLL. |
| 66 |
-- this function handles relocatable and non relocatable DLL. |
| 67 |
-- If the Afiles argument list contains some Ada units then it will |
| 68 |
-- generate the right adainit and adafinal and integrate it in the DLL. |
| 69 |
-- If the Afiles argument list is empty (there is only some object files |
| 70 |
-- provided) then it will not try to build a binder file. This is ok to |
| 71 |
-- build DLL containing no Ada code. If Map_File is set to True, a map |
| 72 |
-- file named Lib_Filename & ".map" will be created. |
| 73 |
|
| 74 |
procedure Build_Import_Library |
| 75 |
(Lib_Filename : String; |
| 76 |
Def_Filename : String); |
| 77 |
-- Build an import library (.a) from definition files. An import library is |
| 78 |
-- needed to link against a DLL. |
| 79 |
|
| 80 |
end MDLL; |