summaryrefslogtreecommitdiff
path: root/gcc/ada/bindgen.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/bindgen.adb')
-rw-r--r--gcc/ada/bindgen.adb64
1 files changed, 58 insertions, 6 deletions
diff --git a/gcc/ada/bindgen.adb b/gcc/ada/bindgen.adb
index 56b2915ef6f..ec983760f29 100644
--- a/gcc/ada/bindgen.adb
+++ b/gcc/ada/bindgen.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2004 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- --
@@ -518,9 +518,10 @@ package body Bindgen is
Write_Statement_Buffer;
-- Generate call to Install_Handler
+
WBI ("");
WBI (" if Handler_Installed = 0 then");
- WBI (" Install_Handler;");
+ WBI (" Install_Handler;");
WBI (" end if;");
end if;
@@ -536,6 +537,17 @@ package body Bindgen is
Write_Statement_Buffer;
end if;
+ -- Generate assignment of default secondary stack size if set
+
+ if Sec_Stack_Used and then Default_Sec_Stack_Size /= -1 then
+ WBI ("");
+ Set_String (" System.Secondary_Stack.");
+ Set_String ("Default_Secondary_Stack_Size := ");
+ Set_Int (Opt.Default_Sec_Stack_Size);
+ Set_Char (';');
+ Write_Statement_Buffer;
+ end if;
+
-- Generate elaboration calls
WBI ("");
@@ -613,6 +625,13 @@ package body Bindgen is
Set_String (""";");
Write_Statement_Buffer;
+ -- Generate declaration for secondary stack default if needed
+
+ if Sec_Stack_Used and then Default_Sec_Stack_Size /= -1 then
+ WBI (" extern int system__secondary_stack__" &
+ "default_secondary_stack_size;");
+ end if;
+
WBI ("");
-- Code for normal case (standard library not suppressed)
@@ -742,6 +761,17 @@ package body Bindgen is
Write_Statement_Buffer;
end if;
+ -- Generate assignment of default secondary stack size if set
+
+ if Sec_Stack_Used and then Default_Sec_Stack_Size /= -1 then
+ WBI ("");
+ Set_String (" system__secondary_stack__");
+ Set_String ("default_secondary_stack_size = ");
+ Set_Int (Opt.Default_Sec_Stack_Size);
+ Set_Char (';');
+ Write_Statement_Buffer;
+ end if;
+
-- Generate elaboration calls
WBI ("");
@@ -1862,12 +1892,24 @@ package body Bindgen is
if With_GNARL then
Name_Len := 0;
- Add_Str_To_Name_Buffer ("-lgnarl");
+
+ if Opt.Shared_Libgnat then
+ Add_Str_To_Name_Buffer (Shared_Lib ("gnarl"));
+ else
+ Add_Str_To_Name_Buffer ("-lgnarl");
+ end if;
+
Write_Linker_Option;
end if;
Name_Len := 0;
- Add_Str_To_Name_Buffer ("-lgnat");
+
+ if Opt.Shared_Libgnat then
+ Add_Str_To_Name_Buffer (Shared_Lib ("gnat"));
+ else
+ Add_Str_To_Name_Buffer ("-lgnat");
+ end if;
+
Write_Linker_Option;
end if;
@@ -1983,6 +2025,12 @@ package body Bindgen is
WBI ("with System.Scalar_Values;");
end if;
+ -- Generate with of System.Secondary_Stack if active
+
+ if Sec_Stack_Used and then Default_Sec_Stack_Size /= -1 then
+ WBI ("with System.Secondary_Stack;");
+ end if;
+
Resolve_Binder_Options;
if not Suppress_Standard_Library_On_Target then
@@ -2698,7 +2746,6 @@ package body Bindgen is
----------------------------
procedure Public_Version_Warning is
-
Time : constant Int := Time_From_Last_Bind;
-- Constants to help defining periods
@@ -2738,13 +2785,18 @@ package body Bindgen is
-- Do not emit the message if the last message was emitted in the
-- specified period taking into account the number of units.
+ pragma Warnings (Off);
+ -- Turn off warning of constant condition, which may happen here
+ -- depending on the choice of constants in the above declarations.
+
if Nb_Unit < Large and then Time <= Period_Small then
return;
-
elsif Time <= Period_Large then
return;
end if;
+ pragma Warnings (On);
+
Write_Eol;
Write_Str ("IMPORTANT NOTICE:");
Write_Eol;