This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch for Preview: Cross-Configury Tweaks (Updated)
- From: Mohan Embar <gnustuff at thisiscool dot com>
- To: rmathew at hotmail dot com
- Cc: GCJ Patches <java-patches at gcc dot gnu dot org>
- Date: Mon, 24 Mar 2003 22:02:39 -0600
- Subject: Re: Patch for Preview: Cross-Configury Tweaks (Updated)
- Reply-to: gnustuff at thisiscool dot com
Ranjit,
Would you mind taking a trip back to Cross-Configury Land? I've been
knee-deep in this for several weeks and need a second set of eyes.
I wanted you to take a look at this variation of your cross-configury
patch. I plan to discuss this approach at length and make references
to discussions on this and other lists, but I'm too tired to do
this now and still need to do tons more testing to validate this.
The "problem" with the variant previously submitted is that the built
cross-compiler is only capable of building the crossed-native compiler
and its libraries. The fact that:
if test -z "${with_cross_host}"
falls into what was previously the newlib piece means that the compiler
is crippled to the point of not having HAVE_BACKTRACE defined and a
slew of other problems (like building an application which uses JNI).
I have therefore changed this back to its previous test:
if test "x${with_newlib}" = "xyes"; then
What do you think of my variant? I think you'll be able to understand
what I'm doing without my documenting it. (If I set out to document this
in detail now, I'll procrastinate on this for another few weeks. If you
don't feel like dealing with this, I understand and will follow up in
awhile with more detail.)
-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/
(Makefile.am is unchanged from the previous iteration.)
Index: Makefile.am
===================================================================
RCS file: /cvsroot/gcc/gcc/libjava/Makefile.am,v
retrieving revision 1.264.2.12
diff -u -2 -r1.264.2.12 Makefile.am
--- Makefile.am 1 Mar 2003 22:57:52 -0000 1.264.2.12
+++ Makefile.am 25 Mar 2003 03:59:19 -0000
@@ -53,8 +53,9 @@
## found in the build tree.
ZIP = $(MULTIBUILDTOP)../$(COMPPATH)/fastjar/jar
+GCJH = gcjh
else
ZIP = jar
+GCJH = $(target_alias)-gcjh
endif
-GCJH = gcjh
else # CANADIAN
GCJH = $(MULTIBUILDTOP)../$(COMPPATH)/gcc/gcjh
Index: configure.in
===================================================================
RCS file: /cvsroot/gcc/gcc/libjava/configure.in,v
retrieving revision 1.142.4.6
diff -u -2 -r1.142.4.6 configure.in
--- configure.in 20 Feb 2003 09:12:24 -0000 1.142.4.6
+++ configure.in 25 Mar 2003 03:59:21 -0000
@@ -735,12 +735,53 @@
changequote([,])
fi
- if test -x "${builddotdot}/../../gcc/gcj"; then
- dir="`cd ${builddotdot}/../../gcc && ${PWDCMD-pwd}`"
- GCJ="$dir/gcj -B`${PWDCMD-pwd}`/ -B$dir/"
+ which_gcj=default
+ built_gcc_dir="`cd ${builddotdot}/../../gcc && ${PWDCMD-pwd}`"
+ if test -n "${with_cross_host}"; then
+ # We are being configured with a cross compiler
+ NATIVE=no
+ # FIXME: Allow the executable extension of the build machine
+ # (i.e. to allow a MingW cross compiler)
+ if test -x "${built_gcc_dir}/gcj"; then
+ if test x"$build" = x"$with_cross_host"; then
+ # Ordinary cross (host!=target and host=build)
+ which_gcj=built
+ else
+ # Canadian cross (host!=target and host!=build)
+ which_gcj=cross
+ fi
+ else
+ which_gcj=path
+ fi
else
- CANADIAN=yes
- NULL_TARGET=yes
- GCJ="gcj -B`${PWDCMD-pwd}`/"
+ # We are being configured with a native or crossed-native compiler
+ if test -x "${built_gcc_dir}/gcj${ac_exeext}"; then
+ if test x"$build" = x"$host"; then
+ # True native build (host=target and host=build)
+ which_gcj=built
+ else
+ # Crossed-native build (host=target and host!=build)
+ which_gcj=cross
+ fi
+ else
+ which_gcj=path
+ fi
fi
+ case "${which_gcj}" in
+ built)
+ GCJ="$built_gcc_dir/gcj -B`${PWDCMD-pwd}`/ -B$built_gcc_dir/"
+ ;;
+ cross)
+ # See the comment in Makefile.am about CANADIAN being a misnomer
+ CANADIAN=yes
+ NULL_TARGET=no
+ GCJ="${target_alias}-gcj -B`${PWDCMD-pwd}`/"
+ ;;
+ path)
+ # See the comment in Makefile.am about CANADIAN being a misnomer
+ CANADIAN=yes
+ NULL_TARGET=yes
+ GCJ="gcj -B`${PWDCMD-pwd}`/"
+ ;;
+ esac
fi