This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch for Review: ${target}-gcjh for Native Builds
- From: Mohan Embar <gnustuff at thisiscool dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: GCJ Patches <java-patches at gcc dot gnu dot org>
- Date: Tue, 11 Nov 2003 07:07:19 -0600
- Subject: Patch for Review: ${target}-gcjh for Native Builds
- Reply-to: gnustuff at thisiscool dot com
Hi People,
This patch adds a symlink for ${target}-gcjh for native builds
in the same way that we have an explicitly-prefixed ${target}-gcc,
${target}-gcj, etc.
I tried to articulate my rationale for this before, but didn't
do a good job of it. Here is my reasoning: although gcjh is
currently classified as a "target-independent tool", I believe
that it's not quite the same animal as its brethren jv-scan
and jcf-dump because it can actually contribute to the build
process.
Suppose that we're on Linux and only have a (Linux,Windows)
cross compiler. We want to write a portable makefile that
can produce Windows executables using the cross compiler
on Linux as well as with the Windows native compiler on Windows.
If we invoke gcjh in this makefile, we *must* use mingw33-gcjh
in the Linux makefile. Therefore, having a mingw32-gcjh
in the Windows native compiler allows us to use this Makefile
unchanged on Windows.
Tested on (i686-pc-linux-gnu,i686-pc-linux-gnu,i686-pc-linux-gnu),
(i686-pc-linux-gnu,i686-pc-linux-gnu,i686-pc-mingw32) and
(i686-pc-linux-gnu,i686-pc-mingw32,i686-pc-mingw32).
-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/
ChangeLog
2003-11-11 Mohan Embar <gnustuff@thisiscool.com>
* Make-lang.in: (java.install-common) Add
symlink for $(target_noncanonical)-gcjh for
native builds.
Index: Make-lang.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Make-lang.in,v
retrieving revision 1.122
diff -u -2 -r1.122 Make-lang.in
--- Make-lang.in 4 Nov 2003 00:25:48 -0000 1.122
+++ Make-lang.in 11 Nov 2003 12:51:52 -0000
@@ -44,4 +44,5 @@
JAVA_INSTALL_NAME = `echo gcj|sed '$(program_transform_name)'`
JAVA_TARGET_INSTALL_NAME = $(target_noncanonical)-`echo gcj|sed '$(program_transform_name)'`
+GCJH_TARGET_INSTALL_NAME = $(target_noncanonical)-`echo gcjh|sed '$(program_transform_name)'`
# Actual names to use when installing a cross-compiler.
@@ -175,4 +176,9 @@
java.install-normal:
+# Install gcj as well as the target-independent tools.
+# For a native build, we special-case gcjh and also install
+# its explicitly-prefixed variant. This allows us to write
+# portable makefiles for both cross builds (where gcjh *must*
+# be explicitly prefixed) and native builds.
java.install-common: installdirs
-if [ -f $(GCJ)$(exeext) ]; then \
@@ -196,4 +202,9 @@
$(INSTALL_PROGRAM) $$tool$(exeext) $(DESTDIR)$(bindir)/$$tool_transformed_name$(exeext); \
chmod a+x $(DESTDIR)$(bindir)/$$tool_transformed_name$(exeext); \
+ if [ $$tool = gcjh ]; then \
+ rm -f $(DESTDIR)$(bindir)/$(GCJH_TARGET_INSTALL_NAME)$(exeext); \
+ ( cd $(DESTDIR)$(bindir) && \
+ $(LN) $$tool_transformed_name$(exeext) $(GCJH_TARGET_INSTALL_NAME)$(exeext) ); \
+ fi; \
fi ; \
done