aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-18 21:39:09 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-18 21:39:09 +0000
commitb851d0b2f0ab6b0912a3a7d02a3714e7b555ea93 (patch)
tree67869a238242e4452f57056c20b84ee0ab886259 /libjava
parent534bddd83f0bb051ab637cc40edf701f8c63a628 (diff)
* libjava.jni/jni.exp (gcj_jni_test_one): Find libstdc++ in build
tree. (gcj_invoke): Added ld_library_additions argument. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51006 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r--libjava/testsuite/ChangeLog6
-rw-r--r--libjava/testsuite/libjava.jni/jni.exp34
2 files changed, 35 insertions, 5 deletions
diff --git a/libjava/testsuite/ChangeLog b/libjava/testsuite/ChangeLog
index fe5ed13786e..ab77ce9be1b 100644
--- a/libjava/testsuite/ChangeLog
+++ b/libjava/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2002-03-18 Tom Tromey <tromey@redhat.com>
+
+ * libjava.jni/jni.exp (gcj_jni_test_one): Find libstdc++ in build
+ tree.
+ (gcj_invoke): Added ld_library_additions argument.
+
2002-03-17 Tom Tromey <tromey@redhat.com>
* libjava.jni/jni.exp (gcj_jni_build_header): Use local_exec, not
diff --git a/libjava/testsuite/libjava.jni/jni.exp b/libjava/testsuite/libjava.jni/jni.exp
index 8dd8b8af049..049383eb177 100644
--- a/libjava/testsuite/libjava.jni/jni.exp
+++ b/libjava/testsuite/libjava.jni/jni.exp
@@ -43,11 +43,18 @@ proc gcj_jni_build_header {file} {
}
# Invoke the program and see what happens. Return 0 on failure.
-proc gcj_invoke {program expectFile} {
+proc gcj_invoke {program expectFile ld_library_additions} {
global env
set lib_path $env(LD_LIBRARY_PATH)
- setenv LD_LIBRARY_PATH .:$lib_path
- setenv SHLIB_PATH .:$lib_path
+
+ set newval .
+ if {[llength $ld_library_additions] > 0} {
+ append newval :[join $ld_library_additions :]
+ }
+ append newval :$lib_path
+
+ setenv LD_LIBRARY_PATH $newval
+ setenv SHLIB_PATH $newval
verbose "LD_LIBRARY_PATH=$env(LD_LIBRARY_PATH)"
@@ -106,10 +113,27 @@ proc gcj_jni_test_one {file} {
set cfile [file rootname $file].c
set cxxflags ""
+ set cxxldlibflags {}
# If there is no `.c' file, assume there is a `.cc' file.
if {! [file exists $cfile]} {
set cfile [file rootname $file].cc
- set cxxflags "-lstdc++"
+
+ set cxxflaglist {}
+ foreach arg [split [libjava_find_lib libstdc++-v3/src stdc++] " "] {
+ switch -glob -- $arg {
+ "-L*" {
+ set arg [string range $arg 2 end]
+ lappend cxxldlibflags $arg
+ # Strip the `.libs' directory; we link with libtool which
+ # doesn't need it.
+ set arg "-L[file dirname $arg]"
+ }
+ }
+ lappend cxxflaglist $arg
+ }
+
+ lappend cxxflaglist "-lstdc++"
+ set cxxflags [join $cxxflaglist]
}
if {! [gcj_jni_compile_c_to_so $cfile]} {
@@ -125,7 +149,7 @@ proc gcj_jni_test_one {file} {
return 0
}
- if {! [gcj_invoke $main [file rootname $file].out]} {
+ if {! [gcj_invoke $main [file rootname $file].out $cxxldlibflags]} {
# FIXME
return 0
}