author | never |
Tue, 08 Dec 2009 16:27:21 -0800 | |
changeset 4469 | 2adc28d44986 |
parent 3261 | c7d5aae8d3f7 |
child 5093 | 5fe28adc52ef |
permissions | -rw-r--r-- |
1 | 1 |
@echo off |
2 |
REM |
|
3261 | 3 |
REM Copyright 1999-2009 Sun Microsystems, Inc. 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 |
|
20 |
REM Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
|
21 |
REM CA 95054 USA or visit www.sun.com if you need additional information or |
|
22 |
REM have any questions. |
|
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 |
|
29 |
REM builds and runs MakeDeps in it. This has the side-effect of creating |
|
30 |
REM the vm.vcproj file in the buildspace, which is then used in Visual C++. |
|
31 |
REM |
|
32 |
REM The generated project file depends upon the include databases. If |
|
33 |
REM those are changed then MakeDeps is rerun. |
|
34 |
||
35 |
REM |
|
36 |
REM Since we don't have uname and we could be cross-compiling, |
|
37 |
REM Use the compiler to determine which ARCH we are building |
|
38 |
REM |
|
39 |
cl 2>&1 | grep "IA-64" >NUL |
|
40 |
if %errorlevel% == 0 goto isia64 |
|
41 |
cl 2>&1 | grep "AMD64" >NUL |
|
42 |
if %errorlevel% == 0 goto amd64 |
|
43 |
set ARCH=x86 |
|
44 |
set BUILDARCH=i486 |
|
45 |
set Platform_arch=x86 |
|
46 |
set Platform_arch_model=x86_32 |
|
47 |
goto end |
|
48 |
:amd64 |
|
49 |
set ARCH=x86 |
|
50 |
set BUILDARCH=amd64 |
|
51 |
set Platform_arch=x86 |
|
52 |
set Platform_arch_model=x86_64 |
|
53 |
goto end |
|
54 |
:isia64 |
|
55 |
set ARCH=ia64 |
|
56 |
set BUILDARCH=ia64 |
|
57 |
set Platform_arch=ia64 |
|
58 |
set Platform_arch_model=ia64 |
|
59 |
:end |
|
60 |
||
61 |
setlocal |
|
62 |
||
63 |
if "%1" == "" goto usage |
|
64 |
||
65 |
if not "%4" == "" goto usage |
|
66 |
||
67 |
set HotSpotWorkSpace=%1 |
|
68 |
set HotSpotBuildSpace=%2 |
|
69 |
set HotSpotJDKDist=%3 |
|
70 |
||
71 |
REM figure out MSC version |
|
338
5cf9f61d76f4
6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents:
1
diff
changeset
|
72 |
for /F %%i in ('sh %HotSpotWorkSpace%/make/windows/get_msc_ver.sh') do set %%i |
1 | 73 |
|
74 |
echo ************************************************************** |
|
2271
ff6d122287cb
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
670
diff
changeset
|
75 |
set ProjectFile=vm.vcproj |
1 | 76 |
if "%MSC_VER%" == "1200" ( |
77 |
set ProjectFile=vm.dsp |
|
78 |
echo Will generate VC6 project {unsupported} |
|
79 |
) else ( |
|
2271
ff6d122287cb
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
670
diff
changeset
|
80 |
if "%MSC_VER%" == "1400" ( |
ff6d122287cb
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
670
diff
changeset
|
81 |
echo Will generate VC8 {Visual Studio 2005} |
ff6d122287cb
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
670
diff
changeset
|
82 |
) else ( |
ff6d122287cb
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
670
diff
changeset
|
83 |
if "%MSC_VER%" == "1500" ( |
ff6d122287cb
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
670
diff
changeset
|
84 |
echo Will generate VC9 {Visual Studio 2008} |
ff6d122287cb
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
670
diff
changeset
|
85 |
) else ( |
ff6d122287cb
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
670
diff
changeset
|
86 |
echo Will generate VC7 project {Visual Studio 2003 .NET} |
ff6d122287cb
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
670
diff
changeset
|
87 |
) |
ff6d122287cb
6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents:
670
diff
changeset
|
88 |
) |
1 | 89 |
) |
90 |
echo %ProjectFile% |
|
91 |
echo ************************************************************** |
|
92 |
||
93 |
REM Test all variables to see whether the directories they |
|
94 |
REM reference exist |
|
95 |
||
96 |
if exist %HotSpotWorkSpace% goto test1 |
|
97 |
||
98 |
echo Error: directory pointed to by HotSpotWorkSpace |
|
99 |
echo does not exist, or the variable is not set. |
|
100 |
echo. |
|
101 |
goto usage |
|
102 |
||
103 |
:test1 |
|
104 |
if exist %HotSpotBuildSpace% goto test2 |
|
105 |
if not "%HotSpotBuildSpace%" == "" mkdir %HotSpotBuildSpace% |
|
106 |
if exist %HotSpotBuildSpace% goto test2 |
|
107 |
echo Error: directory pointed to by HotSpotBuildSpace |
|
108 |
echo does not exist, or the variable is not set. |
|
109 |
echo. |
|
110 |
goto usage |
|
111 |
||
112 |
:test2 |
|
113 |
if exist %HotSpotJDKDist% goto test3 |
|
114 |
echo Error: directory pointed to by %HotSpotJDKDist% |
|
115 |
echo does not exist, or the variable is not set. |
|
116 |
echo. |
|
117 |
goto usage |
|
118 |
||
119 |
:test3 |
|
120 |
if not "%HOTSPOTMKSHOME%" == "" goto makedir |
|
121 |
echo Warning: please set variable HOTSPOTMKSHOME to place where |
|
122 |
echo your MKS/Cygwin installation is |
|
123 |
echo. |
|
124 |
goto usage |
|
125 |
||
126 |
:makedir |
|
127 |
echo NOTE: Using the following settings: |
|
128 |
echo HotSpotWorkSpace=%HotSpotWorkSpace% |
|
129 |
echo HotSpotBuildSpace=%HotSpotBuildSpace% |
|
130 |
echo HotSpotJDKDist=%HotSpotJDKDist% |
|
131 |
||
132 |
||
133 |
REM This is now safe to do. |
|
134 |
:copyfiles |
|
135 |
for /D %%i in (compiler1, compiler2, tiered, core, kernel) do ( |
|
136 |
if NOT EXIST %HotSpotBuildSpace%\%%i mkdir %HotSpotBuildSpace%\%%i |
|
338
5cf9f61d76f4
6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents:
1
diff
changeset
|
137 |
copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\ > NUL |
1 | 138 |
) |
139 |
||
140 |
REM force regneration of ProjectFile |
|
141 |
if exist %HotSpotBuildSpace%\%ProjectFile% del %HotSpotBuildSpace%\%ProjectFile% |
|
142 |
||
143 |
for /D %%i in (compiler1, compiler2, tiered, core, kernel) do ( |
|
144 |
||
145 |
echo # Generated file! > %HotSpotBuildSpace%\%%i\local.make |
|
146 |
echo # Changing a variable below and then deleting %ProjectFile% will cause >> %HotSpotBuildSpace%\%%i\local.make |
|
147 |
echo # %ProjectFile% to be regenerated with the new values. Changing the >> %HotSpotBuildSpace%\%%i\local.make |
|
148 |
echo # version requires rerunning create.bat. >> %HotSpotBuildSpace%\%%i\local.make |
|
149 |
echo. >> %HotSpotBuildSpace%\%%i\local.make |
|
150 |
echo HOTSPOTWORKSPACE=%HotSpotWorkSpace% >> %HotSpotBuildSpace%\%%i\local.make |
|
151 |
echo HOTSPOTBUILDSPACE=%HotSpotBuildSpace% >> %HotSpotBuildSpace%\%%i\local.make |
|
152 |
echo HOTSPOTJDKDIST=%HotSpotJDKDist% >> %HotSpotBuildSpace%\%%i\local.make |
|
153 |
echo ARCH=%ARCH% >> %HotSpotBuildSpace%\%%i\local.make |
|
154 |
echo BUILDARCH=%BUILDARCH% >> %HotSpotBuildSpace%\%%i\local.make |
|
155 |
echo Platform_arch=%Platform_arch% >> %HotSpotBuildSpace%\%%i\local.make |
|
156 |
echo Platform_arch_model=%Platform_arch_model% >> %HotSpotBuildSpace%\%%i\local.make |
|
157 |
||
158 |
REM build config specific stuff |
|
159 |
||
160 |
pushd %HotSpotBuildSpace%\%%i |
|
161 |
nmake /nologo |
|
162 |
popd |
|
163 |
) |
|
164 |
||
165 |
goto end |
|
166 |
||
167 |
:usage |
|
168 |
echo Usage: create HotSpotWorkSpace HotSpotBuildSpace HotSpotJDKDist |
|
169 |
echo. |
|
170 |
echo This is the interactive build setup script (as opposed to the batch |
|
171 |
echo build execution script). It creates HotSpotBuildSpace if necessary, |
|
172 |
echo copies the appropriate files out of HotSpotWorkSpace into it, and |
|
173 |
echo builds and runs MakeDeps in it. This has the side-effect of creating |
|
174 |
echo the %ProjectFile% file in the build space, which is then used in Visual C++. |
|
175 |
echo The HotSpotJDKDist defines place where JVM binaries should be placed. |
|
176 |
echo Environment variable FORCE_MSC_VER allows to override MSVC version autodetection. |
|
177 |
echo. |
|
178 |
echo The generated project file depends upon the include databases. If |
|
179 |
echo those are changed then MakeDeps is rerun. |
|
180 |
echo. |
|
181 |
echo NOTE that it is now NOT safe to modify any of the files in the build |
|
182 |
echo space, since they may be overwritten whenever this script is run or |
|
183 |
echo nmake is run in that directory. |
|
184 |
||
185 |
:end |
|
186 |
||
187 |
endlocal |