[jboss-cvs] repository.jboss.com/apache-xerces/2.7.1-brew/src ...
Vivek Lakshmanan
vivekl at redhat.com
Sun Feb 25 16:19:27 EST 2007
User: vivekl
Date: 07/02/25 16:19:27
Added: apache-xerces/2.7.1-brew/src XJavac.java
Xerces-J-src.2.7.1.tar.gz xerces-j2-build.patch
xerces-j2-libgcj.patch
Log:
- Add brew built xerces 2.7.1
Revision Changes Path
1.1 date: 2007/02/25 21:19:27; author: vivekl; state: Exp;repository.jboss.com/apache-xerces/2.7.1-brew/src/XJavac.java
Index: XJavac.java
===================================================================
/*
* Copyright 2001-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.xerces.util;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.util.JavaEnvUtils;
import org.apache.tools.ant.taskdefs.Javac;
import java.lang.StringBuffer;
import java.util.Properties;
import java.util.Locale;
/**
* The implementation of the javac compiler for IBM JDK 1.4
*
* The purpose of this task is to diagnose whether we're
* running on an IBM 1.4 JVM; if we are, to
* set up the bootclasspath such that the build will
* succeed; if we aren't, then invoke the Javac12
* task.
*
* @author Neil Graham, IBM
*/
public class XJavac extends Javac {
/**
* Run the compilation.
*
* @exception BuildException if the compilation has problems.
*/
public void execute() throws BuildException {
if(isJDK14OrHigher()) {
// maybe the right one; check vendor:
// by checking system properties:
Properties props = null;
try {
props = System.getProperties();
} catch (Exception e) {
throw new BuildException("unable to determine java vendor because could not access system properties!");
}
// this is supposed to be provided by all JVM's from time immemorial
String vendor = ((String)props.get("java.vendor")).toUpperCase(Locale.ENGLISH);
if(vendor.indexOf("IBM") >= 0){
// we're on an IBM 1.4; fiddle with the bootclasspath.
Path bcp = createBootclasspath();
String javaHome = System.getProperty("java.home");
StringBuffer bcpMember = new StringBuffer();
bcpMember.append(javaHome).append("/lib/charsets.jar:");
bcp.createPathElement().setPath(bcpMember.toString());
bcpMember.replace(javaHome.length(), bcpMember.length(), "/lib/core.jar:");
bcp.createPathElement().setPath(bcpMember.toString());
bcpMember.replace(javaHome.length(), bcpMember.length(), "/lib/graphics.jar:");
bcp.createPathElement().setPath(bcpMember.toString());
bcpMember.replace(javaHome.length(), bcpMember.length(), "/lib/javaws.jar:");
bcp.createPathElement().setPath(bcpMember.toString());
bcpMember.replace(javaHome.length(), bcpMember.length(), "/lib/jaws.jar:");
bcp.createPathElement().setPath(bcpMember.toString());
bcpMember.replace(javaHome.length(), bcpMember.length(), "/lib/security.jar:");
bcp.createPathElement().setPath(bcpMember.toString());
bcpMember.replace(javaHome.length(), bcpMember.length(), "/lib/server.jar:");
bcp.createPathElement().setPath(bcpMember.toString());
bcpMember.replace(javaHome.length(), bcpMember.length(), "/lib/ext/JawBridge.jar:");
bcp.createPathElement().setPath(bcpMember.toString());
bcpMember.replace(javaHome.length(), bcpMember.length(), "/lib/ext/gskikm.jar:");
bcp.createPathElement().setPath(bcpMember.toString());
bcpMember.replace(javaHome.length(), bcpMember.length(), "/lib/ext/ibmjceprovider.jar:");
bcp.createPathElement().setPath(bcpMember.toString());
bcpMember.replace(javaHome.length(), bcpMember.length(), "/lib/ext/indicim.jar:");
bcp.createPathElement().setPath(bcpMember.toString());
bcpMember.replace(javaHome.length(), bcpMember.length(), "/lib/ext/jaccess.jar:");
bcp.createPathElement().setPath(bcpMember.toString());
bcpMember.replace(javaHome.length(), bcpMember.length(), "/lib/ext/ldapsec.jar:");
bcp.createPathElement().setPath(bcpMember.toString());
bcpMember.replace(javaHome.length(), bcpMember.length(), "/lib/ext/oldcertpath.jar");
bcp.createPathElement().setPath(bcpMember.toString());
setBootclasspath(bcp);
}
// need to do special things for Sun too and also
// for Apple, HP and Blackdown: a Linux port of Sun Java
else if( (vendor.indexOf("SUN") >= 0) ||
(vendor.indexOf("BLACKDOWN") >= 0) ||
(vendor.indexOf("APPLE") >= 0) ||
(vendor.indexOf("HEWLETT-PACKARD") >= 0)) {
// we're on an SUN 1.4; fiddle with the bootclasspath.
// since we can't eviscerate XML-related info here,
// we must use the classpath
Path bcp = createBootclasspath();
Path clPath = getClasspath();
bcp.append(clPath);
String currBCP = (String)props.get("sun.boot.class.path");
Path currBCPath = new Path(null);
currBCPath.createPathElement().setPath(currBCP);
bcp.append(currBCPath);
setBootclasspath(bcp);
}
}
// now just do the normal thing:
super.execute();
}
/**
* Checks whether the JDK version is 1.4 or higher. If it's not
* JDK 1.4 we check whether we're on a future JDK by checking
* that we're not on JDKs 1.0, 1.1, 1.2 or 1.3. This check by
* exclusion should future proof this task from new versions of
* Ant which are aware of higher JDK versions.
*
* @return true if the JDK version is 1.4 or higher.
*/
private boolean isJDK14OrHigher() {
final String version = JavaEnvUtils.getJavaVersion();
return version.equals(JavaEnvUtils.JAVA_1_4) ||
(!version.equals(JavaEnvUtils.JAVA_1_3) &&
!version.equals(JavaEnvUtils.JAVA_1_2) &&
!version.equals(JavaEnvUtils.JAVA_1_1) &&
!version.equals(JavaEnvUtils.JAVA_1_0));
}
}
1.1 date: 2007/02/25 21:19:27; author: vivekl; state: Exp;repository.jboss.com/apache-xerces/2.7.1-brew/src/Xerces-J-src.2.7.1.tar.gz
<<Binary file>>
1.1 date: 2007/02/25 21:19:27; author: vivekl; state: Exp;repository.jboss.com/apache-xerces/2.7.1-brew/src/xerces-j2-build.patch
Index: xerces-j2-build.patch
===================================================================
--- build.xml.orig 2005-07-26 16:09:07.000000000 -0400
+++ build.xml 2006-08-11 17:57:09.000000000 -0400
@@ -19,7 +19,8 @@
<project default="usage" basedir=".">
<!-- enable compilation under IBM JDK 1.4 -->
- <taskdef name="xjavac" classname="org.apache.xerces.util.XJavac"/>
+ <taskdef name="xjavac" classname="org.apache.xerces.util.XJavac"
+ classpath="./tools/bin/xjavac.jar"/>
<!-- Allow properties following these statements to be overridden -->
<!-- Note that all of these don't have to exist. They've just been defined
@@ -69,7 +70,7 @@
<property name="packages" value="org.*"/>
<property name="doc.generator" value="org.apache.stylebook.StyleBook"/>
- <property name="doc.generator.package" value="${tools.dir}/stylebook-1.0-b2.jar"/>
+ <property name="doc.generator.package" value="./tools/stylebook-1.0-b2.jar"/>
<property name="build.dir" value="./build"/>
<property name="build.src" value="${build.dir}/src"/>
@@ -83,7 +84,6 @@
<property name="distsrc.dir" value="${build.dir}/${parser.shortname}-${parser_version}"/>
<property name="disttools.dir" value="${build.dir}/tools"/>
<property name="distbin.dir" value="${build.dir}/${parser.shortname}-${parser_version}"/>
- <property name='src.apis.zip' value="${tools.dir}/xml-commons-external-src.zip"/>
<filter token="year" value="${year}"/>
<filter token="version" value="${parser.Version}"/>
@@ -195,27 +195,6 @@
javax.xml.parsers.ConvertToURI.java">
</fileset>
</copy>
-
- <!-- now deal with API's: -->
- <unzip src="${src.apis.zip}" dest="${build.src}">
- <patternset
- includes="org/xml/sax/**
- javax/xml/**
- javax/xml/datatype/**
- javax/xml/namespace/**
- javax/xml/parsers/**
- javax/xml/transform/**
- javax/xml/validation/**
- javax/xml/xpath/**
- org/w3c/dom/*
- org/w3c/dom/events/**
- org/w3c/dom/html/**
- org/w3c/dom/ls/**
- org/w3c/dom/ranges/**
- org/w3c/dom/traversal/**
- org/w3c/dom/xpath/**"
- />
- </unzip>
<!-- substitute tokens as needed -->
<replace file="${build.dir}/src/org/apache/xerces/impl/Version.java"
@@ -311,7 +290,7 @@
</copy>
<xjavac srcdir="${build.tests}"
destdir="${build.dest}"
- classpath="${tools.dir}/${jar.apis}:${build.dir}/classes:./tools/junit.jar"
+ classpath="${tools.dir}/${jar.apis}:${build.dir}/classes:${tools.dir}/junit.jar"
debug="${debug}"
includeAntRuntime="false"
includeJavaRuntime="true"/>
@@ -354,9 +333,10 @@
<target name="docs" depends="prepare, prepare-docs">
<echo message="Building docs for ${parser.Name} ${parser.Version} ..." />
<java fork="yes"
- classpath="${java.class.path}:${doc.generator.package}:./tools/xalan.jar"
+ classpath="${java.class.path}:${doc.generator.package}:${tools.dir}/xalan.jar"
classname="${doc.generator}"
failOnError="yes">
+ <jvmarg value="-Djava.awt.headless=true"/>
<arg value="targetDirectory=${build.docs}"/>
<arg value="${build.dir}/xdocs/docs-book.xml"/>
<arg value="${build.dir}/xdocs/style"/>
@@ -997,20 +977,6 @@
<replace file="${build.dir}/src/org/apache/xerces/parsers/AbstractSAXParser.java"
token="return (fConfiguration instanceof XML11Configurable);" value="return false;"/>
- <!-- now deal with API's: -->
- <unzip src="${src.apis.zip}" dest="${build.src}">
- <patternset
- includes="org/xml/sax/**
- javax/xml/parsers/**
- org/w3c/dom/*
- org/w3c/dom/events/**
- org/w3c/dom/html/**
- org/w3c/dom/ranges/**
- org/w3c/dom/traversal/**"
- />
- </unzip>
-
-
<!-- substitute tokens as needed -->
<replace file="${build.dir}/src/org/apache/xerces/impl/Version.java"
token="@@VERSION@@" value="${parser.Name} ${parser.Version}"/>
1.1 date: 2007/02/25 21:19:27; author: vivekl; state: Exp;repository.jboss.com/apache-xerces/2.7.1-brew/src/xerces-j2-libgcj.patch
Index: xerces-j2-libgcj.patch
===================================================================
Also apply the xjavac classpath hack when running under libgcj.
http://issues.apache.org/bugzilla/show_bug.cgi?id=34551
http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=152255
--- tools/org/apache/xerces/util/XJavac.java~ 2005-06-10 10:18:47 +0100
+++ tools/org/apache/xerces/util/XJavac.java 2005-06-10 11:14:35 +0100
@@ -97,7 +97,8 @@
else if( (vendor.indexOf("SUN") >= 0) ||
(vendor.indexOf("BLACKDOWN") >= 0) ||
(vendor.indexOf("APPLE") >= 0) ||
- (vendor.indexOf("HEWLETT-PACKARD") >= 0)) {
+ (vendor.indexOf("HEWLETT-PACKARD") >= 0) ||
+ (vendor.indexOf("FREE SOFTWARE FOUNDATION") >= 0)) {
// we're on an SUN 1.4; fiddle with the bootclasspath.
// since we can't eviscerate XML-related info here,
// we must use the classpath
More information about the jboss-cvs-commits
mailing list