public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
* PR43839 almost fixed
@ 2010-04-22  2:26 Jack Howarth
  2010-04-22  7:08 ` Dave Korn
  0 siblings, 1 reply; 2+ messages in thread
From: Jack Howarth @ 2010-04-22  2:26 UTC (permalink / raw)
  To: java; +Cc: gcc

   I believe I have a fix for PR43839 (where the jni.exp
script doesn't honor --with-iconv as set during the build).
The following patch *almost* works...

Index: testsuite/Makefile.in
===================================================================
--- testsuite/Makefile.in	(revision 158624)
+++ testsuite/Makefile.in	(working copy)
@@ -401,6 +401,7 @@
 	@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
Index: testsuite/libjava.jni/jni.exp
===================================================================
--- testsuite/libjava.jni/jni.exp	(revision 158624)
+++ testsuite/libjava.jni/jni.exp	(working copy)
@@ -251,6 +251,7 @@
 }
 
 proc gcj_jni_get_cxxflags_invocation {} {
+  global libiconv
   global LIBJAVA
   if [info exists LIBJAVA] {
       set libjava $LIBJAVA;
@@ -267,7 +268,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
+    lappend cxxflags "-shared-libgcc -lgcj $libiconv"
   }
 
   if { [istarget "*-*-solaris*"] } {


However the compilation of PR16923.c now fails with...

Executing on host: /sw/src/fink.build/gcc46-4.5.999-20100421/darwin_objdir/gcc/xgcc -B/sw/src/fink.build/gcc46-4.5.999-20100421/darwin_objdir/gcc/ /sw/src/fink.build/gcc46-4.5.999-20100421/gcc-4.6-20100421/libjava/testsuite/libjava.jni/invocation/PR16923.c   -bind_at_load -multiply_defined suppress -I. -I.. -I/sw/src/fink.build/gcc46-4.5.999-20100421/gcc-4.6-20100421/libjava/testsuite/libjava.jni -I/sw/src/fink.build/gcc46-4.5.999-20100421/gcc-4.6-20100421/libjava/testsuite/../include -I/sw/src/fink.build/gcc46-4.5.999-20100421/gcc-4.6-20100421/libjava/testsuite/../classpath/include -fdollars-in-identifiers -L/sw/src/fink.build/gcc46-4.5.999-20100421/darwin_objdir/x86_64-apple-darwin10.3.0/./libjava/.libs -ljvm {-shared-libgcc -lgcj -L/sw/lib -liconv}  -lm   -o PR16923    (timeout = 300)
xgcc: unrecognized option '-shared-libgcc -lgcj -L/sw/lib -liconv'
output is:
xgcc: unrecognized option '-shared-libgcc -lgcj -L/sw/lib -liconv'

FAIL: PR16923.c compilation

Can anyone explain why the above syntax ends up adding wrappering
curly brackets around the evaluated $libiconv. This doesn't seem
to happen for $subdir, etc in the same jni.exp script.
           Jack

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PR43839 almost fixed
  2010-04-22  2:26 PR43839 almost fixed Jack Howarth
@ 2010-04-22  7:08 ` Dave Korn
  0 siblings, 0 replies; 2+ messages in thread
From: Dave Korn @ 2010-04-22  7:08 UTC (permalink / raw)
  To: Jack Howarth; +Cc: java, gcc

On 22/04/2010 03:25, Jack Howarth wrote:

> @@ -267,7 +268,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
> +    lappend cxxflags "-shared-libgcc -lgcj $libiconv"
>    }

> Can anyone explain why the above syntax ends up adding wrappering
> curly brackets around the evaluated $libiconv.

  Because that's what lappend does: it takes a list of *multiple* arguments,
and appends them as list elements to a variable.  By adding those gratuitous
quotes, you've turned the lappend command from multiple args into a single arg
with embedded spaces; you're thinking of shell scripting, but this is TCL.

  http://www.google.com/search?q=tcl+lappend

brings up various man pages.

    cheers,
      DaveK


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-22  7:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-22  2:26 PR43839 almost fixed Jack Howarth
2010-04-22  7:08 ` Dave Korn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).