cp-tools-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Cp-tools-discuss] Building gjdoc+gnujaxp with gcj 4.0


From: Julian Scheid
Subject: [Cp-tools-discuss] Building gjdoc+gnujaxp with gcj 4.0
Date: Sat, 27 Nov 2004 18:48:20 +0100
User-agent: Mozilla Thunderbird 0.8 (X11/20040913)

Here are instructions for building a standalone gjdoc binary with gcj 4.0. Of course this is only a preliminary solution until the autotooled build is fixed.

-> fetch gcc cvs head, compile and install.

I tested these instructions with gcj (GCC) 4.0.0 20041125 (experimental) which I configured as follows:

--program-suffix=-4.0 --enable-languages=java --with-system-zlib --enable-java-awt=gtk --disable-static --disable-checking --disable-multilib

Current cvs head is known to fail if srcdir==builddir, so choose an alternate build directory.

-> make sure the correct gcj is on your path by doing gcj --version

-> get latest gjdoc and gnujaxp sources from cvs head

-> for now, apply the attached patch to gnujaxp. It adds missing imports, removes static bindings to libxmlj, and fixes a bug in the implementation of XSLT's substring function.

-> change to some temporary build directory

-> execute the following:

JAXP_ROOT_DIR=/path/to/jaxp \
        GJDOC_ROOT_DIR=/path/to/gjdoc \
        make -f /path/to/gjdoc/examples/Makefile

-> you should end up with a binary called "gjdoc" in the current directory.

Known issues:
- since gnujaxp doesn't correctly support disable-output-escaping ATM, a couple of  s end up in the output. - if you select an alternate stylesheet and click on a link, the stylesheet is reverted to the default.

Julian

cvs diff: Diffing source
cvs diff: Diffing source/gnu
cvs diff: Diffing source/gnu/xml
cvs diff: Diffing source/gnu/xml/aelfred2
cvs diff: Diffing source/gnu/xml/dom
Index: source/gnu/xml/dom/ImplementationSource.java
===================================================================
RCS file: 
/cvsroot/classpathx/jaxp/source/gnu/xml/dom/ImplementationSource.java,v
retrieving revision 1.6
diff -u -r1.6 ImplementationSource.java
--- source/gnu/xml/dom/ImplementationSource.java        12 Nov 2004 18:44:30 
-0000      1.6
+++ source/gnu/xml/dom/ImplementationSource.java        27 Nov 2004 17:29:43 
-0000
@@ -68,7 +68,11 @@
     acc.add(new gnu.xml.dom.DomImpl());
     try
       {
-        acc.add(new gnu.xml.libxmlj.dom.GnomeDocumentBuilder());
+        
acc.add(Class.forName("gnu.xml.libxmlj.dom.GnomeDocumentBuilder").newInstance());
+      }
+    catch (Exception e)
+      {
+        // libxmlj not available
       }
     catch (UnsatisfiedLinkError e)
       {
cvs diff: Diffing source/gnu/xml/dom/ls
cvs diff: Diffing source/gnu/xml/libxmlj
cvs diff: Diffing source/gnu/xml/libxmlj/dom
cvs diff: Diffing source/gnu/xml/libxmlj/sax
cvs diff: Diffing source/gnu/xml/libxmlj/transform
cvs diff: Diffing source/gnu/xml/libxmlj/util
cvs diff: Diffing source/gnu/xml/pipeline
cvs diff: Diffing source/gnu/xml/transform
Index: source/gnu/xml/transform/Stylesheet.java
===================================================================
RCS file: /cvsroot/classpathx/jaxp/source/gnu/xml/transform/Stylesheet.java,v
retrieving revision 1.22
diff -u -r1.22 Stylesheet.java
--- source/gnu/xml/transform/Stylesheet.java    26 Nov 2004 14:22:42 -0000      
1.22
+++ source/gnu/xml/transform/Stylesheet.java    27 Nov 2004 17:29:45 -0000
@@ -78,6 +78,7 @@
 import gnu.xml.xpath.Root;
 import gnu.xml.xpath.Test;
 import gnu.xml.xpath.XPathImpl;
+import gnu.xml.xpath.NodeTypeTest;
 
 /**
  * An XSL stylesheet.
Index: source/gnu/xml/transform/TransformerImpl.java
===================================================================
RCS file: 
/cvsroot/classpathx/jaxp/source/gnu/xml/transform/TransformerImpl.java,v
retrieving revision 1.15
diff -u -r1.15 TransformerImpl.java
--- source/gnu/xml/transform/TransformerImpl.java       24 Nov 2004 20:48:42 
-0000      1.15
+++ source/gnu/xml/transform/TransformerImpl.java       27 Nov 2004 17:29:45 
-0000
@@ -67,6 +67,7 @@
 import org.w3c.dom.DOMImplementation;
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
+import org.w3c.dom.Text;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;
 import org.xml.sax.ext.LexicalHandler;
cvs diff: Diffing source/gnu/xml/util
cvs diff: Diffing source/gnu/xml/xpath
Index: source/gnu/xml/xpath/SubstringFunction.java
===================================================================
RCS file: /cvsroot/classpathx/jaxp/source/gnu/xml/xpath/SubstringFunction.java,v
retrieving revision 1.2
diff -u -r1.2 SubstringFunction.java
--- source/gnu/xml/xpath/SubstringFunction.java 19 Nov 2004 21:53:16 -0000      
1.2
+++ source/gnu/xml/xpath/SubstringFunction.java 27 Nov 2004 17:29:46 -0000
@@ -75,28 +75,26 @@
     int p = (val2 instanceof Double) ?
       ((Double) val2).intValue() :
         (int) Math.round(_number(context, val2));
-    int l = s.length() + 1;
-    if (arg3 != null)
-      {
-        Object val3 = arg3.evaluate(context, pos, len);
-        l = (val3 instanceof Double) ?
-          ((Double) val3).intValue() :
-            (int) Math.round(_number(context, val3));
-      }
     p--;
-    l--;
     if (p < 0)
       {
         p = 0;
       }
-    if (l > s.length())
-      {
-        l = s.length();
-      }
-    if (l < 0)
+
+    int l = s.length() - p;
+
+    if (arg3 != null)
       {
-        l = 0;
+        Object val3 = arg3.evaluate(context, pos, len);
+        int v3 = (val3 instanceof Double) ?
+          ((Double) val3).intValue() :
+            (int) Math.round(_number(context, val3));
+        if (v3 < l) 
+          {
+            l = v3;
+          }
       }
+
     return s.substring(p, p + l);
   }
 
cvs diff: Diffing source/javax
cvs diff: Diffing source/javax/xml
cvs diff: Diffing source/javax/xml/datatype
cvs diff: Diffing source/javax/xml/namespace
cvs diff: Diffing source/javax/xml/parsers
cvs diff: Diffing source/javax/xml/transform
Index: source/javax/xml/transform/TransformerFactory.java
===================================================================
RCS file: 
/cvsroot/classpathx/jaxp/source/javax/xml/transform/TransformerFactory.java,v
retrieving revision 1.14
diff -u -r1.14 TransformerFactory.java
--- source/javax/xml/transform/TransformerFactory.java  31 Oct 2004 15:17:01 
-0000      1.14
+++ source/javax/xml/transform/TransformerFactory.java  27 Nov 2004 17:29:46 
-0000
@@ -106,7 +106,16 @@
           }
       }
     while (className == null && count < 3);
-    return new gnu.xml.libxmlj.transform.GnomeTransformerFactory();
+    try 
+      {
+        Class t = 
Class.forName("gnu.xml.libxmlj.transform.GnomeTransformerFactory");
+        return (TransformerFactory) t.newInstance();
+      }
+    catch (Exception e)
+      { 
+        throw new TransformerFactoryConfigurationError(e,
+                                                       "error instantiating 
class " + className);
+      } 
   }
   
   private static String getFactoryClassName(ClassLoader loader, int attempt)
cvs diff: Diffing source/javax/xml/transform/dom
cvs diff: Diffing source/javax/xml/transform/sax
cvs diff: Diffing source/javax/xml/transform/stream
cvs diff: Diffing source/javax/xml/validation
cvs diff: Diffing source/javax/xml/xpath
cvs diff: Diffing source/org
cvs diff: Diffing source/org/w3c
cvs diff: Diffing source/org/w3c/dom
cvs diff: Diffing source/org/w3c/dom/bootstrap
cvs diff: Diffing source/org/w3c/dom/css
cvs diff: Diffing source/org/w3c/dom/events
cvs diff: Diffing source/org/w3c/dom/html
cvs diff: Diffing source/org/w3c/dom/ls
cvs diff: Diffing source/org/w3c/dom/ranges
cvs diff: Diffing source/org/w3c/dom/stylesheets
cvs diff: Diffing source/org/w3c/dom/traversal
cvs diff: Diffing source/org/w3c/dom/views
cvs diff: Diffing source/org/w3c/dom/xpath
cvs diff: Diffing source/org/xml
cvs diff: Diffing source/org/xml/sax
cvs diff: Diffing source/org/xml/sax/ext
cvs diff: Diffing source/org/xml/sax/helpers

reply via email to

[Prev in Thread] Current Thread [Next in Thread]