duke@435: @echo off duke@435: REM xdono@1279: REM Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. duke@435: REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. duke@435: REM duke@435: REM This code is free software; you can redistribute it and/or modify it duke@435: REM under the terms of the GNU General Public License version 2 only, as duke@435: REM published by the Free Software Foundation. duke@435: REM duke@435: REM This code is distributed in the hope that it will be useful, but WITHOUT duke@435: REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or duke@435: REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License duke@435: REM version 2 for more details (a copy is included in the LICENSE file that duke@435: REM accompanied this code). duke@435: REM duke@435: REM You should have received a copy of the GNU General Public License version duke@435: REM 2 along with this work; if not, write to the Free Software Foundation, duke@435: REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. duke@435: REM duke@435: REM Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, duke@435: REM CA 95054 USA or visit www.sun.com if you need additional information or duke@435: REM have any questions. duke@435: REM duke@435: REM duke@435: duke@435: REM This is the interactive build setup script (as opposed to the batch duke@435: REM build execution script). It creates $HotSpotBuildSpace if necessary, duke@435: REM copies the appropriate files out of $HotSpotWorkSpace into it, and duke@435: REM builds and runs MakeDeps in it. This has the side-effect of creating duke@435: REM the vm.vcproj file in the buildspace, which is then used in Visual C++. duke@435: REM duke@435: REM The generated project file depends upon the include databases. If duke@435: REM those are changed then MakeDeps is rerun. duke@435: duke@435: REM duke@435: REM Since we don't have uname and we could be cross-compiling, duke@435: REM Use the compiler to determine which ARCH we are building duke@435: REM duke@435: cl 2>&1 | grep "IA-64" >NUL duke@435: if %errorlevel% == 0 goto isia64 duke@435: cl 2>&1 | grep "AMD64" >NUL duke@435: if %errorlevel% == 0 goto amd64 duke@435: set ARCH=x86 duke@435: set BUILDARCH=i486 duke@435: set Platform_arch=x86 duke@435: set Platform_arch_model=x86_32 duke@435: goto end duke@435: :amd64 duke@435: set ARCH=x86 duke@435: set BUILDARCH=amd64 duke@435: set Platform_arch=x86 duke@435: set Platform_arch_model=x86_64 duke@435: goto end duke@435: :isia64 duke@435: set ARCH=ia64 duke@435: set BUILDARCH=ia64 duke@435: set Platform_arch=ia64 duke@435: set Platform_arch_model=ia64 duke@435: :end duke@435: duke@435: setlocal duke@435: duke@435: if "%1" == "" goto usage duke@435: duke@435: if not "%4" == "" goto usage duke@435: duke@435: set HotSpotWorkSpace=%1 duke@435: set HotSpotBuildSpace=%2 duke@435: set HotSpotJDKDist=%3 duke@435: duke@435: REM figure out MSC version kamg@526: for /F %%i in ('sh %HotSpotWorkSpace%/make/windows/get_msc_ver.sh') do set %%i duke@435: duke@435: echo ************************************************************** ikrylov@1094: set ProjectFile=vm.vcproj duke@435: if "%MSC_VER%" == "1200" ( duke@435: set ProjectFile=vm.dsp duke@435: echo Will generate VC6 project {unsupported} duke@435: ) else ( ikrylov@1094: if "%MSC_VER%" == "1400" ( ikrylov@1094: echo Will generate VC8 {Visual Studio 2005} ikrylov@1094: ) else ( ikrylov@1094: if "%MSC_VER%" == "1500" ( ikrylov@1094: echo Will generate VC9 {Visual Studio 2008} ikrylov@1094: ) else ( ikrylov@1094: echo Will generate VC7 project {Visual Studio 2003 .NET} ikrylov@1094: ) ikrylov@1094: ) duke@435: ) duke@435: echo %ProjectFile% duke@435: echo ************************************************************** duke@435: duke@435: REM Test all variables to see whether the directories they duke@435: REM reference exist duke@435: duke@435: if exist %HotSpotWorkSpace% goto test1 duke@435: duke@435: echo Error: directory pointed to by HotSpotWorkSpace duke@435: echo does not exist, or the variable is not set. duke@435: echo. duke@435: goto usage duke@435: duke@435: :test1 duke@435: if exist %HotSpotBuildSpace% goto test2 duke@435: if not "%HotSpotBuildSpace%" == "" mkdir %HotSpotBuildSpace% duke@435: if exist %HotSpotBuildSpace% goto test2 duke@435: echo Error: directory pointed to by HotSpotBuildSpace duke@435: echo does not exist, or the variable is not set. duke@435: echo. duke@435: goto usage duke@435: duke@435: :test2 duke@435: if exist %HotSpotJDKDist% goto test3 duke@435: echo Error: directory pointed to by %HotSpotJDKDist% duke@435: echo does not exist, or the variable is not set. duke@435: echo. duke@435: goto usage duke@435: duke@435: :test3 duke@435: if not "%HOTSPOTMKSHOME%" == "" goto makedir duke@435: echo Warning: please set variable HOTSPOTMKSHOME to place where duke@435: echo your MKS/Cygwin installation is duke@435: echo. duke@435: goto usage duke@435: duke@435: :makedir duke@435: echo NOTE: Using the following settings: duke@435: echo HotSpotWorkSpace=%HotSpotWorkSpace% duke@435: echo HotSpotBuildSpace=%HotSpotBuildSpace% duke@435: echo HotSpotJDKDist=%HotSpotJDKDist% duke@435: duke@435: duke@435: REM This is now safe to do. duke@435: :copyfiles duke@435: for /D %%i in (compiler1, compiler2, tiered, core, kernel) do ( duke@435: if NOT EXIST %HotSpotBuildSpace%\%%i mkdir %HotSpotBuildSpace%\%%i kamg@526: copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\ > NUL duke@435: ) duke@435: duke@435: REM force regneration of ProjectFile duke@435: if exist %HotSpotBuildSpace%\%ProjectFile% del %HotSpotBuildSpace%\%ProjectFile% duke@435: duke@435: for /D %%i in (compiler1, compiler2, tiered, core, kernel) do ( duke@435: duke@435: echo # Generated file! > %HotSpotBuildSpace%\%%i\local.make duke@435: echo # Changing a variable below and then deleting %ProjectFile% will cause >> %HotSpotBuildSpace%\%%i\local.make duke@435: echo # %ProjectFile% to be regenerated with the new values. Changing the >> %HotSpotBuildSpace%\%%i\local.make duke@435: echo # version requires rerunning create.bat. >> %HotSpotBuildSpace%\%%i\local.make duke@435: echo. >> %HotSpotBuildSpace%\%%i\local.make duke@435: echo HOTSPOTWORKSPACE=%HotSpotWorkSpace% >> %HotSpotBuildSpace%\%%i\local.make duke@435: echo HOTSPOTBUILDSPACE=%HotSpotBuildSpace% >> %HotSpotBuildSpace%\%%i\local.make duke@435: echo HOTSPOTJDKDIST=%HotSpotJDKDist% >> %HotSpotBuildSpace%\%%i\local.make duke@435: echo ARCH=%ARCH% >> %HotSpotBuildSpace%\%%i\local.make duke@435: echo BUILDARCH=%BUILDARCH% >> %HotSpotBuildSpace%\%%i\local.make duke@435: echo Platform_arch=%Platform_arch% >> %HotSpotBuildSpace%\%%i\local.make duke@435: echo Platform_arch_model=%Platform_arch_model% >> %HotSpotBuildSpace%\%%i\local.make duke@435: duke@435: REM build config specific stuff duke@435: duke@435: pushd %HotSpotBuildSpace%\%%i duke@435: nmake /nologo duke@435: popd duke@435: ) duke@435: duke@435: goto end duke@435: duke@435: :usage duke@435: echo Usage: create HotSpotWorkSpace HotSpotBuildSpace HotSpotJDKDist duke@435: echo. duke@435: echo This is the interactive build setup script (as opposed to the batch duke@435: echo build execution script). It creates HotSpotBuildSpace if necessary, duke@435: echo copies the appropriate files out of HotSpotWorkSpace into it, and duke@435: echo builds and runs MakeDeps in it. This has the side-effect of creating duke@435: echo the %ProjectFile% file in the build space, which is then used in Visual C++. duke@435: echo The HotSpotJDKDist defines place where JVM binaries should be placed. duke@435: echo Environment variable FORCE_MSC_VER allows to override MSVC version autodetection. duke@435: echo. duke@435: echo The generated project file depends upon the include databases. If duke@435: echo those are changed then MakeDeps is rerun. duke@435: echo. duke@435: echo NOTE that it is now NOT safe to modify any of the files in the build duke@435: echo space, since they may be overwritten whenever this script is run or duke@435: echo nmake is run in that directory. duke@435: duke@435: :end duke@435: duke@435: endlocal