You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by qi...@apache.org on 2009/02/28 10:10:37 UTC

svn commit: r748797 [2/2] - in /harmony/enhanced/jdktools/branches/java6: ./ make/ modules/jdktools/ modules/jdktools/.settings/ modules/jdktools/META-INF/ modules/jdktools/make/ modules/jdktools/src/ modules/jdktools/src/main/ modules/jdktools/src/mai...

Modified: harmony/enhanced/jdktools/branches/java6/make/properties.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/make/properties.xml?rev=748797&r1=748796&r2=748797&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/make/properties.xml (original)
+++ harmony/enhanced/jdktools/branches/java6/make/properties.xml Sat Feb 28 09:10:31 2009
@@ -19,387 +19,55 @@
 
  -->
 
-<project name="Top-Level property definitions" default="echo" basedir="..">
+<project name="Top-Level property definitions">
     <description>
         Ant file of common properties to be imported by other ant files
     </description>
-
-    <!-- Debug or release version -->
-    <property name="hy.cfg" value="debug" />
-
-    <!-- Javac properties -->
-    <!-- Explicitly set to ECJ as the default compiler. -->
-    <property name="hy.javac.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter" />
-    <property name="hy.javac.source" value="1.5" />
-    <property name="hy.javac.target" value="1.5" />
-    <property name="hy.javac.maxmem" value="384M" />
-
-    <condition property="hy.javac.debug" value="on" else="off">
-        <equals arg1="${hy.cfg}" arg2="debug" />
-    </condition>
-
-    <!-- Local variable tables should be available in debug, and unavailable in release modes. -->
-    <condition property="build.compilerarg" value="-nowarn -g" else="-nowarn -g:lines,source">
-        <equals arg1="${hy.cfg}" arg2="debug" />
-    </condition>
+    
+    <dirname property="prop.imported.basedir" file="${ant.file.Top-Level property definitions}"/>
+    <property name="jdktools.base.dir" location="${prop.imported.basedir}/.." />
+    
+    <property file="jdktools.properties"/>
+    <property file="${user.home}/jdktools.properties"/>
 
     <!-- Test run property -->
     <property name="hy.test.forkmode" value="perBatch" />
-    <property name="hy.test.timeout" value="900000" />
-    <property name="hy.test.vm.name" value="drl" />
-    <property name="hy.test.vmargs" value="" />
+    <property name="hy.test.vm.name" value="drl"/>
 
-    <!-- Conditions for operating systems -->
-    <condition property="is.windows">
-        <os family="Windows" />
-    </condition>
-    <condition property="is.linux">
-        <os name="linux" />
-    </condition>
-    <condition property="is.macosx">
-        <os name="mac os x" />
-    </condition>
-    <condition property="is.freebsd">
-        <os name="freebsd" />
-    </condition>
-    <condition property="is.aix">
-        <os name="aix" />
-    </condition>
-    <condition property="is.unix">
-        <os family="unix" />
-    </condition>
-
-    <!-- Normalized operating system family -->
-    <condition property="hy.os.family" value="windows">
-        <isset property="is.windows" />
-    </condition>
-    <property name="hy.os.family" value="unix" />
-
-    <!-- Normalized operating system name -->
-
-    <!-- this special case makes sense -->
-    <condition property="hy.os" value="windows">
-        <isset property="is.windows"/>
-    </condition>
-    <condition property="hy.os" value="linux">
-        <os name="linux" />
-    </condition>
-    <condition property="hy.os" value="freebsd">
-        <os name="freebsd" />
-    </condition>
-    <condition property="hy.os" value="macosx">
-        <isset property="is.macosx"/>
-    </condition>
-    <condition property="hy.os" value="aix">
-        <os name="aix" />
-    </condition>
-
-    <property name="hy.os" value="${os.name}" />
-
-
-    <!-- Conditions for different architectures -->
-    <condition property="is.x86_64">
-        <or>
-            <equals arg1="x86_64" arg2="${os.arch}"/>
-            <equals arg1="amd64" arg2="${os.arch}"/>
-        </or>
-    </condition>
-    <condition property="is.x86">
-	<and>
-	    <not>
-        <isset property="is.x86_64" />
-            </not>
-            <or>
-                <equals arg1="x86" arg2="${os.arch}"/>
-                <equals arg1="i386" arg2="${os.arch}"/>
-                <equals arg1="i686" arg2="${os.arch}"/>
-            </or>
-        </and>
-    </condition>
-    <condition property="is.ia64">
-        <equals arg1="ia64" arg2="${os.arch}"/>
-    </condition>
-    <condition property="is.64bit">
-        <or>
-            <isset property="is.ia64" />
-            <isset property="is.x86_64" />
-        </or>
-    </condition>
-    <condition property="is.32bit">
-        <or>
-            <isset property="is.x86" />
-        </or>
-    </condition>
-    <condition property="hy.bits" value="32">
-        <isset property="is.32bit" />
-    </condition>
-    <property name="hy.bits" value="64" />
-
-    <!-- Normalized architecture name -->
-    <condition property="hy.arch" value="x86_64">
-        <isset property="is.x86_64" />
-    </condition>
-    <condition property="hy.arch" value="x86">
-        <and>
-            <isset property="is.x86" />
-            <isset property="is.32bit" />
-        </and>
-    </condition>
-    <property name="hy.arch" value="${os.arch}" />
+    <!-- set the path root for the classlib : must be relative to the build directory -->
+    <property name="external.classlib.loc" value="${jdktools.base.dir}/../working_classlib/deploy" />
+    <property name="external.drlvm.loc" value="${jdktools.base.dir}/../working_vm/deploy" />
+    <property name="external.resources.loc" value="${jdktools.base.dir}/../common_resources" />
+    <property name="external.resources" location="${external.resources.loc}" />
+
+    <property name="harmony.jdktools" location="${jdktools.base.dir}"/>
+    <condition property="hy.deploy" value="${hy.hdk}">
+        <isset property="hy.hdk"/>
+    </condition>
+    <property name="hy.deploy" location="${external.drlvm.loc}"/>
+    <property name="hy.hdk" location="${external.classlib.loc}" />
+    <property name="jdktools.deploy.dir" location="${jdktools.base.dir}/deploy/jdk" />
+    <property name="jretools.deploy.dir" location="${jdktools.base.dir}/deploy/jdk/jre" />
+
+    <!-- set the path root for the external resources  -->
+    <property name="common.resources.loc" value="${jdktools.base.dir}/../common_resources" />
+    <property name="common.resources" location="${common.resources.loc}" />
+    <fail>
+        <condition>
+            <not><available file="${common.resources}/make/properties.xml"/></not>
+        </condition>
+        Primary dependency is missing: common_resources.
+        You need to check it out from SVN repository or specify it's location:
+        ant -Dcommon.resources.loc=path
+    </fail>
     
-    <condition property="hy.arch.define" value="HYX86">
-        <equals arg1="${hy.arch}" arg2="x86"/>
-    </condition>
-    <condition property="hy.arch.define" value="HYX86_64">
-        <equals arg1="${hy.arch}" arg2="x86_64"/>
-    </condition>
-    <condition property="hy.arch.define" value="HYIA64">
-        <equals arg1="${hy.arch}" arg2="ia64"/>
-    </condition>
-
-    <!-- use native compiler option "-march=pentium3" on 32-bit linux/unix platform -->
-    <condition property="hy.cflags" value="-march=pentium3">
-        <and>
-            <isset property="is.32bit"/>
-            <not>
-                <isset property="is.windows"/>
-            </not>
-        </and>
-    </condition>
+    <import file="${common.resources}/make/properties.xml"/>
+    <import file="${common.resources}/make/depends.xml"/>
     
