From patchwork Mon Oct 4 14:10:26 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Ada] Recompile if ALI file newer than object file Date: Mon, 04 Oct 2010 04:10:26 -0000 From: Arnaud Charlet X-Patchwork-Id: 66682 Message-Id: <20101004141026.GA8327@adacore.com> To: gcc-patches@gcc.gnu.org Cc: Vincent Celier 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 * osint.adb (Read_Library_Info_From_Full): If object timestamp is less than ALI file timestamp, return null. 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;