This is the mail archive of the mailing list for the GCC 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]

[PATCH][Revised2] Fix PR43839 - libjava incorrectly uses -liconv in testsuite

Same patch as
with comment typo fix (someone should fix the original typo in


  The following patch eliminates the failure of the PR16923 libjava
testcase on *-*-darwin* when -with-libiconv-prefix is used to provide
an alternative location for libiconv. Tested on x86_64-apple-darwin10.
Okay for gcc trunk and gcc 4.5.1?

2010-04-22  Jack Howarth <>

	PR 43839
	* testsuite/ Override automake for site.exp creation
	and add entry to set libiconv.
	* testsuite/ Regenerate.
	* testsuite/libjava.jni/jni.exp (gcj_jni_get_cxxflags_invocation):
	Add new global variable libiconv to handle alternative libiconv
Index: libjava/testsuite/libjava.jni/jni.exp
--- libjava/testsuite/libjava.jni/jni.exp	(revision 158676)
+++ 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/
--- libjava/testsuite/	(revision 158676)
+++ libjava/testsuite/	(working copy)
@@ -24,6 +24,27 @@
 .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 '# edit the last section' >>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

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