📄 sysconfg.tcl
字号:
LD_LIBRARY_PATH {
if { [isUnix] } {
set pathToAdd [list [file join [destDirGet] host [windHostTypeGet] lib] \
[file join usr dt lib] [file join usr openwin lib] ]
} else {
set pathToAdd [list [file join [destDirGet] host [windHostTypeGet] lib]]
}
}
TCL_LIBRARY {
set pathToAdd [file join [destDirGet] host [windHostTypeGet] lib]
}
}
if { [info exists env($envVar)] } {
if { [isUnix] } {
set libSeparator ":"
} else {
set libSeparator ";"
}
# check if we need to add new paths to the existing environment
foreach newPath $pathToAdd {
if {[string first $newPath $env($envVar)] == -1} {
# if path does not seem to appear in the already
# existing environment path, add it
set env($envVar) [format "%s%s%s" $newPath $libSeparator \
$env($envVar)]
}
}
} else {
# set the TCL_LIBRARY to be able to retrieve packages
set env($envVar) $pathToAdd
}
dbgputs "$env($envVar)\n"
}
# re-generate toolchain info file...
set oldMakeDir [file join [destDirGet] target h make]
set srcDir [file join [destDirGet] target h tool]
set infoGenFile [file join [destDirGet] host resource tcl app-config Project gnuInfoGen.tcl]
if [isUnix] {
set wtxtclFile [file join [destDirGet] host [windHostTypeGet] bin wtxtcl.ex]
} else {
set wtxtclFile [file join [destDirGet] host [windHostTypeGet] bin wtxtcl.exe]
}
set isSuccess 0
set fileList ""
if [isUnix] {
if { ![catch { exec ls $toolDir } fileList] } {
set isSuccess 1
}
} else {
regsub -all {\\} $toolDir {/} toolDir
if { ![catch { exec cmd /c dir /w $toolDir } fileList] } {
set isSuccess 1
}
}
if { $isSuccess == 1 } {
# check target/h/tool/$tool directory
foreach tool {gnu diab} {
if { $fileList != "" } {
catch {exec $wtxtclFile $infoGenFile $tool} err
dbgputs "Exec from target/h/tool/$tool:\n$err"
}
}
# check target/h/make directory
if { $fileList != "" } {
catch {exec $wtxtclFile $infoGenFile gnu} err
dbgputs "Exec from target/h/make:\n$err"
}
}
}
##############################################################################
#
# oldMakefileCreate - creates make files in target/h/make directory
#
# This procedure creates make files in target/h/make directory to provide
# backward compatibility when user installs T2.0.x 3rd party products
# such as Codetest (or installing any product with SETUP old-format
# library archiving.
#
# This procedure creates make files under target/h/make with the same names
# as makefiles in target/h/tool/(TOOL)/make.* where (TOOL) is gnu or diab.
# This "intermediate" makefiles created here simply points SETUP to the
# location of the actual makefiles under target/h/tool/(TOOL)
#
# SYNOPSIS
# oldMakefileCreate
#
# PARAMETERS: fName - name of make file to be created
#
# RETURNS: N/A
#
# ERRORS: N/A
#
proc oldMakefileCreate {fName} {
if { ![catch {open $fName "w"} f] } {
puts $f "#"
puts $f "# This make fragments is used by SETUP to ensure backward compatibility for our"
puts $f "# pre-veloce partner products. This file MUST NOT be used for anything else."
puts $f "#\n"
puts $f "# SETUP install directory"
puts $f "SETUP_INSTALL_DIR = [destDirGet]\n"
puts $f "# if WIND_BASE not set, set it"
puts $f "# if WIND_BASE is set but wrong one, reset it"
puts $f "ifeq ($(WIND_BASE),)"
puts $f "WIND_BASE = $(SETUP_INSTALL_DIR)"
puts $f "endif\n"
puts $f "ifeq ($(TOOL_FAMILY),)"
puts $f "ifeq ($(findstring gnu,$(TOOL)),gnu)"
puts $f "TOOL_FAMILY = gnu"
puts $f "else"
puts $f "ifeq ($(findstring diab,$(TOOL)),diab)"
puts $f "TOOL_FAMILY = diab"
puts $f "endif"
puts $f "endif"
puts $f "endif\n"
puts $f "ifeq ($(TGT_DIR),)"
puts $f "TGT_DIR = $(WIND_BASE)/target"
puts $f "endif\n"
puts $f "include $(TGT_DIR)/h/tool/$(TOOL_FAMILY)/make.$(CPU)$(TOOL)"
close $f
} else {
puts "ERROR in creating old makefile: $f"
}
}
##############################################################################
#
# torVarsCreate - creates a Tornado environment variables startup file.
#
# SYNOPSIS
# torVarsCreate
#
# PARAMETERS: N/A
#
# RETURNS: N/A
#
# ERRORS: N/A
#
proc torVarsCreate {} {
global setupVals
set binDir [destDirGet]/host/[windHostTypeGet]/bin
if {"[windHostTypeGet]" == "x86-win32" && [file isdirectory $binDir]} {
if {![file exists $binDir/torVars.bat]} {
uninstLog file "wind_base\thost/[windHostTypeGet]/bin/torVars.bat"
}
if {![catch {open $binDir/torVars.bat "w"} f]} {
puts $f "rem Command line build environments"
puts $f "set WIND_HOST_TYPE=[windHostTypeGet]"
puts $f "set WIND_BASE=[destDirGet]"
if [info exists setupVals(regHost)] {
puts $f "set WIND_REGISTRY=$setupVals(regHost)"
}
puts $f "set PATH=%WIND_BASE%\\host\\%WIND_HOST_TYPE%\\bin;%PATH%"
close $f
}
} elseif {[file isdirectory $binDir]} {
if {![file exists $binDir/torVars.csh]} {
uninstLog file "wind_base\thost/[windHostTypeGet]/bin/torVars.csh"
}
if {![catch {open $binDir/torVars.csh "w"} f]} {
puts $f "# Command line build environments"
puts $f "setenv WIND_HOST_TYPE [windHostTypeGet]"
puts $f "setenv WIND_BASE [destDirGet]"
if {[info exists setupVals(registry)]} {
puts $f "setenv WIND_REGISTRY $setupVals(registry)"
}
puts $f {setenv PATH $WIND_BASE/host/$WIND_HOST_TYPE/bin:$PATH}
#if {"[windHostTypeGet]" == "sun4-solaris2"} {
# puts $f {setenv PATH $WIND_BASE/SETUP/SUN4/SOLARIS2:$PATH} } else {
# puts $f {setenv PATH $WIND_BASE/SETUP/X86/LINUX2:$PATH}
#}
puts $f "if \(! \$\?USER) then"
puts $f " setenv USER \$LOGNAME"
puts $f "endif"
if { [windHostTypeGet] == "sun4-solaris2" ||
[windHostTypeGet] == "x86-linux2" } {
puts $f "if \(\$\?LD_LIBRARY_PATH) then"
puts $f " setenv LD_LIBRARY_PATH \${LD_LIBRARY_PATH}:\$WIND_BASE/host/\$WIND_HOST_TYPE/lib:/usr/dt/lib:/usr/openwin/lib"
puts $f "else"
puts $f " setenv LD_LIBRARY_PATH \$WIND_BASE/host/\$WIND_HOST_TYPE/lib:/usr/dt/lib:/usr/openwin/lib"
puts $f "endif"
} elseif {[windHostTypeGet]=="parisc-hpux10"} {
puts $f "if \(\$\?SHLIB_PATH) then"
puts $f " setenv SHLIB_PATH \${SHLIB_PATH}:\$WIND_BASE/host/\$WIND_HOST_TYPE/lib"
puts $f "else"
puts $f " setenv SHLIB_PATH \$WIND_BASE/host/\$WIND_HOST_TYPE/lib"
puts $f "endif"
}
close $f
}
if {![file exists $binDir/torVars.sh]} {
uninstLog file "wind_base\thost/[windHostTypeGet]/bin/torVars.sh"
}
if {![catch {open $binDir/torVars.sh "w"} f]} {
puts $f "# Command line build environments"
puts $f "WIND_HOST_TYPE=[windHostTypeGet]"
puts $f "export WIND_HOST_TYPE"
puts $f "WIND_BASE=[destDirGet]"
puts $f "export WIND_BASE"
if {[info exists setupVals(registry)]} {
puts $f "WIND_REGISTRY=$setupVals(registry)"
puts $f "export WIND_REGISTRY"
}
puts $f {PATH=$WIND_BASE/host/$WIND_HOST_TYPE/bin:$PATH}
#if {"[windHostTypeGet]" == "sun4-solaris2"} {
# puts $f {PATH=$WIND_BASE/SETUP/SUN4/SOLARIS2:$PATH}
#} else {
# puts $f {PATH=$WIND_BASE/SETUP/X86/LINUX2:$PATH}
#}
puts $f "export PATH"
puts $f "if \[ \"\$USER\" = \"\" \] ; then"
puts $f " USER=\$LOGNAME"
puts $f "fi"
puts $f "export USER"
if { [windHostTypeGet] == "sun4-solaris2" ||
[windHostTypeGet] == "x86-linux2" } {
puts $f "if \[ \"\$LD_LIBRARY_PATH\" = \"\" \] ; then"
puts $f " LD_LIBRARY_PATH=\$WIND_BASE/host/\$WIND_HOST_TYPE/lib:/usr/dt/lib:/usr/openwin/lib"
puts $f "else"
puts $f " LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$WIND_BASE/host/\$WIND_HOST_TYPE/lib:/usr/dt/lib:/usr/openwin/lib"
puts $f "fi"
puts $f "export LD_LIBRARY_PATH"
} elseif {[windHostTypeGet]=="parisc-hpux10"} {
puts $f "if \[ \"\$SHLIB_PATH\" = \"\" \] ; then"
puts $f " SHLIB_PATH=\$WIND_BASE/host/\$WIND_HOST_TYPE/lib"
puts $f "else"
puts $f " SHLIB_PATH=\$SHLIB_PATH:\$WIND_BASE/host/\$WIND_HOST_TYPE/lib"
puts $f "fi"
puts $f "export SHLIB_PATH"
}
close $f
}
}
# append diab environment
if {[file exists [destDirGet]/host/diab]} {
torVarsCreateDiab
}
}
proc torVarsCreateDiab {} {
################################
# Lines to add to torVars.sh
################################
set shLines {
# Diab Toolchain additions
case $WIND_HOST_TYPE in
sun4-solaris2)
DIAB_HOST_TYPE="SUNS" ;;
parisc-hpux10)
DIAB_HOST_TYPE="HPUX" ;;
*)
DIAB_HOST_TYPE="NONE" ;;
esac
if [ "$DIAB_HOST_TYPE" != "NONE" ] ; then
DIABLIB=$WIND_BASE/host/diab
export DIABLIB
PATH=$DIABLIB/$DIAB_HOST_TYPE/bin:$PATH
export PATH
else
echo "Unknown WIND_HOST_TYPE. Diab Toolchain is not in PATH."
fi
}
################################
# Lines to add to torVars.csh
################################
set cshLines {
# Diab Toolchain additions
switch ($WIND_HOST_TYPE)
case sun4-solaris2:
set DIAB_HOST_TYPE = SUNS
breaksw
case parisc-hpux10:
set DIAB_HOST_TYPE = HPUX
breaksw
default:
set DIAB_HOST_TYPE = NONE
breaksw
endsw
if ($DIAB_HOST_TYPE != "NONE") then
setenv DIABLIB $WIND_BASE/host/diab
setenv PATH $DIABLIB/$DIAB_HOST_TYPE/bin:$PATH
else
echo "Unknown WIND_HOST_TYPE. Diab Toolchain is not in PATH."
endif
}
################################
# Lines to add to torVars.bat
################################
set batLines {
rem Diab Toolchain additions
set DIABLIB=%WIND_BASE%\host\diab
set PATH=%DIABLIB%\WIN32\bin;%PATH%
}
# Update any torVars scripts found
set bin [destDirGet]/host/[windHostTypeGet]/bin
foreach script {torVars.sh torVars.csh torVars.bat} {
if { [file exists $bin/$script] && [file writable $bin/$script] } {
switch $script {
torVars.sh { set lines $shLines }
torVars.csh { set lines $cshLines }
torVars.bat { set lines $batLines }
default { error "bad script name" }
}
set out [open $bin/$script a]
puts -nonewline $out $lines
close $out
}
}
}
######################################################################
# Dialog Text Messages
######################################################################
set strTable(TOR_REG_WARN) \
"Setup has detected a previously installed Tornado Registry Service. \
Setup will now remove it and install a newer version of the \
Tornado Registry."
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -