This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

Java Patches: -fno-org-xml-sax and -fno-org-w3c-dom


We recently discussed moving org.xml.sax and org.w3c.dom into their own
shared libraries, and adding a compiler flag to turn off linking them in
by default.  After some reflection it seems like a single flag isn't
really a good idea.  The -fno-jaxp idea isn't really workable as jaxp
will change over time.  The scheme implemented below seems flexible
enough...

There are two sets of patches below.  Ok?

AG


2002-11-30  Anthony Green  <green@redhat.com>

	* lang-options.h: Add -fno-org-xml-sax and -fno-org-w3c-dom.
	* gcj.texi (Code Generation): Document -fno-org-xml-sax and
	-fno-org-w3c-dom.

Index: gcc/java/gcj.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/gcj.texi,v
retrieving revision 1.42
diff -c -r1.42 gcj.texi
*** gcc/java/gcj.texi	25 Oct 2002 03:27:02 -0000	1.42
--- gcc/java/gcj.texi	1 Dec 2002 04:32:43 -0000
***************
*** 439,446 ****
  isn't carried out if @code{-C} was specified.) When compiling to native
  code, @code{-fno-optimize-static-class-initialization} will turn this
  optimization off, regardless of the optimization level in use.
- @end table
  
  
  @node Configure-time Options
  @section Configure-time Options
--- 439,451 ----
  isn't carried out if @code{-C} was specified.) When compiling to native
  code, @code{-fno-optimize-static-class-initialization} will turn this
  optimization off, regardless of the optimization level in use.
  
+ @item -fno-org-xml-sax
+ @item -fno-org-w3c-dom
+ Don't link with @command{gcj}'s default implementation of these packages.  This
+ is useful when you need to link with alternate implementations, such as
+ from Apache's Xerces project.
+ @end table
  
  @node Configure-time Options
  @section Configure-time Options
Index: gcc/java/lang-options.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/lang-options.h,v
retrieving revision 1.31
diff -c -r1.31 lang-options.h
*** gcc/java/lang-options.h	3 Mar 2002 08:35:11 -0000	1.31
--- gcc/java/lang-options.h	1 Dec 2002 04:32:43 -0000
***************
*** 60,62 ****
--- 60,67 ----
      N_("Never optimize static class initialization code") },
    { "-findirect-dispatch",
      N_("Use offset tables for virtual method calls") },
+   { "-fno-org-xml-sax",
+     N_("Don't link with gcj's default org.xml.sax library") },
+   { "-fno-org-w3c-dom",
+     N_("Don't link with gcj's default org.w3c.dom library") },
+ 





2002-11-30  Anthony Green  <green@redhat.com>

	* libgcj.spec.in: Add -fno-org-xml-sax and -fno-org-w3c-dom.
	* Makefile.am: Move org.xml.sax and org.w3c.dom into their own
	libraries.
	* Makefile.in: Rebuilt.

Index: libjava/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libjava/Makefile.am,v
retrieving revision 1.261
diff -c -r1.261 Makefile.am
*** libjava/Makefile.am	21 Nov 2002 10:45:12 -0000	1.261
--- libjava/Makefile.am	1 Dec 2002 04:32:47 -0000
***************
*** 29,35 ****
  cond_x_ltlibrary =
  endif
  
! toolexeclib_LTLIBRARIES = libgcj.la $(cond_x_ltlibrary)
  toolexeclib_DATA = libgcj.spec
  
  jardir = $(datadir)/java
--- 29,35 ----
  cond_x_ltlibrary =
  endif
  
! toolexeclib_LTLIBRARIES = libgcj.la lib-org-xml-sax.la lib-org-w3c-dom.la $(cond_x_ltlibrary)
  toolexeclib_DATA = libgcj.spec
  
  jardir = $(datadir)/java
***************
*** 147,152 ****
--- 147,209 ----
  	-version-info `grep -v '^\#' $(srcdir)/libtool-version`
  libgcj_la_LINK = $(LIBLINK)
  
