harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r578221 - in /harmony/enhanced/jdktools/trunk/modules/samsa: build.xml src/main/native/samsa/windows/javaw.c src/main/native/samsa/windows/makefile src/main/native/samsa/windows/makefile.javae src/main/native/samsa/windows/makefile.javaw
Date Fri, 21 Sep 2007 18:34:24 GMT
Author: apetrenko
Date: Fri Sep 21 11:34:24 2007
New Revision: 578221

URL: http://svn.apache.org/viewvc?rev=578221&view=rev
Log:
Patch for HARMONY-4831 "[tools] jdk/bin/javaw.exe must be a windows application"

Added:
    harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/javaw.c  
(with props)
    harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile.javae
  (with props)
    harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile.javaw
  (with props)
Modified:
    harmony/enhanced/jdktools/trunk/modules/samsa/build.xml
    harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile

Modified: harmony/enhanced/jdktools/trunk/modules/samsa/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/samsa/build.xml?rev=578221&r1=578220&r2=578221&view=diff
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/samsa/build.xml (original)
+++ harmony/enhanced/jdktools/trunk/modules/samsa/build.xml Fri Sep 21 11:34:24 2007
@@ -41,7 +41,7 @@
     <target name="build-tests" />
     <target name="test-module" depends="prepare-exclude, run-tests" />
 
-    <target name="build-native" depends="-compile-native, -copy-native-exe, -copy-native-progdb,
-copy-native-data" />
+    <target name="build-native" depends="-compile-native, -copy-native-exe, -copy-native-exe-windows,
-copy-native-progdb, -copy-native-data" />
 
     <!-- compile universal samsa binary -->
     <target name="-compile-native" >
@@ -63,9 +63,6 @@
         <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="${hy.jdk}/bin/javaw${exe.suffix}" />
-        <chmod file="${hy.jdk}/bin/java${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" />
 
@@ -83,14 +80,25 @@
 
     </target>
 
+    <!-- copy windows javaw executable -->
+    <target name="-copy-native-exe-windows" if="is.windows" >
+        <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" />
+    </target>
+
     <!-- copy samsa symbol info for different tools -->
     <target name="-copy-native-progdb" if="is.windows" >
 
         <property name="hy.samsa.progdb"
                   location="${hy.samsa.src.main.native}/samsa/${hy.os.family}/samsa${progdb.suffix}"
/>
+        <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.samsa.progdb}" tofile="${hy.jdk}/bin/javaw${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}"
/>

Added: harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/javaw.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/javaw.c?rev=578221&view=auto
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/javaw.c (added)
+++ harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/javaw.c Fri
Sep 21 11:34:24 2007
@@ -0,0 +1,60 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.
+ */
+
+#include <windows.h>
+#include <stdio.h>
+
+#define WEXE_POSTFIX        "\\jre\\bin\\javaw.exe\" "
+
+char *getJDKRoot();
+
+int WINAPI
+WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
+   int nShowCmd)
+{
+    PROCESS_INFORMATION procInfo;
+    STARTUPINFO startInfo;
+    DWORD res = 0;
+    char *jdkRoot = getJDKRoot();
+    
+    char *exePath = (char *)malloc((strlen(jdkRoot)+strlen(WEXE_POSTFIX)+strlen(lpCmdLine)+2)*sizeof(char));
+    exePath[0] = '\"';
+    strcpy(exePath+1, jdkRoot);
+    strcat(exePath, WEXE_POSTFIX);
+    strcat(exePath, lpCmdLine);
+    
+    // create child process
+    memset(&procInfo, 0, sizeof(PROCESS_INFORMATION));
+    memset(&startInfo, 0, sizeof(STARTUPINFO));
+    startInfo.cb = sizeof(STARTUPINFO);
+    startInfo.wShowWindow = nShowCmd;
+
+    if (!CreateProcess(NULL, exePath, NULL, NULL, TRUE, 0, NULL, NULL, &startInfo, &procInfo))
{ 
+        free(exePath);
+        return -1;
+    }
+
+    free(exePath);
+    
+    WaitForSingleObject(procInfo.hProcess, INFINITE);
+    GetExitCodeProcess(procInfo.hProcess, &res);
+
+    CloseHandle(procInfo.hProcess);
+    CloseHandle(procInfo.hThread);
+
+    return (int)res;
+}
\ No newline at end of file

Propchange: harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/javaw.c
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile?rev=578221&r1=578220&r2=578221&view=diff
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile (original)
+++ harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile Fri
Sep 21 11:34:24 2007
@@ -17,15 +17,10 @@
 # Makefile for module samsa
 #
 
-!include <$(HY_HDK)\build\make\defines.mak>
+all: 
+	$(MAKE) /NOLOGO -f makefile.javae
+	$(MAKE) /NOLOGO -f makefile.javaw
 
-EXENAME = samsa.exe
-BUILDFILES = ..\samsa.obj
-EXEFLAGS=$(conlflags) -subsystem:console
-EXEDLLFILES=$(conlibsdll)
-
-VIRTFILES =
-SYSLIBFILES =
-MDLLIBFILES =
-
-!include <$(HY_HDK)\build\make\rules.mak>
+clean:
+	$(MAKE) /NOLOGO -f makefile.javae clean
+	$(MAKE) /NOLOGO -f makefile.javaw clean

Added: harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile.javae
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile.javae?rev=578221&view=auto
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile.javae
(added)
+++ harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile.javae
Fri Sep 21 11:34:24 2007
@@ -0,0 +1,31 @@
+#  Licensed to the Apache Software Foundation (ASF) under one or more
+#  contributor license agreements.  See the NOTICE file distributed with
+#  this work for additional information regarding copyright ownership.
+#  The ASF licenses this file to You 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.
+
+#
+# Makefile for module samsa
+#
+
+!include <$(HY_HDK)\build\make\defines.mak>
+
+EXENAME = samsa.exe
+BUILDFILES = ..\samsa.obj
+EXEFLAGS=$(conlflags) -subsystem:console
+EXEDLLFILES=$(conlibsdll)
+
+VIRTFILES =
+SYSLIBFILES =
+MDLLIBFILES =
+
+!include <$(HY_HDK)\build\make\rules.mak>

Propchange: harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile.javae
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile.javaw
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile.javaw?rev=578221&view=auto
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile.javaw
(added)
+++ harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile.javaw
Fri Sep 21 11:34:24 2007
@@ -0,0 +1,31 @@
+#  Licensed to the Apache Software Foundation (ASF) under one or more
+#  contributor license agreements.  See the NOTICE file distributed with
+#  this work for additional information regarding copyright ownership.
+#  The ASF licenses this file to You 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.
+
+#
+# Makefile for javaw
+#
+
+!include <$(HY_HDK)\build\make\defines.mak>
+
+EXENAME = javaw.exe
+BUILDFILES = javaw.obj ..\samsa.obj
+EXEFLAGS=$(conlflags) -subsystem:windows
+EXEDLLFILES=$(guilibsdll)
+
+VIRTFILES =
+SYSLIBFILES =
+MDLLIBFILES = 
+
+!include <$(HY_HDK)\build\make\rules.mak>

Propchange: harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/windows/makefile.javaw
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message