author | ohair |
Tue, 25 May 2010 15:58:33 -0700 | |
changeset 5506 | 202f599c92aa |
parent 5381 | d6d64a42ff51 |
child 7668 | d4a77089c587 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
5506 | 2 |
* Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
||
27 |
/* |
|
28 |
* This file contains the main entry point into the launcher code |
|
29 |
* this is the only file which will be repeatedly compiled by other |
|
30 |
* tools. The rest of the files will be linked in. |
|
31 |
*/ |
|
32 |
||
33 |
#include "defines.h" |
|
34 |
||
1776
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
35 |
#ifdef _MSC_VER |
5381
d6d64a42ff51
6931180: Migration to recent versions of MS Platform SDK
prr
parents:
1776
diff
changeset
|
36 |
#if _MSC_VER > 1400 && _MSC_VER < 1600 |
1776
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
37 |
|
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
38 |
/* |
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
39 |
* When building for Microsoft Windows, main has a dependency on msvcr??.dll. |
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
40 |
* |
5381
d6d64a42ff51
6931180: Migration to recent versions of MS Platform SDK
prr
parents:
1776
diff
changeset
|
41 |
* When using Visual Studio 2005 or 2008, that must be recorded in |
1776
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
42 |
* the [java,javaw].exe.manifest file. |
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
43 |
* |
5381
d6d64a42ff51
6931180: Migration to recent versions of MS Platform SDK
prr
parents:
1776
diff
changeset
|
44 |
* As of VS2010 (ver=1600), the runtimes again no longer need manifests. |
d6d64a42ff51
6931180: Migration to recent versions of MS Platform SDK
prr
parents:
1776
diff
changeset
|
45 |
* |
1776
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
46 |
* Reference: |
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
47 |
* C:/Program Files/Microsoft SDKs/Windows/v6.1/include/crtdefs.h |
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
48 |
*/ |
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
49 |
#include <crtassem.h> |
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
50 |
#ifdef _M_IX86 |
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
51 |
|
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
52 |
#pragma comment(linker,"/manifestdependency:\"type='win32' " \ |
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
53 |
"name='" __LIBRARIES_ASSEMBLY_NAME_PREFIX ".CRT' " \ |
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
54 |
"version='" _CRT_ASSEMBLY_VERSION "' " \ |
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
55 |
"processorArchitecture='x86' " \ |
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
56 |
"publicKeyToken='" _VC_ASSEMBLY_PUBLICKEYTOKEN "'\"") |
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
57 |
|
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
58 |
#endif /* _M_IX86 */ |
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
59 |
|
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
60 |
//This may not be necessary yet for the Windows 64-bit build, but it |
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
61 |
//will be when that build environment is updated. Need to test to see |
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
62 |
//if it is harmless: |
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
63 |
#ifdef _M_AMD64 |
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
64 |
|
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
65 |
#pragma comment(linker,"/manifestdependency:\"type='win32' " \ |
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
66 |
"name='" __LIBRARIES_ASSEMBLY_NAME_PREFIX ".CRT' " \ |
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
67 |
"version='" _CRT_ASSEMBLY_VERSION "' " \ |
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
68 |
"processorArchitecture='amd64' " \ |
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
69 |
"publicKeyToken='" _VC_ASSEMBLY_PUBLICKEYTOKEN "'\"") |
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
70 |
|
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
71 |
#endif /* _M_AMD64 */ |
5381
d6d64a42ff51
6931180: Migration to recent versions of MS Platform SDK
prr
parents:
1776
diff
changeset
|
72 |
#endif /* _MSC_VER > 1400 && _MSC_VER < 1600 */ |
1776
33e9405ab91b
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents:
715
diff
changeset
|
73 |
#endif /* _MSC_VER */ |
2 | 74 |
|
75 |
/* |
|
76 |
* Entry point. |
|
77 |
*/ |
|
78 |
#ifdef JAVAW |
|
79 |
||
80 |
char **__initenv; |
|
81 |
||
82 |
int WINAPI |
|
83 |
WinMain(HINSTANCE inst, HINSTANCE previnst, LPSTR cmdline, int cmdshow) |
|
84 |
{ |
|
85 |
int margc; |
|
86 |
char** margv; |
|
87 |
const jboolean const_javaw = JNI_TRUE; |
|
88 |
||
89 |
__initenv = _environ; |
|
90 |
margc = __argc; |
|
91 |
margv = __argv; |
|
92 |
||
93 |
||
94 |
#else /* JAVAW */ |
|
95 |
int |
|
96 |
main(int argc, char ** argv) |
|
97 |
{ |
|
98 |
int margc; |
|
99 |
char** margv; |
|
100 |
const jboolean const_javaw = JNI_FALSE; |
|
101 |
||
102 |
margc = argc; |
|
103 |
margv = argv; |
|
104 |
#endif /* JAVAW */ |
|
105 |
||
106 |
return JLI_Launch(margc, margv, |
|
107 |
sizeof(const_jargs) / sizeof(char *), const_jargs, |
|
108 |
sizeof(const_appclasspath) / sizeof(char *), const_appclasspath, |
|
109 |
FULL_VERSION, |
|
110 |
DOT_VERSION, |
|
111 |
(const_progname != NULL) ? const_progname : *margv, |
|
112 |
(const_launcher != NULL) ? const_launcher : *margv, |
|
113 |
(const_jargs != NULL) ? JNI_TRUE : JNI_FALSE, |
|
114 |
const_cpwildcard, const_javaw, const_ergo_class); |
|
115 |
} |