This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: fix test suite when --disable-static
- From: Tom Tromey <tromey at redhat dot com>
- To: GCC libjava patches <java-patches at gcc dot gnu dot org>
- Date: 12 Aug 2003 09:52:09 -0600
- Subject: Patch: FYI: fix test suite when --disable-static
- Reply-to: tromey at redhat dot com
I'm checking this in on the trunk.
If you build with --disable-static, the test suite will stop working,
since it won't correctly find libgcj.so. Fixed as appended.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* lib/libjava.exp (libjava_find_lib): Search for .so file first.
(libjava_arguments): Don't add libraries to link line explictly.
Index: lib/libjava.exp
===================================================================
RCS file: /cvs/gcc/gcc/libjava/testsuite/lib/libjava.exp,v
retrieving revision 1.51
diff -u -r1.51 libjava.exp
--- lib/libjava.exp 22 Mar 2003 07:14:53 -0000 1.51
+++ lib/libjava.exp 12 Aug 2003 15:59:04 -0000
@@ -200,6 +200,7 @@
if {$gccdir != ""} {
set gccdir [file dirname $gccdir]
lappend libjava_libgcc_s_path $gccdir
+ verbose "libjava_libgcc_s_path = $libjava_libgcc_s_path"
set compiler ${gccdir}/xgcc
if { [is_remote host] == 0 && [which $compiler] != 0 } {
foreach i "[exec $compiler --print-multi-lib]" {
@@ -234,21 +235,24 @@
proc libjava_find_lib {dir name} {
global base_dir
set gp [get_multilibs]
- foreach sub {.libs _libs} {
- if {$gp != ""} {
- if {[file exists $gp/$dir/$sub/lib${name}.a]} then {
- # Just return the `-L' option. The library itself
- # will be picked up via the spec file.
- return "-L$gp/$dir/$sub"
+ foreach extension {so dll a} {
+ foreach sub {.libs _libs} {
+ if {$gp != ""} {
+ if {[file exists $gp/$dir/$sub/lib${name}.${extension}]} then {
+ # Just return the `-L' option. The library itself
+ # will be picked up via the spec file.
+ return "-L$gp/$dir/$sub"
+ }
+ }
+ # Just return the `-L' option. The library itself will be
+ # picked up via the spec file.
+ set lib [findfile \
+ $base_dir/../../$dir/$sub/lib${name}.${extension} \
+ "-L$base_dir/../../$dir/$sub" \
+ ""]
+ if {$lib != ""} {
+ return $lib
}
- }
- # Just return the `-L' option. The library itself will be
- # picked up via the spec file.
- set lib [findfile $base_dir/../../$dir/$sub/lib${name}.a \
- "-L$base_dir/../../$dir/$sub" \
- ""]
- if {$lib != ""} {
- return $lib
}
}
return ""
@@ -340,10 +344,6 @@
set libz [libjava_find_lib zlib zgcj]
}
- # FIXME: there's no way to determine whether -lpthread is
- # required. We should get this info from configure, or it should
- # just be in the compiler driver.
-
verbose "using LIBJAVA = $libjava" 2
verbose "using LIBGC = $libgc" 2
verbose "using LIBQTHREADS = $libqthreads" 2
@@ -365,6 +365,7 @@
}
set lpath [concat $lpath $libjava_libgcc_s_path]
+ verbose "lpath = $lpath ; libgcc_s_path = $libjava_libgcc_s_path"
set ld_library_path [join $lpath :]
# That's enough to make things work for the normal case.
@@ -384,13 +385,9 @@
set env(CLASSPATH) ".:$srcdir/$subdir:$objdir:$libgcj_jar"
if {$mode == "link"} {
- global wrapper_file wrap_compile_flags;
- lappend args "additional_flags=$wrap_compile_flags";
- lappend args "libs=$wrapper_file";
- lappend args "libs=$libjava";
- lappend args "libs=$libgc";
- lappend args "libs=$libqthreads"
- lappend args "libs=$libz"
+ global wrapper_file wrap_compile_flags
+ lappend args "additional_flags=$wrap_compile_flags"
+ lappend args "libs=$wrapper_file"
lappend args debug
}