+ lib_org_w3c_dom_la_SOURCES = org/w3c/dom/Attr.java \
+ org/w3c/dom/CDATASection.java \
+ org/w3c/dom/CharacterData.java \
+ org/w3c/dom/Comment.java \
+ org/w3c/dom/DOMException.java \
+ org/w3c/dom/DOMImplementation.java \
+ org/w3c/dom/Document.java \
+ org/w3c/dom/DocumentFragment.java \
+ org/w3c/dom/DocumentType.java \
+ org/w3c/dom/Element.java \
+ org/w3c/dom/Entity.java \
+ org/w3c/dom/EntityReference.java \
+ org/w3c/dom/NamedNodeMap.java \
+ org/w3c/dom/Node.java \
+ org/w3c/dom/NodeList.java \
+ org/w3c/dom/Notation.java \
+ org/w3c/dom/ProcessingInstruction.java \
+ org/w3c/dom/Text.java \
+ org/w3c/dom/ranges/DocumentRange.java \
+ org/w3c/dom/ranges/Range.java \
+ org/w3c/dom/ranges/RangeException.java \
+ org/w3c/dom/traversal/DocumentTraversal.java \
+ org/w3c/dom/traversal/NodeFilter.java \
+ org/w3c/dom/traversal/NodeIterator.java \
+ org/w3c/dom/traversal/TreeWalker.java
+ 
+ lib_org_xml_sax_la_SOURCES = org/xml/sax/ext/DeclHandler.java \
+ org/xml/sax/ext/LexicalHandler.java \
+ org/xml/sax/helpers/AttributeListImpl.java \
+ org/xml/sax/helpers/AttributesImpl.java \
+ org/xml/sax/helpers/DefaultHandler.java \
+ org/xml/sax/helpers/LocatorImpl.java \
+ org/xml/sax/helpers/NamespaceSupport.java \
+ org/xml/sax/helpers/NewInstance.java \
+ org/xml/sax/helpers/ParserAdapter.java \
+ org/xml/sax/helpers/ParserFactory.java \
+ org/xml/sax/helpers/XMLFilterImpl.java \
+ org/xml/sax/helpers/XMLReaderAdapter.java \
+ org/xml/sax/helpers/XMLReaderFactory.java \
+ org/xml/sax/AttributeList.java \
+ org/xml/sax/Attributes.java \
+ org/xml/sax/ContentHandler.java \
+ org/xml/sax/DTDHandler.java \
+ org/xml/sax/DocumentHandler.java \
+ org/xml/sax/EntityResolver.java \
+ org/xml/sax/ErrorHandler.java \
+ org/xml/sax/HandlerBase.java \
+ org/xml/sax/InputSource.java \
+ org/xml/sax/Locator.java \
+ org/xml/sax/Parser.java \
+ org/xml/sax/SAXException.java \
+ org/xml/sax/SAXNotRecognizedException.java \
+ org/xml/sax/SAXNotSupportedException.java \
+ org/xml/sax/SAXParseException.java \
+ org/xml/sax/XMLFilter.java \
+ org/xml/sax/XMLReader.java
+ 
  libgcjx_la_SOURCES = $(x_nat_source_files)
  EXTRA_libgcjx_la_SOURCES = $(x_java_source_files)
  libgcjx_la_DEPENDENCIES = libgcj-@gcc_version@.jar $(x_javao_files)
***************
*** 168,173 ****
--- 225,232 ----
  all_java_source_files = \
      $(java_source_files) \
      $(built_java_source_files) \
+     $(lib_org_xml_sax_la_SOURCES) \
+     $(lib_org_w3c_dom_la_SOURCES) \
      $(x_java_source_files)
  
  all_java_class_files = $(all_java_source_files:.java=.class)
***************
*** 218,224 ****
  $(c_files): java/lang/fdlibm.h java/lang/ieeefp.h java/lang/mprec.h
  
  ## FIXME: GNU make.
! $(javao_files) $(x_javao_files): %.lo: %.java
  	$(GCJCOMPILE) -o $@ $<
  
  ## Pass the list of object files to libtool in a temporary file to 
--- 277,283 ----
  $(c_files): java/lang/fdlibm.h java/lang/ieeefp.h java/lang/mprec.h
  
  ## FIXME: GNU make.
! $(javao_files) $(x_javao_files) $(lib_org_w3c_dom_la_OBJECTS) $(lib_org_xml_sax_la_OBJECTS): %.lo: %.java
  	$(GCJCOMPILE) -o $@ $<
  
  ## Pass the list of object files to libtool in a temporary file to 
***************
*** 2218,2277 ****
  java/util/zip/ZipFile.java \
  java/util/zip/ZipInputStream.java \
  java/util/zip/ZipOutputStream.java \
