author | jiangli |
Mon, 21 May 2012 14:10:35 -0400 | |
changeset 12772 | d317e5e08194 |
parent 8860 | 98a7ff20acf0 |
child 16447 | 234db5e2ae5e |
permissions | -rw-r--r-- |
1 | 1 |
@echo off |
2 |
REM |
|
8303
81a0b8663748
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
7452
diff
changeset
|
3 |
REM Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. |
1 | 4 |
REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5 |
REM |
|
6 |
REM This code is free software; you can redistribute it and/or modify it |
|
7 |
REM under the terms of the GNU General Public License version 2 only, as |
|
8 |
REM published by the Free Software Foundation. |
|
9 |
REM |
|
10 |
REM This code is distributed in the hope that it will be useful, but WITHOUT |
|
11 |
REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
12 |
REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
13 |
REM version 2 for more details (a copy is included in the LICENSE file that |
|
14 |
REM accompanied this code). |
|
15 |
REM |
|
16 |
REM You should have received a copy of the GNU General Public License version |
|
17 |
REM 2 along with this work; if not, write to the Free Software Foundation, |
|
18 |
REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
19 |
REM |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5093
diff
changeset
|
20 |
REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5093
diff
changeset
|
21 |
REM or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5093
diff
changeset
|
22 |
REM questions. |
1 | 23 |
REM |
24 |
REM |
|
25 |
||
26 |
REM This is the interactive build setup script (as opposed to the batch |
|
27 |
REM build execution script). It creates $HotSpotBuildSpace if necessary, |
|
28 |
REM copies the appropriate files out of $HotSpotWorkSpace into it, and |
|
7397 | 29 |
REM builds and runs ProjectCreator in it. This has the side-effect of creating |
1 | 30 |
REM the vm.vcproj file in the buildspace, which is then used in Visual C++. |
31 |
||
32 |
REM |
|
33 |
REM Since we don't have uname and we could be cross-compiling, |
|
34 |
REM Use the compiler to determine which ARCH we are building |
|
35 |
REM |
|
5093
5fe28adc52ef
6938185: 3/4 6923488 breaks Windows command shell builds
dcubed
parents:
3261
diff
changeset
|
36 |
REM Note: Running this batch file from the Windows command shell requires |
5fe28adc52ef
6938185: 3/4 6923488 breaks Windows command shell builds
dcubed
parents:
3261
diff
changeset
|
37 |
REM that "grep" be accessible on the PATH. An MKS install does this. |
5fe28adc52ef
6938185: 3/4 6923488 breaks Windows command shell builds
dcubed
parents:
3261
diff
changeset
|
38 |
REM |
7452
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
39 |
|
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
40 |
cl 2>NUL >NUL |
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
41 |
if %errorlevel% == 0 goto nexttest |
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
42 |
echo Make sure cl.exe is in your PATH before running this script. |
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
43 |
goto end |
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
44 |
|
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
45 |
:nexttest |
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
46 |
grep -V 2>NUL >NUL |
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
47 |
if %errorlevel% == 0 goto testit |
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
48 |
echo Make sure grep.exe is in your PATH before running this script. Either cygwin or MKS should work. |
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
49 |
goto end |
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
50 |
|
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
51 |
|
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
52 |
:testit |
8303
81a0b8663748
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
7452
diff
changeset
|
53 |
cl 2>&1 | grep "x64" >NUL |
1 | 54 |
if %errorlevel% == 0 goto amd64 |
55 |
set ARCH=x86 |
|
56 |
set BUILDARCH=i486 |
|
57 |
set Platform_arch=x86 |
|
58 |
set Platform_arch_model=x86_32 |
|
7452
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
59 |
goto done |
1 | 60 |
:amd64 |
61 |
set ARCH=x86 |
|
62 |
set BUILDARCH=amd64 |
|
63 |
set Platform_arch=x86 |
|
64 |
set Platform_arch_model=x86_64 |
|
7452
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
65 |
:done |
1 | 66 |
|
67 |
setlocal |
|
68 |
||
69 |
if "%1" == "" goto usage |
|
70 |
||
7452
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
71 |
if not "%2" == "" goto usage |
1 | 72 |
|
7452
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
73 |
REM Set HotSpotWorkSpace to the directy two steps above this script |
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
74 |
for %%i in ("%~dp0..") do ( set HotSpotWorkSpace=%%~dpi) |
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
75 |
set HotSpotBuildRoot=%HotSpotWorkSpace%build |
8303
81a0b8663748
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
7452
diff
changeset
|
76 |
set HotSpotBuildSpace=%HotSpotBuildRoot%\vs-%BUILDARCH% |
7452
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
77 |
set HotSpotJDKDist=%1 |
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
78 |
|
1 | 79 |
|
80 |
REM figure out MSC version |
|
338
5cf9f61d76f4
6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents:
1
diff
changeset
|
81 |
for /F %%i in ('sh %HotSpotWorkSpace%/make/windows/get_msc_ver.sh') do set %%i |
1 | 82 |
|
83 |
echo ************************************************************** |
|
8303
81a0b8663748
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
7452
diff
changeset
|
84 |
set ProjectFile=%HotSpotBuildSpace%\jvm.vcproj |
1 | 85 |
if "%MSC_VER%" == "1200" ( |
8303
81a0b8663748
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
7452
diff
changeset
|
86 |
set ProjectFile=%HotSpotBuildSpace%\jvm.dsp |
1 | 87 |
echo Will generate VC6 project {unsupported} |
88 |
) else ( |
|
2271
ff6d122287cb
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
670
diff
changeset
|
89 |
if "%MSC_VER%" == "1400" ( |
ff6d122287cb
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
670
diff
changeset
|
90 |
echo Will generate VC8 {Visual Studio 2005} |
ff6d122287cb
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
670
diff
changeset
|
91 |
) else ( |
ff6d122287cb
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
670
diff
changeset
|
92 |
if "%MSC_VER%" == "1500" ( |
ff6d122287cb
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
670
diff
changeset
|
93 |
echo Will generate VC9 {Visual Studio 2008} |
ff6d122287cb
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
670
diff
changeset
|
94 |
) else ( |
7452
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
95 |
if "%MSC_VER%" == "1600" ( |
8860 | 96 |
echo Will generate VC10 {Visual Studio 2010} |
97 |
set ProjectFile=%HotSpotBuildSpace%\jvm.vcxproj |
|
7452
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
98 |
) else ( |
2271
ff6d122287cb
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
670
diff
changeset
|
99 |
echo Will generate VC7 project {Visual Studio 2003 .NET} |
ff6d122287cb
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
670
diff
changeset
|
100 |
) |
ff6d122287cb
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
670
diff
changeset
|
101 |
) |
1 | 102 |
) |
7452
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
103 |
) |
8860 | 104 |
echo %ProjectFile% |
1 | 105 |
echo ************************************************************** |
106 |
||
107 |
REM Test all variables to see whether the directories they |
|
108 |
REM reference exist |
|
109 |
||
110 |
if exist %HotSpotWorkSpace% goto test1 |
|
111 |
||
112 |
echo Error: directory pointed to by HotSpotWorkSpace |
|
113 |
echo does not exist, or the variable is not set. |
|
114 |
echo. |
|
115 |
goto usage |
|
116 |
||
117 |
:test1 |
|
118 |
if exist %HotSpotBuildSpace% goto test2 |
|
119 |
if not "%HotSpotBuildSpace%" == "" mkdir %HotSpotBuildSpace% |
|
120 |
if exist %HotSpotBuildSpace% goto test2 |
|
121 |
echo Error: directory pointed to by HotSpotBuildSpace |
|
122 |
echo does not exist, or the variable is not set. |
|
123 |
echo. |
|
124 |
goto usage |
|
125 |
||
126 |
:test2 |
|
127 |
if exist %HotSpotJDKDist% goto test3 |
|
128 |
echo Error: directory pointed to by %HotSpotJDKDist% |
|
129 |
echo does not exist, or the variable is not set. |
|
130 |
echo. |
|
131 |
goto usage |
|
132 |
||
133 |
:test3 |
|
134 |
if not "%HOTSPOTMKSHOME%" == "" goto makedir |
|
7452
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
135 |
if exist c:\cygwin\bin set HOTSPOTMKSHOME=c:\cygwin\bin |
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
136 |
if not "%HOTSPOTMKSHOME%" == "" goto makedir |
1 | 137 |
echo Warning: please set variable HOTSPOTMKSHOME to place where |
138 |
echo your MKS/Cygwin installation is |
|
139 |
echo. |
|
140 |
goto usage |
|
141 |
||
142 |
:makedir |
|
143 |
echo NOTE: Using the following settings: |
|
144 |
echo HotSpotWorkSpace=%HotSpotWorkSpace% |
|
145 |
echo HotSpotBuildSpace=%HotSpotBuildSpace% |
|
146 |
echo HotSpotJDKDist=%HotSpotJDKDist% |
|
147 |
||
148 |
||
149 |
REM This is now safe to do. |
|
150 |
:copyfiles |
|
151 |
for /D %%i in (compiler1, compiler2, tiered, core, kernel) do ( |
|
7452
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
152 |
if NOT EXIST %HotSpotBuildSpace%\%%i\generated mkdir %HotSpotBuildSpace%\%%i\generated |
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
153 |
copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\generated > NUL |
1 | 154 |
) |
155 |
||
156 |
REM force regneration of ProjectFile |
|
8303
81a0b8663748
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
7452
diff
changeset
|
157 |
if exist %ProjectFile% del %ProjectFile% |
1 | 158 |
|
159 |
for /D %%i in (compiler1, compiler2, tiered, core, kernel) do ( |
|
7452
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
160 |
echo -- %%i -- |
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
161 |
echo # Generated file! > %HotSpotBuildSpace%\%%i\local.make |
1 | 162 |
echo # Changing a variable below and then deleting %ProjectFile% will cause >> %HotSpotBuildSpace%\%%i\local.make |
163 |
echo # %ProjectFile% to be regenerated with the new values. Changing the >> %HotSpotBuildSpace%\%%i\local.make |
|
7452
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
164 |
echo # version requires rerunning create.bat. >> %HotSpotBuildSpace%\%%i\local.make |
1 | 165 |
echo. >> %HotSpotBuildSpace%\%%i\local.make |
7452
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
166 |
echo Variant=%%i >> %HotSpotBuildSpace%\%%i\local.make |
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
167 |
echo WorkSpace=%HotSpotWorkSpace% >> %HotSpotBuildSpace%\%%i\local.make |
1 | 168 |
echo HOTSPOTWORKSPACE=%HotSpotWorkSpace% >> %HotSpotBuildSpace%\%%i\local.make |
7452
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
169 |
echo HOTSPOTBUILDROOT=%HotSpotBuildRoot% >> %HotSpotBuildSpace%\%%i\local.make |
1 | 170 |
echo HOTSPOTBUILDSPACE=%HotSpotBuildSpace% >> %HotSpotBuildSpace%\%%i\local.make |
171 |
echo HOTSPOTJDKDIST=%HotSpotJDKDist% >> %HotSpotBuildSpace%\%%i\local.make |
|
172 |
echo ARCH=%ARCH% >> %HotSpotBuildSpace%\%%i\local.make |
|
173 |
echo BUILDARCH=%BUILDARCH% >> %HotSpotBuildSpace%\%%i\local.make |
|
174 |
echo Platform_arch=%Platform_arch% >> %HotSpotBuildSpace%\%%i\local.make |
|
175 |
echo Platform_arch_model=%Platform_arch_model% >> %HotSpotBuildSpace%\%%i\local.make |
|
8303
81a0b8663748
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
7452
diff
changeset
|
176 |
echo MSC_VER=%MSC_VER% >> %HotSpotBuildSpace%\%%i\local.make |
1 | 177 |
|
7452
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
178 |
for /D %%j in (debug, fastdebug, product) do ( |
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
179 |
if NOT EXIST %HotSpotBuildSpace%\%%i\%%j mkdir %HotSpotBuildSpace%\%%i\%%j |
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
180 |
) |
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
181 |
|
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
182 |
pushd %HotSpotBuildSpace%\%%i\generated |
1 | 183 |
nmake /nologo |
184 |
popd |
|
7397 | 185 |
|
1 | 186 |
) |
187 |
||
7452
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
188 |
pushd %HotSpotBuildRoot% |
7397 | 189 |
|
7452
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
190 |
REM It doesn't matter which variant we use here, "compiler1" is as good as any of the others - we need the common variables |
8303
81a0b8663748
7017824: Add support for creating 64-bit Visual Studio projects
sla
parents:
7452
diff
changeset
|
191 |
nmake /nologo /F %HotSpotWorkSpace%/make/windows/projectfiles/common/Makefile LOCAL_MAKE=%HotSpotBuildSpace%\compiler1\local.make %ProjectFile% |
7397 | 192 |
|
193 |
popd |
|
194 |
||
1 | 195 |
goto end |
196 |
||
197 |
:usage |
|
7452
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
198 |
echo Usage: create HotSpotJDKDist |
1 | 199 |
echo. |
7452
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
200 |
echo This is the VS build setup script (as opposed to the batch |
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
201 |
echo build execution script). It creates a build directory if necessary, |
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
202 |
echo copies the appropriate files out of the workspace into it, and |
7397 | 203 |
echo builds and runs ProjectCreator in it. This has the side-effect of creating |
1 | 204 |
echo the %ProjectFile% file in the build space, which is then used in Visual C++. |
7452
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
205 |
echo. |
b3fa838286de
7006354: Updates to Visual Studio project creation and development launcher
sla
parents:
7397
diff
changeset
|
206 |
echo The HotSpotJDKDist defines the JDK that should be used when running the JVM. |
1 | 207 |
echo Environment variable FORCE_MSC_VER allows to override MSVC version autodetection. |
208 |
echo. |
|
209 |
echo NOTE that it is now NOT safe to modify any of the files in the build |
|
210 |
echo space, since they may be overwritten whenever this script is run or |
|
211 |
echo nmake is run in that directory. |
|
212 |
||
213 |
:end |
|
214 |
||
215 |
endlocal |