diff options
author | Vincent Celier <celier@adacore.com> | 2008-08-04 11:36:46 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2008-08-04 11:36:46 +0200 |
commit | 48fbb62da172a73e7b585a272fada37f28443d27 (patch) | |
tree | 2bf1558f1f68834a1659f340a7bf340c58da3207 | |
parent | f2170041e1db5fbc2809310d2eba081f41f94403 (diff) | |
download | gcc-48fbb62da172a73e7b585a272fada37f28443d27.zip gcc-48fbb62da172a73e7b585a272fada37f28443d27.tar.gz gcc-48fbb62da172a73e7b585a272fada37f28443d27.tar.bz2 |
mlib.adb (Create_Sym_Links): Create relative symbolic links when requested
2008-08-04 Vincent Celier <celier@adacore.com>
* mlib.adb (Create_Sym_Links): Create relative symbolic links when
requested
From-SVN: r138593
-rw-r--r-- | gcc/ada/mlib.adb | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/gcc/ada/mlib.adb b/gcc/ada/mlib.adb index b0301d2..0bb3a99 100644 --- a/gcc/ada/mlib.adb +++ b/gcc/ada/mlib.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1999-2007, AdaCore -- +-- Copyright (C) 1999-2008, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -310,18 +310,9 @@ package body MLib is pragma Unreferenced (Success, Result); begin - if Is_Absolute_Path (Lib_Version) then - Version_Path := new String (1 .. Lib_Version'Length + 1); - Version_Path (1 .. Lib_Version'Length) := Lib_Version; - - else - Version_Path := - new String (1 .. Lib_Dir'Length + 1 + Lib_Version'Length + 1); - Version_Path (1 .. Version_Path'Last - 1) := - Lib_Dir & Directory_Separator & Lib_Version; - end if; - - Version_Path (Version_Path'Last) := ASCII.NUL; + Version_Path := new String (1 .. Lib_Version'Length + 1); + Version_Path (1 .. Lib_Version'Length) := Lib_Version; + Version_Path (Version_Path'Last) := ASCII.NUL; if Maj_Version'Length = 0 then declare @@ -339,6 +330,7 @@ package body MLib is Maj_Path : constant String := Lib_Dir & Directory_Separator & Maj_Version; Newpath2 : String (1 .. Maj_Path'Length + 1); + Maj_Ver : String (1 .. Maj_Version'Length + 1); begin Newpath1 (1 .. Lib_Path'Length) := Lib_Path; @@ -347,13 +339,16 @@ package body MLib is Newpath2 (1 .. Maj_Path'Length) := Maj_Path; Newpath2 (Newpath2'Last) := ASCII.NUL; + Maj_Ver (1 .. Maj_Version'Length) := Maj_Version; + Maj_Ver (Maj_Ver'Last) := ASCII.NUL; + Delete_File (Maj_Path, Success); Result := Symlink (Version_Path (1)'Address, Newpath2'Address); Delete_File (Lib_Path, Success); - Result := Symlink (Newpath2'Address, Newpath1'Address); + Result := Symlink (Maj_Ver'Address, Newpath1'Address); end; end if; end Create_Sym_Links; |