PATCH: Fix canadian cross build for libjava (Re: Does canadian cross build work in libjava?)

H. J. Lu hjl@lucon.org
Wed Jul 3 13:46:00 GMT 2002


On Wed, Jul 03, 2002 at 12:32:46AM -0700, H. J. Lu wrote:
> Does canadian cross build work in libjava? Has anyone tried?
> 

Here is a patch to fix canadian cross build for libjava.


H.J.
-------------- next part --------------
2002-07-03  H.J. Lu <hjl@gnu.org>

	* Makefile.am (ZIP): Fix Canadian cross.
	(GCJH): Likewise.
	* Makefile.in: Regenerated.

	* configure.in: Support none-newlibe Canadian cross.
	* configure: Regenerated.

--- libjava/Makefile.am.build	Wed Jul  3 00:28:57 2002
+++ libjava/Makefile.am	Wed Jul  3 08:17:45 2002
@@ -55,13 +55,13 @@ bin_SCRIPTS = addr2name.awk
 ## the tools from the path.
 if CANADIAN
 if NULL_TARGET
+ZIP = jar
+else
 ## In this case, gcj is found outside the build tree.  However, zip is
 ## found in the build tree.
 ZIP = $(MULTIBUILDTOP)../$(COMPPATH)/fastjar/jar$(EXEEXT)
-else
-ZIP = jar
 endif
-GCJH = gcjh
+GCJH = $(host_alias)-gcjh
 else # CANADIAN
 GCJH = $(MULTIBUILDTOP)../$(COMPPATH)/gcc/gcjh$(EXEEXT)
 ZIP = $(MULTIBUILDTOP)../$(COMPPATH)/fastjar/jar$(EXEEXT)
--- libjava/configure.in.build	Wed Jul  3 00:29:06 2002
+++ libjava/configure.in	Wed Jul  3 08:23:17 2002
@@ -491,10 +491,10 @@ if test "x${with_newlib}" = "xyes"; then
 
    # If Canadian cross, then don't pick up tools from the build
    # directory.
-   if test x"$build" != x"$with_cross_host" && x"$build" != x"$target"; then
+   if test x"$build" != x"$with_cross_host" && test x"$build" != x"$host"; then
       CANADIAN=yes
       GCC_UNWIND_INCLUDE=
-      GCJ="${target_alias}-gcj"
+      GCJ="${host_alias}-gcj"
    fi
    NATIVE=no
 else
@@ -720,7 +720,14 @@ changequote(<<,>>)
       builddotdot=`echo ${with_multisubdir} | sed -e 's:[^/][^/]*:..:g'`
 changequote([,])
    fi
-   if test -x "${builddotdot}/../../gcc/gcj"; then
+
+   # If Canadian cross, then don't pick up tools from the build
+   # directory.
+   if test x"$build" != x"$with_cross_host" && test x"$build" != x"$host"; then
+      CANADIAN=yes
+      NULL_TARGET=yes
+      GCJ="${host_alias}-gcj"
+   elif test -x "${builddotdot}/../../gcc/gcj"; then
       dir="`cd ${builddotdot}/../../gcc && pwd`"
       GCJ="$dir/gcj -B`pwd`/ -B$dir/"
    else


More information about the Gcc-patches mailing list