Patchwork [Ada] Recompile if ALI file newer than object file

login
register
mail settings
Submitter Arnaud Charlet
Date Oct. 4, 2010, 2:10 p.m.
Message ID <20101004141026.GA8327@adacore.com>
Download mbox | patch
Permalink /patch/66682/
State New
Headers show

Comments

Arnaud Charlet - Oct. 4, 2010, 2:10 p.m.
When the builder gnatmake detects that an ALI file is newer than the
corresponding object file, the source is recompiled.
The test for this is to build an executable using gnatmake, wait for
three seconds or more, touch one ALI file, then reinvoke gnatmake.
The source corresponding to the ALI file shoud be recompiled.

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

2010-10-04  Vincent Celier  <celier@adacore.com>

	* osint.adb (Read_Library_Info_From_Full): If object timestamp is less
	than ALI file timestamp, return null.

Patch

Index: osint.adb
===================================================================
--- osint.adb	(revision 164906)
+++ osint.adb	(working copy)
@@ -2508,6 +2508,13 @@  package body Osint is
 
                return null;
             end if;
+
+         elsif Current_Full_Obj_Stamp < Current_Full_Lib_Stamp then
+            Close (Lib_FD, Status);
+
+            --  No need to check the status, we return null anyway
+
+            return null;
          end if;
       end if;