Commit d19c9689 by Tom Tromey Committed by Tom Tromey

libjava.exp (libjava_arguments): Rewrote computation of LD_LIBRARY_PATH.

	* lib/libjava.exp (libjava_arguments): Rewrote computation of
	LD_LIBRARY_PATH.  Add gcc build directory if it contains
	libgcc_s.so.

From-SVN: r40564
parent 2d6eb5bf
2001-03-16 Tom Tromey <tromey@redhat.com>
* lib/libjava.exp (libjava_arguments): Rewrote computation of
LD_LIBRARY_PATH. Add gcc build directory if it contains
libgcc_s.so.
2001-03-14 Tom Tromey <tromey@redhat.com> 2001-03-14 Tom Tromey <tromey@redhat.com>
* libjava.compile/assignment.xfail: Removed. * libjava.compile/assignment.xfail: Removed.
......
# Copyright (C) 1998, 1999, 2000 Free Software Foundation # Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
load_lib "libgloss.exp" load_lib "libgloss.exp"
...@@ -192,6 +192,7 @@ proc libjava_arguments {{mode compile}} { ...@@ -192,6 +192,7 @@ proc libjava_arguments {{mode compile}} {
global tmpdir global tmpdir
global runtests global runtests
global env global env
global tool_root_dir
if [info exists LIBJAVA] { if [info exists LIBJAVA] {
set libjava $LIBJAVA; set libjava $LIBJAVA;
...@@ -230,17 +231,25 @@ proc libjava_arguments {{mode compile}} { ...@@ -230,17 +231,25 @@ proc libjava_arguments {{mode compile}} {
# Basically we want to build up a colon separated path list from # Basically we want to build up a colon separated path list from
# the value of $libjava. # the value of $libjava.
# First strip away any -L arguments. set lpath {}
regsub -all -- "-L" $libjava "" ld_library_path foreach dir [list $libjava $libgc $libz] {
foreach item [split $dir " "] {
# Then remove any -lgcj argument. switch -glob -- $item {
regsub -all -- " -lgcj.*" $ld_library_path "" ld_library_path "-L*" {
lappend lpath [string range $item 2 end]
}
}
}
}
# First strip away any -L arguments. # Finally, add the gcc build directory so that we can find the
regsub -all -- "-L" $libgc $ld_library_path ld_library_path # shared libgcc. This, like much of dejagnu, is hideous.
set gccdir [lookfor_file $tool_root_dir gcc/libgcc_s.so]
if {$gccdir != ""} {
lappend lpath [file dirname $gccdir]
}
# Then remove any -lgcjgc argument. set ld_library_path [join $lpath :]
regsub -all -- " -lgcjgc.*" $ld_library_path "" ld_library_path
# That's enough to make things work for the normal case. # That's enough to make things work for the normal case.
# If we wanted to handle an arbitrary value of libjava, # If we wanted to handle an arbitrary value of libjava,
...@@ -251,6 +260,8 @@ proc libjava_arguments {{mode compile}} { ...@@ -251,6 +260,8 @@ proc libjava_arguments {{mode compile}} {
setenv LD_LIBRARY_PATH "$ld_library_path:$original_ld_library_path" setenv LD_LIBRARY_PATH "$ld_library_path:$original_ld_library_path"
setenv SHLIB_PATH "$ld_library_path:$original_ld_library_path" setenv SHLIB_PATH "$ld_library_path:$original_ld_library_path"
verbose "LD_LIBRARY_PATH = $env(LD_LIBRARY_PATH)"
# Set the CLASSPATH environment variable # Set the CLASSPATH environment variable
verbose "CLASSPATH is .:$srcdir/$subdir:$objdir:$objdir/../libgcj.jar" verbose "CLASSPATH is .:$srcdir/$subdir:$objdir:$objdir/../libgcj.jar"
global env global env
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment