diff options
author | Tristan Gingold <tgingold@free.fr> | 2016-07-15 06:29:49 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2016-07-15 06:29:49 +0200 |
commit | 0eadd36bc47b08ad552d325c54f9e3a305c6838c (patch) | |
tree | f09e0bb416739fb71a11c4c877b4602a991ee903 /src | |
parent | 3e04f0aadc73a45eeba46d4ee3bc5a533b8d4a47 (diff) | |
download | ghdl-0eadd36bc47b08ad552d325c54f9e3a305c6838c.tar.gz ghdl-0eadd36bc47b08ad552d325c54f9e3a305c6838c.tar.bz2 ghdl-0eadd36bc47b08ad552d325c54f9e3a305c6838c.zip |
ghdldrv: add --bootstrap-standard to simplify build.
Diffstat (limited to 'src')
-rw-r--r-- | src/ghdldrv/ghdldrv.adb | 47 | ||||
-rw-r--r-- | src/vhdl/translate/ortho_front.adb | 4 |
2 files changed, 47 insertions, 4 deletions
diff --git a/src/ghdldrv/ghdldrv.adb b/src/ghdldrv/ghdldrv.adb index 2bb281cf5..082d1db57 100644 --- a/src/ghdldrv/ghdldrv.adb +++ b/src/ghdldrv/ghdldrv.adb @@ -28,7 +28,6 @@ with Types; use Types; with Iirs; use Iirs; with Files_Map; with Configuration; ---with Disp_Tree; with Default_Pathes; with Interfaces.C_Streams; with System; @@ -133,7 +132,7 @@ package body Ghdldrv is end if; end My_Spawn; - -- Compile FILE with additional argument OPTS. + -- Compile FILE with additional argument OPTIONSS. procedure Do_Compile (Options : Argument_List; File : String; In_Work : Boolean) is @@ -691,7 +690,7 @@ package body Ghdldrv is pragma Unreferenced (Cmd); begin if Args'Length /= 0 then - Error ("--dispconfig does not accept any argument"); + Error ("--disp-config does not accept any argument"); raise Option_Error; end if; @@ -746,6 +745,47 @@ package body Ghdldrv is end loop; end Perform_Action; + -- Command Bootstrap-standard + type Command_Bootstrap is new Command_Comp with null record; + function Decode_Command (Cmd : Command_Bootstrap; Name : String) + return Boolean; + function Get_Short_Help (Cmd : Command_Bootstrap) return String; + procedure Perform_Action (Cmd : in out Command_Bootstrap; + Args : Argument_List); + + function Decode_Command (Cmd : Command_Bootstrap; Name : String) + return Boolean + is + pragma Unreferenced (Cmd); + begin + return Name = "--bootstrap-standard"; + end Decode_Command; + + function Get_Short_Help (Cmd : Command_Bootstrap) return String + is + pragma Unreferenced (Cmd); + begin + return "--bootstrap-standard (Internal) compile std.standard"; + end Get_Short_Help; + + procedure Perform_Action (Cmd : in out Command_Bootstrap; + Args : Argument_List) + is + pragma Unreferenced (Cmd); + Opt : Argument_List (1 .. 1); + begin + if Args'Length /= 0 then + Error ("no file allowed for --bootstrap-standard"); + raise Option_Error; + end if; + + Set_Tools_Name; + Locate_Tools; + + Opt (1) := new String'("--compile-standard"); + Do_Compile (Opt, "std_standard.vhdl", True); + end Perform_Action; + -- Command Analyze. type Command_Analyze is new Command_Comp with null record; function Decode_Command (Cmd : Command_Analyze; Name : String) @@ -1754,5 +1794,6 @@ package body Ghdldrv is Register_Command (new Command_Make); Register_Command (new Command_Gen_Makefile); Register_Command (new Command_Dispconfig); + Register_Command (new Command_Bootstrap); end Register_Commands; end Ghdldrv; diff --git a/src/vhdl/translate/ortho_front.adb b/src/vhdl/translate/ortho_front.adb index 55f076659..46f303348 100644 --- a/src/vhdl/translate/ortho_front.adb +++ b/src/vhdl/translate/ortho_front.adb @@ -336,7 +336,9 @@ package body Ortho_Front is raise Compilation_Error; end if; when Action_Compile_Std_Package => - if Filename /= null then + if Filename /= null + and then Filename.all /= "std_standard.vhdl" + then Error_Msg_Option ("--compile-standard is not compatible with a filename"); return False; |