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]

Re: Mauve, inner classes and dejagnu magic


Hi,

Finally found a way to get it working. Basic idea is to never produce .o
files containing a $ character and to quote class file names that might
contain $ with "'". Something similar should be possible for the PR1343
case. I will see if I can come up with a patch.

2003-02-14  Mark Wielaard  <mark@klomp.org>

	* libjava.mauve/mauve.exp (mauve_compute_uses): Add inner class
	object files by changing all occurances of $ to ^.
	(test_mauve): Replace ^ with $ for class file names and quote
	them with "'"s.

OK for mainline and branch? It makes ClassTest compile/link again and
with this I can enable the ObjectInputOutput tests later.

Cheers,

Mark
Index: libjava.mauve/mauve.exp
===================================================================
RCS file: /cvs/gcc/gcc/libjava/testsuite/libjava.mauve/mauve.exp,v
retrieving revision 1.18
diff -u -r1.18 mauve.exp
--- libjava.mauve/mauve.exp	13 Jan 2003 00:22:20 -0000	1.18
+++ libjava.mauve/mauve.exp	14 Feb 2003 19:36:01 -0000
@@ -46,6 +46,12 @@
     foreach file $ufiles {
       set file [file rootname $file].o
       lappend uses($item) $file
+      # Now add all inner classes
+      foreach inner [glob -nocomplain [file rootname $file]$*.class] {
+	# Prevent excessive escaping by replacing $ with a ^ in the .o name
+	set inner [string map {$ ^} [file rootname $inner]].o
+	lappend uses($item) $inner
+      }
     }
   }
 
@@ -179,9 +185,10 @@
     foreach obj $uses($file) {
       if {! [file exists $obj]} then {
 	verbose "compiling $obj for test of $class"
-	set srcfile [file rootname $obj].class
+	# The .class file does contain a $, but we can quote it between "'"s.
+	set srcfile [string map {^ $} [file rootname $obj]].class
 	set x [libjava_prune_warnings \
-		 [target_compile [pwd]/$srcfile $obj object $compile_args]]
+		 [libjava_tcompile '[pwd]/$srcfile' $obj object $compile_args]]
 	if {$x != ""} then {
 	  fail "Compile $obj for $class"
 	  set ok 0
@@ -196,7 +203,7 @@
     }
 
     set x [libjava_prune_warnings \
-	     [target_compile [concat $uses($file) $objlist] \
+	     [libjava_tcompile [concat $uses($file) $objlist] \
 		$Executable executable $link_args]]
     if {$x != ""} then {
       set proc_ok 0

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