- org/w3c/dom/Attr.java \
- org/w3c/dom/CDATASection.java \
- org/w3c/dom/CharacterData.java \
- org/w3c/dom/Comment.java \
- org/w3c/dom/DOMException.java \
- org/w3c/dom/DOMImplementation.java \
- org/w3c/dom/Document.java \
- org/w3c/dom/DocumentFragment.java \
- org/w3c/dom/DocumentType.java \
- org/w3c/dom/Element.java \
- org/w3c/dom/Entity.java \
- org/w3c/dom/EntityReference.java \
- org/w3c/dom/NamedNodeMap.java \
- org/w3c/dom/Node.java \
- org/w3c/dom/NodeList.java \
- org/w3c/dom/Notation.java \
- org/w3c/dom/ProcessingInstruction.java \
- org/w3c/dom/Text.java \
- org/w3c/dom/ranges/DocumentRange.java \
- org/w3c/dom/ranges/Range.java \
- org/w3c/dom/ranges/RangeException.java \
- org/w3c/dom/traversal/DocumentTraversal.java \
- org/w3c/dom/traversal/NodeFilter.java \
- org/w3c/dom/traversal/NodeIterator.java \
- org/w3c/dom/traversal/TreeWalker.java \
- org/xml/sax/ext/DeclHandler.java \
- org/xml/sax/ext/LexicalHandler.java \
- org/xml/sax/helpers/AttributeListImpl.java \
- org/xml/sax/helpers/AttributesImpl.java \
- org/xml/sax/helpers/DefaultHandler.java \
- org/xml/sax/helpers/LocatorImpl.java \
- org/xml/sax/helpers/NamespaceSupport.java \
- org/xml/sax/helpers/ParserAdapter.java \
- org/xml/sax/helpers/ParserFactory.java \
- org/xml/sax/helpers/XMLFilterImpl.java \
- org/xml/sax/helpers/XMLReaderAdapter.java \
- org/xml/sax/helpers/XMLReaderFactory.java \
- org/xml/sax/AttributeList.java \
- org/xml/sax/Attributes.java \
- org/xml/sax/ContentHandler.java \
- org/xml/sax/DTDHandler.java \
- org/xml/sax/DocumentHandler.java \
- org/xml/sax/EntityResolver.java \
- org/xml/sax/ErrorHandler.java \
- org/xml/sax/HandlerBase.java \
- org/xml/sax/InputSource.java \
- org/xml/sax/Locator.java \
- org/xml/sax/Parser.java \
- org/xml/sax/SAXException.java \
- org/xml/sax/SAXNotRecognizedException.java \
- org/xml/sax/SAXNotSupportedException.java \
- org/xml/sax/SAXParseException.java \
- org/xml/sax/XMLFilter.java \
- org/xml/sax/XMLReader.java \
  $(rmi_java_source_files) \
  $(awt_java_source_files) \
  $(convert_source_files) \
--- 2277,2282 ----
Index: libjava/libgcj.spec.in
===================================================================
RCS file: /cvs/gcc/gcc/libjava/libgcj.spec.in,v
retrieving revision 1.23
diff -c -r1.23 libgcj.spec.in
*** libjava/libgcj.spec.in	31 Mar 2002 18:24:59 -0000	1.23
--- libjava/libgcj.spec.in	1 Dec 2002 04:32:50 -0000
***************
*** 4,9 ****
  # to link with libgcj.
  #
  %rename lib liborig
! *lib: -lgcj -lm @LIBICONV@ @GCSPEC@ @THREADSPEC@ @ZLIBSPEC@ @SYSTEMSPEC@ %(libgcc) %(liborig)
  
  *jc1: @HASH_SYNC_SPEC@ @DIVIDESPEC@ @CHECKREFSPEC@ @JC1GCSPEC@ @EXCEPTIONSPEC@ -fkeep-inline-functions
--- 4,12 ----
  # to link with libgcj.
  #
  %rename lib liborig
! *lib: -lgcj %{!fno-org-xml-sax:-l-org-xml-sax} \
! 	%{!fno-org-w3c-dom:-l-org-w3c-dom} \
! 	-lm @LIBICONV@ @GCSPEC@ @THREADSPEC@ \
! 	@ZLIBSPEC@ @SYSTEMSPEC@ %(libgcc) %(liborig)
  
  *jc1: @HASH_SYNC_SPEC@ @DIVIDESPEC@ @CHECKREFSPEC@ @JC1GCSPEC@ @EXCEPTIONSPEC@ -fkeep-inline-functions



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