harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r413362 - in /incubator/harmony/enhanced/classlibadapter/trunk: bin/java build.xml vmi/Makefile
Date Sat, 10 Jun 2006 20:42:12 GMT
Author: hindessm
Date: Sat Jun 10 13:42:12 2006
New Revision: 413362

URL: http://svn.apache.org/viewvc?rev=413362&view=rev
Log:
Better (?) build structure, and java wrapper from HARMONY-583.

Added:
    incubator/harmony/enhanced/classlibadapter/trunk/bin/java   (with props)
    incubator/harmony/enhanced/classlibadapter/trunk/build.xml   (with props)
    incubator/harmony/enhanced/classlibadapter/trunk/vmi/Makefile   (with props)

Added: incubator/harmony/enhanced/classlibadapter/trunk/bin/java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlibadapter/trunk/bin/java?rev=413362&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlibadapter/trunk/bin/java (added)
+++ incubator/harmony/enhanced/classlibadapter/trunk/bin/java Sat Jun 10 13:42:12 2006
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+export JCHEVM_HOME=/usr/local
+ADAPTER=${0%bin/java}
+if [ -z "$ADAPTER" ]; then
+  ADAPTER=.
+fi
+CLASSLIB_HOME=$ADAPTER/../classlib/deploy/jdk/jre
+
+die() {
+  echo "$@"
+  exit
+}
+
+test -d $CLASSLIB_HOME/lib/boot || \
+  die CLASSLIB_HOME should be set to the path of Harmony jre
+
+JC_BIN=$JCHEVM_HOME/bin/jc
+JCZIP=$JCHEVM_HOME/share/jc/jc.zip
+KERNEL=$ADAPTER/build/classes
+#NIO=$ADAPTER/build/classes
+#ADAPTER_JARS=$KERNEL:$NIO
+ADAPTER_JARS=$KERNEL
+CLASSLIB_JARS=$(ls $CLASSLIB_HOME/lib/boot/*.jar $CLASSLIB_HOME/lib/boot/*/*.jar | tr '\n'
':')
+
+JC_BOOT=$JCZIP:$ADAPTER_JARS:$CLASSLIB_JARS
+ADAPTER_LIBS=$ADAPTER
+CLASSLIB_LIBS=$CLASSLIB_HOME/bin
+JC_LIB_PATH=$ADAPTER_LIBS:$CLASSLIB_LIBS
+
+while [ -n "$1" ]; do
+  
+  case "$1" in
+    -Xbootclasspath/a:*)
+      JC_BOOT=$JC_BOOT:${1#-Xbootclasspath/a:}:
+      ;;
+    -Xbootclasspath/p:*)
+      JC_BOOT=${1#-Xbootclasspath/p:}:$JC_BOOT
+      ;;
+    -showversion*)
+      # not supported ignoring
+      ;;
+    *)
+      args[${#args[@]}]="$1"
+      ;;
+  esac
+  shift
+done
+
+export LD_LIBRARY_PATH=$ADAPTER_LIBS:$CLASSLIB_LIBS:$LD_LIBRARY_PATH
+
+exec $JC_BIN -Djava.library.path=$JC_LIB_PATH \
+             -Djava.boot.class.path=$JC_BOOT "${args[@]}"

Propchange: incubator/harmony/enhanced/classlibadapter/trunk/bin/java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/classlibadapter/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlibadapter/trunk/build.xml?rev=413362&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlibadapter/trunk/build.xml (added)
+++ incubator/harmony/enhanced/classlibadapter/trunk/build.xml Sat Jun 10 13:42:12 2006
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+
+     Copyright 2006 The Apache Software Foundation or its licensors,
+     as applicable
+     
+     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.
+
+  -->
+
+<project name="build-classlibadapter" default="default" basedir=".">
+    <description>
+    	Build the classlibadapter
+    </description>
+
+    <property name="build.output" location="build" />
+    <property name="build.classes" location="${build.output}/classes" />
+    <property environment="env" />
+    <property name="classlib.home.default" location="../classlib" />
+    <condition property="classlib.home" value="${env.CLASSLIB_HOME}"
+               else="${classlib.home.default}">
+        <isset property="env.CLASSLIB_HOME" />
+    </condition>
+    <condition property="make" value="nmake" else="make">
+        <os family="Windows" />
+    </condition>
+
+    <available file="${classlib.home}/deploy/jdk/include/jni.h" type="file"
+               property="classlib.home.is.valid" />
+
+    <path id="classlib.boot">
+        <fileset dir="${classlib.home}/deploy/jdk/jre/lib/boot">
+            <include name="**/*.jar" />
+        </fileset>
+    </path>
+
+    <target name="default" depends="build" />
+
+    <target name="build" depends="check-classlib-home">
+        <mkdir dir="${build.classes}" />
+        <javac destdir="${build.classes}" source="1.5" target="jsr14">
+            <src path="modules/kernel/src/main/java" />
+            <src path="modules/nio/src/main/java" />
+            <classpath refid="classlib.boot" />
+        </javac>
+
+        <exec executable="${make}" dir="vmi">
+            <env key="CLASSLIB_HOME" path="${classlib.home}" />
+        </exec>
+
+    </target>
+
+    <target name="check-classlib-home">
+        <fail unless="classlib.home.is.valid">
+...
+
+CLASSLIB_HOME (or the ant property "classlib.home") should be set to
+point to the root of the Harmony classlib.
+
+        </fail>
+
+        <echo>classlib.home = ${classlib.home}</echo>
+
+    </target>
+    
+    <target name="test">
+    </target>
+
+    <target name="clean">
+        <delete dir="${build.classes}" />
+        <exec executable="${make}" dir="vmi">
+            <arg value="clean" />
+        </exec>
+    </target>
+
+</project>

Propchange: incubator/harmony/enhanced/classlibadapter/trunk/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlibadapter/trunk/vmi/Makefile
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlibadapter/trunk/vmi/Makefile?rev=413362&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlibadapter/trunk/vmi/Makefile (added)
+++ incubator/harmony/enhanced/classlibadapter/trunk/vmi/Makefile Sat Jun 10 13:42:12 2006
@@ -0,0 +1,17 @@
+all: ../libvmi.so
+
+CXXFLAGS = \
+  -Wall -DLINUX \
+  -I$(CLASSLIB_HOME)/deploy/include -I$(CLASSLIB_HOME)/deploy/jdk/include
+
+LDFLAGS= \
+  -L$(CLASSLIB_HOME)/deploy/jdk/jre/bin -lhyprt -lhythr -lhysig \
+  -L$(CLASSLIB_HOME)/native-src/linux.IA32/lib -lhyzip -lhypool
+
+OBJ=vmi.o java_lang_reflect_Array.o
+
+../libvmi.so: $(OBJ)
+	$(CXX) -shared $< -o $@ $(LDFLAGS)
+
+clean:
+	-rm -f *.o ../libvmi.so

Propchange: incubator/harmony/enhanced/classlibadapter/trunk/vmi/Makefile
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message