]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gnat_ugn.texi: Add documentation for new gnatmake switch --create-map-file.
authorVincent Celier <celier@adacore.com>
Thu, 9 Sep 2010 13:55:34 +0000 (13:55 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Thu, 9 Sep 2010 13:55:34 +0000 (15:55 +0200)
2010-09-09  Vincent Celier  <celier@adacore.com>

* gnat_ugn.texi: Add documentation for new gnatmake switch
--create-map-file.
* make.adb (Map_File): New global variable to store the value of switch
--create-map-file.
(Gnatmake): Add switch -M to gnatlink if buider switch --create-map-file
has been specified.
(Scan_Make_Arg): Recognize switch --create-map-file
* makeutl.ads (Create_Map_File_Switch): New constant string for new
gnatmake and gprbuild switch --create-map-file.

From-SVN: r164104

gcc/ada/ChangeLog
gcc/ada/gnat_ugn.texi
gcc/ada/make.adb
gcc/ada/makeutl.ads

index 59562e605743fa2dbf541a7bbe6d36a621cad6a2..6822a1756c958c11eb9f485a70aae0e8ae9cb203 100644 (file)
@@ -1,3 +1,15 @@
+2010-09-09  Vincent Celier  <celier@adacore.com>
+
+       * gnat_ugn.texi: Add documentation for new gnatmake switch
+       --create-map-file.
+       * make.adb (Map_File): New global variable to store the value of switch
+       --create-map-file.
+       (Gnatmake): Add switch -M to gnatlink if buider switch --create-map-file
+       has been specified.
+       (Scan_Make_Arg): Recognize switch --create-map-file
+       * makeutl.ads (Create_Map_File_Switch): New constant string for new
+       gnatmake and gprbuild switch --create-map-file.
+
 2010-09-09  Robert Dewar  <dewar@adacore.com>
 
        * sinput-p.ads: Minor comment update.
index 6a49f046f5f21be707efd98a3895093389572eec..180169ef1017c7cf27ae6dfe591e3af640052db7 100644 (file)
@@ -1778,8 +1778,8 @@ of the compiler (@pxref{Character Set Control}).
 @noindent
 The basic character set is Latin-1. This character set is defined by ISO
 standard 8859, part 1. The lower half (character codes @code{16#00#}
-@dots{} @code{16#7F#)} is identical to standard ASCII coding, but the upper half
-is used to represent additional characters. These include extended letters
+@dots{} @code{16#7F#)} is identical to standard ASCII coding, but the upper
+half is used to represent additional characters. These include extended letters
 used by European languages, such as French accents, the vowels with umlauts
 used in German, and the extra letter A-ring used in Swedish.
 
@@ -3823,7 +3823,8 @@ compiled.
 
 @cindex cannot generate code
 If you attempt to compile any of these files, you will get one of the
-following error messages (where @var{fff} is the name of the file you compiled):
+following error messages (where @var{fff} is the name of the file you
+compiled):
 
 @smallexample
 cannot generate code for file @var{fff} (package spec)
@@ -9253,6 +9254,17 @@ By default, shared library projects are not allowed to import static library
 projects. When this switch is used on the command line, this restriction is
 relaxed.
 
+@ifclear vms
+@item --create-map-file
+When linking an executable, create a map file. The name of the map file
+has the same name as the executable with extension ".map".
+
+@item --create-map-file=mapfile
+When linking an executable, create a map file. The name of the map file is
+"mapfile".
+
+@end ifclear
+
 @item ^-a^/ALL_FILES^
 @cindex @option{^-a^/ALL_FILES^} (@command{gnatmake})
 Consider all files in the make process, even the GNAT internal system
@@ -18647,9 +18659,9 @@ gnatmake -f -pg -P my_project
 @end smallexample
 
 @noindent
-Note that only the objects that were compiled with the @samp{-pg} switch will be
-profiled; if you need to profile your whole project, use the
-@samp{-f} gnatmake switch to force full recompilation.
+Note that only the objects that were compiled with the @samp{-pg} switch will
+be profiled; if you need to profile your whole project, use the @samp{-f}
+gnatmake switch to force full recompilation.
 
 @node Program execution
 @subsection Program execution
@@ -24879,8 +24891,8 @@ Note that in this approach, both declarations are analyzed by the
 compiler so this can only be used where both declarations are legal,
 even though one of them will not be used.
 
-Another approach is to define integer constants, e.g.@: @code{Bits_Per_Word}, or
-Boolean constants, e.g.@: @code{Little_Endian}, and then write declarations
+Another approach is to define integer constants, e.g.@: @code{Bits_Per_Word},
+or Boolean constants, e.g.@: @code{Little_Endian}, and then write declarations
 that are parameterized by these constants. For example
 
 @smallexample @c ada
index 5f08a865268732501d50d0e224801c8254a37af5..16f1d40a34ad1c15d9b82063563cf23bfc4e217b 100644 (file)
@@ -353,6 +353,9 @@ package body Make is
    --  calling Change_Dir if the current working directory is already this
    --  directory.
 
+   Map_File : String_Access := null;
+   --  Value of switch --create-map-file
+
    --  Packages of project files where unknown attributes are errors
 
    Naming_String   : aliased String := "naming";
@@ -6254,6 +6257,15 @@ package body Make is
                   end;
                end if;
 
+               --  Add switch -M to gnatlink if buider switch --create-map-file
+               --  has been specified.
+
+               if Map_File /= null then
+                  Linker_Switches.Increment_Last;
+                  Linker_Switches.Table (Linker_Switches.Last) :=
+                    new String'("-M" & Map_File.all);
+               end if;
+
                declare
                   Args : Argument_List
                            (Linker_Switches.First .. Linker_Switches.Last + 2);
@@ -8121,6 +8133,19 @@ package body Make is
             Add_Switch (Argv, Compiler, And_Save => And_Save);
             Add_Switch (Argv, Linker,   And_Save => And_Save);
 
+         elsif Argv = Create_Map_File_Switch then
+            Map_File := new String'("");
+
+         elsif Argv'Length > Create_Map_File_Switch'Length + 1
+           and then
+             Argv (1 .. Create_Map_File_Switch'Length) = Create_Map_File_Switch
+           and then
+             Argv (Create_Map_File_Switch'Length + 1) = '='
+         then
+            Map_File :=
+              new String'
+                (Argv (Create_Map_File_Switch'Length + 2 .. Argv'Last));
+
          else
             Scan_Make_Switches (Project_Node_Tree, Argv, Success);
          end if;
index 13d53b0229ceafa093d5f6c20927ad2c624c0cd6..f1557a5a3344a9f609e87f4b930e289b758d7e12 100644 (file)
@@ -57,6 +57,9 @@ package Makeutl is
    --  Switch to forbid simultaneous compilations for the same object directory
    --  when project files are used.
 
+   Create_Map_File_Switch : constant String := "--create-map-file";
+   --  Switch to create a map file when an executable is linked
+
    procedure Add
      (Option : String_Access;
       To     : in out String_List_Access;