Shared Source CLI Build Environment Variable Scripts

(env.bat, env.csh, env.sh)

Contents:

Overview

The Shared Source CLI (SSCLI) build process requires specific environment variables to be set in order to function.  Several files have been included in the SSCLI source tree to help correctly set these environment variables in a console window.

You should always run these files from the root of the SSCLI source tree because they will set paths relative to the directory location from which they are run.

Usage

On Microsoft® Windows:

env [option]

On UNIX system-based platforms, [t]csh shell:

source env.csh [option]

On UNIX system-based platforms, [ba|k]sh shell:

. ./env.sh [option]

Options

Option (build type) Description
checked Turns optimizations off, enables debug code, generates debugging symbols.
fastchecked Turns optimizations on, enables debug code, generates debugging symbols.
free Turns optimizations on, disables debug code, generates debugging symbols.

SSCLI Environment Variables on Windows

On Windows the SSCLI build process depends on several external applications already having been installed:

To set up your SSCLI build environment on Windows, switch to the root directory of the SSCLI directory tree and run the env.bat file with the option you want. Several external batch files are called from env.bat.

Table of Environment Variables on Windows

Environment variable Value Description
BROWSER_INFO 1 Not usually modified.
BUILD_ALT_DIR Depends on build type:
  • d in checked
  • df in fastchecked
  • set to nothing in free
Not usually modified.  Used by the build utility.
BUILD_DEFAULT -we -nmake -i -a Default flags used by the build utility.  Build flags are documented in buildutility.html

The flags following -nmake are passed through to the nmake.exe make tool.

BUILD_DEFAULT_TARGETS  -dynamic %TARGET_DIRECTORY% Not usually modified. Used by the build utility to find make tool and other defaults.
COFFBASE_TXT_FILE %ROTOR_DIR%\clr\bin\*\checked\coffbase.txt Sets .dll file base addresses for building Windows dynamic libraries (DLLs).  Not usually modified.
COMPlus_BuildFlavor wks Not usually modified. Hardwired switch in SSCLI
COPYCMD /Y Not usually modified. Allows copying without confirmation.
CORBASE %ROTOR_DIR%\clr Not usually modified. Set in rotorenv.bat.
CORENV %ROTOR_DIR%\rotorenv Not usually modified. Set in rotorenv.bat.
CRT_INC_PATH %ROTOR_DIR%\palrt\inc Not usually modified. Path to required C runtime include files
CRT_LIB_PATH %VCINSTALLDIR%\Vc7\lib files Path to Microsoft Visual C++® .NET .lib files
CSC_COMPILE_FLAGS  /d:FEATURE_PAL Options to be passed to the C# compiler.
C_DEFINES Can vary with build type.

Default for all buildtypes:

  • -DNTMAKEENV
  • -D_DEBUG
  • -DDEBUGGING_SUPPORTED
  • -DPROFILING_SUPPORTED
  • -DFUSION_SUPPORTED
  • -DPLATFORM_WIN32
  • -DFEATURE_PAL
  • -DUSE_CDECL_HELPERS
  • -DPAL_PORTABLE_SEH

#define values passed to the compiler during the build.

These are set in rotorenv.bat.

DDKBUILDENV Depends on build type.
  • checked in checked
  • fastchecked in fastchecked
  • free in free
Set by input to env.bat. Used by other environment variables to build path to binary build output.

 

DDKBUILDLIB Depends on build type.
  • checked in checked
  • fastchecked in fastchecked
  • free in free
Set by input to env.bat.
DEBUGGING_SUPPORTED_BUILD 1 Not usually modified. Set by rotorenv.bat.
DEBUG_CRTS 1 Not usually modified. Set by rotorenv.bat.

Set in both checked and fastchecked builds.

DevEnvDir %VSINSTALLDIR%\Common7\IDE Path to Visual Studio .NET development environment
dnaroot %ROTOR_DIR%\fx Path to root of SSCLI FX directory
FEATURE_PAL 1 Not usually modified.
FEATURE_PAL_VC7 1 Not usually modified.
FPO_OPT 1 Not usually modified.
FrameworkDir %FrameworkDir% Not usually modified. Set in vsvars32.bat
FrameworkSDKDir %FrameworkSDKDir% Not usually modified. Set in vsvars32.bat
FrameworkVersion %FrameworkVersion% Not usually modified. Set in vsvars32.bat
FUSION_LIB_PATH Depends on build type.

%CORBASE%/bin/%TARGET_DIRECTORY%
/%DDKBUILDENV%

Not usually modified. Path to intermediate binary output.
INTTOOLSTARGET Depends on build type.

%ROTOR_DIR%\build\v1.x86*.rotor\int_tools

Path to copy final build output for internal tools.

 

