Commit b5755e2b by Vincent Celier Committed by Arnaud Charlet

mlib.ads, mlib.adb (Build_Library): Do not use hard-coded directory separator...

2007-04-20  Vincent Celier  <celier@adacore.com>

	* mlib.ads, mlib.adb (Build_Library): Do not use hard-coded directory
	separator, use instead the proper host directory separator.
	(Copy_ALI_Files): Make sure that an already existing ALI file in the
	ALI copy dir is writable, before doing the copy.

	* mlib-utl.ads, mlib-utl.adb: 
	(Gcc): If length of command line is too long, put the list of object
	files in a response file, if this is supported by the platform.
	(Ar): If invocation of the archive builder is allowed to be done in
	chunks and building it in one shot would go above an OS dependent
	limit on the number of characters on the command line, build the archive
	in chunks.

From-SVN: r125435
parent da4d406d
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2001-2006, AdaCore -- -- Copyright (C) 2001-2007, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
package MLib.Utl is package MLib.Utl is
procedure Delete_File (Filename : String); procedure Delete_File (Filename : String);
-- Delete the file Filename -- Delete the file Filename and output the name of the deleted file in
-- Why is this different from the standard OS_Lib routine??? -- verbose mode.
procedure Gcc procedure Gcc
(Output_File : String; (Output_File : String;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1999-2006, AdaCore -- -- Copyright (C) 1999-2007, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -30,7 +30,6 @@ with Interfaces.C.Strings; ...@@ -30,7 +30,6 @@ with Interfaces.C.Strings;
with Hostparm; with Hostparm;
with Opt; with Opt;
with Output; use Output; with Output; use Output;
with Namet; use Namet;
with MLib.Utl; use MLib.Utl; with MLib.Utl; use MLib.Utl;
...@@ -59,7 +58,8 @@ package body MLib is ...@@ -59,7 +58,8 @@ package body MLib is
Write_Line (Output_File); Write_Line (Output_File);
end if; end if;
Ar (Output_Dir & "/lib" & Output_File & ".a", Objects => Ofiles); Ar (Output_Dir & Directory_Separator &
"lib" & Output_File & ".a", Objects => Ofiles);
end Build_Library; end Build_Library;
------------------------ ------------------------
...@@ -97,7 +97,7 @@ package body MLib is ...@@ -97,7 +97,7 @@ package body MLib is
procedure Copy_ALI_Files procedure Copy_ALI_Files
(Files : Argument_List; (Files : Argument_List;
To : Name_Id; To : Path_Name_Type;
Interfaces : String_List) Interfaces : String_List)
is is
Success : Boolean := False; Success : Boolean := False;
...@@ -130,6 +130,10 @@ package body MLib is ...@@ -130,6 +130,10 @@ package body MLib is
for Index in Files'Range loop for Index in Files'Range loop
Verbose_Copy (Index); Verbose_Copy (Index);
Set_Writable
(To_Dir &
Directory_Separator &
Base_Name (Files (Index).all));
Copy_File Copy_File
(Files (Index).all, (Files (Index).all,
To_Dir, To_Dir,
...@@ -169,6 +173,10 @@ package body MLib is ...@@ -169,6 +173,10 @@ package body MLib is
if Is_Interface then if Is_Interface then
Success := False; Success := False;
Verbose_Copy (Index); Verbose_Copy (Index);
Set_Writable
(To_Dir &
Directory_Separator &
Base_Name (Files (Index).all));
declare declare
FD : File_Descriptor; FD : File_Descriptor;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1999-2005, AdaCore -- -- Copyright (C) 1999-2007, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -27,9 +27,10 @@ ...@@ -27,9 +27,10 @@
-- This package provides the core high level routines used by GNATMLIB -- This package provides the core high level routines used by GNATMLIB
-- and GNATMAKE to build libraries -- and GNATMAKE to build libraries
with GNAT.OS_Lib; use GNAT.OS_Lib; with Namet; use Namet;
with Osint; use Osint; with Osint; use Osint;
with Types; use Types;
with GNAT.OS_Lib; use GNAT.OS_Lib;
package MLib is package MLib is
...@@ -60,7 +61,7 @@ package MLib is ...@@ -60,7 +61,7 @@ package MLib is
procedure Copy_ALI_Files procedure Copy_ALI_Files
(Files : Argument_List; (Files : Argument_List;
To : Name_Id; To : Path_Name_Type;
Interfaces : String_List); Interfaces : String_List);
-- Copy all ALI files Files to directory To. -- Copy all ALI files Files to directory To.
-- Mark Interfaces ALI files as interfaces, if any. -- Mark Interfaces ALI files as interfaces, if any.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment