From: ibs Date: Mon, 22 Apr 2013 10:20:47 +0000 (+0400) Subject: 0023887: wgenproj -target=amk generate incorrect dependicies in *.am files for occt... X-Git-Tag: V6_7_1~46 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=698b1e250819b00707ca79f1ad00c6c4f7803b44;p=occt-wok.git 0023887: wgenproj -target=amk generate incorrect dependicies in *.am files for occt products if automake files generates for OCCT, toolkits will include to libTKDXF_la_LIBADD variable like ..//lib.so paths to father libs added; all father libs have prefix -l now 0023862: vcX project files, generated by WOK in Linux, contain unnecessary addition options in vcX and amk cases, wok switched to specified system condition: vcX - wnt, amk - lin; osutils:lrmdups method refactored; if vcX is generated in lin, error appears: %Nesting_DBMS_Station and %occt_DFLT_wnt are not "setted". p.s. in my case, vc files are equal for win and lin, BUT in lin version: Tkxbase project doesn’t contain files of “stepFile” group tkadvTools project doesn’t contain files of “ExprIntrp” group --- diff --git a/src/WOKTclLib/OS.tcl b/src/WOKTclLib/OS.tcl index 6596aee..b7d3c0a 100755 --- a/src/WOKTclLib/OS.tcl +++ b/src/WOKTclLib/OS.tcl @@ -1884,28 +1884,32 @@ proc OS:init {{os {}}} { global tcl_platform global OpenSource if [info exists OpenSource] { - unset OpenSource + unset OpenSource } + set askplat $os if { "$os" == "" } { - set os $tcl_platform(os) + set os $tcl_platform(os) } + if { [wokcd] == {} } { - puts stderr " Pas de definition pour [wokcd]. Adm du wb courant " - return {} + puts stderr " Pas de definition pour [wokcd]. Adm du wb courant " + return {} } + ;# ;# ou se trouve tout ce bordel. ;# set OpenSource(box) [OS:defbox] - + ;# On utilise gtar si possible. => ;# + set OpenSource(tar) tar if { $tcl_platform(os) == "SunOS"} { set OpenSource(tar) [file join $env(WOK_LIBRARY) sun gtar] } if { $tcl_platform(os) == "IRIX" } { set OpenSource(tar) [file join $env(WOK_LIBRARY) sil gtar] } set OpenSource(gtar) yes - + ;# ;# Load list of OCCT modules and their definitions ;# @@ -2149,10 +2153,10 @@ proc OS:procs { module plat} { proc OS:casroot {} { global env if { [info exists env(CASROOT)] } { - return $env(CASROOT) + return $env(CASROOT) } - return [lindex [wokinfo -R [lindex [w_info -A [wokcd]] end]] 0] + return [wokinfo -p HomeDir [lindex [w_info -A [wokcd]] end]] } ;# ;# @@ -3300,7 +3304,7 @@ proc OS:MKPRC { {theOutDir {}} {theProjectType {}} {theIDE ""} } { puts stderr "WOK does not support generation of project files for the selected IDE: $theIDE\nSupported IDEs: [join ${aSupportedIDE} " "]" return } - + set anOutRoot $theOutDir if { $anOutRoot == "" } { set anOutRoot [OS -box] @@ -3344,7 +3348,7 @@ proc OS:MKPRC { {theOutDir {}} {theProjectType {}} {theIDE ""} } { if { "$theIDE" == "cmake" } { set anOutDir "${anOutRoot}/${theIDE}" } - + OS:mkdir $anOutDir if { ! [file exists $anOutDir] } { puts stderr "Error: Could not create output directory \"$anOutDir\"" @@ -3944,6 +3948,7 @@ proc OS:defbox {} { # otherwise returns input value (assumed to be already a list of modules) proc OS:listmodules {what {platforms {}}} { OS:init + if { "$what" == "" } { if { "$platforms" != "" } { return [OS -lm -plat $platforms] diff --git a/src/WOKTclLib/osutils.tcl b/src/WOKTclLib/osutils.tcl index e716fc2..58c9a68 100755 --- a/src/WOKTclLib/osutils.tcl +++ b/src/WOKTclLib/osutils.tcl @@ -8,6 +8,39 @@ ;# Author: yolanda_forbes@hotmail.com ;# +# change station (and its environment) and return old station +proc changeStationAndDependentEnvironment { theNewStation } { + + # save old station + set anOldStation [wokparam -v %Station] + + if { "$anOldStation" == "$theNewStation" } { + return $anOldStation + } + + wokprofile -S $theNewStation + + # change station + wokparam -s %Station=$theNewStation + + # we should unset CSF_EDL variable due to it is necessary + # to update all CSF's variables after station change + wokparam -u %CSF_EDL + wokparam -u %CMPLRS_EDL + + # unseting is require + wokparam -u %CSF_[string toupper $theNewStation]_EDL + wokparam -u %CSF_[string toupper $anOldStation]_EDL + + # change env(WOKSTATION) + set ::env(WOKSTATION) $theNewStation + + # redefine csf variables + wokparam -l CMPLRS + + return $anOldStation +} + # intersect3 - perform the intersecting of two lists, returning a list containing three lists. # The first list is everything in the first list that wasn't in the second, # the second list contains the intersection of the two lists, the third list contains everything @@ -34,19 +67,7 @@ proc osutils:intersect3 {list1 list2} { # Sort a list, returning the sorted version minus any duplicates proc osutils:lrmdups list { - if { [llength $list] == 0 } { - return {} - } - set list [lsort $list] - set last [lvarpop list] - lappend result $last - foreach element $list { - if ![cequal $last $element] { - lappend result $element - set last $element - } - } - return $result + return [lsort -unique $list] } # Return the logical union of two lists, removing any duplicates @@ -880,7 +901,7 @@ proc osutils:vcproj { theVcVer theOutDir theToolKit theGuidsMap {theProjTmpl {} regsub -all -- {vc[0-9]+} $aUsedToolKits $theVcVer aUsedToolKits # and put this list to project file - puts "$theToolKit requires $aUsedToolKits" + #puts "$theToolKit requires $aUsedToolKits" if { "$theVcVer" == "vc10" || "$theVcVer" == "vc11" } { set aUsedToolKits [join $aUsedToolKits {;}] } regsub -all -- {__TKDEP__} $theProjTmpl $aUsedToolKits theProjTmpl @@ -893,7 +914,7 @@ proc osutils:vcproj { theVcVer theOutDir theToolKit theGuidsMap {theProjTmpl {} if [array exists written] { unset written } set fxloparamfcxx [lindex [osutils:intersect3 [split [lindex [wokparam -v %CMPLRS_CXX_Options [w_info -f]] 0]] [split [lindex [wokparam -v %CMPLRS_CXX_Options] 0]] ] 2] set fxloparamfc [lindex [osutils:intersect3 [split [lindex [wokparam -v %CMPLRS_C_Options [w_info -f]] 0]] [split [lindex [wokparam -v %CMPLRS_C_Options] 0]] ] 2] - set fxloparam "[osutils:union [split $fxloparamfcxx] [split $fxloparamfc]]" + set fxloparam "" foreach fxlo $resultloc { set xlo [wokinfo -n $fxlo] set aSrcFiles [osutils:tk:files $xlo osutils:compilable 0] diff --git a/src/WOKsite/wok_tclshrc.tcl b/src/WOKsite/wok_tclshrc.tcl index e36b5f7..2229c11 100644 --- a/src/WOKsite/wok_tclshrc.tcl +++ b/src/WOKsite/wok_tclshrc.tcl @@ -384,6 +384,17 @@ proc wgenproj { args } { puts "the \'$anTarget\' target has been applied" + source "$::env(WOKHOME)/lib/osutils.tcl" + source "$::env(WOKHOME)/lib/OS.tcl" + + # change station if it is necessary + set anOldStation "$::env(WOKSTATION)" + if { [lsearch -exact {vc7 vc8 vc9 vc10 vc11} $anTarget] != -1 && "$anOldStation" != "wnt"} { + changeStationAndDependentEnvironment wnt + } elseif { "$anTarget" == "amk" && "$anOldStation" != "lin"} { + changeStationAndDependentEnvironment lin + } + # create the inc directory. The directory should be created by wprocess function. wokcd -P Home file mkdir [file join [pwd] inc] @@ -395,8 +406,7 @@ proc wgenproj { args } { } else { puts "skip wprocess" } - source "$::env(WOKHOME)/lib/osutils.tcl" - source "$::env(WOKHOME)/lib/OS.tcl" + set aWokCD [wokcd] wadm [wokinfo -w] set anAdmPath [pwd] @@ -408,7 +418,11 @@ proc wgenproj { args } { if { [wokinfo -x VAS] } { OS:MKPRC "$anAdmPath" "VAS" "$anTarget" } + wgenprojbat "$anAdmPath" "$anTarget" + + # change back station if it is require + changeStationAndDependentEnvironment "$anOldStation" } # Function to prepare environment