aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@dcc.unicamp.br>1999-07-31 23:53:13 +0000
committerTom Tromey <tromey@gcc.gnu.org>1999-07-31 23:53:13 +0000
commitf2f78c2f2c5486f2cc9fa8a406ab111d873f9c9e (patch)
tree10aac228f5b9a9a3625e3c4842ac4ff58bf0f5c4
parentf3f6c4ff33e1b29a1abaae987b4629704763c8f7 (diff)
downloadgcc-f2f78c2f2c5486f2cc9fa8a406ab111d873f9c9e.zip
gcc-f2f78c2f2c5486f2cc9fa8a406ab111d873f9c9e.tar.gz
gcc-f2f78c2f2c5486f2cc9fa8a406ab111d873f9c9e.tar.bz2
libjava.exp (bytecompile_file): Use `env(SUN_JAVAC)', that defaults to javac, as Sun-javac compiler or compatible.
1999-07-31 Alexandre Oliva <oliva@dcc.unicamp.br> * lib/libjava.exp (bytecompile_file): Use `env(SUN_JAVAC)', that defaults to javac, as Sun-javac compiler or compatible. (libjava_init): Get GCJ from environment if neither GCJ_UNDER_TEST nor TOOL_EXECUTABLE are set. Set `original_ld_library_path' from environment. (libjava_arguments): Prepend `.' and `$srcdir/$subdir' to CLASSPATH, for `support' sources. Search for libgcj.spec in `$objdir/..', by adding -B to GCJ_UNDER_TEST. Append original_ld_library_path to ld_library_path. * libjava.mauve/mauve.exp (test_mauve): Set `env(GCJ)' from GCJ_UNDER_TEST, calculated just like in libjava.exp. From-SVN: r28365
-rw-r--r--libjava/testsuite/ChangeLog14
-rw-r--r--libjava/testsuite/lib/libjava.exp53
-rw-r--r--libjava/testsuite/libjava.mauve/mauve.exp22
3 files changed, 80 insertions, 9 deletions
diff --git a/libjava/testsuite/ChangeLog b/libjava/testsuite/ChangeLog
index 37bb157..e2a3b74 100644
--- a/libjava/testsuite/ChangeLog
+++ b/libjava/testsuite/ChangeLog
@@ -1,3 +1,17 @@
+1999-07-31 Alexandre Oliva <oliva@dcc.unicamp.br>
+
+ * lib/libjava.exp (bytecompile_file): Use `env(SUN_JAVAC)', that
+ defaults to javac, as Sun-javac compiler or compatible.
+ (libjava_init): Get GCJ from environment if neither GCJ_UNDER_TEST
+ nor TOOL_EXECUTABLE are set. Set `original_ld_library_path' from
+ environment.
+ (libjava_arguments): Prepend `.' and `$srcdir/$subdir' to
+ CLASSPATH, for `support' sources. Search for libgcj.spec in
+ `$objdir/..', by adding -B to GCJ_UNDER_TEST. Append
+ original_ld_library_path to ld_library_path.
+ * libjava.mauve/mauve.exp (test_mauve): Set `env(GCJ)' from
+ GCJ_UNDER_TEST, calculated just like in libjava.exp.
+
1999-07-06 Tom Tromey <tromey@cygnus.com>
* libjava.lang/Final.xfail: Output fails, not exec.
diff --git a/libjava/testsuite/lib/libjava.exp b/libjava/testsuite/lib/libjava.exp
index fd5ceb4..73404dd 100644
--- a/libjava/testsuite/lib/libjava.exp
+++ b/libjava/testsuite/lib/libjava.exp
@@ -38,13 +38,30 @@ proc find_jvscan {} {
proc bytecompile_file { file objdir {classpath {}} } {
global env
+ global SUN_JAVAC
set dirname [file dirname $file];
+ # If JDK doesn't run on your platform but some other
+ # JDK-compatible javac does, you may set SUN_JAVAC to point to it.
+ # One of the most important properties of a SUN_JAVAC is that it
+ # must create class-files even for classes that have not been
+ # specified in the command line, but that were needed to compile
+ # those that have. For example, Pizza won't do it, but you can
+ # use `kaffe sun.tools.javac.Main', if you have Sun's classes.zip
+ # in the kaffe's default search path.
+ if ![info exists SUN_JAVAC] {
+ if [info exists env(SUN_JAVAC)] {
+ set SUN_JAVAC $env(SUN_JAVAC)
+ } else {
+ set SUN_JAVAC "javac"
+ }
+ }
+
catch {unset env(CLASSPATH)}
if {$classpath != ""} then {
set env(CLASSPATH) $classpath
}
- if {[catch {system "cd $dirname; javac $file -d $objdir"} msg]} then {
+ if {[catch {system "cd $dirname; $SUN_JAVAC $file -d $objdir"} msg]} then {
verbose "couldn't compile $file: $msg"
set r 0
} else {
@@ -64,6 +81,8 @@ proc libjava_init { args } {
global libjava_initialized
global GCJ_UNDER_TEST
global TOOL_EXECUTABLE
+ global original_ld_library_path
+ global env
if { $libjava_initialized == 1 } { return; }
@@ -71,7 +90,21 @@ proc libjava_init { args } {
if [info exists TOOL_EXECUTABLE] {
set GCJ_UNDER_TEST $TOOL_EXECUTABLE;
} else {
- set GCJ_UNDER_TEST "[find_gcj]"
+ if [info exists env(GCJ)] {
+ set GCJ_UNDER_TEST $env(GCJ)
+ } else {
+ set GCJ_UNDER_TEST "[find_gcj]"
+ }
+ }
+ }
+
+ if [info exists env(LD_LIBRARY_PATH)] {
+ set original_ld_library_path $env(LD_LIBRARY_PATH)
+ } else {
+ if [info exists env(SHLIB_PATH)] {
+ set original_ld_library_path $env(SHLIB_PATH)
+ } else {
+ set original_ld_library_path ""
}
}
@@ -129,6 +162,7 @@ proc libjava_arguments {{mode compile}} {
global GCJ_UNDER_TEST
global tmpdir
global runtests
+ global env
if [info exists LIBJAVA] {
set libjava $LIBJAVA;
@@ -184,13 +218,14 @@ proc libjava_arguments {{mode compile}} {
# then we'd have to do a lot more work.
# Set variables the dynamic linker looks at.
- setenv LD_LIBRARY_PATH $ld_library_path
- setenv SHLIB_PATH $ld_library_path
+ global 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"
# Set the CLASSPATH environment variable
- verbose "CLASSPATH is $objdir/.."
+ verbose "CLASSPATH is .:$srcdir/$subdir:$objdir/..:$objdir/../libgcj.zip"
global env
- set env(CLASSPATH) "$objdir/.."
+ set env(CLASSPATH) ".:$srcdir/$subdir:$objdir/..:$objdir/../libgcj.zip"
global wrapper_file wrap_compile_flags;
lappend args "additional_flags=$wrap_compile_flags";
@@ -217,13 +252,15 @@ proc libjava_arguments {{mode compile}} {
if {[file exists $d/$x/libtool]} then {
# We have to run silently to avoid DejaGNU lossage.
lappend args \
- "compiler=$d/$x/libtool --silent --mode=$mode $GCJ_UNDER_TEST"
+ "compiler=$d/$x/libtool --silent --mode=$mode $GCJ_UNDER_TEST -B$objdir/../"
set found_compiler 1
break
}
}
if {! $found_compiler} {
- lappend args "compiler=$GCJ_UNDER_TEST"
+ # Append -B$objdir/../ so that we find libgcj.spec before it
+ # is installed.
+ lappend args "compiler=$GCJ_UNDER_TEST -B$objdir/../"
}
return $args
diff --git a/libjava/testsuite/libjava.mauve/mauve.exp b/libjava/testsuite/libjava.mauve/mauve.exp
index 0b49bb8..398b670 100644
--- a/libjava/testsuite/libjava.mauve/mauve.exp
+++ b/libjava/testsuite/libjava.mauve/mauve.exp
@@ -49,7 +49,7 @@ proc mauve_compute_uses {aName} {
# Run all the Mauve tests.
proc test_mauve {} {
- global srcdir subdir env
+ global srcdir objdir subdir env
if {! [info exists env(MAUVEDIR)]} then {
verbose "MAUVEDIR not set; not running Mauve tests"
@@ -65,6 +65,26 @@ proc test_mauve {} {
set full_srcdir [pwd]
cd $here/mauve-build
+ global env
+ global GCJ_UNDER_TEST
+ global TOOL_EXECUTABLE
+
+ if ![info exists GCJ_UNDER_TEST] {
+ if [info exists TOOL_EXECUTABLE] {
+ set GCJ_UNDER_TEST $TOOL_EXECUTABLE;
+ } else {
+ if [info exists env(GCJ)] {
+ set GCJ_UNDER_TEST env(GCJ)
+ } else {
+ set GCJ_UNDER_TEST "[find_gcj]"
+ }
+ }
+ }
+
+ # Append -B and -I so that libgcj.spec and libgcj.zip are found
+ # before they're installed.
+ set env(GCJ) "$GCJ_UNDER_TEST -B$objdir/../ -I$objdir/../libgcj.zip"
+
if {[catch {system "$env(MAUVEDIR)/configure --with-gcj"} msg]} then {
fail "Mauve configure"
verbose "configure failed with $msg"