Check-in [a69c0492a6]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2018 Conference, Houston/TX, US, Oct 15-19
Send your abstracts to tclconference@googlegroups.com or submit via the online form
by Aug 20.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Formalizing on ::project(srcdir) as the appropriate flag for file directories Adapted the tea-like template building mechanism from odielib into a general purpose tool
Timelines: family | ancestors | descendants | both | autosetup
Files: files | file ages | folders
SHA1: a69c0492a6a1dd3612ee7a72804a5b6426f66cf8
User & Date: hypnotoad 2015-03-24 21:20:46
Context
2015-03-27
18:41
Modifications to the build process to accomidate linux Added sherpa to the pantheon of bootstrapped packages Removed the autosetup step for toadkits baked into odie autosetup ΓΈ  check-in: 99ca0f2d45 user: hypnotoad tags: autosetup
2015-03-24
21:20
Formalizing on ::project(srcdir) as the appropriate flag for file directories Adapted the tea-like template building mechanism from odielib into a general purpose tool check-in: a69c0492a6 user: hypnotoad tags: autosetup
15:30
Fix the path for building toadkit check-in: d421d45771 user: hypnotoad tags: autosetup
Changes
Unified Diff Ignore Whitespace Patch
Changes to autosetup/lib/cthulhu.tcl.
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
}

###
# topic: 9c0c2d73c1afa8ef83a739c5d01309d0
# title: Signal for a C header to be read with mkhdr
###
proc cthulhu_add_cheader {filename {trace 0}} {
  set hfilename [::cygrelative $::project(src) $filename]
  if {$hfilename in $::project(headers_verbatim)} {
    return
  }
  if {$hfilename ni $::project(headers)} {
    lappend ::project(headers) $hfilename
    #::cthulhu_read_csourcefile $file
  }
}

###
# topic: c52ea7e1ff44f11f960d99a55e4ab998
# title: Add the contents of a header file verbatim to the internal headers and public headers
###
proc cthulhu_add_cheader_verbatim {filename {trace 0}} {
  set hfilename [::cygrelative $::project(src) $filename]
  ldelete ::project(headers) $hfilename
  if {$hfilename ni $::project(headers_verbatim)} {
    lappend ::project(headers_verbatim) $hfilename
  }
}

