diff options
Diffstat (limited to 'gcc/ada/makeutl.adb')
-rw-r--r-- | gcc/ada/makeutl.adb | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/gcc/ada/makeutl.adb b/gcc/ada/makeutl.adb index a570737d711..307ec6ffccc 100644 --- a/gcc/ada/makeutl.adb +++ b/gcc/ada/makeutl.adb @@ -25,6 +25,7 @@ with ALI; use ALI; with Debug; +with Fname; with Osint; use Osint; with Output; use Output; with Opt; use Opt; @@ -213,31 +214,35 @@ package body Makeutl is if Unit_Name /= No_Name then -- For separates, the file is no longer associated with the - -- unit ("proc-sep.adb" is not associated with unit "proc.sep". - -- So we need to check whether the source file still exists in + -- unit ("proc-sep.adb" is not associated with unit "proc.sep") + -- so we need to check whether the source file still exists in -- the source tree: it will if it matches the naming scheme -- (and then will be for the same unit). if Find_Source - (In_Tree => Project_Tree, - Project => No_Project, - Base_Name => SD.Sfile) = No_Source + (In_Tree => Project_Tree, + Project => No_Project, + Base_Name => SD.Sfile) = No_Source then - -- If this is not a runtime file (when using -a) ? Otherwise - -- we get complaints about a-except.adb, which uses - -- separates. - - if not Check_Readonly_Files - or else Find_File (SD.Sfile, Osint.Source) = No_File + -- If this is not a runtime file or if, when gnatmake switch + -- -a is used, we are not able to find this subunit in the + -- source directories, then recompilation is needed. + + if not Fname.Is_Internal_File_Name (SD.Sfile) + or else + (Check_Readonly_Files + and then Find_File (SD.Sfile, Osint.Source) = No_File) then if Verbose_Mode then Write_Line - ("While parsing ALI file: Sdep associates " + ("While parsing ALI file, file " & Get_Name_String (SD.Sfile) - & " with unit " & Get_Name_String (Unit_Name) + & " is indicated as containing subunit " + & Get_Name_String (Unit_Name) & " but this does not match what was found while" & " parsing the project. Will recompile"); end if; + return False; end if; end if; @@ -323,7 +328,9 @@ package body Makeutl is return ""; end if; - return Normalize_Pathname (Exec (Exec'First .. Path_Last - 4)) + return Normalize_Pathname + (Exec (Exec'First .. Path_Last - 4), + Resolve_Links => Opt.Follow_Links_For_Dirs) & Directory_Separator; end Get_Install_Dir; |