📄 libupdte.tcl
字号:
# LIBUPDATE.TCL - Setup procedures for updating vxWorks libraries # wizard page## Copyright 1999-2003 Wind River Systems, Inc## modification history# --------------------# 02g,25feb03,bjl strip cpu variant before calling make (spr 86344).# 02f,23may02,bjl fixed archiving for objects into a T2.0.x tree (spr 76643)# 02e,05feb02,bwd Do not use gnu as a default tool for coldfire# 02d,18jan02,bwd Modified path to makefiles for archiving# 02c,03dec01,bwd Moved dbgputs for newArchive variable# 02b,19nov01,bwd Modified for new format of archives# 02a,12jun01,j_w Modified for Tornado 2.2# 01h,12mar01,j_w Prevent the archiving of non-native simulator libraries --# including SIMLINUX# 01g,10Jan01,j_w Avoid adding duplicate objects onto the objs(arPassId) list# 01f,19dec00,wmd Prevent archiving of libs that don't have a make.<CPU>gnu# file in the ../target/h/make directory.# 01e,21nov00,wmd Prevent the archiving of non-native simulator libraries.# 01d,10nov00,j_w backup the library only if it exists# 01c,08nov00,j_w Archive the objects into the library if obj<cpu>gnuvx# directory exists. Updated arFlag to use -crus# 01b,31oct00,bwd SPR 35597: Remove HELP button# 01a,18sep00,j_w modified from LIBEXTRACT.TCL. (from version tor3_x/8).# Updated makefileCreate{} to include TGT_DIR################################################################################ pageCreate(libUpdate) - Update the library archive objects and displays# progess in updating libraries## This procedure will update the library archive objects and displays progess# in updating libraries## SYNOPSIS# .tS# pageCreate(libUpdate)# .tE## PARAMETERS: N/A## RETURNS: N/A## ERRORS: N/A#proc pageCreate(libUpdate) {} { global ctrlVals global setupVals global newArchive if { [isGUImode] } { set ctrlVals(numBbrd) 0 meterCreate [strTableGet LIBUPDATE_LABEL] set w [dlgFrmCreate [strTableGet LIBUPDATE_TITLE]] controlPropertySet $ctrlVals(meterWindow).$ctrlVals(meterWg) \ -background Blue -foreground Black controlEnable $w.backButt 0 controlEnable $w.nextButt 0 controlHide $w.helpButt 1 } else { printPageTitle [strTableGet LIBUPDATE_TITLE] puts [strTableGet LIBUPDATE_LABEL_TEXT] } # Handle 2 different formats of archive # Variable is set in FILECOPY once found out the archive format if { [info exist newArchive] == 1 && $newArchive == 1 } { set newArchive 0 newLibrariesUpdate } else { librariesUpdate } if { [isGUImode] } { meterDestroy $ctrlVals(meterWindow) controlEnable $w.backButt 1 controlEnable $w.nextButt 1 # test automation if { $ctrlVals(useInputScript) } { autoSetupLog "Library Update page:" autoSetupLog "\tUpdated library objects" } nextCallback } else { nextCallback return 0 }}############################################################################### pageProcess(libUpdate) - process inputs from libUpdate page if necessary## This procedure will process inputs from libUpdate page if necessary## SYNOPSIS# .tS# pageProcess(libUpdate)# .tE## PARAMETERS: N/A## RETURNS: 1 when successful## ERRORS: N/A#proc pageProcess(libUpdate) {} { return 1}################################################################################ librariesUpdate - updating the vxWorks libraries.## This routine walks thru each product, updates the vxWorks libraries w/ the# object list which was obtained and saved by the archListPut() function. The# default updating flag is -crus. A particular product can override this# default setting by provide a postInstall.tcl file that contains a call to# the arFlagsSet() function. To speed up the archiving process, a minimum# amount of AR invocations is made. This is achieved by grouping the object# list into smaller lists of distinct flags and libraries, then archiving# each list of objects via an AR invocation.### SYNOPSIS# librariesUpdate## PARAMETERS: N/A## RETURNS: N/A## ERRORS: N/A#proc librariesUpdate {} { global setupVals global setup_objects dbgputs "\nlibrariesUpdate...\n" set setupVals(cancel) 0 # Determine the total number of new object files for GUI updating purpose. set totalObjFile 0 foreach objDir [array names setup_objects] { incr totalObjFile [llength $setup_objects($objDir)] } set percent 0 # Updating the libraries. if {$totalObjFile != "0"} { meterUpdate $percent "" foreach prodIndex [cdInfoGet selectedProdIndexList] { searchAndProcessSection ArFlags [chooseInfFile $prodIndex] \ $prodIndex set prodARFlag [arFlagsGet $prodIndex] foreach archKey [array names setup_objects] { # typex is useful when updating special component. # ex: windview,... if {[regexp {^(.*),(.*),(.*),(.*),(.*),(.*)$} $archKey \ junk index obj cpu tool type typex] && \ "$prodIndex" == "$index"} { # An arPassId is characterized by the following variables: # "$prodARFlag,$cpu,$tool,$type,$typex,". It corresponds # to one AR call. For example, # prodARFlag, cpu, tool, type, typex, # -cru, R4650, gnu, vx, wv, set arPassId $prodARFlag,$cpu,$tool,$type,$typex, # Any objects that have these properties are "AR"ed # together. typex is optional. #initialize objs and objsArchived if necessary if ![info exists objs($arPassId)] { set objs($arPassId) "" } if ![info exists objsArchived($arPassId) ] { set objsArchived($arPassId) 0 } # now group objects by arPassId and update the # number of objects archived for each arPassId foreach objFile $setup_objects($archKey) { # avoid duplicate objects being added onto the # object list if {[lsearch $objs($arPassId) $objFile] == "-1"} { set objs($arPassId) "$objFile $objs($arPassId)" incr objsArchived($arPassId) } else { #dbgputs "duplicate objects($cpu): $objFile" incr objsArchived($arPassId) } } } } } set numArchivedSoFar 0 foreach arPassId [array name objsArchived] { if {"$setupVals(cancel)" == "1"} { return } # extract elements from arPassId if {[regexp {^(.*),(.*),(.*),(.*),(.*),(.*)$} $arPassId \ junk prodARFlag cpu tool type typex] } { set archiveFile [file join [destDirGet] target lib \ lib$cpu$tool$type.a] meterUpdate $percent "Updating lib$cpu$tool${type}.a" switch -exact $cpu { SIMNT { #puts "cpu = $cpu" #puts "hosttype = [windHostTypeGet]" if {[windHostTypeGet] == "sun4-solaris2"} { continue } if {[windHostTypeGet] == "x86-linux2"} { continue } } SIMSPARCSOLARIS { #puts "cpu = $cpu" #puts "hosttype = [windHostTypeGet]" if {[windHostTypeGet] == "x86-win32"} { continue } if {[windHostTypeGet] == "x86-linux2"} { continue } } SIMLINUX { if {[windHostTypeGet] == "x86-win32"} { continue } if {[windHostTypeGet] == "sun4-solaris2"} { continue } } } # skip library update if the make.<cpu><tool> file is not present # to prevent SETUP from shipping archives of uninstalled arch set dirTool "" if { [regexp {.*(gnu).*} $tool] } { set dirTool "gnu" } elseif { [regexp {.*(diab).*} $tool] } { set dirTool "diab" } set mFile [file join \ [destDirGet] target h tool $dirTool make.$cpu$tool] if {[file exists $mFile] == 0} { # Check if makefile exists in target/h/make. # This is for the case of installing an optional product # into a Tornado 2.0.x tree. set mFile [file join \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -