This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[BC] Patch: FYI: Fix loader.exp


This fixes loader.exp to work with libtool.
Without this, all the tests in libjava.loader fail because they can't
find "dummy.o" -- which libtool has named "dummy.lo".

The approach taken is somewhat of a hack.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>
	* testsuite/libjava.loader/loader.exp (gcj_object_file_name): New
	proc.
	(gcj_loader_test_one): Use it.
	(gcj_loader_run): Likewise.

Index: testsuite/libjava.loader/loader.exp
===================================================================
RCS file: /cvs/gcc/gcc/libjava/testsuite/libjava.loader/loader.exp,v
retrieving revision 1.3
diff -u -r1.3 loader.exp
--- testsuite/libjava.loader/loader.exp 13 Dec 2002 05:00:14 -0000 1.3
+++ testsuite/libjava.loader/loader.exp 13 Oct 2004 01:23:02 -0000
@@ -1,5 +1,15 @@
 # Tests for ClassLoader and native library loader code.
 
+# Compute the correct name for an object file.
+# This is an awful hack.
+proc gcj_object_file_name {compiler base} {
+  verbose "OBJECT: compiler = $compiler"
+  if {[string match *libtool* $compiler]} {
+    return $base.lo
+  }
+  return $base.o
+}
+
 # Do all the work for a single JNI test.  Return 0 on failure.
 proc gcj_loader_test_one {srcfile} {
   global objdir srcdir subdir
@@ -9,9 +19,9 @@
   regsub "^.*/(\[^/.\]+)\[.\]\[^/]*$" "$srcfile" "\\1" out
   set executable "${objdir}/$out.exe"
 
-    set errname [file rootname [file tail $srcfile]]
-    set args [libjava_arguments link]
-    lappend args "additional_flags=--main=[file rootname [file tail $srcfile]] $srcdir/$subdir/MyLoader.java $objdir/dummy.o"
+  set errname [file rootname [file tail $srcfile]]
+  set args [libjava_arguments link]
+  lappend args "additional_flags=--main=[file rootname [file tail $srcfile]] $srcdir/$subdir/MyLoader.java $objdir/[gcj_object_file_name $args dummy]"
   set x [libjava_prune_warnings \
 	     [libjava_tcompile $srcfile "$executable" executable $args]]
 
@@ -47,7 +57,7 @@
   set args [libjava_arguments compile]
   lappend args "additional_flags=--resource $objdir/dummy.class"
   set x [libjava_prune_warnings \
-	   [libjava_tcompile "$objdir/dummy.class" "$objdir/dummy.o" object $args]]
+	   [libjava_tcompile "$objdir/dummy.class" "$objdir/[gcj_object_file_name $args dummy]" object $args]]
 
     if { $x != "" } {
 	verbose "resource compilation failed: $x" 2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]