1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 2004-2023, Free Software Foundation, 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 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. --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
24 ------------------------------------------------------------------------------
26 -- GNATLINK platform-independent switches
28 -- Used to convert GNAT switches to their platform-dependent switch
29 -- equivalent for the underlying linker.
31 with System
.OS_Lib
; use System
.OS_Lib
;
36 -- Independent switches currently supported
39 -- Produce a map file. The path name of the map file to produce
40 -- is given as an argument.
43 (Switch
: Switch_Kind
;
45 To
: out String_List_Access
);
46 -- Convert Switch to the platform-dependent linker switch (with or without
47 -- additional arguments) To. Issue a warning if Switch is not supported
48 -- for the platform; in this case, To is set to null.
50 function Is_Supported
(Switch
: Switch_Kind
) return Boolean;
51 -- Return True for each independent switch supported by the platform
54 -- Default warning messages when the switches are not supported by the
55 -- implementation. These are in the spec so that the platform specific
56 -- bodies do not need to redefine them.
58 Map_File_Not_Supported
: aliased String :=
59 "the underlying linker does not allow the output of a map file";
61 No_Support_For
: constant array (Switch_Kind
) of String_Access
:=
62 (Map_File
=> Map_File_Not_Supported
'Access);
63 -- All implementations of procedure Convert should include a case
64 -- statements with a "when others =>" choice that output the default
71 -- Write_Str ("warning: ");
72 -- Write_Line (No_Support_For (Switch).all);