-    <!-- Normalized platform name -->
-    <property name="hy.platform" value="${hy.os}.${hy.arch}"/>
-    <property name="hy.platform.path" value="${hy.os}/${hy.arch}"/>
-
-    <condition property="exe.suffix" value=".exe">
-        <isset property="is.windows"/>
-    </condition>
-    <property name="exe.suffix" value="" />
-
-    <condition property="shlib.suffix" value=".dll">
-        <isset property="is.windows"/>
-    </condition>
-    <property name="shlib.suffix" value=".so" />
-
-    <condition property="progdb.suffix" value=".pdb">
-        <isset property="is.windows" />
-    </condition>
-
-    <condition property="manifest.suffix" value=".manifest">
-        <isset property="is.windows" />
-    </condition>
-
-    <condition property="linklib.suffix" value=".lib">
-        <isset property="is.windows"/>
-    </condition>
-    <property name="linklib.suffix" value=".so" />
-
-    <condition property="make.command" value="nmake.exe">
-        <isset property="is.windows"/>
-    </condition>
-    <condition property="make.command" value="gmake">
-        <or>
-            <isset property="is.aix"/>
-            <isset property="is.freebsd"/>
-        </or>
-    </condition>
-    <property name="make.command" value="make" />
-
-    <condition property="make.arg" value="/nologo">
-        <isset property="is.windows"/>
-    </condition>
-    <property name="make.arg" value="" />
-
-    <property name="png.home" value="/usr" />
-    <property name="lcms.home" value="/usr" />
-    <property name="jpeg.home" value="/usr" />
-
-    <!-- default property for call-modules macro - i.e. all modules -->
-    <property name="build.module" value="*" />
-    <property name="exclude.module" value="nothing" />
-
-    <!-- names of exclude lists, used by prepare-exclude-list macro -->
-    <property name="common.exclude.file" value="exclude.common" />
-    <property name="common.exclude.interm" value="exclude.interm" />
-    <property name="platform.exclude.file"
-              value="exclude.${hy.platform}.${hy.test.vm.name}" />
-    <property name="platform.exclude.interm"
-              value="exclude.${hy.platform}.${hy.test.vm.name}.interm" />
-
-    <target name="echo" depends="svn-prop, svn-info"
+    <property file="${jdktools.base.dir}/make/depends.properties" />
+    
+    <target name="tools-echo" depends="echo"
             description="Display the properties defined by this ant file" >
-        <echo>
-Harmony release configuration property:
-
-  hy.cfg = ${hy.cfg}
-
-Harmony javac properties:
-
-  hy.javac.compiler = ${hy.javac.compiler}
-  hy.javac.target = ${hy.javac.target}
-  hy.javac.source = ${hy.javac.source}
-  hy.javac.debug  = ${hy.javac.debug}
-  hy.javac.maxmem = ${hy.javac.maxmem}
-
-Harmony platform properties:
-
-  hy.os = ${hy.os}
-  hy.arch = ${hy.arch}
-  hy.bits = ${hy.bits}
-  hy.platform = ${hy.platform}
-  hy.platform.path = ${hy.platform.path}
-
-  is.windows = ${is.windows}
-  is.unix = ${is.unix}
-  is.linux = ${is.linux}
-  is.32bit = ${is.32bit}
-  is.64bit = ${is.64bit}
-  is.x86 = ${is.x86}
-  is.x86_64 = ${is.x86_64}
-  is.ia64 = ${is.ia64}
-
-  exe.suffix = ${exe.suffix}
-  shlib.suffix = ${shlib.suffix}
-  make.command = ${make.command}
-
-  hy.hdk = ${hy.hdk}
-  hy.cflags = ${hy.cflags}
-  hy.arch.define = ${hy.arch.define}
-
-
-The following property is only set if the "svn-prop" target has been
-called:
-
-  svn.revision = ${svn.revision}
-
-
-The following property is only set if the "svn-info" target has been
-called:
-
-  svn.info = ${svn.info}
-
-Ant native properties, for information, but please use Harmony
-properties in preference to these:
-
-  os.name = ${os.name}
-  os.arch = ${os.arch}
-
-        </echo>
     </target>
 
-    <target name="svn-prop">
-        <exec executable="svn">
-            <arg value="--non-interactive" />
-            <arg value="info" />
-            <redirector outputproperty="svn.revision">
-                <outputfilterchain>
-                    <linecontains>
-                        <contains value="Revision: " />
-                    </linecontains>
-                    <tokenfilter>
-                        <replacestring from="Revision: " to=""/>
-                    </tokenfilter>
-                </outputfilterchain>
-            </redirector>
-        </exec>
-    </target>
-
-    <target name="svn-info">
-        <exec executable="svn"
-              failifexecutionfails="false"
-              resultproperty="svn.rc">
-            <arg value="info" />
-            <redirector outputproperty="svn.info.tmp">
-                <outputfilterchain>
-                    <linecontainsregexp>
-                        <regexp pattern="Repository Root:|Revision:" />
-                    </linecontainsregexp>
-                    <tokenfilter>
-                        <replacestring from="Repository Root: " to=""/>
-                        <replacestring from="Revision: " to=" "/>
-                    </tokenfilter>
-                    <striplinebreaks/>
-                </outputfilterchain>
-            </redirector>
-        </exec>
-        <condition property="svn.info" value="${svn.info.tmp}" >
-            <equals arg1="${svn.rc}" arg2="0" />
-        </condition>
-        <tstamp>
-            <format property="svn.info" pattern="'Unknown revision at' dd-MMM-yyyy hh:mm aa"/>
-        </tstamp>
-    </target>
-
-    <macrodef name="call-modules">
-        <attribute name="target" />
-        <sequential>
-            <subant target="@{target}">
-                <dirset dir="modules" includes="${build.module}" excludes="${exclude.module}" />
-            </subant>
-        </sequential>
-    </macrodef>
-
-
-    <!-- macros for modules -->
-    <!-- TOFIX move to a shared file in the HDK/build/make directory. -->
-
-    <macrodef name="make">
-        <attribute name="dir" />
-        <attribute name="target" default="" />
-        <sequential>
-            <echo>Making "@{target}" in @{dir}</echo>
-            <echo> LOCAL MAKE DEFN L ${hy.drlvm}</echo>
-            <exec failonerror="true"
-                  executable="${make.command}"
-                  dir="@{dir}">
-                <env key="HY_HDK" value="${hy.hdk}" />
-                <env key="HY_DRLVM" value="${hy.drlvm}" />
-                <env key="HY_JDKTOOLS" value="${harmony.jdktools}" />
-                <env key="HY_CFG" value="${hy.cfg}" />
-                <env key="HY_ARCH" value="${hy.arch}" />
-                <env key="HY_OS" value="${hy.os}" />
-                <env key="HY_NO_SIG" value="false" />
-                <env key="HY_NO_THR" value="false" />
-                <env key="HY_SHLIB_SUFFIX" value="${shlib.suffix}" />
-                <env key="HY_PLATFORM" value="${hy.platform}" />
-                <env key="HY_CFLAGS" value="${hy.cflags}" />
-                <env key="HY_ARCH_DEFINE" value="${hy.arch.define}" />
-                <arg line="${make.arg}" />
-                <arg line="@{target}" />
-            </exec>
-        </sequential>
-    </macrodef>
-
-    <!-- To use with -Dtest.case=... option                   -->
-    <!-- if ${test.case} is provided in package+class form    -->
-    <!-- it is converted to dir+filename form                 -->
-    <pathconvert property="converted.tc" >
-        <path path="${test.case}"/>
-        <compositemapper>
-            <unpackagemapper from="${basedir}${file.separator}*Test" to="*Test.java" />
-            <globmapper from="${basedir}${file.separator}*.java" to="*.java" />
-        </compositemapper>
-    </pathconvert>
-
-    <!-- Concatenate several exclude lists into single list -->
-    <macrodef name="prepare-exclude-list">
-       <attribute name="moduleName"/>
-       <!-- directory with exclude lists for the module -->
-       <attribute name="dir"/>
-       <!-- name of concatenated list, should be an absolute pathname -->
-       <attribute name="result"/>
-       <sequential>
-           <echo message="" file="@{result}"/>
-           <concat destfile="@{result}" force="yes" fixlastline="yes" append="true">
-               <fileset dir="@{dir}">
-                   <include name="${common.exclude.file}"/> 
-                   <include name="${platform.exclude.file}"/>
-                   <include name="${common.exclude.interm}" if="exclude.interm" />
-                   <include name="${platform.exclude.interm}" if="exclude.interm" />
-		   <size value="0" when="more"/>
-               </fileset>
-           </concat>
-       </sequential>
-   </macrodef>
-
 </project>

Propchange: harmony/enhanced/jdktools/branches/java6/modules/jdktools/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Feb 28 09:10:31 2009
@@ -0,0 +1 @@
+bin

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/build.xml?rev=748797&r1=748796&r2=748797&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/build.xml (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/build.xml Sat Feb 28 09:10:31 2009
@@ -20,7 +20,6 @@
     <description>Build for JPDA component</description>
 
     <!-- import common properties -->
-    <property name="hy.hdk" location="${basedir}/../../deploy" />
     <property name="tests.build.output" location="${basedir}/../../build/tests" />
     <import file="../../make/properties.xml" />
 
@@ -41,9 +40,18 @@
         </or>
     </fileset>
 
-    <property file="../../make/depends.properties" />
+    <target name="fetch-depends">
+        <fetch dep="jdt"/>
+        <fetch dep="icu"/>
+    </target>
+
+    <target name="check-depends">
+        <check-one-file src="${jdt.url}" dest="${jdt.jdi.jar}" />
+        <check-one-file src="${jdt.url}" dest="${jdt.jdimodel.jar}" />
+        <check-one-file src="${icu.url}" dest="${icu.jar}" />
+    </target>
 
-    <target name="build" depends="build-java, build-native" />
+    <target name="build" depends="check-depends, build-java, build-native" />
 
     <target name="clean" depends="clean-java, clean-native" />
 
@@ -63,20 +71,12 @@
 
     <target name="compile-java">
         <echo message="Compiling JPDA classes" />
-
+        <ensure-javac/>
         <mkdir dir="${hy.build}" />
-        <mkdir dir="${hy.jdk}/lib" />
 
-        <javac sourcepath=""
+        <hy.javac sourcepath=""
                srcdir="${hy.jpda.src.main.java}"
-               destdir="${hy.build}"
-               compiler="${hy.javac.compiler}"
-               memoryMaximumSize="${hy.javac.maxmem}"
-               source="${hy.javac.source}" 
-               target="${hy.javac.target}"
-               debug="${hy.javac.debug}">
-
-            <compilerarg line="${build.compilerarg}" />
+               destdir="${hy.build}">
 
             <!-- HDK class library -->
             <classpath>
@@ -90,14 +90,14 @@
                 <pathelement path="${jdt.jdi.jar}"/>
                 <pathelement path="${jdt.jdimodel.jar}"/>
             </classpath>
-        </javac>
+        </hy.javac>
     </target>
 
     <!-- create jdtstub.jar to resolve JDI implementation dependency -->
     <target name="build-jar" depends="svn-info">
-        <mkdir dir="${hy.jdk}/lib" />
+        <mkdir dir="${jdktools.deploy.dir}/lib" />
 
-        <jar destfile="${hy.jdk}/lib/jdtstub.jar"
+        <jar destfile="${jdktools.deploy.dir}/lib/jdtstub.jar"
              manifest="${hy.jpda}/META-INF/MANIFEST.MF">
 
             <fileset refid="classes" />
@@ -110,7 +110,7 @@
             <metainf file="${hy.hdk}/LICENSE"/>
         </jar>
 
-        <jar destfile="${hy.jdk}/lib/jdtstub-src.jar">
+        <jar destfile="${jdktools.deploy.dir}/lib/jdtstub-src.jar">
             <fileset dir="${hy.jpda.src.main.java}" />
             <manifest>
                 <attribute name="Implementation-Version" value="${svn.info}"/> 
@@ -123,8 +123,8 @@
 
     <!-- copy all required jars with JDI implementation and dependent classes -->
     <target name="copy-jars">
-        <mkdir dir="${hy.jdk}/lib" />
-        <copy todir="${hy.jdk}/lib" flatten="true">
+        <mkdir dir="${jdktools.deploy.dir}/lib" />
+        <copy todir="${jdktools.deploy.dir}/lib" flatten="true">
             <fileset file="${icu.jar}"/>
             <fileset file="${jdt.jdimodel.jar}"/>
         </copy>
@@ -138,11 +138,13 @@
         <!-- Build agent shared lib -->
         <make dir="${hy.jpda.src.main.native}/jdwp/${hy.os.family}/agent" />
         
-        <!-- Build transport shared lib -->
-        <make dir="${hy.jpda.src.main.native}/jdwp/${hy.os.family}/transport" />
+        <!-- Build socket transport shared lib -->
+        <make dir="${hy.jpda.src.main.native}/jdwp/${hy.os.family}/transport/dt_socket" />
+
+        <antcall target="-build-native-windows" />
 
         <!-- copy to our local jdk skeleton -->
-        <copy todir="${hy.jdk}/jre/bin" overwrite="yes">
+        <copy todir="${jdktools.deploy.dir}/jre/bin" overwrite="yes">
             <fileset dir="${hy.jpda.src.main.native}/jdwp/${hy.os.family}">
                 <include name="*${shlib.suffix}"/>
                 <include name="*${progdb.suffix}" if="is.windows" />
@@ -150,6 +152,11 @@
         </copy>
     </target>
 
+    <target name="-build-native-windows" if="is.windows">
+        <!-- Build shared memory transport shared lib on Windows -->
+        <make dir="${hy.jpda.src.main.native}/jdwp/${hy.os.family}/transport/dt_shmem" />
+    </target>
+
     <!-- internal target for local and global test run sequence -->
     <target name="test-module" depends="build-tests, prepare-exclude, run-tests" />
 
@@ -157,11 +164,8 @@
     <target name="clean-java">
         <echo message="Cleaning JPDA classes" />
 
-        <delete file="${hy.jdk}/lib/jdtstub.jar" />
-        <delete file="${hy.jdk}/lib/jdtstub-src.jar" />
-
-        <delete file="${hy.jdk}/lib/${icu.jar.name}" />
-        <delete file="${hy.jdk}/lib/${jdt.jdimodel.jar.name}" />
+        <delete file="${jdktools.deploy.dir}/lib/jdtstub.jar" />
+        <delete file="${jdktools.deploy.dir}/lib/jdtstub-src.jar" />
 
         <delete includeemptydirs="true" failonerror="false">
             <!--fileset refid="classes" /-->
@@ -174,22 +178,23 @@
     <target name="clean-native">
         <echo message="Cleaning JPDA natives" />
         <make dir="${hy.jpda.src.main.native}/jdwp/${hy.os.family}/agent" target="clean" />
-        <make dir="${hy.jpda.src.main.native}/jdwp/${hy.os.family}/transport" target="clean" />
+        <make dir="${hy.jpda.src.main.native}/jdwp/${hy.os.family}/transport/dt_socket" target="clean" />
+        <antcall target="-clean-native-windows" />
+    </target>
+
+    <target name="-clean-native-windows" if="is.windows">
+        <make dir="${hy.jpda.src.main.native}/jdwp/${hy.os.family}/transport/dt_shmem" target="clean" />
     </target>
 
     <!-- Compile JDWP tests always with debug info included -->
     <target name="build-tests" >
         <echo message="Compiling JPDA tests" />
-
+        <ensure-javac/>
         <mkdir dir="${tests.build.output}/classes" />
-        <javac
+        <hy.javac
             srcdir="${hy.jpda.src.test}"
             destdir="${tests.build.output}/classes"
             sourcepath=""
-            compiler="${hy.javac.compiler}"
-            memoryMaximumSize="${hy.javac.maxmem}"
-            source="${hy.javac.source}" 
-            target="${hy.javac.target}"
             debug="on">
 
             <!-- HDK class library -->
@@ -204,7 +209,7 @@
                 <pathelement path="${tests.build.output}/classes"/>
                 <pathelement path="${junit.jar}"/>
             </classpath>
-        </javac>
+        </hy.javac>
     </target>
 
     <target name="copy-test-resources">
@@ -221,7 +226,7 @@
 
     <target name="run-tests" depends="build-tests, prepare-exclude, copy-test-resources">
 
-        <property name="test.jre.home" value="${hy.jdk}/jre" />
+        <property name="test.jre.home" value="${jdktools.deploy.dir}/jre" />
         <property name="test.jre.jvm" value="${test.jre.home}/bin/java" />
         <property name="test.debugger.jvm" value="${test.jre.jvm}" />
         <property name="test.debuggee.jvm" value="${test.jre.jvm}" />

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ArrayReference.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ArrayReference.cpp?rev=748797&r1=748796&r2=748797&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ArrayReference.cpp (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ArrayReference.cpp Sat Feb 28 09:10:31 2009
@@ -20,6 +20,7 @@
  * @author Viacheslav G. Rybalov
  * @version $Revision: 1.12 $
  */
+#include <string.h>
 #include "ArrayReference.h"
 #include "PacketParser.h"
 #include "ClassManager.h"

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ArrayType.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ArrayType.cpp?rev=748797&r1=748796&r2=748797&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ArrayType.cpp (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ArrayType.cpp Sat Feb 28 09:10:31 2009
@@ -20,6 +20,7 @@
  * @author Viacheslav G. Rybalov
  * @version $Revision: 1.8 $
  */
+#include <string.h>
 #include "ArrayType.h"
 #include "PacketParser.h"
 #include "ClassManager.h"

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassType.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassType.cpp?rev=748797&r1=748796&r2=748797&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassType.cpp (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ClassType.cpp Sat Feb 28 09:10:31 2009
@@ -20,6 +20,8 @@
  * @author Viacheslav G. Rybalov, Anton V. Karnachuk
  * @version $Revision: 1.25 $
  */
+#include <string.h>
+
 #include "ClassType.h"
 
 #include "PacketParser.h"

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ObjectReference.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ObjectReference.cpp?rev=748797&r1=748796&r2=748797&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ObjectReference.cpp (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/ObjectReference.cpp Sat Feb 28 09:10:31 2009
@@ -20,6 +20,7 @@
  * @author Anatoly F. Bondarenko, Viacheslav G. Rybalov
  * @version $Revision: 1.28 $
  */
+#include <string.h>
 #include "ObjectReference.h"
 #include "PacketParser.h"
 #include "ObjectManager.h"

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/VirtualMachine.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/VirtualMachine.cpp?rev=748797&r1=748796&r2=748797&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/VirtualMachine.cpp (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/commands/VirtualMachine.cpp Sat Feb 28 09:10:31 2009
@@ -20,6 +20,8 @@
  * @author Vitaly A. Provodin
  * @version $Revision: 1.23.2.2 $
  */
+#include <string.h>
+
 #include "jvmti.h"
 #include "jdwp.h"
 

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/Agent.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/Agent.cpp?rev=748797&r1=748796&r2=748797&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/Agent.cpp (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/Agent.cpp Sat Feb 28 09:10:31 2009
@@ -22,6 +22,7 @@
  */
 // Agent.cpp
 
+#include <string.h>
 #include <cstdlib>
 #include <cstdio>
 

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/AgentEventRequest.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/AgentEventRequest.cpp?rev=748797&r1=748796&r2=748797&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/AgentEventRequest.cpp (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/AgentEventRequest.cpp Sat Feb 28 09:10:31 2009
@@ -22,6 +22,7 @@
  */
 // AgentEventRequest.cpp
 
+#include <string.h>
 #include "AgentEventRequest.h"
 #include "RequestManager.h"
 #include "Log.h"

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/ClassManager.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/ClassManager.cpp?rev=748797&r1=748796&r2=748797&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/ClassManager.cpp (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/ClassManager.cpp Sat Feb 28 09:10:31 2009
@@ -22,6 +22,8 @@
  */
 // ClassManager.cpp
 
+#include <string.h>
+
 #include "jni.h"
 
 #include "ClassManager.h"

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/CommandHandler.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/CommandHandler.cpp?rev=748797&r1=748796&r2=748797&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/CommandHandler.cpp (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/CommandHandler.cpp Sat Feb 28 09:10:31 2009
@@ -21,6 +21,8 @@
  * @version $Revision: 1.18 $
  */
 
+#include <string.h>
+
 #include "CommandHandler.h"
 #include "PacketParser.h"
 #include "ThreadManager.h"

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/ObjectManager.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/ObjectManager.cpp?rev=748797&r1=748796&r2=748797&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/ObjectManager.cpp (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/ObjectManager.cpp Sat Feb 28 09:10:31 2009
@@ -24,6 +24,8 @@
 // ObjectManager.cpp - implementation of 'class ObjectManager :public AgentBase'
 // Provide mapping between JDWP IDs and corresponding JVMTI, JNI data types
 
+#include <string.h>
+
 #include "jni.h"
 #include "jvmti.h"
 #include "jdwp.h"

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestManager.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestManager.cpp?rev=748797&r1=748796&r2=748797&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestManager.cpp (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestManager.cpp Sat Feb 28 09:10:31 2009
@@ -22,6 +22,8 @@
  */
 // RequestManager.cpp
 
+#include <string.h>
+
 #include "RequestManager.h"
 #include "ThreadManager.h"
 #include "EventDispatcher.h"

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestModifier.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestModifier.cpp?rev=748797&r1=748796&r2=748797&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestModifier.cpp (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/RequestModifier.cpp Sat Feb 28 09:10:31 2009
@@ -22,6 +22,8 @@
  */
 // RequestModifier.cpp
 
+#include <string.h>
+
 #include "RequestModifier.h"
 
 using namespace jdwp;

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/TransportManager.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/TransportManager.cpp?rev=748797&r1=748796&r2=748797&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/TransportManager.cpp (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/agent/core/TransportManager.cpp Sat Feb 28 09:10:31 2009
@@ -23,6 +23,8 @@
 // TransportManager.cpp
 //
 
+#include <string.h>
+
 #include "TransportManager.h"
 
 using namespace jdwp;

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/transport/common/LastTransportError.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/transport/common/LastTransportError.cpp?rev=748797&r1=748796&r2=748797&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/transport/common/LastTransportError.cpp (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/transport/common/LastTransportError.cpp Sat Feb 28 09:10:31 2009
@@ -20,7 +20,7 @@
  * @author Viacheslav G. Rybalov
  * @version $Revision: 1.6 $
  */
-#include "SocketTransport_pd.h"
+#include "LastTransportError.h"
 
 void (*LastTransportError::m_free)(void *buffer) = 0;
 

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/transport/common/LastTransportError.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/transport/common/LastTransportError.h?rev=748797&r1=748796&r2=748797&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/transport/common/LastTransportError.h (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/common/transport/common/LastTransportError.h Sat Feb 28 09:10:31 2009
@@ -30,7 +30,8 @@
 #ifndef _LASTTRANSPORTERROR_H
 #define _LASTTRANSPORTERROR_H
 
-#include "SocketTransport_pd.h"
+#include "jdwpTransport.h"
+#include "LastTransportError_pd.h"
 
 /**
  * The given class is a container for message and status code of the last 

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/unix/agent/core/TransportManager_pd.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/unix/agent/core/TransportManager_pd.cpp?rev=748797&r1=748796&r2=748797&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/unix/agent/core/TransportManager_pd.cpp (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/unix/agent/core/TransportManager_pd.cpp Sat Feb 28 09:10:31 2009
@@ -31,6 +31,7 @@
 
 #include <unistd.h>
 #include <errno.h>
+#include <string.h>
 #include "TransportManager_pd.h"
 #include "TransportManager.h"
 

Propchange: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/unix/transport/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Sat Feb 28 09:10:31 2009
@@ -1,2 +1,2 @@
 libdt_socket.exp
-
+libdt_socket.so

Propchange: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/unix/transport/dt_socket/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Feb 28 09:10:31 2009
@@ -0,0 +1 @@
+libdt_socket.exp

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/unix/transport/dt_socket/SocketTransport_pd.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/unix/transport/dt_socket/SocketTransport_pd.h?rev=748797&r1=748796&r2=748797&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/unix/transport/dt_socket/SocketTransport_pd.h (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/unix/transport/dt_socket/SocketTransport_pd.h Sat Feb 28 09:10:31 2009
@@ -50,7 +50,6 @@
 
 typedef pthread_mutex_t CriticalSection;
 typedef int SOCKET;
-typedef pthread_t ThreadId_t;
 
 #include "jdwpTransport.h"
 #include "LastTransportError.h"
@@ -161,16 +160,4 @@
     pthread_mutex_unlock(&(((internalEnv*)env->functions->reserved1)->sendLock));
 }
 
-static inline ThreadId_t 
-GetCurrentThreadId()
-{
-    return pthread_self();
-} // GetCurrentThreadId()
-
-static inline bool 
-ThreadId_equal(ThreadId_t treadId1, ThreadId_t treadId2)
-{
-    return pthread_equal(treadId1, treadId2) != 0 ? true : false;
-} // ThreadId_equal()
-
 #endif //_SOCKETTRANSPORT_PD_H

Propchange: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/windows/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Sat Feb 28 09:10:31 2009
@@ -1,5 +1,4 @@
+*.dll
+*.manifest
 *.map
 *.pdb
-*.manifest
-dt_socket.dll
-jdwp.dll

Propchange: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/windows/transport/dt_shmem/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Feb 28 09:10:31 2009
@@ -0,0 +1,2 @@
+*.obj
+*.pdb

Propchange: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/windows/transport/dt_socket/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Feb 28 09:10:31 2009
@@ -0,0 +1 @@
+*.pdb

Modified: harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/windows/transport/dt_socket/SocketTransport_pd.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/windows/transport/dt_socket/SocketTransport_pd.h?rev=748797&r1=748796&r2=748797&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/windows/transport/dt_socket/SocketTransport_pd.h (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/jpda/src/main/native/jdwp/windows/transport/dt_socket/SocketTransport_pd.h Sat Feb 28 09:10:31 2009
@@ -40,7 +40,6 @@
 #include <Ws2tcpip.h>
 
 typedef CRITICAL_SECTION CriticalSection;
-typedef DWORD ThreadId_t;
 
 #include "jdwpTransport.h"
 #include "LastTransportError.h"
@@ -116,9 +115,4 @@
     LeaveCriticalSection(&(((internalEnv*)env->functions->reserved1)->sendLock));
 } //LeaveCriticalSendSection()
 
-static inline bool ThreadId_equal(ThreadId_t treadId1, ThreadId_t treadId2)
-{
-    return (treadId1 == treadId2);
-} // ThreadId_equal()
-
 #endif // _SOCKETTRANSPORT_PD_H

Modified: harmony/enhanced/jdktools/branches/java6/modules/samsa/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/samsa/build.xml?rev=748797&r1=748796&r2=748797&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/samsa/build.xml (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/samsa/build.xml Sat Feb 28 09:10:31 2009
@@ -26,8 +26,6 @@
     <!-- set global properties for this build. -->
     <xmlproperty file="make/hyproperties.xml" semanticAttributes="true" />
 
-    <property file="../../make/depends.properties" />
-
     <!-- filename for tests exclude list -->
     <property name="samsa.exclude.file" location="${hy.hdk}/build/jdktools.samsa.exclude" />
 
@@ -47,7 +45,6 @@
     <target name="-compile-native" >
 
         <echo message="Compiling SAMSA natives" />
-        <echo message="hy.drlvm=${hy.drlvm}" />
         <echo message="harmony.jdktools=${harmony.jdktools}" />
             
         <make dir="${hy.samsa.src.main.native}/samsa/${hy.os.family}" />
@@ -60,29 +57,50 @@
         <property name="hy.samsa.exe"
                   location="${hy.samsa.src.main.native}/samsa/${hy.os.family}/samsa${exe.suffix}" />
 
-        <copy file="${hy.samsa.exe}" tofile="${hy.jdk}/bin/java${exe.suffix}" />
-        <chmod file="${hy.jdk}/bin/java${exe.suffix}" perm="ugo+x" />
+        <copy file="${hy.samsa.exe}" tofile="${jdktools.deploy.dir}/bin/java${exe.suffix}" />
+        <chmod file="${jdktools.deploy.dir}/bin/java${exe.suffix}" perm="ugo+x" />
+
+        <copy file="${hy.samsa.exe}" tofile="${jdktools.deploy.dir}/bin/javac${exe.suffix}" />
+        <chmod file="${jdktools.deploy.dir}/bin/javac${exe.suffix}" perm="ugo+x" />
+
+        <copy file="${hy.samsa.exe}" tofile="${jdktools.deploy.dir}/bin/javah${exe.suffix}" />
+        <chmod file="${jdktools.deploy.dir}/bin/javah${exe.suffix}" perm="ugo+x" />
+
+        <copy file="${hy.samsa.exe}" tofile="${jdktools.deploy.dir}/bin/javadoc${exe.suffix}" />
+        <chmod file="${jdktools.deploy.dir}/bin/javadoc${exe.suffix}" perm="ugo+x" />
+
+        <copy file="${hy.samsa.exe}" tofile="${jdktools.deploy.dir}/bin/javap${exe.suffix}" />
+        <chmod file="${jdktools.deploy.dir}/bin/javap${exe.suffix}" perm="ugo+x" />
+
+        <copy file="${hy.samsa.exe}" tofile="${jdktools.deploy.dir}/bin/jarsigner${exe.suffix}" />
+        <chmod file="${jdktools.deploy.dir}/bin/jarsigner${exe.suffix}" perm="ugo+x" />
+
+        <copy file="${hy.samsa.exe}" tofile="${jdktools.deploy.dir}/bin/appletviewer${exe.suffix}" />
+        <chmod file="${jdktools.deploy.dir}/bin/appletviewer${exe.suffix}" perm="ugo+x" />
 
-        <copy file="${hy.samsa.exe}" tofile="${hy.jdk}/bin/javac${exe.suffix}" />
-        <chmod file="${hy.jdk}/bin/javac${exe.suffix}" perm="ugo+x" />
+        <copy file="${hy.samsa.exe}" tofile="${jdktools.deploy.dir}/bin/keytool${exe.suffix}" />
+        <chmod file="${jdktools.deploy.dir}/bin/keytool${exe.suffix}" perm="ugo+x" />
 
-        <copy file="${hy.samsa.exe}" tofile="${hy.jdk}/bin/javah${exe.suffix}" />
-        <chmod file="${hy.jdk}/bin/javah${exe.suffix}" perm="ugo+x" />
+        <copy file="${hy.samsa.exe}" tofile="${jdktools.deploy.dir}/bin/unpack200${exe.suffix}" />
+        <chmod file="${jdktools.deploy.dir}/bin/unpack200${exe.suffix}" perm="ugo+x" />
 
-        <copy file="${hy.samsa.exe}" tofile="${hy.jdk}/bin/javadoc${exe.suffix}" />
-        <chmod file="${hy.jdk}/bin/javadoc${exe.suffix}" perm="ugo+x" />
+        <copy file="${hy.samsa.exe}" tofile="${jdktools.deploy.dir}/bin/pack200${exe.suffix}" />
+        <chmod file="${jdktools.deploy.dir}/bin/pack200${exe.suffix}" perm="ugo+x" />
 
-        <copy file="${hy.samsa.exe}" tofile="${hy.jdk}/bin/keytool${exe.suffix}" />
-        <chmod file="${hy.jdk}/bin/keytool${exe.suffix}" perm="ugo+x" />
+        <copy file="${hy.samsa.exe}" tofile="${jdktools.deploy.dir}/bin/policytool${exe.suffix}" />
+        <chmod file="${jdktools.deploy.dir}/bin/policytool${exe.suffix}" perm="ugo+x" />
 
-        <copy file="${hy.samsa.exe}" tofile="${hy.jdk}/bin/jarsigner${exe.suffix}" />
-        <chmod file="${hy.jdk}/bin/jarsigner${exe.suffix}" perm="ugo+x" />
+        <copy file="${hy.samsa.exe}" tofile="${jretools.deploy.dir}/bin/keytool${exe.suffix}" />
+        <chmod file="${jretools.deploy.dir}/bin/keytool${exe.suffix}" perm="ugo+x" />
 
-        <copy file="${hy.samsa.exe}" tofile="${hy.jdk}/bin/appletviewer${exe.suffix}" />
-        <chmod file="${hy.jdk}/bin/appletviewer${exe.suffix}" perm="ugo+x" />
+        <copy file="${hy.samsa.exe}" tofile="${jretools.deploy.dir}/bin/unpack200${exe.suffix}" />
+        <chmod file="${jretools.deploy.dir}/bin/unpack200${exe.suffix}" perm="ugo+x" />
 
-        <copy file="${hy.samsa.exe}" tofile="${hy.jdk}/bin/unpack200${exe.suffix}" />
-        <chmod file="${hy.jdk}/bin/unpack200${exe.suffix}" perm="ugo+x" />
+    	<copy file="${hy.samsa.exe}" tofile="${jretools.deploy.dir}/bin/pack200${exe.suffix}" />
+    	<chmod file="${jretools.deploy.dir}/bin/pack200${exe.suffix}" perm="ugo+x" />
+
+    	<copy file="${hy.samsa.exe}" tofile="${jretools.deploy.dir}/bin/policytool${exe.suffix}" />
+        <chmod file="${jretools.deploy.dir}/bin/policytool${exe.suffix}" perm="ugo+x" />
 
     </target>
 
@@ -91,8 +109,8 @@
         <property name="hy.javaw.exe"
                   location="${hy.samsa.src.main.native}/samsa/${hy.os.family}/javaw${exe.suffix}" />
 
-        <copy file="${hy.javaw.exe}" tofile="${hy.jdk}/bin/javaw${exe.suffix}" />
-        <chmod file="${hy.jdk}/bin/java${exe.suffix}" perm="ugo+x" />
+        <copy file="${hy.javaw.exe}" tofile="${jdktools.deploy.dir}/bin/javaw${exe.suffix}" />
+        <chmod file="${jdktools.deploy.dir}/bin/javaw${exe.suffix}" perm="ugo+x" />
     </target>
 
     <!-- copy samsa symbol info for different tools -->
@@ -103,21 +121,24 @@
         <property name="hy.javaw.progdb"
                   location="${hy.samsa.src.main.native}/samsa/${hy.os.family}/javaw${progdb.suffix}" />
 
-        <copy file="${hy.samsa.progdb}" tofile="${hy.jdk}/bin/java${progdb.suffix}" />
-        <copy file="${hy.javaw.progdb}" tofile="${hy.jdk}/bin/javaw${progdb.suffix}" />
-        <copy file="${hy.samsa.progdb}" tofile="${hy.jdk}/bin/javac${progdb.suffix}" />
-        <copy file="${hy.samsa.progdb}" tofile="${hy.jdk}/bin/javah${progdb.suffix}" />
-        <copy file="${hy.samsa.progdb}" tofile="${hy.jdk}/bin/javadoc${progdb.suffix}" />
-        <copy file="${hy.samsa.progdb}" tofile="${hy.jdk}/bin/keytool${progdb.suffix}" />
-        <copy file="${hy.samsa.progdb}" tofile="${hy.jdk}/bin/jarsigner${progdb.suffix}" />
-    	<copy file="${hy.samsa.progdb}" tofile="${hy.jdk}/bin/unpack200${progdb.suffix}" />
+        <copy file="${hy.samsa.progdb}" tofile="${jdktools.deploy.dir}/bin/java${progdb.suffix}" />
+        <copy file="${hy.javaw.progdb}" tofile="${jdktools.deploy.dir}/bin/javaw${progdb.suffix}" />
+        <copy file="${hy.samsa.progdb}" tofile="${jdktools.deploy.dir}/bin/javac${progdb.suffix}" />
+        <copy file="${hy.samsa.progdb}" tofile="${jdktools.deploy.dir}/bin/javah${progdb.suffix}" />
+        <copy file="${hy.samsa.progdb}" tofile="${jdktools.deploy.dir}/bin/javadoc${progdb.suffix}" />
+        <copy file="${hy.samsa.progdb}" tofile="${jdktools.deploy.dir}/bin/javap${progdb.suffix}" />
+        <copy file="${hy.samsa.progdb}" tofile="${jdktools.deploy.dir}/bin/jarsigner${progdb.suffix}" />
+    	<copy file="${hy.samsa.progdb}" tofile="${jretools.deploy.dir}/bin/unpack200${progdb.suffix}" />
+    	<copy file="${hy.samsa.progdb}" tofile="${jretools.deploy.dir}/bin/pack200${progdb.suffix}" />
+    	<copy file="${hy.samsa.progdb}" tofile="${jretools.deploy.dir}/bin/keytool${progdb.suffix}" />
+        <copy file="${hy.samsa.progdb}" tofile="${jretools.deploy.dir}/bin/policytool${progdb.suffix}" />
 
     </target>
 
     <!-- copy samsa configuration data for different tools -->
     <target name="-copy-native-data" >
 
-        <copy todir="${hy.jdk}/bin/data" overwrite="yes">
+        <copy todir="${jdktools.deploy.dir}/bin/data" overwrite="yes">
             <fileset dir="${hy.samsa.src.main.resources}/data/">
                 <include name="*.dat" />
             </fileset>
@@ -133,7 +154,7 @@
 
     <target name="run-tests" depends="prepare-exclude" >
 
-        <property name="test.jre.home" value="${hy.jdk}/jre" />
+        <property name="test.jre.home" value="${jdktools.deploy.dir}/jre" />
 
         <echo message="Running SAMSA tests" />
         <echo message="test.jre.home=${test.jre.home}" />
@@ -173,20 +194,28 @@
 	    <arg line="" />
         </exec>
 
-        <echo message="Run jdk/bin/keytool -help in ${hy.tests.reports}"/>
+        <echo message="Run jdk/jre/bin/keytool -help in ${hy.tests.reports}"/>
         <exec failonerror="true"
-	        executable="${test.jre.home}/../bin/keytool${exe.suffix}"
+	        executable="${test.jre.home}/bin/keytool${exe.suffix}"
 	        dir="${hy.tests.reports}">
 	    <arg line="-help" />
         </exec>
 
-        <echo message="Run jdk/bin/unpack200 in ${hy.tests.reports}"/>
+        <echo message="Run jdk/jre/bin/unpack200 in ${hy.tests.reports}"/>
         <exec failonerror="true"
-	        executable="${test.jre.home}/../bin/unpack200${exe.suffix}"
+	        executable="${test.jre.home}/bin/unpack200${exe.suffix}"
 	        dir="${hy.tests.reports}">
 	    <arg line="" />
         </exec>
 
+        <echo message="Run jdk/jre/bin/pack200 in ${hy.tests.reports}"/>
+        <exec failonerror="true"
+	        executable="${test.jre.home}/bin/pack200${exe.suffix}"
+	        dir="${hy.tests.reports}">
+	    <arg line="" />
+        </exec>
+
+
     </target>
 
     <!-- Clean natives -->

Modified: harmony/enhanced/jdktools/branches/java6/modules/samsa/src/main/native/samsa/samsa.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/samsa/src/main/native/samsa/samsa.c?rev=748797&r1=748796&r2=748797&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/samsa/src/main/native/samsa/samsa.c (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/samsa/src/main/native/samsa/samsa.c Sat Feb 28 09:10:31 2009
@@ -21,31 +21,55 @@
 #include <string.h>
 #include <limits.h>
 
+
 #if defined(WIN32)
 #include <windows.h>
+#include <sys/stat.h>
+#else
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
 #endif
 #if defined(FREEBSD)
 #include <dlfcn.h>
 #endif
 
-#define TOOL_JAR      "tools.jar"
-#define CLASS_PREFIX  "org.apache.harmony.tools."
+#define JRE_CLASS_PREFIX  "org.apache.harmony.jretools."
+#define JDK_CLASS_PREFIX  "org.apache.harmony.tools."
 #define CLASS_POSTFIX ".Main"
 
 #if defined(WIN32)
 #define PATH_SEPARATOR_CHAR '\\'
 #define PATH_SEPARATOR      "\\"
-#define EXE_POSTFIX         "\\jre\\bin\\java.exe"
-#define WEXE_POSTFIX        "\\jre\\bin\\javaw.exe"
+#define JDK_EXE_POSTFIX     "\\jre\\bin\\java.exe"
+#define JDK_WEXE_POSTFIX    "\\jre\\bin\\javaw.exe"
+#define JRE_EXE_POSTFIX     "\\bin\\java.exe"
+#define JRE_WEXE_POSTFIX    "\\bin\\javaw.exe"
+#define JRE_TEST_PREFIX     "\\jre\\bin"
 #define LIB_POSTFIX         "\\lib\\"
+#define JRE_LIB_POSTFIX     "\\jre\\lib\\"
+#define DATA_POSTFIX        "\\bin\\data\\"
+#define JRE_DATA_POSTFIX    "\\jre\\bin\\data\\"
+#define TOOL_JAR            "\\lib\\tools.jar"
+#define JRE_TOOL_JAR        "\\jre\\lib\\tools.jar"
 #define CLASSPATH_SEP       ";"
+#define EXE_SUFFIX          ".exe"
 #else
 #define PATH_SEPARATOR_CHAR '/'
 #define PATH_SEPARATOR      "/"
-#define EXE_POSTFIX         "/jre/bin/java"
-#define WEXE_POSTFIX        "/jre/bin/javaw"
+#define JDK_EXE_POSTFIX     "/jre/bin/java"
+#define JDK_WEXE_POSTFIX    "/jre/bin/javaw"
+#define JRE_EXE_POSTFIX     "/bin/java"
+#define JRE_WEXE_POSTFIX    "/bin/javaw"
+#define JRE_TEST_PREFIX     "/jre/bin"
 #define LIB_POSTFIX         "/lib/"
+#define JRE_LIB_POSTFIX     "/jre/lib/"
+#define DATA_POSTFIX        "/bin/data/"
+#define JRE_DATA_POSTFIX    "/jre/bin/data/"
+#define TOOL_JAR            "/lib/tools.jar"
+#define JRE_TOOL_JAR        "/jre/lib/tools.jar"
 #define CLASSPATH_SEP       ":"
+#define EXE_SUFFIX          ""
 #endif
 
 typedef struct ToolData {
@@ -55,8 +79,10 @@
 
 char     *cleanToolName(const char *);
 char     *getExeDir();
-char     *getJDKRoot();
-TOOLDATA *getToolData(const char *, const char *);
+char     *getRoot();
+TOOLDATA *getToolData(const char *, const char *, int toolType);
+int getToolType(const char*, const char*);
+char* jarFile(const char*, const char*);
 
 /**
  *  main
@@ -90,23 +116,24 @@
     int cmd_len = 0;
     int exit_code = -1;
     int newIndex = 0;
-    char *jdkRoot = NULL;
+    char *root = NULL;
     char *fullExePath = NULL;
     TOOLDATA *pToolData = (TOOLDATA *) malloc(sizeof(TOOLDATA));
     
     int isJavaw = 0;
+    int toolType = 0; /* 0 = JRE tool, 1 = JDK tool, 2 = JRE tool in jdk/bin */
 
     /*
-     *  get the jdkroot and the construct invocation path for exe
+     *  get the root and the construct invocation path for exe
      *  and the full paths to jars.  This way, we can be called 
      *  from anywhere
      */    
-    jdkRoot = getJDKRoot();
+    root = getRoot();
 
-//    printf("root = %s\n", jdkRoot);
+//    printf("root = %s\n", root);
     
-    if (!jdkRoot) { 
-        fprintf(stderr, "Unable to find JDK Root");
+    if (!root) { 
+        fprintf(stderr, "Unable to find JRE/JDK Root");
         return 2;
     }
         
@@ -118,34 +145,39 @@
 //    printf("tool name = %s\n", toolName);
     
     if (toolName == NULL) { 
-        fprintf(stderr, "Uknown tool name %s\n", argv[0]);
+        fprintf(stderr, "Unknown tool name %s\n", argv[0]);
         return 1;
     }
     
     isJavaw = strcmp(toolName, "javaw") == 0;
 
+    toolType = getToolType(root, toolName);
+    if (toolType == -1) {
+        fprintf(stderr, "Unable to determine type (JDK/JRE) of tool\n");
+        return 1;
+    }
+      
     /*
      *  get the 'tool data' - right now, this is just the jars
      *  specificly needed by this tool
      */
-    pToolData = getToolData(toolName, jdkRoot);
+    pToolData = getToolData(toolName, root, toolType);
        
     if (pToolData == NULL) { 
-        fprintf(stderr, "Unable to get tool data for %s");
         return 2;
     }
     
-    fullExePath = (char *) malloc(strlen(jdkRoot) + strlen(EXE_POSTFIX) + 1);
+    fullExePath = (char *) malloc(strlen(root) + strlen(JDK_WEXE_POSTFIX) + 1);
     
-    strcpy(fullExePath, jdkRoot);
+    strcpy(fullExePath, root);
     
     /* 
      * If we're javaw then we need to javaw to command line
      */
     if (isJavaw) {
-        strcat(fullExePath, WEXE_POSTFIX);
+        strcat(fullExePath, toolType ? JDK_WEXE_POSTFIX : JRE_WEXE_POSTFIX);
     } else {
-        strcat(fullExePath, EXE_POSTFIX);
+        strcat(fullExePath, toolType ? JDK_EXE_POSTFIX : JRE_EXE_POSTFIX);
     }
     
     /*
@@ -169,8 +201,8 @@
                 myArgv[newIndex++] = argv[i] + 2;
             }
         }
-     
-        size = (strlen(jdkRoot) + strlen(LIB_POSTFIX)) * pToolData->numJars +
+
+        size = strlen(root) * pToolData->numJars +
                    strlen(CLASSPATH_SEP) * (pToolData->numJars - 1) + 1;
 
         for (i = 0; i < pToolData->numJars; i++) { 
@@ -179,23 +211,23 @@
                     
         classpath = (char *) malloc(size * sizeof(char));
 
-        strcpy(classpath, jdkRoot);
-        strcat(classpath, LIB_POSTFIX);
+        strcpy(classpath, root);
         strcat(classpath, pToolData->jarList[0]);
 
         for (i = 1; i < pToolData->numJars; i++) { 
             strcat(classpath, CLASSPATH_SEP);
-            strcat(classpath, jdkRoot);
-            strcat(classpath, LIB_POSTFIX);
+            strcat(classpath, root);
             strcat(classpath, pToolData->jarList[i]);
         }
  
         myArgv[newIndex++] = "-cp";
         myArgv[newIndex++] = classpath;
 
-        buffer = (char *) malloc(strlen(CLASS_PREFIX) + strlen(toolName) + strlen(CLASS_POSTFIX) + 1);
+        buffer =
+          (char *) malloc(strlen(toolType==1 ? JDK_CLASS_PREFIX : JRE_CLASS_PREFIX)
+                          + strlen(toolName) + strlen(CLASS_POSTFIX) + 1);
     
-        strcpy(buffer, CLASS_PREFIX);
+        strcpy(buffer, toolType==1 ? JDK_CLASS_PREFIX : JRE_CLASS_PREFIX);
         strcat(buffer, toolName);
         strcat(buffer, CLASS_POSTFIX);
         
@@ -390,12 +422,12 @@
 }
 
 /******************************************************************
- *  getJDKRoot()
+ *  getRoot()
  * 
- *  returns the root of the JDK if it can figure it out
- *  or NULL if it can't
+ *  returns the root (JDK or JRE) where this executable is located
+ *  if it can figure it out or NULL if it can't
  */
-char *getJDKRoot() { 
+char *getRoot() { 
     
     char *exeDir = getExeDir();
 
@@ -421,7 +453,7 @@
 #if defined(LINUX)
     char buffer[PATH_MAX + 1];
     
-    int size = readlink ("/proc/self/exe", buffer, sizeof(buffer)-1);
+    int size = readlink ("/proc/self/exe", buffer, sizeof(buffer)-2);
     
     buffer[size+1] = '\0';
 #elif defined(FREEBSD)
@@ -453,78 +485,195 @@
 }
 
 /***********************************************************************
- *  getToolData()
+ *  getToolData(const char* toolName, const char* root, int toolType)
  * 
- *  Read the jdk/bin/data/<toolname>.data file and 
+ *  Read the bin/data/<toolname>.dat file and 
  *  return the list of jars needed for this tool
  *  Format : 
- *  ToolJar = <jar1name>
- *  ToolJar = <jar2name>
- *  ToolJar = <jar3name>
+ *  JDKToolJar = <jdkjar1name>
+ *  JDKToolJar = <jdkjar2name>
+ *  JREToolJar = <jrejar1name>
+ *  JREToolJar = <jrejar2name>
  * 
+ *  Obviously, JRE tools should not reference any JDK jars.
  *  If the data file doesn't exist, it will return tools.jar
  */
-TOOLDATA *getToolData(const char *toolName, const char *jdkRoot) { 
+TOOLDATA *getToolData(const char *toolName, const char *root, int toolType) { 
     
     FILE *fp = NULL;
     char key[256];
     char value[256];
     int count = 0;
     char *temp = NULL;
-    TOOLDATA *pToolData = (TOOLDATA *) malloc(sizeof(TOOLDATA));
+    TOOLDATA *pToolData = NULL;
             
-    if (toolName == NULL || jdkRoot == NULL) { 
+    if (toolName == NULL || root == NULL) { 
+        fprintf(stderr, "Unable to get tool data for %s", toolName);
         return NULL;
     }
-   
+
+    pToolData = (TOOLDATA *) malloc(sizeof(TOOLDATA));
     if (pToolData == NULL) { 
+        fprintf(stderr,
+                "Unable to get tool data for %s: out of memory", toolName);
         return NULL;
     }
     
     memset(pToolData, 0, sizeof(TOOLDATA));    
     
    /*
-    *  assumes that the data files are in jdk/bin/data with a ".dat" extension
+    *  assumes that the data files are in bin/data with a ".dat" extension
     */ 
-    temp = (char *) malloc(strlen(jdkRoot) + strlen(PATH_SEPARATOR) + strlen("bin") 
-            + strlen(PATH_SEPARATOR) + strlen("data") + strlen(PATH_SEPARATOR) + strlen(toolName) 
-            + strlen(".dat") + 1);
+    temp = (char *) malloc(strlen(root) 
+                           + strlen(toolType==2
+                                    ? JRE_DATA_POSTFIX 
+                                    : DATA_POSTFIX)
+                           + strlen(toolName) 
+                           + strlen(".dat") + 1);
                 
     if (temp == NULL) { 
+        fprintf(stderr,
+                "Unable to get tool data for %s: out of memory", toolName);
+        free(pToolData);
         return NULL;
     }
     
-    strcpy(temp, jdkRoot);
-    strcat(temp, PATH_SEPARATOR);
-    strcat(temp, "bin");
-    strcat(temp, PATH_SEPARATOR);
-    strcat(temp, "data");
-    strcat(temp, PATH_SEPARATOR);
+    strcpy(temp, root);
+    strcat(temp, toolType==2 ? JRE_DATA_POSTFIX : DATA_POSTFIX);
     strcat(temp, toolName);
     strcat(temp, ".dat");
     
     //printf("tool data file = %s\n", temp);
     
     fp = fopen(temp, "r");
+    free(temp);
  
     if (fp) {
-        while (EOF != (count= fscanf(fp, "%s = %s\n", key, value))) {
+        while (EOF != (count = fscanf(fp, "%s = %s\n", key, value))) {
             // printf("count = %d : %s = %s\n", count, key, value);
+            
+            if (count != 2)
+                continue;
 
-            if (count == 2 && !strcmp("ToolJar", key)) {
+            if (!strcmp("JREToolJar", key)) {
+                pToolData->jarList = (char **) realloc(pToolData->jarList, (pToolData->numJars + 1) * sizeof(char *));
+                pToolData->jarList[pToolData->numJars] =
+                    jarFile(toolType ? JRE_LIB_POSTFIX : LIB_POSTFIX, value);
+                if (pToolData->jarList[pToolData->numJars] == NULL) {
+                    fprintf(stderr,
+                            "Unable to get tool data for %s: out of memory",
+                            toolName);
+                    free(pToolData);
+                    return NULL;
+                }                    
+                pToolData->numJars++;
+            } else if (!strcmp("JDKToolJar", key) ) {
+                if (toolType != 1) {
+                    fprintf(stderr,
+                            "Invalid tool data for %s: jre tool using jdk jar",
+                            toolName);
+                    free(pToolData);
+                    return NULL;
+                }
                 pToolData->jarList = (char **) realloc(pToolData->jarList, (pToolData->numJars + 1) * sizeof(char *));
-                pToolData->jarList[pToolData->numJars++] = strdup(value);
+                pToolData->jarList[pToolData->numJars] =
+                    jarFile(LIB_POSTFIX, value);
+                if (pToolData->jarList[pToolData->numJars] == NULL) {
+                    fprintf(stderr,
+                            "Unable to get tool data for %s: out of memory",
+                            toolName);
+                    free(pToolData);
+                    return NULL;
+                }                    
+                pToolData->numJars++;
             }
         }
         
         fclose(fp);
+    } else {
+        if (toolType == 0 || toolType == 1) {
+            pToolData->jarList = (char **) realloc(pToolData->jarList, (pToolData->numJars + 1) * sizeof(char *));
+            pToolData->jarList[pToolData->numJars++] = TOOL_JAR;
+        }
+        if (toolType) {
+            pToolData->jarList = (char **) realloc(pToolData->jarList, (pToolData->numJars + 1) * sizeof(char *));
+            pToolData->jarList[pToolData->numJars++] = JRE_TOOL_JAR;
+        }
     }
-    else {        
-        pToolData->jarList = (char **) realloc(pToolData->jarList,  (pToolData->numJars + 1) * sizeof(char *));
-        pToolData->jarList[pToolData->numJars++] = TOOL_JAR;
+    
+    return pToolData;
+}
+
+
+/*****************************************************************
+ * getToolType(const char* root, const char* toolName)
+ * 
+ *  returns 0 if this is a jre too1 in the jre/bin, 1 if this is a jdk
+ *          tool in the jdk/bin, and 2 if this is a jre tool in the jdk/bin
+ */
+int getToolType(const char* root, const char* toolName) {
+
+    char *temp = NULL;
+#if defined(WIN32)
+    DWORD result;
+#else
+    struct stat statbuf;
+    int rc;
+#endif
+
+    temp = (char *) malloc(strlen(root) + strlen(JRE_TEST_PREFIX) +
+                           1 + strlen(toolName) + strlen(EXE_SUFFIX) +
+                           1);
+                
+    if (temp == NULL) { 
+        return -1;
     }
     
-    free(temp);
+    strcpy(temp, root);
+    strcat(temp, JRE_TEST_PREFIX);
     
-    return pToolData;
+#if defined(WIN32)
+    result = GetFileAttributes((LPCTSTR) temp);
+    if (result == 0xFFFFFFFF) {
+      free(temp);
+      return 0;
+    }
+
+#else
+    rc = lstat(temp, &statbuf);
+    if (rc == -1) {
+      free(temp);
+      return 0;
+    }
+#endif
+
+    strcat(temp, PATH_SEPARATOR);
+    strcat(temp, toolName);
+
+#if defined(WIN32)
+    strcat(temp, EXE_SUFFIX);
+    result = GetFileAttributes((LPCTSTR) temp);
+    free(temp);
+    return result == 0xFFFFFFFF ? 1 : 2;
+#else
+    rc = lstat(temp, &statbuf);
+    free(temp);
+    return rc == -1 ? 1 : 2;
+#endif
+
+}
+
+/*****************************************************************
+ * lib_jar(const char* jarName)
+ * 
+ *  returns a pointer to the jar file name
+ */
+char* jarFile(const char* path, const char* jarName) {
+    char* jarPath = (char*) malloc(strlen(path) + strlen(jarName) + 1);
+    if (jarPath == NULL) {
+        return NULL;
+    }
+    strcpy(jarPath, path);
+    strcat(jarPath, jarName);
+    return jarPath;
 }

Modified: harmony/enhanced/jdktools/branches/java6/modules/samsa/src/main/native/samsa/windows/javaw.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/samsa/src/main/native/samsa/windows/javaw.c?rev=748797&r1=748796&r2=748797&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/samsa/src/main/native/samsa/windows/javaw.c (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/samsa/src/main/native/samsa/windows/javaw.c Sat Feb 28 09:10:31 2009
@@ -17,10 +17,14 @@
 
 #include <windows.h>
 #include <stdio.h>
+#include <sys/stat.h>
 
-#define WEXE_POSTFIX        "\\jre\\bin\\javaw.exe\" "
+#define JDK_WEXE_POSTFIX        "\\jre\\bin\\javaw.exe\" "
+#define JRE_WEXE_POSTFIX        "\\bin\\javaw.exe\" "
+#define JRE_TEST_FILE       "\\bin\\harmony.properties"
 
-char *getJDKRoot();
+char *getRoot();
+int isJRERoot(const char*);
 
 int WINAPI
 WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
@@ -29,12 +33,17 @@
     PROCESS_INFORMATION procInfo;
     STARTUPINFO startInfo;
     DWORD res = 0;
-    char *jdkRoot = getJDKRoot();
+    char *root = getRoot();
+    int isJRE = isJRERoot(root);
     
-    char *exePath = (char *)malloc((strlen(jdkRoot)+strlen(WEXE_POSTFIX)+strlen(lpCmdLine)+2)*sizeof(char));
+    char *exePath = (char *)malloc((strlen(root)
+                                    +strlen(isJRE 
+                                            ? JRE_WEXE_POSTFIX 
+                                            : JDK_WEXE_POSTFIX)
+                                    +strlen(lpCmdLine)+2)*sizeof(char));
     exePath[0] = '\"';
-    strcpy(exePath+1, jdkRoot);
-    strcat(exePath, WEXE_POSTFIX);
+    strcpy(exePath+1, root);
+    strcat(exePath, isJRE ? JRE_WEXE_POSTFIX : JDK_WEXE_POSTFIX);
     strcat(exePath, lpCmdLine);
     
     // create child process
@@ -57,4 +66,39 @@
     CloseHandle(procInfo.hThread);
 
     return (int)res;
-}
\ No newline at end of file
+}
+
+/*****************************************************************
+ * isJRERoot(const char* root)
+ * 
+ *  returns 1 if root is the jre root
+ */
+int isJRERoot(const char* root) {
+
+    char *temp = NULL;
+#if defined(WIN32)
+    DWORD result;
+#else
+    struct stat statbuf;
+    int rc;
+#endif
+
+    temp = (char *) malloc(strlen(root) + strlen(JRE_TEST_FILE) + 1);
+                
+    if (temp == NULL) { 
+        return -1;
+    }
+    
+    strcpy(temp, root);
+    strcat(temp, JRE_TEST_FILE);
+    
+#if defined(WIN32)
+    result = GetFileAttributes((LPCTSTR) temp);
+    free(temp);
+    return result == 0xFFFFFFFF ? 0 : 1;
+#else
+    rc = lstat(temp, &statbuf);
+    free(temp);
+    return rc == -1 ? 0 : 1;
+#endif
+}

Modified: harmony/enhanced/jdktools/branches/java6/modules/samsa/src/main/resources/data/jartool.dat
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/samsa/src/main/resources/data/jartool.dat?rev=748797&r1=748796&r2=748797&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/samsa/src/main/resources/data/jartool.dat (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/samsa/src/main/resources/data/jartool.dat Sat Feb 28 09:10:31 2009
@@ -1,3 +1,3 @@
-ToolJar = ecj_3.2.jar
-ToolJar = tools.jar
+JDKToolJar = ecj_3.2.jar
+JDKToolJar = tools.jar
 

Modified: harmony/enhanced/jdktools/branches/java6/modules/samsa/src/main/resources/data/javac.dat
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/samsa/src/main/resources/data/javac.dat?rev=748797&r1=748796&r2=748797&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/samsa/src/main/resources/data/javac.dat (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/samsa/src/main/resources/data/javac.dat Sat Feb 28 09:10:31 2009
@@ -1,3 +1,3 @@
-ToolJar = ecj_3.2.jar
-ToolJar = tools.jar
+JDKToolJar = ecj_3.2.jar
+JDKToolJar = tools.jar
 

Modified: harmony/enhanced/jdktools/branches/java6/modules/samsa/src/main/resources/data/keysigner.dat
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/branches/java6/modules/samsa/src/main/resources/data/keysigner.dat?rev=748797&r1=748796&r2=748797&view=diff
==============================================================================
--- harmony/enhanced/jdktools/branches/java6/modules/samsa/src/main/resources/data/keysigner.dat (original)
+++ harmony/enhanced/jdktools/branches/java6/modules/samsa/src/main/resources/data/keysigner.dat Sat Feb 28 09:10:31 2009
@@ -1,3 +1,3 @@
-ToolJar = ecj_3.2.jar
-ToolJar = tools.jar
+JDKToolJar = ecj_3.2.jar
+JDKToolJar = tools.jar