1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/make/windows/create.bat Wed Apr 09 14:22:48 2008 -0400 1.3 @@ -0,0 +1,179 @@ 1.4 +@echo off 1.5 +REM 1.6 +REM Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved. 1.7 +REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 +REM 1.9 +REM This code is free software; you can redistribute it and/or modify it 1.10 +REM under the terms of the GNU General Public License version 2 only, as 1.11 +REM published by the Free Software Foundation. 1.12 +REM 1.13 +REM This code is distributed in the hope that it will be useful, but WITHOUT 1.14 +REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.15 +REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.16 +REM version 2 for more details (a copy is included in the LICENSE file that 1.17 +REM accompanied this code). 1.18 +REM 1.19 +REM You should have received a copy of the GNU General Public License version 1.20 +REM 2 along with this work; if not, write to the Free Software Foundation, 1.21 +REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.22 +REM 1.23 +REM Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 1.24 +REM CA 95054 USA or visit www.sun.com if you need additional information or 1.25 +REM have any questions. 1.26 +REM 1.27 +REM 1.28 + 1.29 +REM This is the interactive build setup script (as opposed to the batch 1.30 +REM build execution script). It creates $HotSpotBuildSpace if necessary, 1.31 +REM copies the appropriate files out of $HotSpotWorkSpace into it, and 1.32 +REM builds and runs MakeDeps in it. This has the side-effect of creating 1.33 +REM the vm.vcproj file in the buildspace, which is then used in Visual C++. 1.34 +REM 1.35 +REM The generated project file depends upon the include databases. If 1.36 +REM those are changed then MakeDeps is rerun. 1.37 + 1.38 +REM 1.39 +REM Since we don't have uname and we could be cross-compiling, 1.40 +REM Use the compiler to determine which ARCH we are building 1.41 +REM 1.42 +cl 2>&1 | grep "IA-64" >NUL 1.43 +if %errorlevel% == 0 goto isia64 1.44 +cl 2>&1 | grep "AMD64" >NUL 1.45 +if %errorlevel% == 0 goto amd64 1.46 +set ARCH=x86 1.47 +set BUILDARCH=i486 1.48 +set Platform_arch=x86 1.49 +set Platform_arch_model=x86_32 1.50 +goto end 1.51 +:amd64 1.52 +set ARCH=x86 1.53 +set BUILDARCH=amd64 1.54 +set Platform_arch=x86 1.55 +set Platform_arch_model=x86_64 1.56 +goto end 1.57 +:isia64 1.58 +set ARCH=ia64 1.59 +set BUILDARCH=ia64 1.60 +set Platform_arch=ia64 1.61 +set Platform_arch_model=ia64 1.62 +:end 1.63 + 1.64 +setlocal 1.65 + 1.66 +if "%1" == "" goto usage 1.67 + 1.68 +if not "%4" == "" goto usage 1.69 + 1.70 +set HotSpotWorkSpace=%1 1.71 +set HotSpotBuildSpace=%2 1.72 +set HotSpotJDKDist=%3 1.73 + 1.74 +REM figure out MSC version 1.75 +for /F %%i in ('sh %HotSpotWorkSpace%/make/windows/get_msc_ver.sh') do set %%i 1.76 + 1.77 +echo ************************************************************** 1.78 +if "%MSC_VER%" == "1200" ( 1.79 +set ProjectFile=vm.dsp 1.80 +echo Will generate VC6 project {unsupported} 1.81 +) else ( 1.82 +set ProjectFile=vm.vcproj 1.83 +echo Will generate VC7 project 1.84 +) 1.85 +echo %ProjectFile% 1.86 +echo ************************************************************** 1.87 + 1.88 +REM Test all variables to see whether the directories they 1.89 +REM reference exist 1.90 + 1.91 +if exist %HotSpotWorkSpace% goto test1 1.92 + 1.93 +echo Error: directory pointed to by HotSpotWorkSpace 1.94 +echo does not exist, or the variable is not set. 1.95 +echo. 1.96 +goto usage 1.97 + 1.98 +:test1 1.99 +if exist %HotSpotBuildSpace% goto test2 1.100 +if not "%HotSpotBuildSpace%" == "" mkdir %HotSpotBuildSpace% 1.101 +if exist %HotSpotBuildSpace% goto test2 1.102 +echo Error: directory pointed to by HotSpotBuildSpace 1.103 +echo does not exist, or the variable is not set. 1.104 +echo. 1.105 +goto usage 1.106 + 1.107 +:test2 1.108 +if exist %HotSpotJDKDist% goto test3 1.109 +echo Error: directory pointed to by %HotSpotJDKDist% 1.110 +echo does not exist, or the variable is not set. 1.111 +echo. 1.112 +goto usage 1.113 + 1.114 +:test3 1.115 +if not "%HOTSPOTMKSHOME%" == "" goto makedir 1.116 +echo Warning: please set variable HOTSPOTMKSHOME to place where 1.117 +echo your MKS/Cygwin installation is 1.118 +echo. 1.119 +goto usage 1.120 + 1.121 +:makedir 1.122 +echo NOTE: Using the following settings: 1.123 +echo HotSpotWorkSpace=%HotSpotWorkSpace% 1.124 +echo HotSpotBuildSpace=%HotSpotBuildSpace% 1.125 +echo HotSpotJDKDist=%HotSpotJDKDist% 1.126 + 1.127 + 1.128 +REM This is now safe to do. 1.129 +:copyfiles 1.130 +for /D %%i in (compiler1, compiler2, tiered, core, kernel) do ( 1.131 +if NOT EXIST %HotSpotBuildSpace%\%%i mkdir %HotSpotBuildSpace%\%%i 1.132 +copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\ > NUL 1.133 +) 1.134 + 1.135 +REM force regneration of ProjectFile 1.136 +if exist %HotSpotBuildSpace%\%ProjectFile% del %HotSpotBuildSpace%\%ProjectFile% 1.137 + 1.138 +for /D %%i in (compiler1, compiler2, tiered, core, kernel) do ( 1.139 + 1.140 +echo # Generated file! > %HotSpotBuildSpace%\%%i\local.make 1.141 +echo # Changing a variable below and then deleting %ProjectFile% will cause >> %HotSpotBuildSpace%\%%i\local.make 1.142 +echo # %ProjectFile% to be regenerated with the new values. Changing the >> %HotSpotBuildSpace%\%%i\local.make 1.143 +echo # version requires rerunning create.bat. >> %HotSpotBuildSpace%\%%i\local.make 1.144 +echo. >> %HotSpotBuildSpace%\%%i\local.make 1.145 +echo HOTSPOTWORKSPACE=%HotSpotWorkSpace% >> %HotSpotBuildSpace%\%%i\local.make 1.146 +echo HOTSPOTBUILDSPACE=%HotSpotBuildSpace% >> %HotSpotBuildSpace%\%%i\local.make 1.147 +echo HOTSPOTJDKDIST=%HotSpotJDKDist% >> %HotSpotBuildSpace%\%%i\local.make 1.148 +echo ARCH=%ARCH% >> %HotSpotBuildSpace%\%%i\local.make 1.149 +echo BUILDARCH=%BUILDARCH% >> %HotSpotBuildSpace%\%%i\local.make 1.150 +echo Platform_arch=%Platform_arch% >> %HotSpotBuildSpace%\%%i\local.make 1.151 +echo Platform_arch_model=%Platform_arch_model% >> %HotSpotBuildSpace%\%%i\local.make 1.152 + 1.153 +REM build config specific stuff 1.154 + 1.155 +pushd %HotSpotBuildSpace%\%%i 1.156 +nmake /nologo 1.157 +popd 1.158 +) 1.159 + 1.160 +goto end 1.161 + 1.162 +:usage 1.163 +echo Usage: create HotSpotWorkSpace HotSpotBuildSpace HotSpotJDKDist 1.164 +echo. 1.165 +echo This is the interactive build setup script (as opposed to the batch 1.166 +echo build execution script). It creates HotSpotBuildSpace if necessary, 1.167 +echo copies the appropriate files out of HotSpotWorkSpace into it, and 1.168 +echo builds and runs MakeDeps in it. This has the side-effect of creating 1.169 +echo the %ProjectFile% file in the build space, which is then used in Visual C++. 1.170 +echo The HotSpotJDKDist defines place where JVM binaries should be placed. 1.171 +echo Environment variable FORCE_MSC_VER allows to override MSVC version autodetection. 1.172 +echo. 1.173 +echo The generated project file depends upon the include databases. If 1.174 +echo those are changed then MakeDeps is rerun. 1.175 +echo. 1.176 +echo NOTE that it is now NOT safe to modify any of the files in the build 1.177 +echo space, since they may be overwritten whenever this script is run or 1.178 +echo nmake is run in that directory. 1.179 + 1.180 +:end 1.181 + 1.182 +endlocal