This is the mail archive of the mailing list for the Java project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch for Review: ${target}-gcjh for Native Builds

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

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

-- Mohan

2003-11-11  Mohan Embar  <>

	* (java.install-common) Add
	symlink for $(target_noncanonical)-gcjh for
	native builds.

RCS file: /cvs/gcc/gcc/gcc/java/,v
retrieving revision 1.122
diff -u -2 -r1.122
---	4 Nov 2003 00:25:48 -0000	1.122
+++	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 @@
+# 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 ; \

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]