diff options
author | cvs2fossil <cvs2fossil> | 2011-01-25 19:02:56 (GMT) |
---|---|---|
committer | cvs2fossil <cvs2fossil> | 2011-01-25 19:02:56 (GMT) |
commit | 352fce86be9d102b2284de839b7f7ff94ed971f2 (patch) | |
tree | e454e0d4460f15029e4ed5ae3f3131a992445426 /tools | |
parent | 75f084f6970d2344bb5a82fdff6a73825bc6e64e (diff) | |
download | tcl-dgp_refactor_merge_synthetic.zip tcl-dgp_refactor_merge_synthetic.tar.gz tcl-dgp_refactor_merge_synthetic.tar.bz2 |
Created branch dgp-refactor-merge-syntheticdgp_refactor_mergedgp_refactor_merge_synthetic
Diffstat (limited to 'tools')
-rw-r--r-- | tools/cvtEOL.tcl | 35 | ||||
-rw-r--r-- | tools/genWinImage.tcl | 157 |
2 files changed, 192 insertions, 0 deletions
diff --git a/tools/cvtEOL.tcl b/tools/cvtEOL.tcl new file mode 100644 index 0000000..e2df341 --- /dev/null +++ b/tools/cvtEOL.tcl @@ -0,0 +1,35 @@ +# cvtEOL.tcl -- +# +# This file contains a script to parse a Tcl/Tk distribution and +# convert the EOL from \n to \r on all text files. +# +# Copyright (c) 1996-1997 by Sun Microsystems, Inc. +# +# SCCS: @(#) cvtEOL.tcl 1.1 97/01/30 11:33:33 +# + +# +# Convert files in the distribution to Mac style +# + +set distDir [lindex $argv 0] + +set dirs {unix mac generic win library compat tests unix/dltest \ + library/demos library/demos/images bitmaps xlib xlib/X11 .} +set files {*.c *.y *.h *.r *.tcl *.test *.rc *.bc *.vc *.bmp *.html \ + *.in *.notes *.terms all defs \ + README ToDo changes tclIndex configure install-sh mkLinks \ + square widget rmt ixset hello browse rolodex tcolor timer} + +foreach x $dirs { + if [catch {cd $distDir/$x}] continue + puts "Working on $x..." + foreach y [eval glob $files] { + exec chmod 666 $y + exec cp $y $y.tmp + exec tr \012 \015 < $y.tmp > $y + exec chmod 444 $y + exec rm $y.tmp + } +} + diff --git a/tools/genWinImage.tcl b/tools/genWinImage.tcl new file mode 100644 index 0000000..e57d018 --- /dev/null +++ b/tools/genWinImage.tcl @@ -0,0 +1,157 @@ +# genWinImage.tcl -- +# +# This script generates the Windows installer. +# +# Copyright (c) 1999 by Scriptics Corporation. +# All rights reserved. +# +# RCS: @(#) $Id: genWinImage.tcl,v 1.5 2000/04/25 22:29:21 hobbs Exp $ + + +# This file is insensitive to the directory from which it is invoked. + +namespace eval genWinImage { + # toolsDir -- + # + # This variable points to the platform specific tools directory. + + variable toolsDir + + # tclBuildDir -- + # + # This variable points to the directory containing the Tcl built tree. + + variable tclBuildDir + + # tkBuildDir -- + # + # This variable points to the directory containing the Tk built tree. + + variable tkBuildDir + + # our script name at runtime + variable script [info script] +} + +# genWinImage::init -- +# +# This is the main entry point. +# +# Arguments: +# None. +# +# Results: +# None. + +proc genWinImage::init {} { + global tcl_platform argv argv0 + variable tclBuildDir + variable tkBuildDir + variable toolsDir + variable script + + puts "\n--- $script started: \ + [clock format [clock seconds] -format "%Y%m%d-%H:%M"] --\n" + + if {$tcl_platform(platform) != "windows"} { + puts stderr "ERROR: Cannot build TCL.EXE on Unix systems" + exit 1 + } + + if {[llength $argv] != 3} { + puts stderr "usage: $argv0 <tclBuildDir> <tkBuildDir> <toolsDir>" + exit 0 + } + + set tclBuildDir [lindex $argv 0] + set tkBuildDir [lindex $argv 1] + set toolsDir [lindex $argv 2] + + generateInstallers + + puts "\n--- $script finished: \ + [clock format [clock seconds] -format "%Y%m%d-%H:%M"] --\n\n" +} + +# genWinImage::makeTextFile -- +# +# Convert the input file into a CRLF terminated text file. +# +# Arguments: +# infile The input file to convert. +# outfile The location where the text file should be stored. +# +# Results: +# None. + +proc genWinImage::makeTextFile {infile outfile} { + set f [open $infile r] + set text [read $f] + close $f + set f [open $outfile w] + fconfigure $f -translation crlf + puts -nonewline $f $text + close $f +} + +# genWinImage::generateInstallers -- +# +# Perform substitutions on the pro.wse.in file and then +# invoke the WSE script twice; once for CD and once for web. +# +# Arguments: +# None. +# +# Results: +# Leaves proweb.exe and procd.exe sitting in the curent directory. + +proc genWinImage::generateInstallers {} { + variable toolsDir + variable tclBuildDir + variable tkBuildDir + + # Now read the "pro/srcs/install/pro.wse.in" file, have Tcl make + # appropriate substitutions, write out the resulting file in a + # current-working-directory. Use this new file to perform installation + # image creation. Note that we have to use this technique to set + # the value of _WISE_ because wise32 won't use a /d switch for this + # variable. + + set __TCLBASEDIR__ [file native $tclBuildDir] + set __TKBASEDIR__ [file native $tkBuildDir] + set __WISE__ [file native [file join $toolsDir wise]] + + set f [open [file join $__TCLBASEDIR__ generic/tcl.h] r] + set s [read $f] + close $f + regexp {TCL_PATCH_LEVEL\s*\"([^\"]*)\"} $s dummy __TCL_PATCH_LEVEL__ + + set f [open tcl.wse.in r] + set s [read $f] + close $f + set s [subst -nocommands -nobackslashes $s] + set f [open tcl.wse w] + puts $f $s + close $f + + # Ensure the text files are CRLF terminated + + makeTextFile [file join $tclBuildDir win/README.binary] \ + [file join $tclBuildDir win/readme.txt] + makeTextFile [file join $tclBuildDir license.terms] \ + [file join $tclBuildDir license.txt] + + set wise32ProgFilePath [file native [file join $__WISE__ wise32.exe]] + + # Run the Wise installer to create the Windows install images. + + if {[catch {exec [file native $wise32ProgFilePath] /c tcl.wse} errMsg]} { + puts stderr "ERROR: $errMsg" + } else { + puts "\"TCL.EXE\" created." + } + + return +} + +genWinImage::init |