This is the mail archive of the java-patches@gcc.gnu.org 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: FYI: unbreak the build


The java.endorsed.dirs patch broke the build.  This patch fixes it.
Sorry this took so long to get out.

I don't have an explanation for why I didn't find this earlier.  I
think some of this didn't used to happen before because we were only
making convenience libraries and not real libraries.

This patch is really ugly.  The problem was that when building in
external/, we couldn't find libgcj.spec.  For some reason, the setting
of GCJ in configure.ac is not being used (maybe this is what changed?
I don't know).

I tried adding a -B to find libgcj.spec, but libtool drops that
argument.  I don't know why.  Then I tried adding -L$(top_builddir),
but that fails because libgcj has not yet been built, so the `-lgcj'
in libgcj.spec causes a failure.

So in the end I resorted to an evil hack.  I create a fake libgcj.spec
that is used only when linking these libraries.  This omits the -lgcj.
I think (but I'm not certain) that we don't really need to link these
against libgcj, as they are compiled BC.  (If it turns out we do need
to do that, perhaps it could be done by compiling these libraries to
.o in the top-level Makefile.  I haven't looked into that
possibility.)

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* external/w3c_dom/Makefile.in: Rebuilt.
	* external/w3c_dom/Makefile.am (libw3c_gcj_la_GCJFLAGS): Include
	AM_GCJFLAGS.
	(libw3c_gcj_la_LDFLAGS): New variable.
	(libw3c_gcj_la_DEPENDENCIES): Likewise.
	(hack/libgcj.spec): New target.
	* external/sax/Makefile.in: Rebuilt.
	* external/sax/Makefile.am (libsax_gcj_la_GCJFLAGS): Include
	AM_GCJFLAGS.
	(libsax_gcj_la_LDFLAGS): New variable.
	(libsax_gcj_la_DEPENDENCIES): Likewise.
	(hack/libgcj.spec): New target.

Index: external/sax/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libjava/external/sax/Makefile.am,v
retrieving revision 1.4
diff -u -r1.4 Makefile.am
--- external/sax/Makefile.am 24 Mar 2005 00:04:06 -0000 1.4
+++ external/sax/Makefile.am 24 Mar 2005 18:14:36 -0000
@@ -38,7 +38,18 @@
 toolexeclib_LTLIBRARIES = libsax-gcj.la
 
 libsax_gcj_la_SOURCES =	sax.jar
-libsax_gcj_la_GCJFLAGS = -findirect-dispatch
+libsax_gcj_la_GCJFLAGS = -findirect-dispatch $(AM_GCJFLAGS)
+## When compiling we use the real libgcj.spec.  When linking, we use a
+## different one.  See the comment below explaining why.
+libsax_gcj_la_LDFLAGS = -Lhack
+libsax_gcj_la_DEPENDENCIES = hack/libgcj.spec
+
+## This is an evil hack to let us build our .so without depending on
+## libgcj.so -- which hasn't been built yet.  Since we're building BC,
+## we don't need to link against libgcj.so anyway.
+hack/libgcj.spec:
+	@mkdir -p hack
+	echo '*lib: %(liborig)' > hack/libgcj.spec
 
 source_files = \
 org/xml/sax/SAXNotSupportedException.java \
Index: external/w3c_dom/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libjava/external/w3c_dom/Makefile.am,v
retrieving revision 1.4
diff -u -r1.4 Makefile.am
--- external/w3c_dom/Makefile.am 24 Mar 2005 00:04:08 -0000 1.4
+++ external/w3c_dom/Makefile.am 24 Mar 2005 18:14:36 -0000
@@ -38,7 +38,19 @@
 toolexeclib_LTLIBRARIES = libw3c-gcj.la
 
 libw3c_gcj_la_SOURCES =	w3c.jar
-libw3c_gcj_la_GCJFLAGS = -findirect-dispatch
+libw3c_gcj_la_GCJFLAGS = -findirect-dispatch $(AM_GCJFLAGS)
+## When compiling we use the real libgcj.spec.  When linking, we use a
+## different one.  See the comment below explaining why.
+libw3c_gcj_la_LDFLAGS = -Lhack
+libw3c_gcj_la_DEPENDENCIES = hack/libgcj.spec
+
+## This is an evil hack to let us build our .so without depending on
+## libgcj.so -- which hasn't been built yet.  Since we're building BC,
+## we don't need to link against libgcj.so anyway.
+hack/libgcj.spec:
+	@mkdir -p hack
+	echo '*lib: %(liborig)' > hack/libgcj.spec
+
 
 source_files = \
 org/w3c/dom/xpath/XPathNamespace.java \


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