-- --
-- B o d y --
-- --
--- Copyright (C) 1997-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1997-2006, 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- --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
--- MA 02111-1307, USA. --
+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
+-- Boston, MA 02110-1301, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- build the DLL.
Help : Boolean := False;
- -- Help will be set to True the usage information is to be displayed.
+ -- Help will be set to True the usage information is to be displayed
Version : constant String := Gnatvsn.Gnat_Version_String;
-- Why should it be necessary to make a copy of this
-- Check --
-----------
- procedure Check (Filename : in String) is
+ procedure Check (Filename : String) is
begin
if not Is_Regular_File (Filename) then
Raise_Exception
procedure Parse_Command_Line is
- use GNAT.Command_Line;
-
- procedure Add_File (Filename : in String);
+ procedure Add_File (Filename : String);
-- Add one file to the list of file to handle
- procedure Add_Files_From_List (List_Filename : in String);
+ procedure Add_Files_From_List (List_Filename : String);
-- Add the files listed in List_Filename (one by line) to the list
-- of file to handle
-- Add_File --
--------------
- procedure Add_File (Filename : in String) is
+ procedure Add_File (Filename : String) is
begin
if Is_Ali (Filename) then
-
Check (Filename);
-- Record it to generate the binder program when
A := A + 1;
elsif Is_Obj (Filename) then
-
Check (Filename);
-- Just record this object file
-- Add_Files_From_List --
-------------------------
- procedure Add_Files_From_List (List_Filename : in String) is
+ procedure Add_Files_From_List (List_Filename : String) is
File : File_Type;
Buffer : String (1 .. 500);
Last : Natural;
end loop;
Close (File);
+
+ exception
+ when Name_Error =>
+ Raise_Exception
+ (Syntax_Error'Identity,
+ "list-of-files file " & List_Filename & " not found.");
end Add_Files_From_List;
-- Start of processing for Parse_Command_Line
end if;
exception
-
when Invalid_Switch =>
Raise_Exception
(Syntax_Error'Identity,
Raise_Exception
(Syntax_Error'Identity,
Message => "No parameter for " & Full_Switch);
-
end Parse_Command_Line;
-------------------
procedure Check_Context is
begin
-
Check (To_String (Def_Filename));
-- Check that each object file specified exists and raise exception
Check_Context;
case Build_Mode is
-
when Import_Lib =>
MDLL.Build_Import_Library
(To_String (Lib_Filename),
Set_Exit_Status (Success);
exception
-
when SE : Syntax_Error =>
Put_Line ("Syntax error : " & Exception_Message (SE));
New_Line;
when others =>
Put_Line ("gnatdll: INTERNAL ERROR. Please report");
Set_Exit_Status (Failure);
-
end Gnatdll;