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 @@
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -30,8 +30,8 @@
package MLib.Utl is
procedure Delete_File (Filename : String);
-- Delete the file Filename
-- Why is this different from the standard OS_Lib routine???
-- Delete the file Filename and output the name of the deleted file in
-- verbose mode.
procedure Gcc
(Output_File : String;
......
......@@ -6,7 +6,7 @@
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -30,7 +30,6 @@ with Interfaces.C.Strings;
with Hostparm;
with Opt;
with Output; use Output;
with Namet; use Namet;
with MLib.Utl; use MLib.Utl;
......@@ -59,7 +58,8 @@ package body MLib is
Write_Line (Output_File);
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;
------------------------
......@@ -97,7 +97,7 @@ package body MLib is
procedure Copy_ALI_Files
(Files : Argument_List;
To : Name_Id;
To : Path_Name_Type;
Interfaces : String_List)
is
Success : Boolean := False;
......@@ -130,6 +130,10 @@ package body MLib is
for Index in Files'Range loop
Verbose_Copy (Index);
Set_Writable
(To_Dir &
Directory_Separator &
Base_Name (Files (Index).all));
Copy_File
(Files (Index).all,
To_Dir,
......@@ -169,15 +173,19 @@ package body MLib is
if Is_Interface then
Success := False;
Verbose_Copy (Index);
Set_Writable
(To_Dir &
Directory_Separator &
Base_Name (Files (Index).all));
declare
FD : File_Descriptor;
Len : Integer;
Actual_Len : Integer;
S : String_Access;
Curr : Natural;
FD : File_Descriptor;
Len : Integer;
Actual_Len : Integer;
S : String_Access;
Curr : Natural;
P_Line_Found : Boolean;
Status : Boolean;
Status : Boolean;
begin
-- Open the file
......
......@@ -6,7 +6,7 @@
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -27,9 +27,10 @@
-- This package provides the core high level routines used by GNATMLIB
-- and GNATMAKE to build libraries
with Namet; use Namet;
with Osint; use Osint;
with GNAT.OS_Lib; use GNAT.OS_Lib;
with Osint; use Osint;
with Types; use Types;
package MLib is
......@@ -60,7 +61,7 @@ package MLib is
procedure Copy_ALI_Files
(Files : Argument_List;
To : Name_Id;
To : Path_Name_Type;
Interfaces : String_List);
-- Copy all ALI files Files to directory To.
-- 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