###
# topic: 91e4d7da8dd82d78af41561360deab10
# title: Signal for a C source to be read with mkhdr
###
proc cthulhu_add_csource {filename {cmdconfig {}}} {
  set config [dict merge $::cthulhu_config $cmdconfig]
  
  set cfilename [::cygrelative $::project(src) $filename]
  dict set ::thesources $cfilename $config
  if {$cfilename ni $::project(sources)} {
    lappend ::project(sources) $cfilename
  }
  if {[string is true [dictGetnull $config scan]]} {
    if {$cfilename ni $::project(scanlist)} {
      lappend ::project(scanlist) $cfilename







|














|













|







18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
}

###
# topic: 9c0c2d73c1afa8ef83a739c5d01309d0
# title: Signal for a C header to be read with mkhdr
###
proc cthulhu_add_cheader {filename {trace 0}} {
  set hfilename [::cygrelative $::project(srcdir) $filename]
  if {$hfilename in $::project(headers_verbatim)} {
    return
  }
  if {$hfilename ni $::project(headers)} {
    lappend ::project(headers) $hfilename
    #::cthulhu_read_csourcefile $file
  }
}

###
# topic: c52ea7e1ff44f11f960d99a55e4ab998
# title: Add the contents of a header file verbatim to the internal headers and public headers
###
proc cthulhu_add_cheader_verbatim {filename {trace 0}} {
  set hfilename [::cygrelative $::project(srcdir) $filename]
  ldelete ::project(headers) $hfilename
  if {$hfilename ni $::project(headers_verbatim)} {
    lappend ::project(headers_verbatim) $hfilename
  }
}

###
# topic: 91e4d7da8dd82d78af41561360deab10
# title: Signal for a C source to be read with mkhdr
###
proc cthulhu_add_csource {filename {cmdconfig {}}} {
  set config [dict merge $::cthulhu_config $cmdconfig]
  
  set cfilename [::cygrelative $::project(srcdir) $filename]
  dict set ::thesources $cfilename $config
  if {$cfilename ni $::project(sources)} {
    lappend ::project(sources) $cfilename
  }
  if {[string is true [dictGetnull $config scan]]} {
    if {$cfilename ni $::project(scanlist)} {
      lappend ::project(scanlist) $cfilename
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
}

###
# topic: 1d3a911fd58337df92205759a6d092c3
# title: Add a source file in Tcl that produces a C file
###
proc cthulhu_add_dynamic {csource tclscript} {
  set cfilename [::cygrelative $::project(src) $csource]
  set tclfilename [::cygrelative $::project(src) $tclscript]
  dict set ::thesources $cfilename tclscript $tclfilename
}

###
# topic: d10665e8da4dd0781bb0a9ced5486e40
# title: Add a pure-tcl library
###
proc cthulhu_add_library {here {cmdconfig {}}} {
  set config [dict merge {
    cthulhu-ignore-tclfiles {}
  } $::cthulhu_config $cmdconfig]

  dict with config {}
  set here [::realpath $here]
  foreach file [lsort [glob -nocomplain $here/*.tcl]] {
    if {[file tail $file] in ${cthulhu-ignore-tclfiles}} continue
    set libfilename [::cygrelative $::project(src) $libfilename]
  }
}

###
# topic: ccfe65b26705afc498e08d3004031066
# title: Detect where we need to produce a _cases.h file to automate a C source
###
proc cthulhu_detect_cases filename {
  set cfilename [::cygrelative $::project(src) $filename]
  set cases [codebale_detect_cases $filename]
  if {![llength $cases]} return
  set dirname [file dirname $cfilename]
  foreach case $cases {
    lappend result [file join $dirname $case]
  }
  dict set ::thesources $cfilename cases $result







|
|
















|








|







112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
}

###
# topic: 1d3a911fd58337df92205759a6d092c3
# title: Add a source file in Tcl that produces a C file
###
proc cthulhu_add_dynamic {csource tclscript} {
  set cfilename [::cygrelative $::project(srcdir) $csource]
  set tclfilename [::cygrelative $::project(srcdir) $tclscript]
  dict set ::thesources $cfilename tclscript $tclfilename
}

###
# topic: d10665e8da4dd0781bb0a9ced5486e40
# title: Add a pure-tcl library
###
proc cthulhu_add_library {here {cmdconfig {}}} {
  set config [dict merge {
    cthulhu-ignore-tclfiles {}
  } $::cthulhu_config $cmdconfig]

  dict with config {}
  set here [::realpath $here]
  foreach file [lsort [glob -nocomplain $here/*.tcl]] {
    if {[file tail $file] in ${cthulhu-ignore-tclfiles}} continue
    set libfilename [::cygrelative $::project(srcdir) $libfilename]
  }
}

###
# topic: ccfe65b26705afc498e08d3004031066
# title: Detect where we need to produce a _cases.h file to automate a C source
###
proc cthulhu_detect_cases filename {
  set cfilename [::cygrelative $::project(srcdir) $filename]
  set cases [codebale_detect_cases $filename]
  if {![llength $cases]} return
  set dirname [file dirname $cfilename]
  foreach case $cases {
    lappend result [file join $dirname $case]
  }
  dict set ::thesources $cfilename cases $result
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
    set ofile [file join $bldpath [string trimleft [string map {/ _ .c .o .. {}} $csource] _]]
    lappend pkg_sources $csource
    lappend pkg_objects $ofile
    dict set ::thesources $csource ofile $ofile
  }
  set ILINE "MYINCLUDES="
  foreach ipath $::project(include_paths) {
    append ILINE \\\n"  -I[::cygrelative $::project(src) $ipath]"
  }
  puts $fout $ILINE
  puts $fout {}
  define PKG_OBJECTS [lsort  $pkg_objects]
  define PKG_SOURCES [lsort  $pkg_sources]
  
  #puts $fout "build/$project(c_file):"







|







288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
    set ofile [file join $bldpath [string trimleft [string map {/ _ .c .o .. {}} $csource] _]]
    lappend pkg_sources $csource
    lappend pkg_objects $ofile
    dict set ::thesources $csource ofile $ofile
  }
  set ILINE "MYINCLUDES="
  foreach ipath $::project(include_paths) {
    append ILINE \\\n"  -I[::cygrelative $::project(srcdir) $ipath]"
  }
  puts $fout $ILINE
  puts $fout {}
  define PKG_OBJECTS [lsort  $pkg_objects]
  define PKG_SOURCES [lsort  $pkg_sources]
  
  #puts $fout "build/$project(c_file):"
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
###
# topic: ba1d2c7e8eab96029e434d54f917ef5a
###
proc cthulhu_mkhdr_index {hout docfileout} {
  global project
  set scanlist {}
  foreach file $::project(headers) {
    lappend scanlist [::realpath [file join $::project(src) $file]]
  }
  foreach file $::project(scanlist) {
    lappend scanlist [::realpath [file join $::project(src) $file]]
  }
  ldelete scanlist  [::realpath $::project(src)/generic/$::project(h_file_int)]
  ldelete scanlist  [::realpath $::project(src)/generic/$::project(c_file)]
  puts "WRITING INTERNAL HEADERS TO $hout"
  set fout [open $hout w]
puts $fout "/*
** DO NOT EDIT THIS FILE
** It is automagically generated by scripts/cthulhu.tcl
*/"
  fconfigure $fout -translation crlf
  foreach file $::project(headers_verbatim) {
    puts $fout "/* Verbatim headers */"
    set fullname [file join $::project(src) $file]
    set type [file type $fullname]
    if {$type ne "file"} continue
    puts $fout "/*\n *$file \n*/"
    set fin [open $fullname r]
    puts $fout [read $fin]
    close $fin
  }







|


|

|
|









|







450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
###
# topic: ba1d2c7e8eab96029e434d54f917ef5a
###
proc cthulhu_mkhdr_index {hout docfileout} {
  global project
  set scanlist {}
  foreach file $::project(headers) {
    lappend scanlist [::realpath [file join $::project(srcdir) $file]]
  }
  foreach file $::project(scanlist) {
    lappend scanlist [::realpath [file join $::project(srcdir) $file]]
  }
  ldelete scanlist  [::realpath $::project(srcdir)/generic/$::project(h_file_int)]
  ldelete scanlist  [::realpath $::project(srcdir)/generic/$::project(c_file)]
  puts "WRITING INTERNAL HEADERS TO $hout"
  set fout [open $hout w]
puts $fout "/*
** DO NOT EDIT THIS FILE
** It is automagically generated by scripts/cthulhu.tcl
*/"
  fconfigure $fout -translation crlf
  foreach file $::project(headers_verbatim) {
    puts $fout "/* Verbatim headers */"
    set fullname [file join $::project(srcdir) $file]
    set type [file type $fullname]
    if {$type ne "file"} continue
    puts $fout "/*\n *$file \n*/"
    set fin [open $fullname r]
    puts $fout [read $fin]
    close $fin
  }
Changes to autosetup/lib/odie.tcl.
1
2
3
4
5
6
7














































































































































































































































8
9
10
11
12
13
14
# @synopsis:
#
# ODIE modules adds teacup platform data and integration with
# sherpa
#
use system codebale
# Build procs for this modules















































































































































































































































###
# Initialize our picture of the world
###
array set odie_tcl {
  config_flags {}
  version 8.6







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# @synopsis:
#
# ODIE modules adds teacup platform data and integration with
# sherpa
#
use system codebale
# Build procs for this modules

options {
nodots => "Suppress dots in version numbers in lib names"
pkgdir: => "Where to install the package (default $prefix/lib)"
shlibver:=0.0 => "Shared lib version"
debugbld => "Debug build: symbols, asserts, etc."
nothreads => "Turn off threads"
static => "Build a static library (default off)"
}

proc odie_tea_init conflist {
  array set project $conflist
  
  set nodots [lindex [opt-val nodots] end]
  if {$nodots eq {}} {
    if {$::odie(windows)} {
      set nodots 1
    }
  } elseif {[string is true -strict $nodots]} {
    set nodots 1
  } else {
    set nodots 0
  }
  
  set libver $::project(pkgvers)
  lassign [regsub {^(\d)\.(\d)\.\d+$} [package provide Tcl] {\1.\2}] tclver
  if {[string is true -strict $nodots]} {
    set libver [string map {. ""} $libver]
    set tclver [string map {. ""} $tclver]
  }
  set prefix [get-define prefix]
  set pkgdir [lindex [opt-val pkgdir] end]
  if { $pkgdir eq {}} {
    set pkgdir [file join $prefix lib]
  }
  define pkgdir $pkgdir  
  define docdir [file join $prefix share doc]
  define exadir [file join $prefix share examples]
  define datarootdir [file join $prefix share]

  
  if {[file exists [file join $project(srcdir) .. odie odieConfig.tcl]]} {
    source [file join $project(srcdir) .. odie odieConfig.tcl]
  } else {
    set prefix [get-define prefix]
    if {$prefix eq {}} {
      foreach path {
        /odie
        ~/odie
        c:/odie
        /opt/local
        /opt/odie
        /opt/local/odie
        /usr/local/odie
      } {
        set cffile [file join $path sandbox odie odieConfig.tcl]
        if {[file exists $cffile]} {
  	set prefix [file normalize $path]
  	source $cffile
  	break
        }
      }
    }
    if {$prefix eq {} } { 
       error "No Odie detected"
    }
    if {![file exists [file join $prefix sandbox odie odieConfig.tcl]]} { 
       error "odieConfig.tcl not found"
    }
  }

  foreach {field} [lsort -dictionary [array names package]] {
    define PACKAGE_[string toupper $field] $package($field)
    define PKG_[string toupper $field] $package($field)
  }
  
  define PKG_NAME $::project(name)
  define PKG_VER $::project(pkgvers)
  
  set shlibver [lindex [opt-val shlibver 0.0] end]
  define SHLIB_VER $shlibver
  if {$shlibver ni {0.0 {}}} {
    append shlibspec [format [get-define SH_SOEXTVER] $shlibver]
  } else {
    set shlibspec [get-define SH_SOEXT]
  }
  define SHLIB_SPEC $shlibspec
  
  define EXT_INC_SPEC ""
  define EXT_LIB_DIR_SPEC ""
  define EXT_LIB_SPEC ""

  define TCL_INC_SPEC $::odie_tcl(include_spec)
  if {"tk" in $project(libs)} {
    define TCL_LIB_SPEC "$::odie_tcl(build_stub_lib_spec) $::odie_tk(build_stub_lib_spec)"
  } else {
    define TCL_LIB_SPEC $::odie_tcl(build_stub_lib_spec)
  }
  
  set ::odie_package(name) $::project(pkgname)
  set ::odie_package(version) $::project(pkgvers)
  set ::odie_package(ver) $::project(pkgvers)
  set ::odie_package(libfile) lib${::project(name)}$libver[get-define SHLIB_SPEC]
  set ::odie_package(lib_file) $::odie_package(libfile)
  if {"tk" in $project(libs)} {
    set ::odie_package(libs) $::odie_tk(libs)
  } else {
    set ::odie_package(libs) $::odie_tcl(libs)    
  }
  foreach lib $project(libs) {
    if { $lib in {tcl tk} } continue
    if { "-l$lib" ni $::odie_package(libs) } {
      lappend ::odie_package(libs) "-l$lib"
    }
  }
  set idx 0
  set start 0
  set end 0
  if {"tk" in $project(libs)} {
    set str $::odie_tk(defs)
  } else {
    set str $::odie_tcl(defs)
  }
  set len [string length $str]
  set token {}
  set next {}
  set item {}
  set opts {}
  while {$idx < $len} {
  ###
  # Seek start of opt
  ###
  if {[string range [string trim $item] end-1 end] != "-D"} {
    append item [string index $str $idx]
    incr idx
  } else {
    set end [expr {$idx-3}]
    set token [string trim [string range $str $start $end]]
    lappend opts $token
    set item {}
    set start $idx
    incr idx
  }
  }
  set token [string trim [string range $str $start end]]
  lappend opts $token
  
  set defs "-DPACKAGE_NAME=\"$::project(pkgname)\" -DPACKAGE_TARNAME=\"$::project(name)\" -DPACKAGE_VERSION=\"$::project(pkgvers)\" -DPACKAGE_STRING=\"$::project(pkgname) $::project(pkgvers)\""
  foreach opt [lrange $opts 4 end] {
  append defs " -D$opt"
  }
  set ::odie_package(defs) $defs
  set ::odie_package(cflags)  {}
  define DEFS $::odie_package(defs)
  set cflags { -pipe }
  if {[opt-bool debugbld]} {
  append cflags {${CFLAGS_DEBUG} ${CFLAGS_WARNING}}
  } else {
  append cflags {${CFLAGS_DEFAULT} ${CFLAGS_WARNING}}
  }
  if {[opt-bool static]} {
  } else {
  append cflags { ${SHLIB_CFLAGS}}
  }
  define CCFLAGS $cflags
  
  if {[lindex [opt-val nothreads] end] eq "1"} {
	define TH_CFLAGS ""
	define TH_LIBS ""
	define TH_DEFS ""
  } else {
	define TH_CFLAGS -pthread
	define TH_LIBS ""
	define TH_DEFS "-DTCL_THREADS=1 -DUSE_THREAD_ALLOC=1"
  }
  
  set tdefs {}
  lappend tdefs -DUSE_TCL_STUBS=1
  if {"tk" in $project(libs)} {
    lappend tdefs -DUSE_TK_STUBS=1
  }
  if {[lindex [opt-val debugbld] end] eq "1"} {
	define DEBUG ""
	define NDEBUG "#"
	lappend tdefs -DTCL_MEM_DEBUG=1
  } else {
	define DEBUG "#"
	define NDEBUG ""
  }
  define TDEFS [join $tdefs]
  
  set opt_defs {}
  define OPT_DEFS [join $opt_defs]
  
  define CCFLAGS $::odie_tcl(extra_cflags)
  define CFLAGS_WARN $::odie_tcl(cflags_warning)
  define CFLAGS_OPT $::odie_tcl(cflags_optimize)
  define CFLAGS_DEBUG $::odie_tcl(cflags_debug)
  
  foreach path $::project(include_paths) {
  append ::odie_package(includes) " " -I$path
  }
  
  set ::odie_package(headers) $::project(h_file)
  
  foreach {var val} [array get ::odie_package] {
  define PACKAGE_[string toupper $var] $val
  define PKG_[string toupper $var] $val
  }
  
  
  define LIB lib${::project(name)}$libver[get-define SHLIB_SPEC]
  define PKG_LIB lib${::project(name)}$libver[get-define SHLIB_SPEC]
  
  define PKG_TCL_MODULES_ROOT [file join $::project(srcdir) modules]
  define PKG_TCL_SOURCES ""
  set modules {}
  foreach path [glob -nocomplain [file join $::project(srcdir) modules *]] {
  if {[file isdirectory $path]} {
    lappend modules [file tail $path]
  }
  }
  define PKG_TCL_MODULES $modules
  define PKG_LIB_INIT $::project(name)
}


proc odie_mkhdr {} {
  ###
  # Build mkhdr if we don't have it
  ###
  if {![file exists [::realpath $::odie(mkhdr)]]} {
      cd [::realpath $::odie(src_dir)]
      doexec $::odie(cc) -o mkhdr.o -c scripts/mkhdr.c
      doexec $::odie(cc) mkhdr.o -o mkhdr$::odie(exe_suffix)
      file copy -force mkhdr$::odie(exe_suffix) [::realpath $::odie(mkhdr)]
  }
}

###
# Initialize our picture of the world
###
array set odie_tcl {
  config_flags {}
  version 8.6
295
296
297
298
299
300
301

302
303
304
305
306
307
308
} else {
  set ::odie(tcl_shell) [file join $prefix bin tclsh${::odie_tcl(major_version)}.${::odie_tcl(minor_version)}]
  set ::odie(wish_shell) [file join $prefix bin wish${::odie_tk(major_version)}.${::odie_tk(minor_version)}]
  set ::odie(tclkit)  [file join $prefix bin tclkit${::odie_tcl(major_version)}.${::odie_tcl(minor_version)}]
  set ::odie(wishkit)  [file join $prefix bin wishkit${::odie_tcl(major_version)}.${::odie_tcl(minor_version)}]
  set ::odie(toadkit)  [file join $prefix bin toadkit${::odie_tcl(major_version)}.${::odie_tcl(minor_version)}]
}

define TCL_SHELL   $::odie(tcl_shell)
define WISH_SHELL  $::odie(wish_shell)
define TCLSH_PROG  [info nameofexecutable]
define BUILD_TCLSH [info nameofexecutable]

set ::force_check 0
###







>







533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
} else {
  set ::odie(tcl_shell) [file join $prefix bin tclsh${::odie_tcl(major_version)}.${::odie_tcl(minor_version)}]
  set ::odie(wish_shell) [file join $prefix bin wish${::odie_tk(major_version)}.${::odie_tk(minor_version)}]
  set ::odie(tclkit)  [file join $prefix bin tclkit${::odie_tcl(major_version)}.${::odie_tcl(minor_version)}]
  set ::odie(wishkit)  [file join $prefix bin wishkit${::odie_tcl(major_version)}.${::odie_tcl(minor_version)}]
  set ::odie(toadkit)  [file join $prefix bin toadkit${::odie_tcl(major_version)}.${::odie_tcl(minor_version)}]
}

define TCL_SHELL   $::odie(tcl_shell)
define WISH_SHELL  $::odie(wish_shell)
define TCLSH_PROG  [info nameofexecutable]
define BUILD_TCLSH [info nameofexecutable]

set ::force_check 0
###
Changes to src/odielib/configure.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
###
# This file assembles the machine-generated portions of this
# extension
####

set path [file normalize [file dirname [info script]]]
set ::project(src)  $path
set ::project(path) [file normalize [file dirname [file dirname $path]]]
source [file join $::project(path) odieConfig.tcl]
source [file join $::project(path) ]
source [file join $::odie(sandbox) odielib modules codebale index.tcl]

set ::project(name)           odie
set ::project(pkgname)        odielib






|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
###
# This file assembles the machine-generated portions of this
# extension
####

set path [file normalize [file dirname [info script]]]
set ::project(srcdir)  $path
set ::project(path) [file normalize [file dirname [file dirname $path]]]
source [file join $::project(path) odieConfig.tcl]
source [file join $::project(path) ]
source [file join $::odie(sandbox) odielib modules codebale index.tcl]

set ::project(name)           odie
set ::project(pkgname)        odielib
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
** This file is machine generated by the [info script] file
*/
}]

cthulhu_init
cthulhu_add_cheader_verbatim [file join $::project(path) scripts cthulhu.h]

if {![file exists [file join $::project(src) build]]} {
  file mkdir [file join $::project(src) build]
}

foreach file [glob -nocomplain build/*] {
  file delete $file
}
set config {}

# Exclude the following files from automatic scans
dict set config cthulhu-ignore-hfiles [list $::project(h_file_int)  $::project(h_file)]
dict set config cthulhu-ignore-cfiles [list $::project(c_file) tree.c]
#dict set config cthulhu-ignore-cfiles {}

dict set config_module math build-ignore-cfiles quaternion.c

cthulhu_add_directory [file join $::project(src) build]    $config
cthulhu_add_directory [file join $::project(src) generic]  $config
if {$::tcl_platform(platform) eq "unix"} {
  cthulhu_add_directory [file join $::project(src) unix]  $config
}
foreach path [lsort -dictionary [glob [file join $::project(path) cmodules *]]] {
  if {[file exists [file join $path cthulhu.ini]]} {
    source [file join $path cthulhu.ini]
  }
}

if {[file mtime [file join $::project(src) configure.in]] < [file mtime [file join $::project(path) cthulhu.ini]]} {
  ###
  # If the cthulhu.ini file is modified, it's a tipoff that
  # our configuration could have changed
  ###
  ::codebale::rewrite_autoconf
}

if {[file exists [file join $::project(path) build $::project(declfile)]]} {
  ###
  # Build our stubs definitions
  ###
  file mkdir $::project(src)/build
  cthulhu_mk_stub_decls $::project(pkgname) $docfileout $::project(src)/build
  doexec [info nameofexecutable] [file join $::project(path) .. tcl tools genStubs.tcl] $::project(src)/build [file join $::project(path) build $::project(declfile)] 
}

###
# Build our libinit.c file and internal.h file
###
set hout $::project(src)/generic/$::project(h_file_int)
set docfileout $::project(src)/build/cthulhu.rc
cd $::project(src)
cthulhu_mkhdr_index $hout $docfileout
cthulhu_mk_lib_init.c [file join $::project(src) generic $::project(c_file)]
cthulhu_add_dynamic [file join $::project(src) generic $::project(c_file)] [file join $::project(src) configure.tcl]
cthulhu_add_csource [file join $::project(src) generic $::project(c_file)]

###
# Build our cthulhu.mk file
###
cthulhu_mk_sources build [file join $::project(src) cthulhu.mk]







|
|














|
|

|







|











|
|
|





|
|
|

|
|
|




|
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
** This file is machine generated by the [info script] file
*/
}]

cthulhu_init
cthulhu_add_cheader_verbatim [file join $::project(path) scripts cthulhu.h]

if {![file exists [file join $::project(srcdir) build]]} {
  file mkdir [file join $::project(srcdir) build]
}

foreach file [glob -nocomplain build/*] {
  file delete $file
}
set config {}

# Exclude the following files from automatic scans
dict set config cthulhu-ignore-hfiles [list $::project(h_file_int)  $::project(h_file)]
dict set config cthulhu-ignore-cfiles [list $::project(c_file) tree.c]
#dict set config cthulhu-ignore-cfiles {}

dict set config_module math build-ignore-cfiles quaternion.c

cthulhu_add_directory [file join $::project(srcdir) build]    $config
cthulhu_add_directory [file join $::project(srcdir) generic]  $config
if {$::tcl_platform(platform) eq "unix"} {
  cthulhu_add_directory [file join $::project(srcdir) unix]  $config
}
foreach path [lsort -dictionary [glob [file join $::project(path) cmodules *]]] {
  if {[file exists [file join $path cthulhu.ini]]} {
    source [file join $path cthulhu.ini]
  }
}

if {[file mtime [file join $::project(srcdir) configure.in]] < [file mtime [file join $::project(path) cthulhu.ini]]} {
  ###
  # If the cthulhu.ini file is modified, it's a tipoff that
  # our configuration could have changed
  ###
  ::codebale::rewrite_autoconf
}

if {[file exists [file join $::project(path) build $::project(declfile)]]} {
  ###
  # Build our stubs definitions
  ###
  file mkdir $::project(srcdir)/build
  cthulhu_mk_stub_decls $::project(pkgname) $docfileout $::project(srcdir)/build
  doexec [info nameofexecutable] [file join $::project(path) .. tcl tools genStubs.tcl] $::project(srcdir)/build [file join $::project(path) build $::project(declfile)] 
}

###
# Build our libinit.c file and internal.h file
###
set hout $::project(srcdir)/generic/$::project(h_file_int)
set docfileout $::project(srcdir)/build/cthulhu.rc
cd $::project(srcdir)
cthulhu_mkhdr_index $hout $docfileout
cthulhu_mk_lib_init.c [file join $::project(srcdir) generic $::project(c_file)]
cthulhu_add_dynamic [file join $::project(srcdir) generic $::project(c_file)] [file join $::project(srcdir) configure.tcl]
cthulhu_add_csource [file join $::project(srcdir) generic $::project(c_file)]

###
# Build our cthulhu.mk file
###
cthulhu_mk_sources build [file join $::project(srcdir) cthulhu.mk]
Changes to src/toadkit/configure.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
###
# This file assembles the machine-generated portions of this
# extension
####

set path [file normalize [file dirname [info script]]]
set ::project(src)  $path
set ::project(path) [file normalize [file join $path .. ..]]
if {![info exists ::odie(host)]} {
  source [file join $::project(path) scripts common.tcl]
  puts "CALLED EXTERNALLY"
}
use cc system cthulhu







|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
###
# This file assembles the machine-generated portions of this
# extension
####

set path [file normalize [file dirname [info script]]]
set ::project(srcdir)  $path
set ::project(path) [file normalize [file join $path .. ..]]
if {![info exists ::odie(host)]} {
  source [file join $::project(path) scripts common.tcl]
  puts "CALLED EXTERNALLY"
}
use cc system cthulhu

31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
** This file is machine generated by the [info script] file
*/
}]

cthulhu_init
set ::project(h_file_int) odieInt.h

if {![file exists [file join $::project(src) build]]} {
  file mkdir [file join $::project(src) build]
}
cthulhu_add_cheader_verbatim [file join $::project(path) scripts cthulhu.h]
cthulhu_add_cheader_verbatim [file join $::project(src) generic _macros.h]

foreach file [glob -nocomplain build/*] {
  file delete $file
}
set config {}

# Exclude the following files from automatic scans
dict set config cthulhu-ignore-hfiles [list $::project(h_file_int)  $::project(h_file)]
dict set config cthulhu-ignore-cfiles [list $::project(c_file) tree.c]
#dict set config cthulhu-ignore-cfiles {}

dict set config_module math build-ignore-cfiles quaternion.c

#cthulhu_add_directory [file join $::project(src) build]    $config
#cthulhu_add_directory [file join $::project(src) generic]  $config
#if {$::tcl_platform(platform) eq "unix"} {
#  cthulhu_add_directory [file join $::project(src) unix]  $config
#}
#foreach path [lsort -dictionary [glob [file join $::odie(sandbox) odielib cmodules *]]] {
#  if {[file exists [file join $path cthulhu.ini]]} {
#    source [file join $path cthulhu.ini]
#  }
#}

#foreach dir {logicset odieutil} {
#  set path [file join $::odie(sandbox) odielib cmodules $dir]
#  if {[file exists [file join $path cthulhu.ini]]} {
#    source [file join $path cthulhu.ini]
#  }
#}

###
# Add our Zip file system functions
###
cthulhu_add_csource [file join $::project(src) generic zvfs.c] {scan 0}
cthulhu_add_csource [file join $::project(src) generic zvfsboot.c] {scan 0}
foreach zfile {
  adler32.c compress.c crc32.c deflate.c infback.c inffast.c inflate.c inftrees.c
  trees.c uncompr.c zutil.c
} {
  cthulhu_add_csource [file join $::odie(sandbox) tcl compat zlib $zfile] {scan 0}
}

#cthulhu_include_directory [file join $::odie_build(sandbox) tcl compat zlib]
#cthulhu_include_directory [file join $::odie_build(sandbox) tcl generic]

cthulhu_add_csource [file join $::project(src) generic tclkit_init.c] {scan 0}
if {$::odie(windows)} {
  #cthulhu_include_directory [file join $::odie_build(sandbox) tcl win]
  cthulhu_add_csource [file join $::project(src) win tclsh_packages.c] {scan 0}
  cthulhu_add_csource [file join  $::odie(sandbox) tcl win tclAppInit.c] {scan 0 extra {-DTCL_LOCAL_APPINIT=Toadkit_AppInit -DTCL_LOCAL_MAIN_HOOK=Toadkit_MainHook}}
  #cthulhu_add_csource [file join $::odie_build(sandbox) tcl win tclWinDde.c]
  cthulhu_add_csource [file join $::odie(sandbox) tcl win tclWinReg.c]
} else {
  #cthulhu_include_directory [file join $::odie_build(sandbox) tcl unix]
  cthulhu_add_csource [file join $::project(src) unix tclsh_packages.c] {scan 0}
  cthulhu_add_csource [file join  $::odie(sandbox) tcl unix tclAppInit.c] {scan 0 extra {-DTCL_LOCAL_APPINIT=Toadkit_AppInit -DTCL_LOCAL_MAIN_HOOK=Toadkit_MainHook}}
}
if {$::odie(windows)} {
  if {![file exists [file join $::odie(sandbox) odielib cmodules odieutil password.c]]} {
    puts "BUILDING PASSWORD (toadkit)"
    source [file join $::odie(sandbox) odielib cmodules odieutil mkPassword.tcl]
  }







|
|


|













|
|

|

















|
|










|


|





|







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
** This file is machine generated by the [info script] file
*/
}]

cthulhu_init
set ::project(h_file_int) odieInt.h

if {![file exists [file join $::project(srcdir) build]]} {
  file mkdir [file join $::project(srcdir) build]
}
cthulhu_add_cheader_verbatim [file join $::project(path) scripts cthulhu.h]
cthulhu_add_cheader_verbatim [file join $::project(srcdir) generic _macros.h]

foreach file [glob -nocomplain build/*] {
  file delete $file
}
set config {}

# Exclude the following files from automatic scans
dict set config cthulhu-ignore-hfiles [list $::project(h_file_int)  $::project(h_file)]
dict set config cthulhu-ignore-cfiles [list $::project(c_file) tree.c]
#dict set config cthulhu-ignore-cfiles {}

dict set config_module math build-ignore-cfiles quaternion.c

#cthulhu_add_directory [file join $::project(srcdir) build]    $config
#cthulhu_add_directory [file join $::project(srcdir) generic]  $config
#if {$::tcl_platform(platform) eq "unix"} {
#  cthulhu_add_directory [file join $::project(srcdir) unix]  $config
#}
#foreach path [lsort -dictionary [glob [file join $::odie(sandbox) odielib cmodules *]]] {
#  if {[file exists [file join $path cthulhu.ini]]} {
#    source [file join $path cthulhu.ini]
#  }
#}

#foreach dir {logicset odieutil} {
#  set path [file join $::odie(sandbox) odielib cmodules $dir]
#  if {[file exists [file join $path cthulhu.ini]]} {
#    source [file join $path cthulhu.ini]
#  }
#}

###
# Add our Zip file system functions
###
cthulhu_add_csource [file join $::project(srcdir) generic zvfs.c] {scan 0}
cthulhu_add_csource [file join $::project(srcdir) generic zvfsboot.c] {scan 0}
foreach zfile {
  adler32.c compress.c crc32.c deflate.c infback.c inffast.c inflate.c inftrees.c
  trees.c uncompr.c zutil.c
} {
  cthulhu_add_csource [file join $::odie(sandbox) tcl compat zlib $zfile] {scan 0}
}

#cthulhu_include_directory [file join $::odie_build(sandbox) tcl compat zlib]
#cthulhu_include_directory [file join $::odie_build(sandbox) tcl generic]

cthulhu_add_csource [file join $::project(srcdir) generic tclkit_init.c] {scan 0}
if {$::odie(windows)} {
  #cthulhu_include_directory [file join $::odie_build(sandbox) tcl win]
  cthulhu_add_csource [file join $::project(srcdir) win tclsh_packages.c] {scan 0}
  cthulhu_add_csource [file join  $::odie(sandbox) tcl win tclAppInit.c] {scan 0 extra {-DTCL_LOCAL_APPINIT=Toadkit_AppInit -DTCL_LOCAL_MAIN_HOOK=Toadkit_MainHook}}
  #cthulhu_add_csource [file join $::odie_build(sandbox) tcl win tclWinDde.c]
  cthulhu_add_csource [file join $::odie(sandbox) tcl win tclWinReg.c]
} else {
  #cthulhu_include_directory [file join $::odie_build(sandbox) tcl unix]
  cthulhu_add_csource [file join $::project(srcdir) unix tclsh_packages.c] {scan 0}
  cthulhu_add_csource [file join  $::odie(sandbox) tcl unix tclAppInit.c] {scan 0 extra {-DTCL_LOCAL_APPINIT=Toadkit_AppInit -DTCL_LOCAL_MAIN_HOOK=Toadkit_MainHook}}
}
if {$::odie(windows)} {
  if {![file exists [file join $::odie(sandbox) odielib cmodules odieutil password.c]]} {
    puts "BUILDING PASSWORD (toadkit)"
    source [file join $::odie(sandbox) odielib cmodules odieutil mkPassword.tcl]
  }
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
    }
  }
}

###
# Build our libinit.c file and internal.h file
###
set hout $::project(src)/generic/$::project(h_file_int)
set docfileout $::project(src)/build/cthulhu.rc
cd $::project(src)
cthulhu_mkhdr_index $hout $docfileout
cthulhu_mk_app_init.c [file join $::project(src) generic $::project(c_file)]
cthulhu_add_dynamic [file join $::project(src) generic $::project(c_file)] [file join $::project(src) configure.tcl]
cthulhu_add_csource [file join $::project(src) generic $::project(c_file)] {scan 0}

###
# Build our cthulhu.mk file
###
cthulhu_mk_sources build [file join $::project(src) cthulhu.mk]
make-template [file join $::project(src) Makefile.in]








|
|
|

|
|
|




|
|

115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
    }
  }
}

###
# Build our libinit.c file and internal.h file
###
set hout $::project(srcdir)/generic/$::project(h_file_int)
set docfileout $::project(srcdir)/build/cthulhu.rc
cd $::project(srcdir)
cthulhu_mkhdr_index $hout $docfileout
cthulhu_mk_app_init.c [file join $::project(srcdir) generic $::project(c_file)]
cthulhu_add_dynamic [file join $::project(srcdir) generic $::project(c_file)] [file join $::project(srcdir) configure.tcl]
cthulhu_add_csource [file join $::project(srcdir) generic $::project(c_file)] {scan 0}

###
# Build our cthulhu.mk file
###
cthulhu_mk_sources build [file join $::project(srcdir) cthulhu.mk]
make-template [file join $::project(srcdir) Makefile.in]