This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch for Preview: Cross-Configury Tweaks (Updated)
- From: Mohan Embar <gnustuff at thisiscool dot com>
- To: GCJ Patches <java-patches at gcc dot gnu dot org>
- Date: Sat, 08 Mar 2003 00:37:55 -0600
- Subject: Patch for Preview: Cross-Configury Tweaks (Updated)
- Reply-to: gnustuff at thisiscool dot com
Hi Patch Folks,
I am resubmitting this, again taking the liberty of updating the ChangeLog
date and keeping this under Ranjit's name. The only change from the last
submission is that I changed Ranjit's ac_cv_exeext to ac_exeext.
I don't think this is perfect: for some reason, the cross compiler
I built with this produced an executable which didn't pick up
swt-XXX.dll. (It looked like it was searching for a library without
the .dll suffix.) Nevertheless, I think it is an order of magnitude better
than the existing version, which is downright wrong for cross and
crossed-native builds. And the patch in its current state allows a generated
cross compiler to build a crossed-native compiler because no JNI is required
by the cross compiler.
I felt a sense of urgency to resubmit this since Andrew said he
might look at patches this weekend. Ranjit: if you're not happy with this, speak up.
-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/
2003-03-07 Ranjit Mathew <rmathew at hotmail dot com>
* configure.in: Use "with_cross_host" to check if we are
being built with a cross-compiler.
Add ac_exeext to the file name used in a native build
to check if gcj has been built alongside.
Use this gcj only if it is not a crossed-native build,
otherwise assume cross-compiling gcj for the target is in
the path.
Eliminate native build check when building libltdl
* configure: Rebuilt.
* Makefile.am: Use cross-compiling gcjh from the path for
a crossed-native build.
* Makefile.in: Rebuilt.
Index: Makefile.am
===================================================================
RCS file: /cvsroot/gcc/gcc/libjava/Makefile.am,v
retrieving revision 1.264.2.10
diff -u -2 -r1.264.2.10 Makefile.am
--- Makefile.am 12 Feb 2003 20:00:03 -0000 1.264.2.10
+++ Makefile.am 23 Feb 2003 15:24:11 -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 23 Feb 2003 15:24:38 -0000
@@ -24,16 +24,14 @@
AM_CONFIG_HEADER(include/config.h gcj/libgcj-config.h)
-# Only use libltdl for native builds.
-if test -z "${with_cross_host}"; then
- AC_LIBLTDL_CONVENIENCE
- AC_LIBTOOL_DLOPEN
- DIRLTDL=libltdl
- AC_DEFINE(USE_LTDL)
- # Sigh. Libtool's macro doesn't do the right thing.
- INCLTDL="-I\$(top_srcdir)/libltdl $INCLTDL"
- # FIXME: this is a hack.
- sub_auxdir="`cd $ac_aux_dir && ${PWDCMD-pwd}`"
- ac_configure_args="$ac_configure_args --with-auxdir=$sub_auxdir"
-fi
+AC_LIBLTDL_CONVENIENCE
+AC_LIBTOOL_DLOPEN
+DIRLTDL=libltdl
+AC_DEFINE(USE_LTDL)
+# Sigh. Libtool's macro doesn't do the right thing.
+INCLTDL="-I\$(top_srcdir)/libltdl $INCLTDL"
+# FIXME: this is a hack.
+sub_auxdir="`cd $ac_aux_dir && ${PWDCMD-pwd}`"
+ac_configure_args="$ac_configure_args --with-auxdir=$sub_auxdir"
+
AC_SUBST(INCLTDL)
AC_SUBST(LIBLTDL)
@@ -472,5 +470,5 @@
AC_SUBST(gcc_version)
-if test "x${with_newlib}" = "xyes"; then
+if test -n "${with_cross_host}"; then
# We are being configured with a cross compiler. AC_REPLACE_FUNCS
# may not work correctly, because the compiler may not be able to
@@ -735,7 +733,14 @@
changequote([,])
fi
- if test -x "${builddotdot}/../../gcc/gcj"; then
- dir="`cd ${builddotdot}/../../gcc && ${PWDCMD-pwd}`"
- GCJ="$dir/gcj -B`${PWDCMD-pwd}`/ -B$dir/"
+ if test -x "${builddotdot}/../../gcc/gcj${ac_exeext}"; then
+ if test x"$build" = x"$host"; then
+ dir="`cd ${builddotdot}/../../gcc && ${PWDCMD-pwd}`"
+ GCJ="$dir/gcj -B`${PWDCMD-pwd}`/ -B$dir/"
+ else
+ # Crossed-native build (host=target and host!=build)
+ CANADIAN=yes
+ NULL_TARGET=no
+ GCJ="${target_alias}-gcj -B`${PWDCMD-pwd}`/"
+ fi
else
CANADIAN=yes