Set the ld_library_path so that running programs linked against the
authorOvidiu Predescu <ovidiu@gcc.gnu.org>
Sun, 6 Aug 2000 18:41:49 +0000 (18:41 +0000)
committerOvidiu Predescu <ovidiu@gcc.gnu.org>
Sun, 6 Aug 2000 18:41:49 +0000 (18:41 +0000)
shared version of libobjc run correctly.

From-SVN: r35531

gcc/testsuite/lib/objc.exp

index e537f785ac1ee03a4a73779ac74d3d1cf14e27d2..8a9658f57efb0e39ebe6366f52d39c8e00d7b57d 100644 (file)
@@ -117,8 +117,11 @@ proc objc_target_compile { source dest type options } {
     global gluefile wrap_flags;
     global OBJC_UNDER_TEST
     global TOOL_OPTIONS
+    global ld_library_path
 
+    set ld_library_path "."
     lappend options "libs=-lobjc"
+
     if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } {
        lappend options "libs=${gluefile}"
        lappend options "ldflags=$wrap_flags"
@@ -142,8 +145,10 @@ proc objc_target_compile { source dest type options } {
     set objcpath "[get_multilibs]"
     set libobjc_dir [lookfor_file ${objcpath} libobjc/.libs/libobjc.a]
     if { $libobjc_dir != "" } {
-       set objc_link_flags "-L[file dirname ${libobjc_dir}]"
+       set libobjc_dir [file dirname ${libobjc_dir}]
+       set objc_link_flags "-L${libobjc_dir}"
        lappend options "additional_flags=${objc_link_flags}"
+       append ld_library_path ":${libobjc_dir}"
     }
     lappend options "compiler=$OBJC_UNDER_TEST"
     return [target_compile $source $dest $type $options]