Fri, 11 Apr 2008 09:56:35 -0400
Merge
duke@435 | 1 | @echo off |
duke@435 | 2 | REM |
duke@435 | 3 | REM Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved. |
duke@435 | 4 | REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@435 | 5 | REM |
duke@435 | 6 | REM This code is free software; you can redistribute it and/or modify it |
duke@435 | 7 | REM under the terms of the GNU General Public License version 2 only, as |
duke@435 | 8 | REM published by the Free Software Foundation. |
duke@435 | 9 | REM |
duke@435 | 10 | REM This code is distributed in the hope that it will be useful, but WITHOUT |
duke@435 | 11 | REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@435 | 12 | REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@435 | 13 | REM version 2 for more details (a copy is included in the LICENSE file that |
duke@435 | 14 | REM accompanied this code). |
duke@435 | 15 | REM |
duke@435 | 16 | REM You should have received a copy of the GNU General Public License version |
duke@435 | 17 | REM 2 along with this work; if not, write to the Free Software Foundation, |
duke@435 | 18 | REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@435 | 19 | REM |
duke@435 | 20 | REM Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
duke@435 | 21 | REM CA 95054 USA or visit www.sun.com if you need additional information or |
duke@435 | 22 | REM have any questions. |
duke@435 | 23 | REM |
duke@435 | 24 | REM |
duke@435 | 25 | |
duke@435 | 26 | REM This is the interactive build setup script (as opposed to the batch |
duke@435 | 27 | REM build execution script). It creates $HotSpotBuildSpace if necessary, |
duke@435 | 28 | REM copies the appropriate files out of $HotSpotWorkSpace into it, and |
duke@435 | 29 | REM builds and runs MakeDeps in it. This has the side-effect of creating |
duke@435 | 30 | REM the vm.vcproj file in the buildspace, which is then used in Visual C++. |
duke@435 | 31 | REM |
duke@435 | 32 | REM The generated project file depends upon the include databases. If |
duke@435 | 33 | REM those are changed then MakeDeps is rerun. |
duke@435 | 34 | |
duke@435 | 35 | REM |
duke@435 | 36 | REM Since we don't have uname and we could be cross-compiling, |
duke@435 | 37 | REM Use the compiler to determine which ARCH we are building |
duke@435 | 38 | REM |
duke@435 | 39 | cl 2>&1 | grep "IA-64" >NUL |
duke@435 | 40 | if %errorlevel% == 0 goto isia64 |
duke@435 | 41 | cl 2>&1 | grep "AMD64" >NUL |
duke@435 | 42 | if %errorlevel% == 0 goto amd64 |
duke@435 | 43 | set ARCH=x86 |
duke@435 | 44 | set BUILDARCH=i486 |
duke@435 | 45 | set Platform_arch=x86 |
duke@435 | 46 | set Platform_arch_model=x86_32 |
duke@435 | 47 | goto end |
duke@435 | 48 | :amd64 |
duke@435 | 49 | set ARCH=x86 |
duke@435 | 50 | set BUILDARCH=amd64 |
duke@435 | 51 | set Platform_arch=x86 |
duke@435 | 52 | set Platform_arch_model=x86_64 |
duke@435 | 53 | goto end |
duke@435 | 54 | :isia64 |
duke@435 | 55 | set ARCH=ia64 |
duke@435 | 56 | set BUILDARCH=ia64 |
duke@435 | 57 | set Platform_arch=ia64 |
duke@435 | 58 | set Platform_arch_model=ia64 |
duke@435 | 59 | :end |
duke@435 | 60 | |
duke@435 | 61 | setlocal |
duke@435 | 62 | |
duke@435 | 63 | if "%1" == "" goto usage |
duke@435 | 64 | |
duke@435 | 65 | if not "%4" == "" goto usage |
duke@435 | 66 | |
duke@435 | 67 | set HotSpotWorkSpace=%1 |
duke@435 | 68 | set HotSpotBuildSpace=%2 |
duke@435 | 69 | set HotSpotJDKDist=%3 |
duke@435 | 70 | |
duke@435 | 71 | REM figure out MSC version |
kamg@526 | 72 | for /F %%i in ('sh %HotSpotWorkSpace%/make/windows/get_msc_ver.sh') do set %%i |
duke@435 | 73 | |
duke@435 | 74 | echo ************************************************************** |
duke@435 | 75 | if "%MSC_VER%" == "1200" ( |
duke@435 | 76 | set ProjectFile=vm.dsp |
duke@435 | 77 | echo Will generate VC6 project {unsupported} |
duke@435 | 78 | ) else ( |
duke@435 | 79 | set ProjectFile=vm.vcproj |
duke@435 | 80 | echo Will generate VC7 project |
duke@435 | 81 | ) |
duke@435 | 82 | echo %ProjectFile% |
duke@435 | 83 | echo ************************************************************** |
duke@435 | 84 | |
duke@435 | 85 | REM Test all variables to see whether the directories they |
duke@435 | 86 | REM reference exist |
duke@435 | 87 | |
duke@435 | 88 | if exist %HotSpotWorkSpace% goto test1 |
duke@435 | 89 | |
duke@435 | 90 | echo Error: directory pointed to by HotSpotWorkSpace |
duke@435 | 91 | echo does not exist, or the variable is not set. |
duke@435 | 92 | echo. |
duke@435 | 93 | goto usage |
duke@435 | 94 | |
duke@435 | 95 | :test1 |
duke@435 | 96 | if exist %HotSpotBuildSpace% goto test2 |
duke@435 | 97 | if not "%HotSpotBuildSpace%" == "" mkdir %HotSpotBuildSpace% |
duke@435 | 98 | if exist %HotSpotBuildSpace% goto test2 |
duke@435 | 99 | echo Error: directory pointed to by HotSpotBuildSpace |
duke@435 | 100 | echo does not exist, or the variable is not set. |
duke@435 | 101 | echo. |
duke@435 | 102 | goto usage |
duke@435 | 103 | |
duke@435 | 104 | :test2 |
duke@435 | 105 | if exist %HotSpotJDKDist% goto test3 |
duke@435 | 106 | echo Error: directory pointed to by %HotSpotJDKDist% |
duke@435 | 107 | echo does not exist, or the variable is not set. |
duke@435 | 108 | echo. |
duke@435 | 109 | goto usage |
duke@435 | 110 | |
duke@435 | 111 | :test3 |
duke@435 | 112 | if not "%HOTSPOTMKSHOME%" == "" goto makedir |
duke@435 | 113 | echo Warning: please set variable HOTSPOTMKSHOME to place where |
duke@435 | 114 | echo your MKS/Cygwin installation is |
duke@435 | 115 | echo. |
duke@435 | 116 | goto usage |
duke@435 | 117 | |
duke@435 | 118 | :makedir |
duke@435 | 119 | echo NOTE: Using the following settings: |
duke@435 | 120 | echo HotSpotWorkSpace=%HotSpotWorkSpace% |
duke@435 | 121 | echo HotSpotBuildSpace=%HotSpotBuildSpace% |
duke@435 | 122 | echo HotSpotJDKDist=%HotSpotJDKDist% |
duke@435 | 123 | |
duke@435 | 124 | |
duke@435 | 125 | REM This is now safe to do. |
duke@435 | 126 | :copyfiles |
duke@435 | 127 | for /D %%i in (compiler1, compiler2, tiered, core, kernel) do ( |
duke@435 | 128 | if NOT EXIST %HotSpotBuildSpace%\%%i mkdir %HotSpotBuildSpace%\%%i |
kamg@526 | 129 | copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\ > NUL |
duke@435 | 130 | ) |
duke@435 | 131 | |
duke@435 | 132 | REM force regneration of ProjectFile |
duke@435 | 133 | if exist %HotSpotBuildSpace%\%ProjectFile% del %HotSpotBuildSpace%\%ProjectFile% |
duke@435 | 134 | |
duke@435 | 135 | for /D %%i in (compiler1, compiler2, tiered, core, kernel) do ( |
duke@435 | 136 | |
duke@435 | 137 | echo # Generated file! > %HotSpotBuildSpace%\%%i\local.make |
duke@435 | 138 | echo # Changing a variable below and then deleting %ProjectFile% will cause >> %HotSpotBuildSpace%\%%i\local.make |
duke@435 | 139 | echo # %ProjectFile% to be regenerated with the new values. Changing the >> %HotSpotBuildSpace%\%%i\local.make |
duke@435 | 140 | echo # version requires rerunning create.bat. >> %HotSpotBuildSpace%\%%i\local.make |
duke@435 | 141 | echo. >> %HotSpotBuildSpace%\%%i\local.make |
duke@435 | 142 | echo HOTSPOTWORKSPACE=%HotSpotWorkSpace% >> %HotSpotBuildSpace%\%%i\local.make |
duke@435 | 143 | echo HOTSPOTBUILDSPACE=%HotSpotBuildSpace% >> %HotSpotBuildSpace%\%%i\local.make |
duke@435 | 144 | echo HOTSPOTJDKDIST=%HotSpotJDKDist% >> %HotSpotBuildSpace%\%%i\local.make |
duke@435 | 145 | echo ARCH=%ARCH% >> %HotSpotBuildSpace%\%%i\local.make |
duke@435 | 146 | echo BUILDARCH=%BUILDARCH% >> %HotSpotBuildSpace%\%%i\local.make |
duke@435 | 147 | echo Platform_arch=%Platform_arch% >> %HotSpotBuildSpace%\%%i\local.make |
duke@435 | 148 | echo Platform_arch_model=%Platform_arch_model% >> %HotSpotBuildSpace%\%%i\local.make |
duke@435 | 149 | |
duke@435 | 150 | REM build config specific stuff |
duke@435 | 151 | |
duke@435 | 152 | pushd %HotSpotBuildSpace%\%%i |
duke@435 | 153 | nmake /nologo |
duke@435 | 154 | popd |
duke@435 | 155 | ) |
duke@435 | 156 | |
duke@435 | 157 | goto end |
duke@435 | 158 | |
duke@435 | 159 | :usage |
duke@435 | 160 | echo Usage: create HotSpotWorkSpace HotSpotBuildSpace HotSpotJDKDist |
duke@435 | 161 | echo. |
duke@435 | 162 | echo This is the interactive build setup script (as opposed to the batch |
duke@435 | 163 | echo build execution script). It creates HotSpotBuildSpace if necessary, |
duke@435 | 164 | echo copies the appropriate files out of HotSpotWorkSpace into it, and |
duke@435 | 165 | echo builds and runs MakeDeps in it. This has the side-effect of creating |
duke@435 | 166 | echo the %ProjectFile% file in the build space, which is then used in Visual C++. |
duke@435 | 167 | echo The HotSpotJDKDist defines place where JVM binaries should be placed. |
duke@435 | 168 | echo Environment variable FORCE_MSC_VER allows to override MSVC version autodetection. |
duke@435 | 169 | echo. |
duke@435 | 170 | echo The generated project file depends upon the include databases. If |
duke@435 | 171 | echo those are changed then MakeDeps is rerun. |
duke@435 | 172 | echo. |
duke@435 | 173 | echo NOTE that it is now NOT safe to modify any of the files in the build |
duke@435 | 174 | echo space, since they may be overwritten whenever this script is run or |
duke@435 | 175 | echo nmake is run in that directory. |
duke@435 | 176 | |
duke@435 | 177 | :end |
duke@435 | 178 | |
duke@435 | 179 | endlocal |