Patchwork backport PR java/43839 fix

login
register
mail settings
Submitter Jack Howarth
Date Oct. 4, 2010, 3:48 p.m.
Message ID <20101004154844.GA18670@bromo.med.uc.edu>
Download mbox | patch
Permalink /patch/66707/
State New
Headers show

Comments

Jack Howarth - Oct. 4, 2010, 3:48 p.m.
The attached patch backports r159009 which solves PR java/43839
so that alternative locations of libiconv will be used by the libjava
testsuite. Tested on x86_64-apple-darwin10. Okay for gcc 4.5.2?
                  Jack

2010-10-04  Jack Howarth <howarth@bromo.med.uc.edu>

	Backport from mainline
	2010-05-03  Jack Howarth <howarth@bromo.med.uc.edu>

	PR java/43839
	* testsuite/Makefile.am: Override automake for site.exp creation
	and add entry to set libiconv.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/libjava.jni/jni.exp (gcj_jni_get_cxxflags_invocation):
	Add new global variable libiconv to handle alternative libiconv
	locations.
Andrew Haley - Oct. 6, 2010, 2:48 p.m.
On 10/04/2010 04:48 PM, Jack Howarth wrote:
>   The attached patch backports r159009 which solves PR java/43839
> so that alternative locations of libiconv will be used by the libjava
> testsuite. Tested on x86_64-apple-darwin10. Okay for gcc 4.5.2?

Sure.  This should have been posted to java-patches.

Andrew.


>                   Jack
> 
> 2010-10-04  Jack Howarth <howarth@bromo.med.uc.edu>
> 
> 	Backport from mainline
> 	2010-05-03  Jack Howarth <howarth@bromo.med.uc.edu>
> 
> 	PR java/43839
> 	* testsuite/Makefile.am: Override automake for site.exp creation
> 	and add entry to set libiconv.
> 	* testsuite/Makefile.in: Regenerate.
> 	* testsuite/libjava.jni/jni.exp (gcj_jni_get_cxxflags_invocation):
> 	Add new global variable libiconv to handle alternative libiconv
> 	locations.

Patch

Index: libjava/testsuite/Makefile.in
===================================================================
--- libjava/testsuite/Makefile.in	(revision 164915)
+++ libjava/testsuite/Makefile.in	(working copy)
@@ -388,25 +388,6 @@ 
 	else echo "WARNING: could not find \`runtest'" 1>&2; :;\
 	fi; \
 	exit $$exit_status
-site.exp: Makefile
-	@echo 'Making a new site.exp file...'
-	@echo '## these variables are automatically generated by make ##' >site.tmp
-	@echo '# Do not edit here.  If you wish to override these values' >>site.tmp
-	@echo '# edit the last section' >>site.tmp
-	@echo 'set srcdir $(srcdir)' >>site.tmp
-	@echo "set objdir `pwd`" >>site.tmp
-	@echo 'set build_alias "$(build_alias)"' >>site.tmp
-	@echo 'set build_triplet $(build_triplet)' >>site.tmp
-	@echo 'set host_alias "$(host_alias)"' >>site.tmp
-	@echo 'set host_triplet $(host_triplet)' >>site.tmp
-	@echo 'set target_alias "$(target_alias)"' >>site.tmp
-	@echo 'set target_triplet $(target_triplet)' >>site.tmp
-	@echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp
-	@test ! -f site.exp || \
-	  sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
-	@-rm -f site.bak
-	@test ! -f site.exp || mv site.exp site.bak
-	@mv site.tmp site.exp
 
 distclean-DEJAGNU:
 	-rm -f site.exp site.bak
@@ -557,6 +538,31 @@ 
 
 .PHONY: compile-tests
 