MSC_OPTIMIZATION /Od /Oi /GZ /G6 Microsoft® Visual C++ .NET compiler optimization switches.
MSVCDir %VCINSTALLDIR%\Vc7 Not usually modified.  Path to Microsoft Visual C++ .NET root directory.
NTDEBUG ntsd Not usually modified.
NTDEBUGTYPE vc6 Not usually modified.
NTMAKEENV %ROTOR_DIR%\rotorenv\bin Not usually modified.  Path to SSCLI build tools and scripts.
Path %PATH% After running env.bat, the path will include directories in SSCLI, Visual Studio .NET, and the Microsoft .NET Framework SDK.
PERLLIB PerlRoot\lib Path to \Perl\lib directory.
PREVIOUSCORPATH <set by rotorenv.bat> The path before rotorenv.bat runs.
PREVIOUSPATHSET 1 Not usually modified.
PREVIOUS_NT_SYMBOL_PATH_SET 1 Not usually modified.
PROFILING_SUPPORTED_BUILD 1 Not usually modified.
ROTOR 1 Must be "1" for build to complete
ROTOR_DIR %ROTOR_DIR% Path to root of SSCLI source directory. Set by env.bat to the location where it is executed.
SDK_INC_PATH %ROTOR_DIR%\pal; Not usually modified. Path to required SSCLI platform include data in rotor_pal.h.
SDK_LIB_PATH %VCINSTALLDIR%\Vc7\PlatformSDK\lib Not usually modified. Path to Visual Studio .NET .lib files.
SVR_WKS_DIRS wks Not usually modified.
TARGETCOMPLUS Depends on build type.

%ROTOR_DIR%\build\v1.x86*.rotor

Not usually modified directly. Use _URTTARGET to change output location.

Path to copy final build output.

TARGETCOMPLUSSDK Depends on build type.

%ROTOR_DIR%\build\v1.x86*.rotor\sdk

Not usually modified directly. Use _URTTARGET to change output location.

Path to copy final build output for tools.

 

URTBUILDENV

 

Depends on build type:
  • chk in checked.
  • fstchk in fastchecked.
  • fre in free.
Used to create name of build output directory.
URTSDKTARGET %ROTOR_DIR%\build\v1.x86*.rotor\sdk Not usually modified directly.  Use _URTTARGET to change output location.

Same as TARGETCOMPLUSSDK.

URTTARGET %ROTOR_DIR%\build\v1.x86* Not usually modified directly.  Use _URTTARGET to change output location.

Same as TARGETCOMPLUS without the .rotor

USE_PDB Depends on build type:
  • 1 in checked and fastchecked.
  • not set in free.
Not usually modified.
VCINSTALLDIR Depends on install location of Visual Studio Root of Visual Studio installation.  Set by vsvars32.bat.
VSINSTALLDIR Depends on install location of Visual Studio Root of IDE location in Visual Studio installation.  Set by vsvars32.bat.
_ENV Depends on build type.
  • ConfigChecked in checked.
  • ConfigFastChecked in fastchecked.
  • ConfigFree in free.
Not usually modified.

Used internally in batch file system.

_NTDRIVE Depends on root installation of SSCLI. Not usually modified.

Drive letter of path in %ROTOR_DIR%

_NTROOT %ROTOR_DIR%\clr Not usually modified.

Root of clr directory.

_NT_DEBUGGER_EXTENSION_PATH %ROTOR_DIR%\build\v1.x86*.rotor\int_tools Not usually modified.

Location where debugger extension file SOS is copied.

_NT_SYMBOL_PATH %ROTOR_DIR%\build\v1.x86*.rotor\ Not usually modified.

Location of debug symbolic information (.ildb files)

_TGTCPU i386 Not usually modified.
_TGTCPUTYPE x86 Not usually modified.
_TGTOS NT32 Not usually modified.
_URTTARGET %ROTOR_DIR%\build Base of the build output directory. 

You can set this environment variable manually to override the location for the binary build output.

SSCLI Environment Variables on UNIX System-based Platforms

To build SSCLI on UNIX system-based platforms you must install a developer distribution of that operating system.  The SSCLI build process requires commonly installed developer tools such as the gcc compiler, Perl, and ld to be in the path for the build to work. 

Note: The SSCLI build process on UNIX system-based platforms requires gcc version 2.95.3.

For tcsh or csh shell users:    

Switch to the root directory of the SSCLI source tree and run the env.csh script:

source env.csh [option]

Option can be checked, free, or fastchecked.

Users of other sh-style shells like bash or ksh should switch to the root directory of the SSCLI source tree and run the env.sh script:

. ./env.sh [option]

The SSCLI build process on UNIX system-based platforms is an amalgam of the SSCLI Windows build process preceded by a bootstrapping sequence that builds the Windows build tools.

Table of Environment Variables on UNIX System-based Platforms

