From 962c616c963e91429e36c6543ad21718c94991cc Mon Sep 17 00:00:00 2001 From: cas Date: Fri, 27 Sep 2002 18:04:23 +0000 Subject: [PATCH] advanced Jini compiler edl, tcl --- src/WOKStep/FILES | 2 + src/WOKStep/WOKStep_JavaCompile.tcl | 92 ++++++++++++++++++----------- src/WOKStep/WOKStep_JavaHeader.tcl | 12 ++-- 3 files changed, 64 insertions(+), 42 deletions(-) diff --git a/src/WOKStep/FILES b/src/WOKStep/FILES index 65bf21c..1a9977c 100755 --- a/src/WOKStep/FILES +++ b/src/WOKStep/FILES @@ -3,3 +3,5 @@ WOKStep_frontal.tcl WOKStep_TclLibIdep.tcl WOKStep_JavaCompile.tcl WOKStep_JavaHeader.tcl +WOKStep_LibRename.tcl + diff --git a/src/WOKStep/WOKStep_JavaCompile.tcl b/src/WOKStep/WOKStep_JavaCompile.tcl index 4e62034..92dc658 100755 --- a/src/WOKStep/WOKStep_JavaCompile.tcl +++ b/src/WOKStep/WOKStep_JavaCompile.tcl @@ -42,12 +42,15 @@ proc WOKStep_JavaCompile:ComputeIncludeDir { unit } { set result "" set themax [llength $allwb] + for { set i $themax } { [expr $i != 0] } { incr i -1 } { + set awb [lindex $allwb [expr $i - 1]] + if { $fJava } { - set addinc [wokparam -e WOKEntity_javadir ${awb}] + set addinc [UNC [wokparam -e WOKEntity_javadir ${awb}]] } else { - set addinc [wokparam -e WOKEntity_drvdir ${awb}] + set addinc [UNC [wokparam -e WOKEntity_drvdir ${awb}]] } set result ${addinc}$ps$result @@ -56,7 +59,7 @@ proc WOKStep_JavaCompile:ComputeIncludeDir { unit } { set result $env(WOKHOME)$ps$result - return $result + return /usr/java/jre/lib/rt.jar$ps$result } @@ -65,7 +68,7 @@ proc WOKStep_JavaCompile:Execute { theunit args } { global env global tcl_platform - msgprint -i -c "WOKStep_JavaCompile:Execute" "Processing JavaCompile unit : $theunit" + msgprint -i -c "WOKStep_JavaCompile:Execute" "Processing unit : $theunit" msgprint -i -c "WOKStep_JavaCompile:Execute" set fJava [info exists env(WOK_USE_JAVA_DIRECTORY)] @@ -74,47 +77,64 @@ proc WOKStep_JavaCompile:Execute { theunit args } { set failed 0 set incdir [WOKStep_JavaCompile:ComputeIncludeDir $theunit] wokparam -s%IncludeDir=$incdir + if { $fJava } { - set outdir [wokUtils:EASY:stobs2 [wokparam -e WOKEntity_javadir [wokinfo -w]]] + set outdir [UNC [wokparam -e WOKEntity_javadir [wokinfo -w]]] } else { - set outdir [wokUtils:EASY:stobs2 [wokparam -e WOKEntity_drvdir [wokinfo -w]]] + set outdir [UNC [wokparam -e WOKEntity_drvdir [wokinfo -w]]] } wokparam -s%OutDir=$outdir - foreach ID $args { - - scan $ID "%\[^:\]:%\[^:\]:%\[^:\]" unit type name - set infile [wokUtils:EASY:stobs2 [woklocate -p $ID]] - - if { $tcl_platform(platform) == "windows" } { - regsub -all "/" $infile "\\\\\\" infile - } - wokparam -s%Source=$infile - set thecommand [wokparam -e JAVA_Compiler] - set outfileid [file rootname $name] - set outfileid ${outfileid}.class - - msgprint -i -c "WOKStep_JavaCompile:Execute" "Compiling $name" - if { [catch {eval exec [lindex $thecommand 0]} res] } { - msgprint -e -c "WOKStep_JavaCompile:Execute" $res - set failed 1 - - } else { - - if { $fJava } { - stepoutputadd $unitname:javafile:$outfileid - stepaddexecdepitem $ID $unitname:javafile:$outfileid - } else { - stepoutputadd $unitname:derivated:$outfileid - stepaddexecdepitem $ID $unitname:derivated:$outfileid - } - - } + set sources {} + foreach ID $args { + + scan $ID "%\[^:\]:%\[^:\]:%\[^:\]" unit type name + set infile [UNC [woklocate -p $ID]] + + if { $tcl_platform(platform) == "windows" } { + regsub -all "/" $infile "\\\\\\" infile + } + lappend sources $infile + +# wokparam -s%Source=$infile + + ##set outfileid [file rootname $name] + ##set outfileid ${outfileid}.class + +# msgprint -i -c "WOKStep_JavaCompile:Execute" "Compiling $name" +# msgprint -i -c "WOKStep_JavaCompile:Execute" [lindex $thecommand 0] + +# if { [catch {eval exec [lindex $thecommand 0]} res] } { + +# msgprint -e -c "WOKStep_JavaCompile:Execute" $res +# set failed 1 + +# } else { + +# if { $fJava } { +# ##stepoutputadd $unitname:javafile:$outfileid +# ##stepaddexecdepitem $ID $unitname:javafile:$outfileid +# } else { +# ##stepoutputadd $unitname:derivated:$outfileid +# ##stepaddexecdepitem $ID $unitname:derivated:$outfileid +# } + + #} + } - + + wokparam -s%Source=$sources + set thecommand [wokparam -e JAVA_Compiler] + msgprint -i -c "WOKStep_JavaCompile:Execute" [lindex $thecommand 0] + if { [catch {eval exec [lindex $thecommand 0]} res] } { + + msgprint -e -c "WOKStep_JavaCompile:Execute" $res + set failed 1 + } + return $failed } diff --git a/src/WOKStep/WOKStep_JavaHeader.tcl b/src/WOKStep/WOKStep_JavaHeader.tcl index 8f736a2..2cac194 100755 --- a/src/WOKStep/WOKStep_JavaHeader.tcl +++ b/src/WOKStep/WOKStep_JavaHeader.tcl @@ -47,9 +47,9 @@ proc WOKStep_JavaHeader:ComputeIncludeDir { unit } { set awb [lindex $allwb [expr $i - 1]] if { $fJava != 0 } { - set addinc [wokparam -e WOKEntity_javadir ${awb}] + set addinc [UNC [wokparam -e WOKEntity_javadir ${awb}]] } else { - set addinc [wokparam -e WOKEntity_drvdir ${awb}] + set addinc [UNC [wokparam -e WOKEntity_drvdir ${awb}]] } set result ${addinc}$ps$result @@ -64,7 +64,7 @@ proc WOKStep_JavaHeader:Execute { theunit args } { global tcl_platform - msgprint -i -c "WOKStep_JavaHeader:Execute" "Processing JavaHeader unit : $theunit" + msgprint -i -c "WOKStep_JavaHeader:Execute" "Processing unit : $theunit" msgprint -i -c "WOKStep_JavaHeader:Execute" set unitname [wokinfo -n $theunit] @@ -72,11 +72,10 @@ proc WOKStep_JavaHeader:Execute { theunit args } { set incdir [WOKStep_JavaHeader:ComputeIncludeDir $theunit] wokparam -s%IncludeDir=$incdir - foreach ID $args { scan $ID "%\[^:\]:%\[^:\]:%\[^:\]" unit type name - set infile [wokUtils:EASY:stobs2 [woklocate -p $ID]] + set infile [UNC [woklocate -p $ID]] if { $tcl_platform(platform) == "windows" } { regsub -all "/" $infile "\\\\\\" infile @@ -89,10 +88,11 @@ proc WOKStep_JavaHeader:Execute { theunit args } { regsub -all "\\." $nameid "_" nameid set outfileid ${nameid}_${outfileid}.h - set outfile [wokinfo -p pubinclude:$outfileid $theunit] + set outfile [UNC [wokinfo -p pubinclude:$outfileid $theunit]] wokparam -s%OutFile=$outfile set thecommand [wokparam -e JAVA_Header] + msgprint -i -c "WOKStep_JavaCompile:Execute" "Building header $outfileid" if { [catch {eval exec [lindex $thecommand 0]} res] } { -- 2.39.5