diff options
Diffstat (limited to 'gcc/ada/mlib.adb')
-rw-r--r-- | gcc/ada/mlib.adb | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/gcc/ada/mlib.adb b/gcc/ada/mlib.adb index 5016587d5f8..3cefb6d2c90 100644 --- a/gcc/ada/mlib.adb +++ b/gcc/ada/mlib.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1999-2003, Ada Core Technologies, Inc. -- +-- Copyright (C) 1999-2004, Ada Core Technologies, 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- -- @@ -25,6 +25,7 @@ ------------------------------------------------------------------------------ with Ada.Characters.Handling; use Ada.Characters.Handling; +with Interfaces.C.Strings; with Hostparm; with Opt; @@ -40,6 +41,9 @@ with System; package body MLib is + pragma Linker_Options ("link.o"); + -- For run_path_option string. + ------------------- -- Build_Library -- ------------------- @@ -285,13 +289,34 @@ package body MLib is end if; end Copy_ALI_Files; + -------------------------------- + -- Linker_Library_Path_Option -- + -------------------------------- + + function Linker_Library_Path_Option return String_Access is + + Run_Path_Option_Ptr : Interfaces.C.Strings.chars_ptr; + pragma Import (C, Run_Path_Option_Ptr, "run_path_option"); + -- Pointer to string representing the native linker option which + -- specifies the path where the dynamic loader should find shared + -- libraries. Equal to null string if this system doesn't support it. + + S : constant String := Interfaces.C.Strings.Value (Run_Path_Option_Ptr); + + begin + if S'Length = 0 then + return null; + else + return new String'(S); + end if; + end Linker_Library_Path_Option; + -- Package elaboration begin - if Hostparm.OpenVMS then - - -- Copy_Attributes always fails on VMS + -- Copy_Attributes always fails on VMS + if Hostparm.OpenVMS then Preserve := None; end if; end MLib; |