📄 libupdte.tcl
字号:
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 family cpu tool type] } { set archiveFile [file join [destDirGet] target lib \ $family $cpu $tool lib$type.a] meterUpdate $percent "Updating $archiveFile" 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 # And skip this checking if tool (the directory name) is "common" if { ![regexp {.*common.*} $tool] } { 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} { continue } } # don't backup library if this is the first installation # Backup only if the .a exists if {[file extension $setupVals(uninstFile)] != ".001"} { set aFile [file join [destDirGet] target lib \ $family $cpu $tool lib$type.a] if {[file exists $aFile]} { backup target/lib/$family/$cpu/$tool/lib$type.a # immediately flush the queue; otherwise we may not # be backing up the old archive backupFileQueueFlush } } cd [file join [destDirGet] target lib $family \ $cpu $tool obj$type] set numArchivedSoFar \ [expr $numArchivedSoFar + $objsArchived($arPassId)] set percent [expr $numArchivedSoFar * 100 / $totalObjFile] # call to create makefile and archive newLibUpdateHelper $family $cpu $tool $type ar \ $prodARFlag $objs($arPassId) # Ranlib to update the lib table of content. newLibUpdateHelper $family $cpu $tool $type ranlib meterUpdate $percent "Updating ../target/lib/$family/$cpu/$tool/lib$type.a" dbgputs " AR pass Id: $arPassId" dbgputs " Library: \ target/lib/$family/$cpu/$tool/lib$type.a" dbgputs " Object directory: [pwd]" dbgputs " ARFLAGS: $prodARFlag" dbgputs "Number of objects in this AR pass: \ $objsArchived($arPassId)" dbgputs "Number of objects archived so far: \ $numArchivedSoFar" dbgputs " Percent archived so far: \ $percent% of $totalObjFile objects" dbgputs "------------------------------------------------" # log it for uninstall set f [file join target lib $family $cpu $tool lib$type.a] uninstLog file "wind_base\t$f" dbgputs "uninstLog file $f" } else { puts "newLibrariesUpdate: cannot get arPassId" } } meterUpdate 100 "" }}################################################################################ newLibUpdateHelper - invokes make to carry out the requested action.## a -n option is used to obtain a list of commands that 'make' supposes to# carry out. Each command is then evaluated separately. Asking make to carry# out the real action will cause many console windows to pop up.## SYNOPSIS# newLibUpdateHelper <family> <cpu> <tool> <type> <action> [arFlags] [objs]## PARAMETERS:# <family>: Architecture, i.e. ppc, mips# <cpu> : CPU family, i.e. ppc604, MIPS32# <tool>: compiler family, i.e 'gnu', 'sfgnule'# <type>: library type, ex: type is 'cplus' for the "objcplus" directory# <action>: build target, i.e. 'ar' or 'ranlib'# <DIR_TOOL>: name of tool directory, i.e. 'gnu' or 'diab'# [arFlags] : the default value is -crus# [objs] : object file list separated by space, needed when <action> is ar## RETURNS: N/A## ERRORS: N/A#proc newLibUpdateHelper {family cpu tool type action {arFlags "-crus"} {objs ""}} { global setupVals set binDir [file join [destDirGet] host [windHostTypeGet] bin] regsub -all {\\} $binDir {/} binDir # for *common* directory, use gnu tool for archiving (except for coldfire) # for coldfire, use "diab" as a default tool # for others (ex: gnu, diab, gnule..), use that tool if { [string match $family "cf"] } { regsub {(.*)common(.*)} $tool {\1diab\2} tool } else { regsub {(.*)common(.*)} $tool {\1gnu\2} tool } set dirTool "" if { [regexp {.*(gnu).*} $tool] } { set dirTool "gnu" } elseif { [regexp {.*(diab).*} $tool] } { set dirTool "diab" } # If a cpu variant is part of the "tool" string, strip # it out before doing the make so that the proper makefile # is used. For example, "_vr54xx" is stripped from # "sfgnule_vr54xx". if { [regexp $setupVals(toolset) $tool basetool] } { set tool $basetool } if {![catch {exec $binDir/make -n -f [newMakefileCreate] CPU=$cpu \ TOOL=$tool TYPE=$type \ OBJS=$objs DIR_TOOL=$dirTool \ ARFLAGS=$arFlags $action} retVal]} { regsub -all {\\} $retVal {/} retVal # location of diab archiver (but not for ranlib) if { $action != "ranlib" } { if { [string match $dirTool "diab"] } { set binDir "" if { [isUnix] } { set binDir [file join [destDirGet] host diab SUNS bin] } else { set binDir [file join [destDirGet] host diab WIN32 bin] } regsub -all {\\} $binDir {/} binDir } } if {[catch {eval "exec $binDir/$retVal"} error1]} { if {[catch {eval "exec $retVal"} error2]} { puts "$error1\n$error2" uninstLog setup "\t$error1" uninstLog setup "\t$error2" } else { dbgputs "\n$retVal" } } else { dbgputs "\n$binDir/$retVal" } } else { puts "new_libUpdate: $retVal" uninstLog setup "\t$retVal" }}################################################################################ newMakefileCreate - create a makefile for use with the archiver and# vxWorks libraries.## SYNOPSIS# newMakefileCreate## PARAMETERS: N/A## RETURNS: N/A## ERRORS: N/A#proc newMakefileCreate {} { if {[windHostTypeGet] == "x86-win32"} { set mFile "[tempDirGet]\\Makefile" } else { set mFile "[tempDirGet]/Makefile" } if ![file exists $mFile] { set f [open $mFile "w"] if {"[windHostTypeGet]" == "x86-win32"} { puts $f "TGT_DIR = [destDirGet]\\target" puts $f "include [destDirGet]\\target\\h\\tool\\$(DIR_TOOL)\\make.$(CPU)$(TOOL)" puts $f "ARFLAGS = -crus" puts $f "ar:" puts $f "\t- $(AR) $(ARFLAGS) ..\\lib$(TYPE).a $(OBJS)" puts $f "ranlib:" puts $f "\t- $(RANLIB) ..\\lib$(TYPE).a" } else { puts $f "TGT_DIR = [destDirGet]/target" puts $f "include [destDirGet]/target/h/tool/$(DIR_TOOL)/make.$(CPU)$(TOOL)" puts $f "ARFLAGS = -crus" puts $f "ar:" puts $f "\t- $(AR) $(ARFLAGS) ../lib$(TYPE).a $(OBJS)" puts $f "ranlib:" puts $f "\t- $(RANLIB) ../lib$(TYPE).a" } close $f } return $mFile}####################################################################### Dialog Text Messages######################################################################set strTable(LIBUPDATE_TITLE) "Libraries Update"set strTable(LIBUPDATE_LABEL) \ "SETUP is updating the VxWorks libraries. We recommend that you let\ SETUP finish this step, or the libraries will be in an inconsistent\ state. Please be patient as the process may take several minutes. \ If you want to quit the SETUP program, click <Cancel> and run\ the SETUP program again at a later time."set strTable(LIBUPDATE_LABEL_TEXT) \ "SETUP is updating the VxWorks libraries. We recommend that you let\ SETUP finish this step, or the libraries will be in an inconsistent\ state. Please be patient as the process may take several minutes."
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -