-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
-- --
-- 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- --
Write_Eol;
Write_Eol;
+ -- Line for @response_file
+
+ Write_Line (" @<resp_file> Get arguments from response file");
+ Write_Eol;
+
-- Line for -aO switch
Write_Line (" -aOdir Specify library files search path");
Write_Line (" -r List restrictions that could be applied " &
"to this partition");
+ -- Line for -R switch
+
+ Write_Line
+ (" -R List sources referenced in closure (implies -c)");
+
-- Line for -s switch
Write_Line (" -s Require all source files to be present");
-- Line for --RTS
+ -- Line for -Z switch
+
+ Write_Line (" -Z " &
+ "Zero formatting in auxiliary outputs (-e, -K, -l, -R)");
+
+ -- Line for --RTS
+
Write_Line (" --RTS=dir specify the default source and " &
"object search path");
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
-- --
-- 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- --
with Csets;
with Debug; use Debug;
with Fmap;
+with Fname; use Fname;
with Gnatvsn; use Gnatvsn;
with Namet; use Namet;
with Opt; use Opt;
with Types; use Types;
with System.Case_Util; use System.Case_Util;
+with System.OS_Lib; use System.OS_Lib;
+
+with Ada.Command_Line.Response_File; use Ada.Command_Line;
procedure Gnatbind is
Next_Argv : String (1 .. Len_Arg (Next_Arg));
begin
Fill_Arg (Next_Argv'Address, Next_Arg);
- Scan_Bind_Arg (Next_Argv);
+
+ if Next_Argv'Length > 0 then
+ if Next_Argv (1) = '@' then
+ if Next_Argv'Length > 1 then
+ declare
+ Arguments : constant Argument_List :=
+ Response_File.Arguments_From
+ (Response_File_Name =>
+ Next_Argv (2 .. Next_Argv'Last),
+ Recursive => True,
+ Ignore_Non_Existing_Files => True);
+ begin
+ for J in Arguments'Range loop
+ Scan_Bind_Arg (Arguments (J).all);
+ end loop;
+ end;
+ end if;
+
+ else
+ Scan_Bind_Arg (Next_Argv);
+ end if;
+ end if;
end;
Next_Arg := Next_Arg + 1;
and then ALIs.Table (ALIs.First).Main_Program = None
and then not No_Main_Subprogram
then
- Error_Msg_Name_1 := Main_Lib_File;
+ Error_Msg_File_1 := Main_Lib_File;
Error_Msg ("% does not contain a unit that can be a main program");
end if;
Find_Elab_Order;
if Errors_Detected = 0 then
+ -- Display elaboration order if -l was specified
+
if Elab_Order_Output then
- Write_Eol;
- Write_Str ("ELABORATION ORDER");
- Write_Eol;
+ if not Zero_Formatting then
+ Write_Eol;
+ Write_Str ("ELABORATION ORDER");
+ Write_Eol;
+ end if;
for J in Elab_Order.First .. Elab_Order.Last loop
if not Units.Table (Elab_Order.Table (J)).SAL_Interface then
- Write_Str (" ");
+ if not Zero_Formatting then
+ Write_Str (" ");
+ end if;
+
Write_Unit_Name
(Units.Table (Elab_Order.Table (J)).Uname);
Write_Eol;
end if;
end loop;
- Write_Eol;
+ if not Zero_Formatting then
+ Write_Eol;
+ end if;
end if;
if not Check_Only then
Gen_Output_File (Output_File_Name.all);
end if;
+
+ -- Display list of sources in the closure (except predefined
+ -- sources) if -R was used.
+
+ if List_Closure then
+ if not Zero_Formatting then
+ Write_Eol;
+ Write_Str ("REFERENCED SOURCES");
+ Write_Eol;
+ end if;
+
+ for J in reverse Elab_Order.First .. Elab_Order.Last loop
+
+ -- Do not include the sources of the runtime
+
+ if not Is_Internal_File_Name
+ (Units.Table (Elab_Order.Table (J)).Sfile)
+ then
+ if not Zero_Formatting then
+ Write_Str (" ");
+ end if;
+
+ Write_Str
+ (Get_Name_String
+ (Units.Table (Elab_Order.Table (J)).Sfile));
+ Write_Eol;
+ end if;
+ end loop;
+
+ if not Zero_Formatting then
+ Write_Eol;
+ end if;
+ end if;
end if;
end if;