Fossil SCM

Fix auto.def, such that it works with Tcl 9 as well

jan.nijtmans 2025-11-20 15:10 trunk
Commit 7a43dcbe151f1f4b609a0a0f5c1cda1698fa76381bdd1b8aaf14fbdba0355cf3
1 file changed +8 -2
+8 -2
--- auto.def
+++ auto.def
@@ -95,13 +95,14 @@
9595
# or a version of tclsh that we find unsuitable below!
9696
cc-check-progs tclsh
9797
set hbtd /usr/local/Cellar/tcl-tk
9898
if {[string equal false [get-define TCLSH]]} {
9999
msg-result "WARNING: 'make test' will not run here."
100
+ set v 8.6
100101
} else {
101102
set v [exec sh -c "echo 'puts \$tcl_version' | tclsh"]
102
- if {[expr {$v >= 8.6}]} {
103
+ if {$v >= 8.6} {
103104
msg-result "Found Tclsh version $v in the PATH."
104105
define TCLSH tclsh
105106
} elseif {[file isdirectory $hbtd]} {
106107
# This is a macOS system with the Homebrew version of Tcl/Tk
107108
# installed. Select the newest version. It won't normally be
@@ -626,18 +627,23 @@
626627
627628
#
628629
# Handle the --with-tcl flag.
629630
#
630631
proc handle-with-tcl {} {
632
+ global v
631633
set tclpath [opt-val with-tcl]
632634
if {$tclpath eq ""} {
633635
return
634636
}
635637
set tclprivatestubs [opt-bool with-tcl-private-stubs]
636638
# Note parse-tclconfig-sh is in autosetup/local.tcl
637639
if {$tclpath eq "1"} {
638
- set tcldir [file dirname $::autosetup(dir)]/compat/tcl-8.6
640
+ if {$v >= 9.0} {
641
+ set tcldir [file dirname $::autosetup(dir)]/compat/tcl-9.0
642
+ } else {
643
+ set tcldir [file dirname $::autosetup(dir)]/compat/tcl-8.6
644
+ }
639645
if {$tclprivatestubs} {
640646
set tclconfig(TCL_INCLUDE_SPEC) -I$tcldir/generic
641647
set tclconfig(TCL_VERSION) {Private Stubs}
642648
set tclconfig(TCL_PATCH_LEVEL) {}
643649
set tclconfig(TCL_PREFIX) $tcldir
644650
--- auto.def
+++ auto.def
@@ -95,13 +95,14 @@
95 # or a version of tclsh that we find unsuitable below!
96 cc-check-progs tclsh
97 set hbtd /usr/local/Cellar/tcl-tk
98 if {[string equal false [get-define TCLSH]]} {
99 msg-result "WARNING: 'make test' will not run here."
 
100 } else {
101 set v [exec sh -c "echo 'puts \$tcl_version' | tclsh"]
102 if {[expr {$v >= 8.6}]} {
103 msg-result "Found Tclsh version $v in the PATH."
104 define TCLSH tclsh
105 } elseif {[file isdirectory $hbtd]} {
106 # This is a macOS system with the Homebrew version of Tcl/Tk
107 # installed. Select the newest version. It won't normally be
@@ -626,18 +627,23 @@
626
627 #
628 # Handle the --with-tcl flag.
629 #
630 proc handle-with-tcl {} {
 
631 set tclpath [opt-val with-tcl]
632 if {$tclpath eq ""} {
633 return
634 }
635 set tclprivatestubs [opt-bool with-tcl-private-stubs]
636 # Note parse-tclconfig-sh is in autosetup/local.tcl
637 if {$tclpath eq "1"} {
638 set tcldir [file dirname $::autosetup(dir)]/compat/tcl-8.6
 
 
 
 
639 if {$tclprivatestubs} {
640 set tclconfig(TCL_INCLUDE_SPEC) -I$tcldir/generic
641 set tclconfig(TCL_VERSION) {Private Stubs}
642 set tclconfig(TCL_PATCH_LEVEL) {}
643 set tclconfig(TCL_PREFIX) $tcldir
644
--- auto.def
+++ auto.def
@@ -95,13 +95,14 @@
95 # or a version of tclsh that we find unsuitable below!
96 cc-check-progs tclsh
97 set hbtd /usr/local/Cellar/tcl-tk
98 if {[string equal false [get-define TCLSH]]} {
99 msg-result "WARNING: 'make test' will not run here."
100 set v 8.6
101 } else {
102 set v [exec sh -c "echo 'puts \$tcl_version' | tclsh"]
103 if {$v >= 8.6} {
104 msg-result "Found Tclsh version $v in the PATH."
105 define TCLSH tclsh
106 } elseif {[file isdirectory $hbtd]} {
107 # This is a macOS system with the Homebrew version of Tcl/Tk
108 # installed. Select the newest version. It won't normally be
@@ -626,18 +627,23 @@
627
628 #
629 # Handle the --with-tcl flag.
630 #
631 proc handle-with-tcl {} {
632 global v
633 set tclpath [opt-val with-tcl]
634 if {$tclpath eq ""} {
635 return
636 }
637 set tclprivatestubs [opt-bool with-tcl-private-stubs]
638 # Note parse-tclconfig-sh is in autosetup/local.tcl
639 if {$tclpath eq "1"} {
640 if {$v >= 9.0} {
641 set tcldir [file dirname $::autosetup(dir)]/compat/tcl-9.0
642 } else {
643 set tcldir [file dirname $::autosetup(dir)]/compat/tcl-8.6
644 }
645 if {$tclprivatestubs} {
646 set tclconfig(TCL_INCLUDE_SPEC) -I$tcldir/generic
647 set tclconfig(TCL_VERSION) {Private Stubs}
648 set tclconfig(TCL_PATCH_LEVEL) {}
649 set tclconfig(TCL_PREFIX) $tcldir
650

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button