1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 2004-2019, 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. --
18 -- As a special exception under Section 7 of GPL version 3, you are granted --
19 -- additional permissions described in the GCC Runtime Library Exception, --
20 -- version 3.1, as published by the Free Software Foundation. --
22 -- You should have received a copy of the GNU General Public License and --
23 -- a copy of the GCC Runtime Library Exception along with this program; --
24 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
25 -- <http://www.gnu.org/licenses/>. --
27 -- GNAT was originally developed by the GNAT team at New York University. --
28 -- Extensive contributions were provided by Ada Core Technologies Inc. --
30 ------------------------------------------------------------------------------
32 -- GNATLINK platform-independent switches
34 -- Used to convert GNAT switches to their platform-dependent switch
35 -- equivalent for the underlying linker.
37 with System
.OS_Lib
; use System
.OS_Lib
;
42 -- Independent switches currently supported
45 -- Produce a map file. The path name of the map file to produce
46 -- is given as an argument.
49 (Switch
: Switch_Kind
;
51 To
: out String_List_Access
);
52 -- Convert Switch to the platform-dependent linker switch (with or without
53 -- additional arguments) To. Issue a warning if Switch is not supported
54 -- for the platform; in this case, To is set to null.
56 function Is_Supported
(Switch
: Switch_Kind
) return Boolean;
57 -- Return True for each independent switch supported by the platform
60 -- Default warning messages when the switches are not supported by the
61 -- implementation. These are in the spec so that the platform specific
62 -- bodies do not need to redefine them.
64 Map_File_Not_Supported
: aliased String :=
65 "the underlying linker does not allow the output of a map file";
67 No_Support_For
: constant array (Switch_Kind
) of String_Access
:=
68 (Map_File
=> Map_File_Not_Supported
'Access);
69 -- All implementations of procedure Convert should include a case
70 -- statements with a "when others =>" choice that output the default
77 -- Write_Str ("warning: ");
78 -- Write_Line (No_Support_For (Switch).all);