+# We need more things in site.exp, but automake completely controls the
+# creation of that file; there's no way to append to it without messing up
+# the dependency chains.  So we overrule automake.  This rule is exactly
+# what it would have generated, plus our own additions.
+site.exp: Makefile
+	@echo 'Making a new site.exp file...'
+	@echo '## these variables are automatically generated by make ##' >site.tmp
+	@echo '# Do not edit here.  If you wish to override these values' >>site.tmp
+	@echo '# edit the last section' >>site.tmp
+	@echo 'set srcdir $(srcdir)' >>site.tmp
+	@echo "set objdir `pwd`" >>site.tmp
+	@echo 'set build_alias "$(build_alias)"' >>site.tmp
+	@echo 'set build_triplet $(build_triplet)' >>site.tmp
+	@echo 'set host_alias "$(host_alias)"' >>site.tmp
+	@echo 'set host_triplet $(host_triplet)' >>site.tmp
+	@echo 'set target_alias "$(target_alias)"' >>site.tmp
+	@echo 'set target_triplet $(target_triplet)' >>site.tmp
+	@echo 'set libiconv "$(LIBICONV)"' >>site.tmp
+	@echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp
+	@test ! -f site.exp || \
+	  sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
+	@-rm -f site.bak
+	@test ! -f site.exp || mv site.exp site.bak
+	@mv site.tmp site.exp
+
 check-am: compile-tests
 
 compile-tests:
Index: libjava/testsuite/libjava.jni/jni.exp
===================================================================
--- libjava/testsuite/libjava.jni/jni.exp	(revision 164915)
+++ libjava/testsuite/libjava.jni/jni.exp	(working copy)
@@ -251,7 +251,11 @@ 
 }
 
 proc gcj_jni_get_cxxflags_invocation {} {
+  global libiconv
   global LIBJAVA
+  if {$libiconv == ""} {
+      set libiconv "-liconv"
+  }
   if [info exists LIBJAVA] {
       set libjava $LIBJAVA;
   } else {
@@ -267,7 +271,7 @@ 
   # to just make the linker find libgcc using -L options.
   # Similar logic applies to libgcj.
   if { [istarget "*-*-darwin*"] } {
-    lappend cxxflags -shared-libgcc -lgcj -liconv
+    eval lappend cxxflags "-shared-libgcc -lgcj $libiconv"
   }
 
   if { [istarget "*-*-solaris*"] } {
Index: libjava/testsuite/Makefile.am
===================================================================
--- libjava/testsuite/Makefile.am	(revision 164915)
+++ libjava/testsuite/Makefile.am	(working copy)
@@ -24,6 +24,31 @@ 
 
 .PHONY: compile-tests
 
+# We need more things in site.exp, but automake completely controls the
+# creation of that file; there's no way to append to it without messing up
+# the dependency chains.  So we overrule automake.  This rule is exactly
+# what it would have generated, plus our own additions.
+site.exp: Makefile
+	@echo 'Making a new site.exp file...'
+	@echo '## these variables are automatically generated by make ##' >site.tmp
+	@echo '# Do not edit here.  If you wish to override these values' >>site.tmp
+	@echo '# edit the last section' >>site.tmp
+	@echo 'set srcdir $(srcdir)' >>site.tmp
+	@echo "set objdir `pwd`" >>site.tmp
+	@echo 'set build_alias "$(build_alias)"' >>site.tmp
+	@echo 'set build_triplet $(build_triplet)' >>site.tmp
+	@echo 'set host_alias "$(host_alias)"' >>site.tmp
+	@echo 'set host_triplet $(host_triplet)' >>site.tmp
+	@echo 'set target_alias "$(target_alias)"' >>site.tmp
+	@echo 'set target_triplet $(target_triplet)' >>site.tmp
+	@echo 'set libiconv "$(LIBICONV)"' >>site.tmp
+	@echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp
+	@test ! -f site.exp || \
+	  sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
+	@-rm -f site.bak
+	@test ! -f site.exp || mv site.exp site.bak
+	@mv site.tmp site.exp
+
 check-am: compile-tests
 
 compile-tests: