Set the ld_library_path so that running programs linked against the

shared version of libobjc run correctly.

From-SVN: r35531
This commit is contained in:
Ovidiu Predescu 2000-08-06 18:41:49 +00:00
parent cd7324181a
commit 822c7fe253
1 changed files with 6 additions and 1 deletions

View 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]