aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/prj-nmsc.adb
diff options
context:
space:
mode:
authorVincent Celier <celier@adacore.com>2010-10-26 13:08:59 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2010-10-26 15:08:59 +0200
commit1ce9dff334e66750cfc2a42509c8bed0d7a16f63 (patch)
tree4a4d16379b668c85c0e7cad179766e7dc7945011 /gcc/ada/prj-nmsc.adb
parent39ab2e8fc9d4efb8dc6e089ce69738c2506ec0f1 (diff)
downloadgcc-1ce9dff334e66750cfc2a42509c8bed0d7a16f63.zip
gcc-1ce9dff334e66750cfc2a42509c8bed0d7a16f63.tar.gz
gcc-1ce9dff334e66750cfc2a42509c8bed0d7a16f63.tar.bz2
opt.ads (Old_Checksums, [...]): New Boolean flags, defaulted to False.
2010-10-26 Vincent Celier <celier@adacore.com> * opt.ads (Old_Checksums, Old_Old_Checksums): New Boolean flags, defaulted to False. * prj-nmsc.adb (Process_Project_Level_Array_Attributes): When processing attribute Toolchain_Version ("Ada"), set Opt.Old_Checksums and Opt.Old_Old_Checksums depending on the GNAT version. * scng.adb (Accumulate_Token_Checksum_Old): New procedure. (Accumulate_Token_Checksum_Old_Old): New procedure. (Scan): For keywords, when Opt.Old_Checksums is True, call one of the alternative procedures Accumulate_Token_Checksum_Old or Accumulate_Token_Checksum_Old_Old, instead of Accumulate_Token_Checksum. From-SVN: r165959
Diffstat (limited to 'gcc/ada/prj-nmsc.adb')
-rw-r--r--gcc/ada/prj-nmsc.adb47
1 files changed, 47 insertions, 0 deletions
diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb
index 246d28a..e0df107 100644
--- a/gcc/ada/prj-nmsc.adb
+++ b/gcc/ada/prj-nmsc.adb
@@ -2399,6 +2399,53 @@ package body Prj.Nmsc is
Lang_Index.Config.Toolchain_Version :=
Element.Value.Value;
+ -- We need a complete comment section discussing the
+ -- need for three versions of the checksum algorithm
+ -- and what is going on here??? Also Old and Old_Old
+ -- are rather poor names I would say. How about
+
+ -- Opt.Checksum_503
+ -- Opt.Checksum_63
+
+ -- If the Ada compiler is version 6.3 or before, then
+ -- checksums need to be computed using the old way.
+
+ -- Also, how about an abstraction for checking
+ -- version numbers, something like ???
+
+ -- if Version_Is_Before (5, 3) ....
+
+ if Lang_Index.Name = Name_Ada then
+ declare
+ Vers : constant String :=
+ Get_Name_String (Element.Value.Value);
+ pragma Assert (Vers'First = 1);
+
+ begin
+ if Vers'Length >= 8
+ and then Vers (1 .. 5) = "GNAT "
+ and then Vers (7) = '.'
+ and then
+ (Vers (6) < '6'
+ or else
+ (Vers (6) = '6' and then Vers (8) < '4'))
+ then
+ Opt.Old_Checksums := True;
+
+ -- If the Ada compiler is version 5.03 or
+ -- before, then checksums need to be computed
+ -- using the other old way.
+
+ if Vers (6) < '5'
+ or else (Vers (6) = '5'
+ and then Vers (Vers'Last) < '4')
+ then
+ Opt.Old_Old_Checksums := True;
+ end if;
+ end if;
+ end;
+ end if;
+
when Name_Runtime_Library_Dir =>
-- Attribute Runtime_Library_Dir (<language>)