When gnatmake is invoked with -s and some additional compilation switches
(-gnateA, -gnateE, -gnateF, -gnateinn, -gnateu, -gnateV or -gnateY),
recompilation does not necessarily occur. This patch fix this.
The test is to invoke gnatmake with -s and one or these switches:
recompilation should occur.

Tested on x86_64-pc-linux-gnu, committed on trunk

2014-02-20  Vincent Celier  <cel...@adacore.com>

        * switch-m.adb (Normalize_Compiler_Switches): Take into account
        switches that are recorded in ALI files: -gnateA, -gnateE,
        -gnateF, -gnateinn, -gnateu, -gnateV and -gnateY.

Index: switch-m.adb
===================================================================
--- switch-m.adb        (revision 207879)
+++ switch-m.adb        (working copy)
@@ -310,6 +310,10 @@
                      else
                         case Switch_Chars (Ptr) is
 
+                           when 'A' =>
+                              Ptr := Ptr + 1;
+                              Add_Switch_Component ("-gnateA");
+
                            when 'D' =>
                               Storing (First_Stored + 1 ..
                                          First_Stored + Max - Ptr + 1) :=
@@ -319,16 +323,17 @@
                                    First_Stored + Max - Ptr + 1));
                               Ptr := Max + 1;
 
-                           when 'G' =>
+                           when 'E' | 'F' | 'G' | 'S' | 'u' | 'V' | 'Y' =>
+                              Add_Switch_Component
+                                ("-gnate" & Switch_Chars (Ptr));
                               Ptr := Ptr + 1;
-                              Add_Switch_Component ("-gnateG");
 
-                           when 'I' =>
-                              Ptr := Ptr + 1;
-
+                           when 'i' | 'I' =>
                               declare
-                                 First : constant Positive := Ptr - 1;
+                                 First : constant Positive := Ptr;
                               begin
+                                 Ptr := Ptr + 1;
+
                                  if Ptr <= Max and then
                                    Switch_Chars (Ptr) = '='
                                  then
@@ -376,10 +381,6 @@
 
                               return;
 
-                           when 'S' =>
-                              Ptr := Ptr + 1;
-                              Add_Switch_Component ("-gnateS");
-
                            when others =>
                               Last := 0;
                               return;

Reply via email to