(Using csh script format.)

Environment variable Value Description
_NTROOT ${CORBASE} Not usually modified.  Contains the path to the /clr directory.
_TGTCPU i386 Not usually modified.
BUILD_ALT_DIR Depends on build type:
  • d in checked
  • df in fastchecked
  • r to in free (only on UNIX system-based platforms)
Not usually modified.  Used by the build utility.
BUILD_DEFAULT -iwe -nmake -i -a Default flags used by the build utility.  Build flags are documented in buildutility.html

The flags following -nmake are passed through to the nmake make tool.

BUILD_DEFAULT_TARGETS -dynamic ${TARGET_DIRECTORY} Not usually modified. Default behavior and location for temporary binary build output.
C_DEFINES Can vary with build type.

See env.csh or env.sh for default values.

#define values passed to the compiler during build.

 

COFFBASE_TXT_FILE ${ROTOR_DIR}/clr/bin/*/checked/coffbase.txt Not usually modified.
CORBASE ${ROTOR_DIR}/clr Not usually modified. Location of the clr directory.
CORBUILDENV Depends on build type.

${DDKBUILDENV}/

Not usually modified.
CORENV ${ROTOR_DIR}/rotorenv Not usually modified.
CRT_INC_PATH ${PWD}/palrt/inc Not usually modified. Path to required C runtime include files
CSC_COMPILE_FLAGS /d:FEATURE_PAL /d:PLATFORM_UNIX #define options for C#
DDKBUILDENV Depends on build type.
  • checked in checked.
  • fastchecked in fastchecked.
  • free in free.
Not usually modified.  Used by other environment variables to build a path to binary build output.
DEBUGGING_SUPPORTED_BUILD 1 Not usually modified.
DNAROOT ${ROTOR_DIR}/fx Not usually modified. Root of the FX directory
FEATURE_PAL 1 Not usually modified. Build requires this to be set.
FUSION_LIB_PATH Depends on build and processor type.

${CORBASE}/bin/${TARGET_DIRECTORY}
/${DDKBUILDENV}

Not usually modified. Path to intermediate binary output.
INTTOOLSTARGET Depends on build type.

${TARGETCOMPLUS}/int_tools

Path to final internal tools binary build output.
LD_LIB_DIRS Depends on build type.

-L${TARGETCOMPLUS}

Path to SSCLI native libraries. Path is modified to support ld linker.
LD_LIBRARY_PATH Depends on build type.

${TARGETCOMPLUS}

System path for dynamically loaded libraries. Path is modified to include final binary build output of the SSCLI build.
NTDEBUG Depends on build type.
  • Checked build value: ntsd
  • Fastchecked value: ntsd
  • Free build value: ntsdnodbg
Not usually modified.
NTMAKEENV ${ROTOR_DIR}/rotorenv/bin Not usually modified. Path to internal build scripts and tools.
PATH ${PATH}:${TARGETCOMPLUS}/int_tools:
${TARGETCOMPLUS}/sdk/bin
Path is modified to include final binary build output applications.
PLATFORM Depends on operating system. Not usually modified.
PLATFORM_UNIX 1 Not usually modified. Indicates that current operating system platform is a UNIX system-based platform.
PROCESSOR_ARCHITECTURE x86 Processor target type.
ROTOR_DIR ${PWD} Path to root of SSCLI source tree. Set by using current directory.
ROTOR_X86 1 Not usually modified.
SDK_INC_PATH ${ROTOR_DIR}/pal Not usually modified. Path to required SSCLI platform include data in rotor_pal.h.
SVR_WKS_DIRS wks Not usually modified.
TARGET_DIRECTORY Depends on target processor type.

rotor_${PROCESSOR_ARCHITECTURE}

Not usually modified. Path to root of directory that will contain temporary build output.
TARGETCOMPLUS Depends on build type.

${ROTOR_DIR}/build/v1.x86*.rotor

Not usually modified. Path to root of directory that will contain SSCLI final build output.
TARGETCORBIN ${CORBASE}/bin Not usually modified. Path to clr/bin directory.
TARGETCORLIB ${CORBASE}/bin Not usually modified. Path to clr/bin directory.
TARGETPATH ${CORBASE}/bin Not usually modified. Path to clr/bin directory.
TH_CONFIG ${ROTOR_DIR}/tests/palsuite/palverify.dat Path to PAL test suite verify file.
TH_DIR ${ROTOR_DIR}/tests/palsuite Path to root of PAL test suite directories
TH_RESULTS ${ROTOR_DIR}/tests/palsuite/test_results.log Path to PAL test suite log file.
TH_XRUN ${ROTOR_DIR}/tests/harness/xrun/xrun Path to test suite xrun test harness.


Copyright (c) 2002 Microsoft Corporation. All rights reserved.