summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorkjnash <k.j.nash@usa.net>2022-08-31 15:24:20 (GMT)
committerkjnash <k.j.nash@usa.net>2022-08-31 15:24:20 (GMT)
commit7443a97bd1d5060c2bc3ea57dbd1899ea2efb9b8 (patch)
treea7402019faf3e75458552fe9dde90324f981fe7b /tools
parent19f8c3bb6b2aa8d571a7534b588ddacfb49952d3 (diff)
parent52b58d0c7d1575d7c784ccb344862e0de8a9686b (diff)
downloadtcl-7443a97bd1d5060c2bc3ea57dbd1899ea2efb9b8.zip
tcl-7443a97bd1d5060c2bc3ea57dbd1899ea2efb9b8.tar.gz
tcl-7443a97bd1d5060c2bc3ea57dbd1899ea2efb9b8.tar.bz2
Merge old 8.7 6c69a72c58
Diffstat (limited to 'tools')
-rw-r--r--tools/README19
-rw-r--r--tools/genStubs.tcl9
-rw-r--r--tools/installData.tcl4
-rw-r--r--tools/makeHeader.tcl4
-rw-r--r--tools/mkVfs.tcl4
-rw-r--r--tools/regexpTestLib.tcl2
-rwxr-xr-xtools/tclZIC.tcl4
-rw-r--r--tools/tcltk-man2html-utils.tcl10
-rwxr-xr-x[-rw-r--r--]tools/tcltk-man2html.tcl24
-rw-r--r--tools/tsdPerf.c2
-rw-r--r--tools/uniParse.tcl2
11 files changed, 45 insertions, 39 deletions
diff --git a/tools/README b/tools/README
index f4bf627..a37c2f4 100644
--- a/tools/README
+++ b/tools/README
@@ -9,17 +9,12 @@ uniClass.tcl -- Script for generating regexp class tables from the Tcl
"string is" classes
Generating HTML files.
-The tcl-tk-man-html.tcl script from Robert Critchlow
-generates a nice set of HTML with good cross references.
-Use it like
- tclsh tcl-tk-man-html.tcl --htmldir=/tmp/tcl8.2
+The tcltk-man2html.tcl script generates a nice set of HTML with
+good cross references. Use it like
+ cd unix
+ ./configure
+ make html
This script is very picky about the organization of man pages,
effectively acting as a style enforcer.
-
-Generating Windows Help Files:
-1) Build tcl in the ../unix directory
-2) On UNIX, (after autoconf and configure), do
- make
- this converts the Nroff to RTF files.
-2) On Windows, convert the RTF to a Help doc, do
- nmake helpfile
+The resulting documentation can be found at
+ /tmp/dist/tcl<version>/html
diff --git a/tools/genStubs.tcl b/tools/genStubs.tcl
index bc0d700..4f4acbb 100644
--- a/tools/genStubs.tcl
+++ b/tools/genStubs.tcl
@@ -257,8 +257,9 @@ proc genStubs::rewriteFile {file text} {
return
}
set in [open ${file} r]
+ fconfigure $in -eofchar "\032 {}" -encoding utf-8
set out [open ${file}.new w]
- fconfigure $out -translation lf
+ fconfigure $out -translation lf -encoding utf-8
while {![eof $in]} {
set line [gets $in]
@@ -1100,7 +1101,7 @@ proc genStubs::emitInit {name textVar} {
}
foreach intf [array names interfaces] {
if {[info exists hooks($intf)]} {
- if {[lsearch -exact $hooks($intf) $name] >= 0} {
+ if {$name in $hooks($intf)} {
set root 0
break
}
@@ -1191,7 +1192,7 @@ proc genStubs::init {} {
set outDir [lindex $argv 0]
foreach file [lrange $argv 1 end] {
- source $file
+ source -encoding utf-8 $file
}
foreach name [lsort [array names interfaces]] {
@@ -1213,7 +1214,7 @@ proc genStubs::init {} {
# Results:
# Returns any values that were not assigned to variables.
-if {[string length [namespace which lassign]] == 0} {
+if {[namespace which lassign] ne ""} {
proc lassign {valueList args} {
if {[llength $args] == 0} {
error "wrong # args: should be \"lassign list varName ?varName ...?\""
diff --git a/tools/installData.tcl b/tools/installData.tcl
index dd7976b..4a3b1ee 100644
--- a/tools/installData.tcl
+++ b/tools/installData.tcl
@@ -32,7 +32,7 @@ proc copyDir {d1 d2} {
} elseif {[file isfile $f]} {
file copy -force $f [file join $d2 $ftail]
if {$::tcl_platform(platform) eq {unix}} {
- file attributes [file join $d2 $ftail] -permissions 0644
+ file attributes [file join $d2 $ftail] -permissions 0o644
} else {
file attributes [file join $d2 $ftail] -readonly 1
}
@@ -40,7 +40,7 @@ proc copyDir {d1 d2} {
}
if {$::tcl_platform(platform) eq {unix}} {
- file attributes $d2 -permissions 0755
+ file attributes $d2 -permissions 0o755
} else {
file attributes $d2 -readonly 1
}
diff --git a/tools/makeHeader.tcl b/tools/makeHeader.tcl
index dd2f199..1d961c9 100644
--- a/tools/makeHeader.tcl
+++ b/tools/makeHeader.tcl
@@ -8,7 +8,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-package require Tcl 8.6
+package require Tcl 8.6-
namespace eval makeHeader {
@@ -25,7 +25,7 @@ namespace eval makeHeader {
}
set XFORM {[format \\\\\\\\u%04x {*}[scan & %c]]}
- subst [regsub -all {[^\u0020-\u007e]} [string map $MAP $str] $XFORM]
+ subst [regsub -all {[^\x20-\x7E]} [string map $MAP $str] $XFORM]
}
####################################################################
diff --git a/tools/mkVfs.tcl b/tools/mkVfs.tcl
index cbfb81e..c4021f6 100644
--- a/tools/mkVfs.tcl
+++ b/tools/mkVfs.tcl
@@ -39,7 +39,7 @@ proc copyDir {d1 d2} {
} elseif {[file isfile $f]} {
file copy -force $f [file join $d2 $ftail]
if {$::tcl_platform(platform) eq {unix}} {
- file attributes [file join $d2 $ftail] -permissions 0644
+ file attributes [file join $d2 $ftail] -permissions 0o644
} else {
file attributes [file join $d2 $ftail] -readonly 1
}
@@ -47,7 +47,7 @@ proc copyDir {d1 d2} {
}
if {$::tcl_platform(platform) eq {unix}} {
- file attributes $d2 -permissions 0755
+ file attributes $d2 -permissions 0o755
} else {
file attributes $d2 -readonly 1
}
diff --git a/tools/regexpTestLib.tcl b/tools/regexpTestLib.tcl
index a94d90f..bdb7d90 100644
--- a/tools/regexpTestLib.tcl
+++ b/tools/regexpTestLib.tcl
@@ -192,7 +192,7 @@ proc convertTestLine {currentLine len lineNum srcLineNum} {
# if and \r substitutions are made, do not wrap re, flags,
# str, and result in braces
- set noBraces [regsub -all {R} $currentLine {\\\u000D} currentLine]
+ set noBraces [regsub -all {R} $currentLine {\\\x0D} currentLine]
regsub -all {T} $currentLine {\\t} currentLine
regsub -all {V} $currentLine {\\v} currentLine
if {[regexp {=} $flags] == 1} {
diff --git a/tools/tclZIC.tcl b/tools/tclZIC.tcl
index 52b86ea..901814f 100755
--- a/tools/tclZIC.tcl
+++ b/tools/tclZIC.tcl
@@ -1263,7 +1263,7 @@ proc writeZones {outDir} {
# Write the data to the information file
set f [open $fileName w]
- fconfigure $f -translation lf
+ fconfigure $f -translation lf -encoding utf-8
puts $f "\# created by $::argv0 - do not edit"
puts $f ""
puts $f [list set TZData(:$zoneName) $data]
@@ -1316,7 +1316,7 @@ proc writeLinks {outDir} {
# Write the file
set f [open $fileName w]
- fconfigure $f -translation lf
+ fconfigure $f -translation lf -encoding utf-8
puts $f "\# created by $::argv0 - do not edit"
puts $f $ifCmd
puts $f $setCmd
diff --git a/tools/tcltk-man2html-utils.tcl b/tools/tcltk-man2html-utils.tcl
index 94440d5..b7a8520 100644
--- a/tools/tcltk-man2html-utils.tcl
+++ b/tools/tcltk-man2html-utils.tcl
@@ -130,8 +130,8 @@ proc htmlize-text {text {charmap {}}} {
\" {&quot;} \
{<} {&lt;} \
{>} {&gt;} \
- \u201c "&ldquo;" \
- \u201d "&rdquo;"
+ \u201C "&ldquo;" \
+ \u201D "&rdquo;"
return [string map $charmap $text]
}
@@ -1303,8 +1303,8 @@ proc make-manpage-section {outputDir sectionDescriptor} {
global manual overall_title tcltkdesc verbose
global excluded_pages forced_index_pages process_first_patterns
- set LQ \u201c
- set RQ \u201d
+ set LQ \u201C
+ set RQ \u201D
lassign $sectionDescriptor \
manual(wing-glob) \
@@ -1314,6 +1314,7 @@ proc make-manpage-section {outputDir sectionDescriptor} {
set manual(wing-copyrights) {}
makedirhier $outputDir/$manual(wing-file)
set manual(wing-toc-fp) [open $outputDir/$manual(wing-file)/[indexfile] w]
+ fconfigure $manual(wing-toc-fp) -translation lf -encoding utf-8
# whistle
puts stderr "scanning section $manual(wing-name)"
# put the entry for this section into the short table of contents
@@ -1364,6 +1365,7 @@ proc make-manpage-section {outputDir sectionDescriptor} {
continue
}
set manual(infp) [open $manual(page)]
+ fconfigure $manual(infp) -encoding utf-8
set manual(text) {}
set manual(partial-text) {}
foreach p {.RS .DS .CS .SO} {
diff --git a/tools/tcltk-man2html.tcl b/tools/tcltk-man2html.tcl
index efb7a13..0e87531 100644..100755
--- a/tools/tcltk-man2html.tcl
+++ b/tools/tcltk-man2html.tcl
@@ -67,7 +67,7 @@ proc findversion {top name useversion} {
# to do
# use glob matching instead of string matching or add
# brace handling to [string matcch]
- if {$useversion eq {} || [string match $useversion $major.$minor]} {
+ if {$useversion eq "" || [string match $useversion $major.$minor]} {
set top [file dirname [file dirname $tclh]]
set prefix [file dirname $top]
return [list $prefix [file tail $top] $major $minor]
@@ -172,17 +172,17 @@ proc parse_command_line {} {
# Find Tcl (firstly using glob pattern / backwards compatible way)
set tcldir [lindex [lsort [glob -nocomplain -tails -type d \
-directory $tcltkdir tcl$useversion]] end]
- if {$tcldir ne {}} {
+ if {$tcldir ne ""} {
# obtain version from generic header if we can:
lassign [getversion [file join $tcltkdir $tcldir generic tcl.h]] major minor
} else {
lassign [findversion $tcltkdir tcl $useversion] tcltkdir tcldir major minor
}
- if {$tcldir eq {} && $opt_build_tcl} {
+ if {$tcldir eq "" && $opt_build_tcl} {
puts stderr "tcltk-man-html: couldn't find Tcl below $tcltkdir"
exit 1
}
- puts "using Tcl source directory $tcltkdir $tcldir"
+ puts "using Tcl source directory [file join $tcltkdir $tcldir]"
}
@@ -190,19 +190,19 @@ proc parse_command_line {} {
# Find Tk (firstly using glob pattern / backwards compatible way)
set tkdir [lindex [lsort [glob -nocomplain -tails -type d \
-directory $tcltkdir tk$useversion]] end]
- if {$tkdir ne {}} {
+ if {$tkdir ne ""} {
if {$major eq ""} {
# obtain version from generic header if we can:
- lassign [getversion [file join $tcltkdir $tcldir generic tk.h]] major minor
+ lassign [getversion [file join $tcltkdir $tkdir generic tk.h]] major minor
}
} else {
lassign [findversion $tcltkdir tk $useversion] tcltkdir tkdir major minor
}
- if {$tkdir eq {} && $opt_build_tk} {
+ if {$tkdir eq "" && $opt_build_tk} {
puts stderr "tcltk-man-html: couldn't find Tk below $tcltkdir"
exit 1
}
- puts "using Tk source directory $tkdir"
+ puts "using Tk source directory [file join $tcltkdir $tkdir]"
}
puts "verbose messages are [expr {$verbose ? {on} : {off}}]"
@@ -329,10 +329,12 @@ proc make-man-pages {html args} {
makedirhier $html
set cssfd [open $html/$::CSSFILE w]
+ fconfigure $cssfd -translation lf -encoding utf-8
puts $cssfd [css-stylesheet]
close $cssfd
set manual(short-toc-n) 1
set manual(short-toc-fp) [open $html/[indexfile] w]
+ fconfigure $manual(short-toc-fp) -translation lf -encoding utf-8
puts $manual(short-toc-fp) [htmlhead $overall_title $overall_title]
puts $manual(short-toc-fp) "<dl class=\"keylist\">"
set manual(merge-copyrights) {}
@@ -370,6 +372,7 @@ proc make-man-pages {html args} {
file delete -force -- $html/Keywords
makedirhier $html/Keywords
set keyfp [open $html/Keywords/[indexfile] w]
+ fconfigure $keyfp -translation lf -encoding utf-8
puts $keyfp [htmlhead "$tcltkdesc Keywords" "$tcltkdesc Keywords" \
$overall_title "../[indexfile]"]
set letters {A B C D E F G H I J K L M N O P Q R S T U V W X Y Z}
@@ -393,6 +396,7 @@ proc make-man-pages {html args} {
}
# Per-keyword page
set afp [open $html/Keywords/$a.html w]
+ fconfigure $afp -translation lf -encoding utf-8
puts $afp [htmlhead "$tcltkdesc Keywords - $a" \
"$tcltkdesc Keywords - $a" \
$overall_title "../[indexfile]"]
@@ -469,6 +473,7 @@ proc make-man-pages {html args} {
puts -nonewline stderr .
}
set outfd [open $html/$manual(wing-file)/$manual(name).html w]
+ fconfigure $outfd -translation lf -encoding utf-8
puts $outfd [htmlhead "$manual($manual(wing-file)-$manual(name)-title)" \
$manual(name) $wing_name "[indexfile]" \
$overall_title "../[indexfile]"]
@@ -511,6 +516,7 @@ proc plus-base {var root glob name dir desc} {
if {$var} {
if {[file exists $tcltkdir/$root/README]} {
set f [open $tcltkdir/$root/README]
+ fconfigure $f -encoding utf-8
set d [read $f]
close $f
if {[regexp {This is the \w+ (\S+) source distribution} $d -> version]} {
@@ -746,6 +752,7 @@ try {
} trap {POSIX ENOENT} {} {
set f [open [file join $pkgsDir $dir configure.ac]]
}
+ fconfigure $f -encoding utf-8
foreach line [split [read $f] \n] {
if {2 == [scan $line \
{ AC_INIT ( [%[^]]] , [%[^]]] ) } n v]} {
@@ -770,6 +777,7 @@ try {
set packageDirNameMap {}
if {$build_tcl} {
set f [open $tcltkdir/$tcldir/pkgs/package.list.txt]
+ fconfigure $f -encoding utf-8
try {
foreach line [split [read $f] \n] {
if {[string trim $line] eq ""} continue
diff --git a/tools/tsdPerf.c b/tools/tsdPerf.c
index 7a599e0..4c96f28 100644
--- a/tools/tsdPerf.c
+++ b/tools/tsdPerf.c
@@ -1,6 +1,6 @@
#include <tcl.h>
-extern DLLEXPORT Tcl_PackageInitProc Tsdperf_Init;
+extern DLLEXPORT Tcl_LibraryInitProc Tsdperf_Init;
static Tcl_ThreadDataKey key;
diff --git a/tools/uniParse.tcl b/tools/uniParse.tcl
index 90d249a..aec5864 100644
--- a/tools/uniParse.tcl
+++ b/tools/uniParse.tcl
@@ -177,7 +177,7 @@ proc uni::main {} {
puts "shift = $shift, space = $size"
set f [open [file join [lindex $argv 1] tclUniData.c] w]
- fconfigure $f -translation lf
+ fconfigure $f -translation lf -encoding utf-8
puts $f "/*
* tclUniData.c --
*