1 |
# Copyright (C) 1992 - 2001 Free Software Foundation, Inc. |
# Copyright (C) 1992 - 2002, 2003 Free Software Foundation, Inc. |
2 |
|
|
3 |
# This program is free software; you can redistribute it and/or modify |
# This program is free software; you can redistribute it and/or modify |
4 |
# it under the terms of the GNU General Public License as published by |
# it under the terms of the GNU General Public License as published by |
35 |
|
|
36 |
proc unix_load { dest prog args } { |
proc unix_load { dest prog args } { |
37 |
global ld_library_path |
global ld_library_path |
38 |
set output ""; |
set output "" |
39 |
|
set orig_ld_library_path "" |
40 |
|
|
41 |
if { [llength $args] > 0 } { |
if { [llength $args] > 0 } { |
42 |
set parg [lindex $args 0]; |
set parg [lindex $args 0]; |
64 |
set command "$prog $parg"; |
set command "$prog $parg"; |
65 |
} |
} |
66 |
|
|
67 |
if [info exists ld_library_path] { |
if ![info exists ld_library_path] { |
68 |
setenv LD_LIBRARY_PATH $ld_library_path |
set ld_library_path "" |
|
setenv SHLIB_PATH $ld_library_path |
|
69 |
} |
} |
70 |
|
|
71 |
|
set orig_ld_library_path "[getenv LD_LIBRARY_PATH]" |
72 |
|
setenv LD_LIBRARY_PATH "$ld_library_path:$orig_ld_library_path" |
73 |
|
setenv SHLIB_PATH "$ld_library_path:$orig_ld_library_path" |
74 |
|
verbose -log "Setting LD_LIBRARY_PATH to $ld_library_path:$orig_ld_library_path" 2 |
75 |
|
|
76 |
set id [remote_spawn $dest "$command" "readonly"]; |
set id [remote_spawn $dest "$command" "readonly"]; |
77 |
if { $id < 0 } { |
if { $id < 0 } { |
78 |
set output "remote_spawn failed" |
set output "remote_spawn failed" |
87 |
# fix in the first place; this just tries to minimize the resulting |
# fix in the first place; this just tries to minimize the resulting |
88 |
# crap.) |
# crap.) |
89 |
if [info exists ld_library_path] { |
if [info exists ld_library_path] { |
90 |
unsetenv LD_LIBRARY_PATH |
setenv LD_LIBRARY_PATH $orig_ld_library_path |
91 |
unsetenv SHLIB_PATH |
setenv SHLIB_PATH $orig_ld_library_path |
92 |
} |
} |
93 |
} else { |
} else { |
94 |
set remotefile "/tmp/[file tail $prog].[pid]" |
set remotefile "/tmp/[file tail $prog].[pid]" |
123 |
set output [lindex $status 1] |
set output [lindex $status 1] |
124 |
set status [lindex $status 0] |
set status [lindex $status 0] |
125 |
} |
} |
126 |
|
|
127 |
|
setenv LD_LIBRARY_PATH $orig_ld_library_path |
128 |
|
setenv SHLIB_PATH $orig_ld_library_path |
129 |
|
|
130 |
verbose "Executed $prog, status $status" 2 |
verbose "Executed $prog, status $status" 2 |
131 |
if ![string match "" $output] { |
if ![string match "" $output] { |