VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware2/VBoxPkg/env.cmd@ 35646

Last change on this file since 35646 was 29200, checked in by vboxsync, 15 years ago

more manual Oracle rebranding in headers

  • Property svn:eol-style set to CRLF
  • Property svn:keywords set to Author Date Id Revision
File size: 6.6 KB
Line 
1@echo off
2
3REM $Id $
4REM /*
5REM * Environment Setup Script for VBoxPkg + EDK2.
6REM */
7
8REM /*
9REM Copyright (C) 2009 Oracle Corporation
10REM
11REM This file is part of VirtualBox Open Source Edition (OSE), as
12REM available from http://www.virtualbox.org. This file is free software;
13REM you can redistribute it and/or modify it under the terms of the GNU
14REM General Public License (GPL) as published by the Free Software
15REM Foundation, in version 2 as it comes in the "COPYING" file of the
16REM VirtualBox OSE distribution. VirtualBox OSE is distributed in the
17REM hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
18REM
19REM */
20
21rem
22rem Figure where the VBox tools are, i.e. that tools/env.cmd has been execute.
23rem
24if not "%KBUILD_DEVTOOLS%"=="" goto kbuild_devtools_set
25if "%PATH_DEVTOOLS%"=="" goto error_devtools
26set KBUILD_DEVTOOLS=%PATH_DEVTOOLS%
27:kbuild_devtools_set
28
29rem
30rem Check that all the tools we need are there.
31rem
32set MY_MISSING=
33if not exist "%KBUILD_DEVTOOLS%\win.x86\vcc\v8sp1\bin\cl.exe" echo env.cmd: missing v8sp1.
34if not exist "%KBUILD_DEVTOOLS%\win.x86\vcc\v8sp1\bin\cl.exe" set MY_MISSING=1
35if not exist "%KBUILD_DEVTOOLS%\win.x86\vcc\v8sp1\env-x86.cmd" set MY_MISSING=1
36if not exist "%KBUILD_DEVTOOLS%\win.x86\ddk\6000\bin\x86\nmake.exe" echo env.cmd: missing ddk/6001.
37if not exist "%KBUILD_DEVTOOLS%\win.x86\ddk\6000\bin\x86\nmake.exe" set MY_MISSING=1
38if not exist "%KBUILD_DEVTOOLS%\win.x86\sdk\200504\env-x86.cmd" echo env.cmd: missing sdk/200504.
39if not exist "%KBUILD_DEVTOOLS%\win.x86\sdk\200504\env-x86.cmd" set MY_MISSING=1
40if "%MY_MISSING%"=="" goto devtools_ok
41echo env.cmd: Please run kmk -C %KBUILD_DEVTOOLS% KBUILD_TARGET_ARCH=amd64 to fetch the missing tools
42set MY_MISSING=
43exit /b1
44:devtools_ok
45
46rem
47rem Figure out where the EDK2 checkout is.
48rem
49if "%CD%"=="" goto error_cd_not_set
50pushd .
51cd %~dp0
52cd ..
53set WORKSPACE=%CD%
54popd
55if exist "%WORKSPACE%\VBoxPkg\VBoxPkg.dsc" goto found_edk2
56set WORKSPACE=%CD%
57if exist "%WORKSPACE%\VBoxPkg\VBoxPkg.dsc" goto found_edk2
58set WORKSPACE=%CD%\..
59if exist "%WORKSPACE%\VBoxPkg\VBoxPkg.dsc" goto found_edk2
60set WORKSPACE=%CD%\..\..
61if exist "%WORKSPACE%\VBoxPkg\VBoxPkg.dsc" goto found_edk2
62set WORKSPACE=
63echo env.cmd: Cannot find EDK2. Please enter the VBoxPkg directory in your EDK2 checkout and re-run this script.
64exit /b 1
65:found_edk2
66
67rem
68rem Config the workspace.
69rem
70if exist "%WORKSPACE%\Conf\target.txt" goto reconfig
71echo env.cmd: Configuring the workspace...
72
73echo # Edited by VBoxPkg/env.cmd (%DATE% %TIME%)> "%WORKSPACE%\Conf\tools_def.txt"
74echo # > tmp_vbox_env.sed
75echo s,C:\\Program Files\\Microsoft Visual Studio \.NET 2003\\Vc7,%KBUILD_DEVTOOLS%/win.x86/vcc/v7,>> tmp_vbox_env.sed
76echo s,C:\\Program Files\\Microsoft Visual Studio \.NET 2003\\Common7\\IDE,%KBUILD_DEVTOOLS%/win.x86/vcc/v7/bin,>> tmp_vbox_env.sed
77echo s,C:\\Program Files\\Microsoft Visual Studio 8\\Vc,%KBUILD_DEVTOOLS%/win.x86/vcc/v8sp1,>> tmp_vbox_env.sed
78echo s,C:\\Program Files\\Microsoft Visual Studio 8\\Common7\\IDE,%KBUILD_DEVTOOLS%/win.x86/vcc/v8sp1/bin,>> tmp_vbox_env.sed
79echo s,C:\\Program Files (x86)\\Microsoft Visual Studio 8\\Vc,%KBUILD_DEVTOOLS%/win.x86/vcc/v8sp1,>> tmp_vbox_env.sed
80echo s,C:\\Program Files (x86)\\Microsoft Visual Studio 8\\Common7\\IDE,%KBUILD_DEVTOOLS%/win.x86/vcc/v8sp1/bin,>> tmp_vbox_env.sed
81echo s,C:\\WINDDK\\3790.1830,%KBUILD_DEVTOOLS%/win.x86/ddk/6001,>> tmp_vbox_env.sed
82echo s,C:\ASL,%KBUILD_DEVTOOLS%/win.x86/bin,>> tmp_vbox_env.sed
83echo s,c:/cygwin,c:/no-cygwin-please,>> tmp_vbox_env.sed
84kmk_sed -f tmp_vbox_env.sed --append "%WORKSPACE%\Conf\tools_def.txt" "%WORKSPACE%\BaseTools\Conf\tools_def.template"
85if not errorlevel 0 goto error_sed
86del tmp_vbox_env.sed
87
88copy "%WORKSPACE%\BaseTools\Conf\build_rule.template" "%WORKSPACE%\Conf\build_rule.txt"
89if not errorlevel 0 goto error_copy
90
91rem must come last
92echo # Generated by VBoxPkg/env.cmd (%DATE% %TIME%)> "%WORKSPACE%\Conf\target.txt"
93echo ACTIVE_PLATFORM=VBoxPkg/VBoxPkg.dsc>> "%WORKSPACE%\Conf\target.txt"
94echo TARGET=DEBUG>> "%WORKSPACE%\Conf\target.txt"
95echo TARGET_ARCH=IA32>> "%WORKSPACE%\Conf\target.txt"
96echo TOOL_CHAIN_CONF=Conf/tools_def.txt>> "%WORKSPACE%\Conf\target.txt"
97echo TOOL_CHAIN_TAG=MYTOOLS>> "%WORKSPACE%\Conf\target.txt"
98echo MAX_CONCURRENT_THREAD_NUMBER=%NUMBER_OF_PROCESSORS% >> "%WORKSPACE%\Conf\target.txt"
99echo BUID_RULE_CONF=Conf/build_rule.txt>> "%WORKSPACE%\Conf\target.txt"
100
101goto configured
102:reconfig
103echo env.cmd: Already configured.
104echo env.cmd: If you want to reconfigure delete the following files and
105echo env.cmd: re-run VBoxPkg\env.cmd:
106echo env.cmd: %WORKSPACE%\Conf\target.txt
107echo env.cmd: %WORKSPACE%\Conf\tools_def.txt
108echo env.cmd: %WORKSPACE%\Conf\build_rule.txt
109:configured
110
111rem
112rem Make sure ComSpec is pointing to the standard Windows shell.
113rem 4NT and other replacements may cause trouble.
114rem
115if "%ComSpec%"=="%SystemRoot%\system32\cmd.exe" goto comspec_ok
116echo env.cmd: ComSpec does not seem to point at %SystemRoot%\system32\cmd.exe, fixing.
117echo env.cmd: (ComSpec=%ComSpec%)
118if not exist "%ComSpec%" echo env.cmd: Huh?? %SystemRoot%\system32\cmd.exe does not exist!
119if not exist "%ComSpec%" exit /b 1
120set ComSpec=%SystemRoot%\system32\cmd.exe
121:comspec_ok
122
123rem
124rem Load the environment.
125rem
126echo env.cmd: Loading the environment...
127call "%KBUILD_DEVTOOLS%\win.x86\sdk\200504\env-x86.cmd"
128if not errorlevel 0 goto error_sdk_env
129
130call "%KBUILD_DEVTOOLS%\win.x86\vcc\v8sp1\env-x86.cmd"
131if not errorlevel 0 goto error_vcc_env
132
133set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools
134call "%WORKSPACE%\BaseTools\toolsetup.bat"
135if not errorlevel 0 goto error_edk2_toolsetup
136
137echo env.cmd: Done.
138exit /b 0
139
140
141rem
142rem Error messages.
143rem
144:error_devtools
145echo env.cmd: Cannot find the VirtualBox devtools. Did you remember run tools/env.cmd in the VirtualBox tree first?
146exit /b 1
147
148:error_sdk_env
149echo env.cmd: the SDK env script failed.
150exit /b 1
151
152:error_vcc_env
153echo env.cmd: the Visual C++ env script failed.
154exit /b 1
155
156:error_edk2_toolsetup
157echo env.cmd: the EDK2 env script failed.
158exit /b 1
159
160:error_cd_not_set
161echo env.cmd: the internal CD variable isn't set. Complain to bird.
162exit /b 1
163
164:error_sed
165echo env.cmd: kmk_sed failed, see above error messages(s).
166exit /b 1
167
168:error_copy
169echo env.cmd: copy fails, see above error message(s).
170del tmp_vbox_env.sed
171exit /b 1
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette