From 0ba4197bfec6a5cc74018f616493a7b6d57ebc21 Mon Sep 17 00:00:00 2001 From: cas Date: Thu, 19 Jul 2001 13:13:37 +0000 Subject: [PATCH] No comments --- src/WOKsite/INSTALL | 120 ++++++++--------------- src/WOKsite/tclshrc_Wok | 211 +++++++++++++++++++++------------------- 2 files changed, 151 insertions(+), 180 deletions(-) diff --git a/src/WOKsite/INSTALL b/src/WOKsite/INSTALL index e47954a..0c491cc 100755 --- a/src/WOKsite/INSTALL +++ b/src/WOKsite/INSTALL @@ -1,106 +1,62 @@ - Section A) of this paper is the Unix guidelines for installing - WOK on SunOS, Linux, HP-UX and IRIX systems. - - - - PRE-REQUISITES: --------------- - On SunOS and IRIX WOK requires at least Tcl 7.5, Tclx 7.5.1 and Tk 4.1. - On Linux you can use Tcl 8.0 or later. - We suppose that on SunOS and IRIX, tcltk is installed in /usr/tcltk, and in /usr on Linux - If it is not the case, modify the TCLHOME variable in the file /home/me/wok-C40/site/wokcfg. - (We suppose you have downloaded this tarball in /home/me) + This version of Wok requires at least Tcl 8.0. + (In the following we assume you have downloaded this tarball in /home/me) + + + The section A) and B) explain how to install Wok and getting started. + The section C) explains how you can use this version of Wok to access + previous version of OpenCascade. -A) INSTALLATION on Unix like systems. -------------------------------------- +A) First installation Unix/Linux systems. +----------------------------------------- This section assumes that you have never installed WOK on your system. Performing the four following steps will install WOK and create a minimal environment for working. - 1. From the current directory where this README is located, move to the sub-directory + 1. From the current directory where you have downloaded , move to the sub-directory site. - % cd /home/me/wok-C40/site - - 2. Configure WOK so that its administration files will be located in - . You do this by typing: - - % ./wokcfg configure /home/me/wokentities ~/wok - - This will create the directory /home/me/entities if it does not exist, then create - a c-shell executable file ~/wok. This file will be your wok launcher. This file is - used in the next step. - - 3. Insert in your ~/.tclshrc the lines listed in the file /home/me/wok-C40/site/tclshrc_Wok. - This file is sourced by the tclsh shell at the beginning of a session. - (See tclsh documentation for more information about the .tclshrc file.) + % cd /home/me/wok-CXX/site - At this point either you want to create WOK entitites or import files from a previously Cascade - source download. To create new entities from scratch execute step 4., to import files execute - step 5. + 2. Copy from this directory the file tclshrc_Wok in your home directory with name + .tclshrc or .wishrc depending on the shell you want to use. - 4. Once configured, you can create minimal entities and tell WOK where to - physically create them. The following command setup WOK environment so that they will be - implemented under the directory /home/me/workarea. These entities are a factory - (named KAS below), a workshop ( say C40 ), and a workbench (ref). - - % mkdir /home/me/workarea - % cd ~ - % ./wok setup /home/me/workarea KAS C40 ref + 3. Insert in your LD_LIBRARY_PATH the location where the wok shareable have been downloaded + that is in our case: + /home/me/wok-CXX/lib/lin if your are on Linux + /home/me/wok-CXX/lib/sun if your are on SunOS + 4. Start tclsh or wish. You can then create new wok entities. - 5. You perform this step if you want to use WOK on a previously Cascade source download. - % mkdir /home/me/workarea - % cd ~ - % ./wok import /home/me/workarea KAS C40 ref /somewhere/source/downloaded/CAS3.0 - or if you have the variable CASROOT already pointing to this location : - % ./wok import /home/me/workarea KAS C40 ref $CASROOT - - This will create and populate the workbench KAS:C40:ref with all development units downloaded in - directory /somewhere/source/downloaded/CAS3.0. You can build them using the WOK commands umake - and wprocess. See documentation for details. +B) First installation on WindowsNT. +----------------------------------- - - 6. Then running wok and accessing previously created entities looks like this: - - % ~/wok - tclsh> wokcd KAS:C40:ref - KAS:C40:ref> - - At this point, you run wok by using the above created command ~/wok. No additional - operation is required. - Note that the wok procedure can be placed in any directory listed in your path. - It can also be published to a set of developers by placing it in a shared location. - - -B) INSTALLATION on WindowsNT. ------------------------------ - - We suppose that you have doanloaded the zip archive for WOK in directory W:\wok-C31 + We suppose that you have downloaded the zip archive for WOK in directory W:\wok-CXX 1. Open a MS-DOS command console and set the current directory as follow - W:> cd wok-C31\site + W:> cd wok-CXX\site - 2. Configure WOK so that its administration files will be located - in directory W:/home/me/wokentities. (IMPORTANT : You must create the - directories W:/home/me/entities using the explorer or the command mkdir) - You can now issue the following command (Note precise usage of / instead of \ below): + 2. Copy from this directory the file tclshrc_Wok in the directory pointed to by the variable + HOME if any. If this variable is not setted, set it to a location and copy the file tclshrc_Wok + in there. The final name must be tclshrc.tcl or wishrc.tcl depending on the shell you want to + use. + - W:\site> wokcfg.bat configure W:/wok-C31 W:/home/me/wokentities w:/home/me/wok.bat + 3. Insert in the PATH variable the location where Wok dll resides that is : + wok-CXX\lib\wnt - This will create the file w:/home/me/wok, your wok launcher. + 4. Start tclsh or wish. - 3. Tell WOK where to physically create entities. The following command setup WOK so that they will be - implemented under the directory W:/home/me/wokarea - (IMPORTANT : Create directory W:/home/me/wokarea before) +C) Accessing previous OpenCascade workbenches. +--------------------------------------------- - W:\site> wokcfg.bat setup W:/wok-C31 W:/home/me/wokarea - - 4. You can now use the wok.bat launcher to create entities. - W:\home\me\wok.bat - tclsh> source $env(WOKHOME)/site/CreateFactory.tcl - tclsh> CreateFactory W:/home/me/wokarea KAS C30 ref /dev/null + By default , all the required initialisations are done in the tcl init file. One of them consist to + set the location where Wok will find or created entities. This location is pointed to by the environment + variable ( or MS Dos variable ) named WOK_ROOTADMDIR. If you want to address previous Wok workbenches + (say those created with the C3.1 version) set the variable WOK_ROOTADMDIR to this place. + Note: The directory pointed to by WOK_ROOTADMDIR contains at least 3 files. ATLIST, DEFAULT.edl, SESSION.edl. + diff --git a/src/WOKsite/tclshrc_Wok b/src/WOKsite/tclshrc_Wok index 2f8c6d5..696f60c 100755 --- a/src/WOKsite/tclshrc_Wok +++ b/src/WOKsite/tclshrc_Wok @@ -41,109 +41,124 @@ ;# In this case you can make up a Tcl proc from this file and invoke it at the moment you ;# choose. ;# -proc RUNWOK { } { - global env tcl_platform - if { "$tcl_platform(platform)" == "unix" && ![info exists env(LD_LIBRARY_PATH)] } { - puts stderr "You must set LD_LIBRARY_PATH to point where you have installed Wok" - exit - } - - if { "$tcl_platform(platform)" == "windows" && ![info exists env(PATH)] } { - puts stderr "You must set PATH to point where you have installed Wok" - exit - } - if [info exists wm] { - wm withdraw . - } - if { "$tcl_platform(platform)" == "unix" } { - set wrk [split $env(LD_LIBRARY_PATH) :] - set fmtshr "lib%s.so" - if { $tcl_platform(os) == "HP-UX" } { set fmtshr "lib%s.sl" } - } - if { "$tcl_platform(platform)" == "windows" } { - set wrk [split $env(PATH) ";"] - set fmtshr "%s.dll" +global env tcl_platform +if { "$tcl_platform(platform)" == "unix" && ![info exists env(LD_LIBRARY_PATH)] } { + puts stderr "You must set LD_LIBRARY_PATH to point where you have installed Wok" + exit +} + +if { "$tcl_platform(platform)" == "windows" && ![info exists env(PATH)] } { + puts stderr "You must set PATH to point where you have installed Wok" + exit +} +if [info exists wm] { + wm withdraw . +} +if { "$tcl_platform(platform)" == "unix" } { + set sprtor ":" + set fmtshr "lib%s.so" + set wrk [split $env(LD_LIBRARY_PATH) $sprtor] + if { $tcl_platform(os) == "HP-UX" } { set fmtshr "lib%s.sl" } + set msgnotfound "Please check your variable LD_LIBRARY_PATH" +} +if { "$tcl_platform(platform)" == "windows" } { + set sprtor ";" + set fmtshr "%s.dll" + set wrk [split $env(PATH) $sprtor] + set msgnotfound "Please check your variable PATH" +} +;# +;# Find out in wrk where wok resides. That is : where the file libTKWOK resides. +;# +set wokso [format $fmtshr TKWOK] +foreach d $wrk { + if { [file exists [file join $d $wokso]] && ![info exists wokfound] } { + set wokfound $d } - ;# - ;# Find out in wrk where wok resides. That is : where the file libTKWOK resides. - ;# - set wokso [format $fmtshr TKWOK] - foreach d $wrk { - if { [file exists [file join $d $wokso]] && ![info exists wokfound] } { - set wokfound $d +} +if ![info exists wokfound] { + puts stderr "Wok (actually $wokso) was not found in the directory(ies) $d" + puts stderr "$msgnotfound or check that the above directory are readable." + return +} +;# +;# Wok's here we can set up our niche. +;# +set wok_library [file dirname $wokfound] +set wok_ptfm [file tail $wokfound] +;# +;# +lappend auto_path $wok_library +package require Wok +package require Ms +;# +;# Where tcl and edl file of wok reside. +;# +set env(WOK_LIBRARY) $wok_library +set env(WOK_LIBPATH) "${wok_library}${sprtor}[file join $wok_library $wok_ptfm]" +set env(WOKSTATION) $wok_ptfm +set env(WOKHOME) [file dirname $wok_library] +set woksite [file join $env(WOKHOME) site] +;# +;# Where the files ATLIST , DEFAULT.edl and SESSION.edl reside +;# +if {![info exists env(WOK_ROOTADMDIR)] } { + set env(WOK_ROOTADMDIR) $env(WOKHOME)/wok_entities + if ![file exists $env(WOK_ROOTADMDIR)] { + if [file writable $env(WOKHOME)] { + puts stderr "Creating directory $env(WOK_ROOTADMDIR) for wok entities..." + if [catch { wokUtils:FILES:mkdir $env(WOK_ROOTADMDIR) } status] { + puts stderr "Error : $status" + return + } + if ![file exists $env(WOK_ROOTADMDIR)] { + return + } + } else { + puts stderr "The directory $env(WOK_ROOTADMDIR) cannot be created because $env(WOKHOME) is not writable." + puts stderr "Please give write access to this directory." + return } + } else { + puts stderr "Using $env(WOKHOME)/wok_entities for working entities." } - if ![info exists wokfound] { - puts stderr "Wok (actually $wokso) was not found in the directory(ies) $d" - puts stderr "Please check your variable LD_LIBRARY_PATH(Unix) or PATH (windows)" - return - } - ;# - ;# Wok's here we can set up our niche. - ;# - set wok_library [file dirname $wokfound] - set wok_ptfm [file tail $wokfound] - ;# - ;# - lappend auto_path $wok_library - package require Wok - package require Ms - ;# - ;# Where tcl and edl file of wok reside. - ;# - set env(WOK_LIBRARY) $wok_library - set env(WOK_LIBPATH) $wok_library:[file join $wok_library $wok_ptfm] - set env(WOKSTATION) $wok_ptfm - set env(WOKHOME) [file dirname $wok_library] - set env(WOKSITE) [file join $env(WOKHOME) site] - ;# - ;# Where the files ATLIST , DEFAULT.edl and SESSION.edl reside - ;# - if {![info exists env(WOK_ROOTADMDIR)] } { - set env(WOK_ROOTADMDIR) $env(WOKHOME)/wok_entities - } +} else { if ![file exists $env(WOK_ROOTADMDIR)] { - puts stderr "Creating directory $env(WOK_ROOTADMDIR) for wok entities..." - if [catch { wokUtils:FILES:mkdir $env(WOK_ROOTADMDIR) } status] { - puts stderr "Error : $status" - exit - } - if ![file exists $env(WOK_ROOTADMDIR)] { - exit - } + puts stderr "The directory $env(WOK_ROOTADMDIR) can not be found" + return } - ;# - ;# Check if Wok stuff is correct. If not set it up silently. - ;# - if ![file exists [set woksession [file join $env(WOK_ROOTADMDIR) WOKSESSION.edl]]] { - set str1 [wokUtils:FILES:FileToString [file join $env(WOKSITE) WOKSESSION.edl]] - regsub -all -- {TOSUBSTITUTE} "$str1" "$env(WOK_ROOTADMDIR)" result1 - wokUtils:FILES:StringToFile $result1 $woksession - if [file exists $woksession] { - puts stderr "File $session has been created. " - } + puts stderr "Using variable WOK_ROOTADMDIR = $env(WOK_ROOTADMDIR) for working entities." +} + +;# +;# Check if Wok stuff is correct. If not set it up silently. +;# +if ![file exists [set woksession [file join $env(WOK_ROOTADMDIR) WOKSESSION.edl]]] { + set str1 [wokUtils:FILES:FileToString [file join $woksite WOKSESSION.edl]] + regsub -all -- {TOSUBSTITUTE} "$str1" "$env(WOK_ROOTADMDIR)" result1 + wokUtils:FILES:StringToFile $result1 $woksession + if [file exists $woksession] { + puts stderr "File $woksession has been created. " } - ;# - ;# - ;# - if ![file exists [set default [file join $env(WOK_ROOTADMDIR) DEFAULT.edl]]] { - set str2 [wokUtils:FILES:FileToString [file join $env(WOKSITE) DEFAULT.edl]] - regsub -all -- {dp_xx} "$str2" "$env(WOK_ROOTADMDIR)" result2 - wokUtils:FILES:StringToFile $result2 $default - if [file exists $default] { - puts stderr "File $default has been created. " - } +} +;# +;# +;# +if ![file exists [set default [file join $env(WOK_ROOTADMDIR) DEFAULT.edl]]] { + set str2 [wokUtils:FILES:FileToString [file join $woksite DEFAULT.edl]] + regsub -all -- {/dp_xx} "$str2" "$env(WOK_ROOTADMDIR)" result2 + wokUtils:FILES:StringToFile $result2 $default + if [file exists $default] { + puts stderr "File $default has been created. " } - ;# - ;# Where to read/write the current working entity - ;# - set env(WOK_SESSIONID) $env(HOME)/.wok - ;# - ;# Every thing seems OK. Display a nice prompt: - ;# - set tcl_prompt1 {if {[info commands wokcd] != ""} then \ - {puts -nonewline stdout "[wokcd]> "} else \ - {puts -nonewline stdout "tclsh> "}} - } -RUNWOK +;# +;# Where to read/write the current working entity +;# +set env(WOK_SESSIONID) $env(HOME)/.wok +;# +;# Every thing seems OK. Display a nice prompt: +;# +set tcl_prompt1 {if {[info commands wokcd] != ""} then \ + {puts -nonewline stdout "[wokcd]> "} else \ + {puts -nonewline stdout "tclsh> "}} -- 2.39.5