Check-in [170e7fa9e8]
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:Stardarized the storage and use of exe_prefix Added a separate array for odie_prog (indicating where programs reside) Fixes to sqlite build to accomidate the lack of the pwd command in non-mingw Windows
Timelines: family | ancestors | descendants | both | autosetup
Files: files | file ages | folders
SHA1: 170e7fa9e8d87ce8d6880e62f807c40fdb314256
User & Date: hypnotoad 2015-03-15 06:39:17
Context
2015-03-18
09:13
Fixed the basekit and sherpa building process. Sherpa now builds directly out of the sanbox/sherpa directory. The basekit builds using sources from sandbox/odielib. Broke the core procs out of autosetup, and placed them in their own file to allow other Tcl applications to access them. check-in: 5617c7dc7d user: hypnotoad tags: autosetup
2015-03-15
06:39
Stardarized the storage and use of exe_prefix Added a separate array for odie_prog (indicating where programs reside) Fixes to sqlite build to accomidate the lack of the pwd command in non-mingw Windows check-in: 170e7fa9e8 user: hypnotoad tags: autosetup
2015-03-13
12:45
Remember your fossil check-in: 8b085269ca user: hypnotoad tags: autosetup
Changes
Unified Diff Ignore Whitespace Patch
Changes to apps/sherpa/src/main.tcl.
56
57
58
59
60
61
62
63
64




65
66
67
68
69
70
71
###
# topic: d433b7cb5066412cd1b6e065129e91da
# description:
#    Find package attempts to load packages live from source, and failing that
#    use an internal version
###
proc ::find_package package {
  if {[file exists [file join $::odie(odie_src_dir) modules $package index.tcl]]} {
    uplevel #0 source [file join $::odie(odie_src_dir) modules $package index.tcl]




  } elseif {[file exists [file join $::odie(sandbox) taolib modules $package index.tcl]]} {
    uplevel #0 source [file join $::odie(sandbox) taolib modules $package index.tcl]
  } else {
    uplevel #0 [list package require $package]
  }
}








|
|
>
>
>
>







56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
###
# topic: d433b7cb5066412cd1b6e065129e91da
# description:
#    Find package attempts to load packages live from source, and failing that
#    use an internal version
###
proc ::find_package package {
  if {[file exists [file join $::odie(src_dir) modules $package index.tcl]]} {
    uplevel #0 source [file join $::odie(src_dir) modules $package index.tcl]
  } elseif {[file exists [file join $::odie(sandbox) odielib modules $package index.tcl]]} {
    uplevel #0 source [file join $::odie(sandbox) odielib modules $package index.tcl]
  } elseif {[file exists [file join $::odie(sandbox) sherpa modules $package index.tcl]]} {
    uplevel #0 source [file join $::odie(sandbox) sherpa modules $package index.tcl]
  } elseif {[file exists [file join $::odie(sandbox) taolib modules $package index.tcl]]} {
    uplevel #0 source [file join $::odie(sandbox) taolib modules $package index.tcl]
  } else {
    uplevel #0 [list package require $package]
  }
}

Changes to apps/temple/src/main.tcl.
37
38
39
40
41
42
43
44
45
46
47
48
49


50
51
52
53
54
55
56
#    use an internal version
###
proc ::find_package package {
  if {[file exists [file join $::odie(sandbox) tcllib modules $package index.tcl]]} {
    uplevel #0 source [file join $::odie(sandbox) tcllib modules $package index.tcl]
  } elseif {[file exists [file join $::odie(sandbox) tcllib modules $package $package.tcl]]} {
    uplevel #0 source [file join $::odie(sandbox) tcllib modules $package $package.tcl]
  } elseif {[file exists [file join $::odie(odie_src_dir) modules $package index.tcl]]} {
    uplevel #0 source [file join $::odie(odie_src_dir) modules $package index.tcl]
  } elseif {[file exists [file join $::odie(odie_src_dir) modules $package index.tcl]]} {
    uplevel #0 source [file join $::odie(odie_src_dir) modules $package $package.tcl]
  } elseif {[file exists [file join $::odie(sandbox) taolib modules $package index.tcl]]} {
    uplevel #0 source [file join $::odie(sandbox) taolib modules $package index.tcl]


  } else {
    uplevel #0 [list package require $package]
  }
}

package require teapotclient
find_package odie







|
|
|
|
|
|
>
>







37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#    use an internal version
###
proc ::find_package package {
  if {[file exists [file join $::odie(sandbox) tcllib modules $package index.tcl]]} {
    uplevel #0 source [file join $::odie(sandbox) tcllib modules $package index.tcl]
  } elseif {[file exists [file join $::odie(sandbox) tcllib modules $package $package.tcl]]} {
    uplevel #0 source [file join $::odie(sandbox) tcllib modules $package $package.tcl]
  } elseif {[file exists [file join $::odie(src_dir) modules $package index.tcl]]} {
    uplevel #0 source [file join $::odie(src_dir) modules $package index.tcl]
  } elseif {[file exists [file join $::odie(sandbox) taolib modules $package index.tcl]]} {
    uplevel #0 source [file join $::odie(sandbox) taolib modules $package index.tcl]
  } elseif {[file exists [file join $::odie(sandbox) odielib modules $package index.tcl]]} {
    uplevel #0 source [file join $::odie(sandbox) odielib modules $package index.tcl]
  } elseif {[file exists [file join $::odie(sandbox) sherpa modules $package index.tcl]]} {
    uplevel #0 source [file join $::odie(sandbox) sherpa modules $package index.tcl]
  } else {
    uplevel #0 [list package require $package]
  }
}

package require teapotclient
find_package odie
Changes to auto.def.
12
13
14
15
16
17
18
19

20
21
22
23
24
25
26
 * if "none" is specified, Tk is disabled}
  windowsystem:native    =>  {For platforms with multiple windowing systems, which system to target.
native - The native window system
x11 - An x11 emulation environment
none - Disable Tk support (equivilent to tkbranch=none)
}
  64bit:detect		=> {Enable 64 bit support (default detect)}
  fossil:               => {Location of fossil executable}

}

set ::odie(src_dir) [file dirname [file-normalize [info script]]]

switch [opt-val 64bit] {
  amd64 -
  x64 -







|
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * if "none" is specified, Tk is disabled}
  windowsystem:native    =>  {For platforms with multiple windowing systems, which system to target.
native - The native window system
x11 - An x11 emulation environment
none - Disable Tk support (equivilent to tkbranch=none)
}
  64bit:detect		=> {Enable 64 bit support (default detect)}
  fossil:               => {Location of native fossil executable (default detect)}
  tclsh:                => {Location of native tcl shell (default detect)}
}

set ::odie(src_dir) [file dirname [file-normalize [info script]]]

switch [opt-val 64bit] {
  amd64 -
  x64 -
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
set ::odie_config(64bit) $::odie(64bit)
set ::odie(host) [get-define host]
set ::odie(target) [get-define target]

#--------------------------------------------------------------------
# Determines the correct executable file extension (.exe)
#--------------------------------------------------------------------
define EXE $::odie(exe)
define EXE_SUFFIX $::odie(exe)
define target [get-define target]

set ::odie(sandbox_path) [opt-val sandbox]
if {$::odie(sandbox_path) eq {}} {
  set ::odie(sandbox_path) [file join $::odie(prefix) sandbox]
} else {
  set ::odie_config(sandbox) $::odie(sandbox_path)
}
set ::odie(download_path) [opt-val download]
if {$::odie(download_path) eq {}} {
  set ::odie(download_path) [file join $::odie(prefix) download]
} else {
  set ::odie_config(download) $::odie(download_path)
}
set ::odie(fossil) [lindex [opt-val fossil] end]
if {$::odie(fossil) eq {}} {
  set ::odie(fossil) [lindex [find-an-executable -required fossil] 0]
  define FOSSIL_PROG $::odie(fossil)
} else {
  set ::odie_config(fossil) $::odie(fossil)
}












foreach {program required domake} {
  zip 	 1 0
  unzip  1 0
  tar    1 0
  git    0 1
  strip  0 0
  mkhdr  0 1
  sherpa 0 1
} {
  if {$required} {
    set exename [lindex [find-an-executable -required $program] 0]
  } else {
    set exename [lindex [find-an-executable $program] 0]
  }
  if {$domake && $exename eq {}} {
    set prog_build($program) 1
    set exename [file join $::odie(prefix) bin ${program}$::odie(exe)]
  } else {
    set prog_build($program) 0
  }

  define [string toupper ${program}_prog] $exename
}

# XXX SC_ODIE
# XXX SC_ENABLE_SHARED
# XXX ODIE_PROG_TCLSH
# XXX ODIE_PROG_WISH








|
|

















<



>
>
>
>
>
>
>
>
>
>
>

















|



>
|







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
set ::odie_config(64bit) $::odie(64bit)
set ::odie(host) [get-define host]
set ::odie(target) [get-define target]

#--------------------------------------------------------------------
# Determines the correct executable file extension (.exe)
#--------------------------------------------------------------------
define EXE $::odie(exe_suffix)
define EXE_SUFFIX $::odie(exe_suffix)
define target [get-define target]

set ::odie(sandbox_path) [opt-val sandbox]
if {$::odie(sandbox_path) eq {}} {
  set ::odie(sandbox_path) [file join $::odie(prefix) sandbox]
} else {
  set ::odie_config(sandbox) $::odie(sandbox_path)
}
set ::odie(download_path) [opt-val download]
if {$::odie(download_path) eq {}} {
  set ::odie(download_path) [file join $::odie(prefix) download]
} else {
  set ::odie_config(download) $::odie(download_path)
}
set ::odie(fossil) [lindex [opt-val fossil] end]
if {$::odie(fossil) eq {}} {
  set ::odie(fossil) [lindex [find-an-executable -required fossil] 0]

} else {
  set ::odie_config(fossil) $::odie(fossil)
}
set ::odie_prog(fossil) $::odie(fossil)
define FOSSIL_PROG $::odie(fossil)

set ::odie(build_tclsh) [lindex [opt-val tclsh] end]
if {$::odie(build_tclsh) eq {}} {
  set ::odie(build_tclsh) [info nameofexecutable]
} else {
  set ::odie_config(tclsh) $::odie(build_tclsh)
}
set ::odie_prog(tclsh) $::odie(build_tclsh)
define ODIE_BUILD_TCLSH $::odie_config(tclsh)

foreach {program required domake} {
  zip 	 1 0
  unzip  1 0
  tar    1 0
  git    0 1
  strip  0 0
  mkhdr  0 1
  sherpa 0 1
} {
  if {$required} {
    set exename [lindex [find-an-executable -required $program] 0]
  } else {
    set exename [lindex [find-an-executable $program] 0]
  }
  if {$domake && $exename eq {}} {
    set prog_build($program) 1
    set exename [file join $::odie(prefix) bin ${program}$::odie(exe_suffix)]
  } else {
    set prog_build($program) 0
  }
  set odie_prog($program) [::realpath $exename]
  define [string toupper ${program}_prog] [::cygpath $exename]
}

# XXX SC_ODIE
# XXX SC_ENABLE_SHARED
# XXX ODIE_PROG_TCLSH
# XXX ODIE_PROG_WISH

163
164
165
166
167
168
169







170
171
172
173
174
175
176
177
178




179
180
181
182
183
184
185
        }
      }
    }
  }
}
set ::odie_config(tkbranch) $::odie_tk(fossil_branch)
set ::odie_config(windowsystem) $::odie(window_system)








foreach {field value} [array get ::odie] {
  define [string toupper ODIE_$field] $value
}
foreach {field value} [array get ::odie_tcl] {
  define [string toupper TCL_$field] $value
}
foreach {field value} [array get ::odie_tk] {
  define [string toupper TK_$field] $value




}
define FOSSIL_CHECKOUT $::odie(fossil_checkout)
make-template odieConfig.sh.in odieConfig.sh
make-template odieConfig.tcl.in odieConfig.tcl

set fout [open [file join $::odie(src_dir) odieConfig.tcl] a]
puts $fout "array set ::odie_config \{"







>
>
>
>
>
>
>









>
>
>
>







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
        }
      }
    }
  }
}
set ::odie_config(tkbranch) $::odie_tk(fossil_branch)
set ::odie_config(windowsystem) $::odie(window_system)

###
# Detect a CC to use
###
if {![info exists ::odie(cc)]} {
  set ::odie(cc) [get-define CC]
}

foreach {field value} [array get ::odie] {
  define [string toupper ODIE_$field] $value
}
foreach {field value} [array get ::odie_tcl] {
  define [string toupper TCL_$field] $value
}
foreach {field value} [array get ::odie_tk] {
  define [string toupper TK_$field] $value
}
foreach {field value} [array get ::odie_prog] {
  define [string toupper ODIE_PROG_$field] $value
  define [string toupper ${field}_PROG] $value
}
define FOSSIL_CHECKOUT $::odie(fossil_checkout)
make-template odieConfig.sh.in odieConfig.sh
make-template odieConfig.tcl.in odieConfig.tcl

set fout [open [file join $::odie(src_dir) odieConfig.tcl] a]
puts $fout "array set ::odie_config \{"
201
202
203
204
205
206
207






208
209
210
211
212
213
214
puts $fout "\}"

puts $fout "array set ::odie_tk \{"
foreach {field} [lsort  [array names ::odie_tk]] {
  puts $fout "  [list $field $::odie_tk($field)]"
}
puts $fout "\}"







close $fout

set fout [open [file join $::odie(src_dir) odieConfig.sh] a]
set opts {}
foreach {field} [lsort  [array names ::odie_config]] {
  set value $::odie_config($field)







>
>
>
>
>
>







224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
puts $fout "\}"

puts $fout "array set ::odie_tk \{"
foreach {field} [lsort  [array names ::odie_tk]] {
  puts $fout "  [list $field $::odie_tk($field)]"
}
puts $fout "\}"

puts $fout "array set ::odie_prog \{"
foreach {field} [lsort  [array names ::odie_prog]] {
  puts $fout "  [list $field $::odie_prog($field)]"
}
puts $fout "\}"

close $fout

set fout [open [file join $::odie(src_dir) odieConfig.sh] a]
set opts {}
foreach {field} [lsort  [array names ::odie_config]] {
  set value $::odie_config($field)
242
243
244
245
246
247
248





  if {[llength $value]!=1} {
    set value '$value'
  }
  puts $fout "TK_[string toupper $field]=$value"
}

close $fout












>
>
>
>
>
271
272
273
274
275
276
277
278
279
280
281
282
  if {[llength $value]!=1} {
    set value '$value'
  }
  puts $fout "TK_[string toupper $field]=$value"
}

close $fout

###
# Configure toadkit
###
source [file join $::odie(src_dir) src toadkit configure.tcl]
Changes to autosetup/lib/cthulhu.tcl.
1
2
3
4
5
6







7
8
9
10
11
12
13
###
# Utilities for automating the build process of C extensions
###
use codebale

#::namespace eval ::cthulhu {}








###
# 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]






>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
###
# Utilities for automating the build process of C extensions
###
use codebale

#::namespace eval ::cthulhu {}

###
# title: define which modules the source we are adding contributes to
###
proc cthulhu_config args {
  set ::cthulhu_config [dict merge $::cthulhu_config $args]
}

###
# 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]
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
# 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
    #::cthulhu_read_csourcefile $file
  }
}

###
# topic: 91e4d7da8dd82d78af41561360deab10
# title: Signal for a C source to be read with mkhdr
###
proc cthulhu_add_csource {filename {config {}}} {


  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
    }
  }
}

###
# topic: f11da5f705442524715e8f8fe9af5276
# title: Add a path containing C code
###
proc cthulhu_add_directory {here config} {

  set cthulhu-ignore-hfiles {}
  set cthulhu-ignore-cfiles {}
  set build-ignore-cfiles {}
  set cthulhu-trace-cfiles {}


  dict with config {}
  
  set here [::realpath $here]
  ###
  # Execute any .tcl scripts in the generic directory
  ###
  foreach file [lsort  [glob -nocomplain [file join $here *.tcl]]] {







<







|
>
>
















|
>
|
|
|
|
>
>







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
# 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
    }
  }
}

###
# topic: f11da5f705442524715e8f8fe9af5276
# title: Add a path containing C code
###
proc cthulhu_add_directory {here {cmdconfig {}}} {
  set config [dict merge {
    cthulhu-ignore-hfiles {}
    cthulhu-ignore-cfiles {}
    build-ignore-cfiles {}
    cthulhu-trace-cfiles {}
  } $::cthulhu_config $cmdconfig]

  dict with config {}
  
  set here [::realpath $here]
  ###
  # Execute any .tcl scripts in the generic directory
  ###
  foreach file [lsort  [glob -nocomplain [file join $here *.tcl]]] {
105
106
107
108
109
110
111
112

113


114
115
116
117
118
119
120
121
122
123
  dict set ::thesources $cfilename tclscript $tclfilename
}

###
# topic: d10665e8da4dd0781bb0a9ced5486e40
# title: Add a pure-tcl library
###
proc cthulhu_add_library {here config} {

  set cthulhu-ignore-tclfiles {}


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

###
# topic: ccfe65b26705afc498e08d3004031066







|
>
|
>
>


|







116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
  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
137
138
139
140
141
142
143
144



145
146
147
148
149
150
151
###
# topic: 41d95037e5a1cab76939150efdef8939
# title: Declare an end to modifications of ::project
# description:
#    This directive is placed after the last set ::project(X) Y
#    but before the first ::cthulhu_add_*
###
proc cthulhu_init {} {



  set ::project(strlen) [string length $::project(path)/]
  set ::project(cases)  {}
  set ::project(sources)  {}
  set ::project(headers)  {}
  set ::project(scanlist) {}
  set ::project(headers_verbatim) {}
}







|
>
>
>







151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
###
# topic: 41d95037e5a1cab76939150efdef8939
# title: Declare an end to modifications of ::project
# description:
#    This directive is placed after the last set ::project(X) Y
#    but before the first ::cthulhu_add_*
###
proc cthulhu_init args {
  set ::cthulhu_config [dict merge {
    target pkg
  } $args]
  set ::project(strlen) [string length $::project(path)/]
  set ::project(cases)  {}
  set ::project(sources)  {}
  set ::project(headers)  {}
  set ::project(scanlist) {}
  set ::project(headers_verbatim) {}
}
251
252
253
254
255
256
257
258
259

260
261
262
263
264
265
266
267
268
269
270
271
272
  puts $cout "  return TCL_OK\;\n\}"
  close $cout
}

###
# topic: 06bca7e2bddebdca69537fc3a9a0735f
###
proc cthulhu_mk_sources outfile {
  global project

  set fout [open $outfile w]
  fconfigure $fout -translation crlf
  set pkg_sources {}
  set pkg_objects {}
  foreach {csource} $::project(sources) {
    set ofile build/[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]"







|

>





|







268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
  puts $cout "  return TCL_OK\;\n\}"
  close $cout
}

###
# topic: 06bca7e2bddebdca69537fc3a9a0735f
###
proc cthulhu_mk_sources {bldpath outfile} {
  global project
  file mkdir $bldpath
  set fout [open $outfile w]
  fconfigure $fout -translation crlf
  set pkg_sources {}
  set pkg_objects {}
  foreach {csource} $::project(sources) {
    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]"
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
    return [list exec [::realpath $exename]]
  }
  if {[info exists ::odie(mkhdr)]} {
    if {[file exists [::realpath $::odie(mkhdr)]]} {
      return [list exec [::realpath $::odie(mkhdr)]]
    } 
  }
  doexec $::odie(cc) -o mkhdr.o -c $::odie(odie_src_dir)/scripts/mkhdr.c
  doexec $::odie(cc) mkhdr.o -o mkhdr$::odie(exe_suffix)
  file copy -force mkhdr$::odie(exe_suffix) [::realpath $::odie(mkhdr)]
  return [list exec [::realpath $::odie(mkhdr)]]
  error {mkhdr not available}
}


proc cthulhu_mkhdr args {
  set cmd [cthulhu_find_mkhdr]
  {*}${cmd} {*}$args
}

array set ::project {
  include_paths {}
  sources {}
  tcl_sources {}
  modules {}
}









|



















<
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555

    return [list exec [::realpath $exename]]
  }
  if {[info exists ::odie(mkhdr)]} {
    if {[file exists [::realpath $::odie(mkhdr)]]} {
      return [list exec [::realpath $::odie(mkhdr)]]
    } 
  }
  doexec $::odie(cc) -o mkhdr.o -c $::odie(src_dir)/scripts/mkhdr.c
  doexec $::odie(cc) mkhdr.o -o mkhdr$::odie(exe_suffix)
  file copy -force mkhdr$::odie(exe_suffix) [::realpath $::odie(mkhdr)]
  return [list exec [::realpath $::odie(mkhdr)]]
  error {mkhdr not available}
}


proc cthulhu_mkhdr args {
  set cmd [cthulhu_find_mkhdr]
  {*}${cmd} {*}$args
}

array set ::project {
  include_paths {}
  sources {}
  tcl_sources {}
  modules {}
}


Changes to autosetup/lib/odie.tcl.
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
  version 8.6
  major_version 8
  minor_version 6
  patch_level .4
  fossil_branch release
}
array set odie {
  exe {}
  platform unix
  tea_platform_dir unix
  tcl_platform_dir unix
  tcl_config_flags {}
  tk_config_flags {}
  64bit {}
  windows 0
  system generic
  target generic
  os generic
  os_version {}
  teacup_os generic
  cpu {}
  window_system {}
  fossil_checkout .fslckout
  teacup_profile {}
  tk_binary_platform {}
  mirror_url http://fossil.etoyoc.com/fossil
}
set ::odie(build_tclsh) [info nameofexecutable]

# Make sure srcdir is fully qualified!
set ::odie(cpu) [exec uname -m]
set ::odie(os)  [exec uname -s]
set ::odie(system) ${::odie(os)}-${::odie(cpu)}

set vfscp {cp -a}
set ::odie(windows) 0
set ::odie(64bit) [expr {$::odie(cpu) in {amd64 x64 x86_64}}]

puts [list BUILD [get-define build]]
puts [list HOST [get-define host]]
puts [list TARGET [get-define target]]

###
# Sort out some slight differences between Visual studio
# based builds and mingw/cygwin
###
switch -glob -- [get-define build] {
  *-*-ming* - *-*-cygwin - *-*-msys {
    ###







|



















<










<
<
<
<







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
  version 8.6
  major_version 8
  minor_version 6
  patch_level .4
  fossil_branch release
}
array set odie {
  exe_suffix {}
  platform unix
  tea_platform_dir unix
  tcl_platform_dir unix
  tcl_config_flags {}
  tk_config_flags {}
  64bit {}
  windows 0
  system generic
  target generic
  os generic
  os_version {}
  teacup_os generic
  cpu {}
  window_system {}
  fossil_checkout .fslckout
  teacup_profile {}
  tk_binary_platform {}
  mirror_url http://fossil.etoyoc.com/fossil
}


# Make sure srcdir is fully qualified!
set ::odie(cpu) [exec uname -m]
set ::odie(os)  [exec uname -s]
set ::odie(system) ${::odie(os)}-${::odie(cpu)}

set vfscp {cp -a}
set ::odie(windows) 0
set ::odie(64bit) [expr {$::odie(cpu) in {amd64 x64 x86_64}}]





###
# Sort out some slight differences between Visual studio
# based builds and mingw/cygwin
###
switch -glob -- [get-define build] {
  *-*-ming* - *-*-cygwin - *-*-msys {
    ###
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
    if {$::odie(64bit)} {
      set ::odie(teacup_profile) win32-ix86
      set ::odie(cpu) ix86
    } else {
      set ::odie(teacup_profile) win32-x86_64
      set ::odie(cpu) x86_64
    }
    set ::odie(exe) .exe
  }
  *-*-linux* {
    set glibcver [exec ldd --version]
    set major [lindex [split $glibcver .] 0]
    set minor [lindex [split $glibcver .] 1]
    set ::odie(teacup_os) linux-glibc$major.$minor
    set ::odie(system) linux-$::odie(cpu)







|







128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
    if {$::odie(64bit)} {
      set ::odie(teacup_profile) win32-ix86
      set ::odie(cpu) ix86
    } else {
      set ::odie(teacup_profile) win32-x86_64
      set ::odie(cpu) x86_64
    }
    set ::odie(exe_suffix) .exe
  }
  *-*-linux* {
    set glibcver [exec ldd --version]
    set major [lindex [split $glibcver .] 0]
    set minor [lindex [split $glibcver .] 1]
    set ::odie(teacup_os) linux-glibc$major.$minor
    set ::odie(system) linux-$::odie(cpu)
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
      set ::odie(teacup_os) win32
      set ::odie(windows) 1
      set ::odie(tclsrc_dir) win
      set ::odie(platform_dir) win
      set ::odie(64bit) 1
      set ::odie(teacup_profile) win32-x86_64
      set ::odie(cpu) x86_64
      set ::odie(exe) .exe 
    }
    windows-ix86 - win32-ix86 {
      set ::odie(platform) windows
      set ::odie(system) windows
      set ::odie(teacup_os) win32
      set ::odie(windows) 1
      set ::odie(tclsrc_dir) win
      set ::odie(platform_dir) win
      set ::odie(64bit) 0
      set ::odie(teacup_profile) win32-ix86
      set ::odie(cpu) ix86
      set ::odie(exe) .exe
    }
    default {
      switch -glob -nocase -- [get-define target] {
        *macosx* - *-*-darwin* {
          # We don't know the version, so punt to
          # modern 64bit ix86
          set ::odie(os) macosx







|











|







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
      set ::odie(teacup_os) win32
      set ::odie(windows) 1
      set ::odie(tclsrc_dir) win
      set ::odie(platform_dir) win
      set ::odie(64bit) 1
      set ::odie(teacup_profile) win32-x86_64
      set ::odie(cpu) x86_64
      set ::odie(exe_suffix) .exe 
    }
    windows-ix86 - win32-ix86 {
      set ::odie(platform) windows
      set ::odie(system) windows
      set ::odie(teacup_os) win32
      set ::odie(windows) 1
      set ::odie(tclsrc_dir) win
      set ::odie(platform_dir) win
      set ::odie(64bit) 0
      set ::odie(teacup_profile) win32-ix86
      set ::odie(cpu) ix86
      set ::odie(exe_suffix) .exe
    }
    default {
      switch -glob -nocase -- [get-define target] {
        *macosx* - *-*-darwin* {
          # We don't know the version, so punt to
          # modern 64bit ix86
          set ::odie(os) macosx
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
          if {$::odie(64bit)} {
            set ::odie(teacup_profile) win32-x86_64
            set ::odie(cpu) x86_64
          } else {
            set ::odie(teacup_profile) win32-ix86
            set ::odie(cpu) ix86
          }
          set ::odie(exe) .exe
        }
        *-*-linux* {
          # Assume a modern linux found in teacup profiles
          set ::odie(teacup_os) linux-glibc2.3
          set ::odie(system) linux-$::odie(cpu)
          set ::odie(os) linux 
        }







|







211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
          if {$::odie(64bit)} {
            set ::odie(teacup_profile) win32-x86_64
            set ::odie(cpu) x86_64
          } else {
            set ::odie(teacup_profile) win32-ix86
            set ::odie(cpu) ix86
          }
          set ::odie(exe_suffix) .exe
        }
        *-*-linux* {
          # Assume a modern linux found in teacup profiles
          set ::odie(teacup_os) linux-glibc2.3
          set ::odie(system) linux-$::odie(cpu)
          set ::odie(os) linux 
        }
311
312
313
314
315
316
317
318
319
320
321
322
323
324

set ::force_check 0
###
# Under MSYS/Cygwin transform the Cygwinized paths
# pack into proper names for Windows
###
foreach path {
  sandbox download src_dir tcl_shell wish_shell
  fossil git zip unzip sherpa lib local_repo
} {
  if {[info exists ::odie($path)]} {
    set ::odie_build($path) [::realpath $::odie($path)]
  }
}







|






306
307
308
309
310
311
312
313
314
315
316
317
318
319

set ::force_check 0
###
# Under MSYS/Cygwin transform the Cygwinized paths
# pack into proper names for Windows
###
foreach path {
  sandbox download src_dir tcl_shell wish_shell build_tclsh
  fossil git zip unzip sherpa lib local_repo
} {
  if {[info exists ::odie($path)]} {
    set ::odie_build($path) [::realpath $::odie($path)]
  }
}
Changes to scripts/common.tcl.
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
    }
  }
}

proc ::sherpa_bootstrap::build_sak {pkg action} {
  if {$action eq "install"} {
    set PKG_SRCPATH [sandbox_path $pkg]
    doexec $::odie(tcl_shell) [file join $PKG_SRCPATH installer.tcl] \
                -no-examples -no-nroff -no-html \
                -no-wait -no-gui
  }
}

proc ::sherpa_bootstrap::build_kettle {pkg action} {
  set PKG_SRCPATH [sandbox_path $pkg]
  if {$pkg eq "kettle"} {
    doexec $::odie(tcl_shell) [file join $PKG_SRCPATH kettle] -f [file join $PKG_SRCPATH build.tcl] $action
  } else {
    doexec $::odie(tcl_shell) $::odie(kettle) -f [file join $PKG_SRCPATH build.tcl] $action
  }
}

proc ::sherpa_bootstrap::build_sqlite {pkg action} {
    ###
    # Sqlite
    ###
    set SQLITE_VERSION 3.8.7.4
    set SQLITE_TFNAME sqlite-autoconf-3080704
    set SQLITE_SRCPATH $::odie(sandbox)/sqlite
    set SQLITE_URL http://sqlite.org/2014/${SQLITE_TFNAME}.tar.gz
    # In MSYS, tar may not understand the prefix
    set download_msys [exec pwd]
    set SQLITE_TARBALL [file join [::realpath $::odie(download)] sqlite${SQLITE_VERSION}.tar.gz]
    cd [::realpath $::odie(odie_src_dir)]
    if {![file exists $SQLITE_TARBALL]} {
      doexec $::odie(tcl_shell) scripts/url-get.tcl ${SQLITE_URL} ${SQLITE_TARBALL}
    }
    if {![file exists ${SQLITE_SRCPATH}/README]} {
      file delete -force ${SQLITE_SRCPATH}
      cd $::odie(sandbox)
      doexec tar xfz [::cygpath ${SQLITE_TARBALL}]
      file rename -force ${SQLITE_TFNAME} ${SQLITE_SRCPATH}
    }







|








|

|












|

|

|







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
    }
  }
}

proc ::sherpa_bootstrap::build_sak {pkg action} {
  if {$action eq "install"} {
    set PKG_SRCPATH [sandbox_path $pkg]
    doexec $::odie(build_tclsh) [file join $PKG_SRCPATH installer.tcl] \
                -no-examples -no-nroff -no-html \
                -no-wait -no-gui
  }
}

proc ::sherpa_bootstrap::build_kettle {pkg action} {
  set PKG_SRCPATH [sandbox_path $pkg]
  if {$pkg eq "kettle"} {
    doexec $::odie(build_tclsh) [file join $PKG_SRCPATH kettle] -f [file join $PKG_SRCPATH build.tcl] $action
  } else {
    doexec $::odie(build_tclsh) $::odie(kettle) -f [file join $PKG_SRCPATH build.tcl] $action
  }
}

proc ::sherpa_bootstrap::build_sqlite {pkg action} {
    ###
    # Sqlite
    ###
    set SQLITE_VERSION 3.8.7.4
    set SQLITE_TFNAME sqlite-autoconf-3080704
    set SQLITE_SRCPATH $::odie(sandbox)/sqlite
    set SQLITE_URL http://sqlite.org/2014/${SQLITE_TFNAME}.tar.gz
    # In MSYS, tar may not understand the prefix
    set download_msys [::cygpath [pwd]]
    set SQLITE_TARBALL [file join [::realpath $::odie(download)] sqlite${SQLITE_VERSION}.tar.gz]
    cd [::realpath $::odie(src_dir)]
    if {![file exists $SQLITE_TARBALL]} {
      doexec $::odie(build_tclsh) scripts/url-get.tcl ${SQLITE_URL} ${SQLITE_TARBALL}
    }
    if {![file exists ${SQLITE_SRCPATH}/README]} {
      file delete -force ${SQLITE_SRCPATH}
      cd $::odie(sandbox)
      doexec tar xfz [::cygpath ${SQLITE_TARBALL}]
      file rename -force ${SQLITE_TFNAME} ${SQLITE_SRCPATH}
    }
Changes to scripts/make_sherpa.tcl.
34
35
36
37
38
39
40
41
42
43
44
source [file join $path .. odielib modules codebale index.tcl]

###
# Build supporting libraries needed by Sherpa
##

# Rebuild sherpa
set SHERPA_SRCPATH $::odie(odie_src_dir)/apps/sherpa
cd ${SHERPA_SRCPATH}
doexec make clean
doexec make install







|



34
35
36
37
38
39
40
41
42
43
44
source [file join $path .. odielib modules codebale index.tcl]

###
# Build supporting libraries needed by Sherpa
##

# Rebuild sherpa
set SHERPA_SRCPATH $::odie(src_dir)/apps/sherpa
cd ${SHERPA_SRCPATH}
doexec make clean
doexec make install
Changes to scripts/make_sqlite.tcl.
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
set SQLITE_VERSION 3.8.7.4
set SQLITE_TFNAME sqlite-autoconf-3080704
set SQLITE_SRCPATH $::odie(sandbox)/sqlite
set SQLITE_URL http://sqlite.org/2014/${SQLITE_TFNAME}.tar.gz
# In MSYS, tar may not understand the prefix
set download_msys [exec pwd]
set SQLITE_TARBALL [file join [::realpath $::odie(download)] sqlite${SQLITE_VERSION}.tar.gz]
cd [::realpath $::odie(odie_src_dir)]
if {![file exists $SQLITE_TARBALL]} {
  doexec $::odie(tcl_shell) scripts/url-get.tcl ${SQLITE_URL} ${SQLITE_TARBALL}
}
if {![file exists ${SQLITE_SRCPATH}/README]} {
  file delete -force ${SQLITE_SRCPATH}
  cd $::odie(sandbox)
  doexec tar xfz [::cygpath ${SQLITE_TARBALL}]
  file rename -force ${SQLITE_TFNAME} ${SQLITE_SRCPATH}
}







|

|







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
set SQLITE_VERSION 3.8.7.4
set SQLITE_TFNAME sqlite-autoconf-3080704
set SQLITE_SRCPATH $::odie(sandbox)/sqlite
set SQLITE_URL http://sqlite.org/2014/${SQLITE_TFNAME}.tar.gz
# In MSYS, tar may not understand the prefix
set download_msys [exec pwd]
set SQLITE_TARBALL [file join [::realpath $::odie(download)] sqlite${SQLITE_VERSION}.tar.gz]
cd [::realpath $::odie(src_dir)]
if {![file exists $SQLITE_TARBALL]} {
  doexec $::odie(build_tclsh) scripts/url-get.tcl ${SQLITE_URL} ${SQLITE_TARBALL}
}
if {![file exists ${SQLITE_SRCPATH}/README]} {
  file delete -force ${SQLITE_SRCPATH}
  cd $::odie(sandbox)
  doexec tar xfz [::cygpath ${SQLITE_TARBALL}]
  file rename -force ${SQLITE_TFNAME} ${SQLITE_SRCPATH}
}
Changes to src/odielib/configure.tcl.
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
###
# 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 $::odie(sandbox) odielib modules odie index.tcl]
source [file join $::odie(sandbox) odielib modules codebale index.tcl]

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

set ::project(h_file)         $::project(name).h
set ::project(h_file_int)     $::project(name)Int.h
set ::project(c_file)         lib${project(name)}.c
set ::project(init_funct)     [string totitle ${project(name)}lib]_Init
set ::project(declfile)       odielib.decls

set ::project(standard_header) [subst {
/*
** 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 mkhdr if we don't have it
###
if {![file exists [::realpath $::odie(mkhdr)]]} {
    cd $::odie_build(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 ${exec_prefix}/bin/mkhdr$::odie(exe_suffix)]
}

###
# 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 [file join $::project(src) cthulhu.mk]









|


















|
|

















|
|

|




















|



<
<
<
<
<
<
<
<
<
<






|
|
|
|




|
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
###
# 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
set ::project(pkgvers)        2.1

set ::project(h_file)         $::project(name).h
set ::project(h_file_int)     $::project(name)Int.h
set ::project(c_file)         lib${project(name)}.c
set ::project(init_funct)     [string totitle ${project(name)}lib]_Init
set ::project(declfile)       odielib.decls

set ::project(standard_header) [subst {
/*
** 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]
Changes to src/toadkit/Makefile.
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
	eval ${ODIE_RM} ${TCL_LIB_FILE} ${builddir} cthulhu.mk *.exe *.zip *.o *.c toadConfig.sh tclkit_bare${EXE} tclkit${EXE} tclkit.zip *.vfs zipkit* zzipsetup*
	mkdir -p ${builddir}

install: ${ALLPROD}
	cp -f tclkit${EXE} ${ODIE_TCLKIT}

cthulhu.mk:
	$(ODIE_TCLSH) configure.tcl

include cthulhu.mk

null.zip:
	touch .empty
	zip null.zip .empty








|







65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
	eval ${ODIE_RM} ${TCL_LIB_FILE} ${builddir} cthulhu.mk *.exe *.zip *.o *.c toadConfig.sh tclkit_bare${EXE} tclkit${EXE} tclkit.zip *.vfs zipkit* zzipsetup*
	mkdir -p ${builddir}

install: ${ALLPROD}
	cp -f tclkit${EXE} ${ODIE_TCLKIT}

cthulhu.mk:
	$(ODIE_BUILD_TCLSH) configure.tcl

include cthulhu.mk

null.zip:
	touch .empty
	zip null.zip .empty

99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
		${libdir}/${TCL_STUB_LIB_FILE} \
		$(subst ', , $(KIT_LIBS) $(TCL_LIBS) $(TCL_CC_SEARCH_FLAGS)) \
		$(TOADKIT_EXTRA_OBJS) \
		-o tclkit_bare${EXE})

tclkit.vfs:
ifneq ($(TK_FOSSIL_BRANCH),none)
	$(ODIE_TCLSH) mkVfs.tcl  ${ODIE_PLATFORM} "$(PWD)/tclkit.vfs/boot" "$(TCL_SRCROOT)"  "$(TK_SRCROOT)" "$(TK_FULL_VERSION)" "$(TK_DYLIB)"
else
	$(ODIE_TCLSH) mkVfs.tcl  ${ODIE_PLATFORM} "$(PWD)/tclkit.vfs/boot" "$(TCL_SRCROOT)"  
endif


tclkit${EXE}: tclkit_bare${EXE} null.zip tclkit.vfs
	cp tclkit_bare${EXE} tclkit.zip
	cat null.zip >> tclkit.zip
	cd $(PWD)/tclkit.vfs ; ${ZIP} -rAq ${PWD}/tclkit.zip .







|

|







99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
		${libdir}/${TCL_STUB_LIB_FILE} \
		$(subst ', , $(KIT_LIBS) $(TCL_LIBS) $(TCL_CC_SEARCH_FLAGS)) \
		$(TOADKIT_EXTRA_OBJS) \
		-o tclkit_bare${EXE})

tclkit.vfs:
ifneq ($(TK_FOSSIL_BRANCH),none)
	$(ODIE_BUILD_TCLSH) mkVfs.tcl  ${ODIE_PLATFORM} "$(PWD)/tclkit.vfs/boot" "$(TCL_SRCROOT)"  "$(TK_SRCROOT)" "$(TK_FULL_VERSION)" "$(TK_DYLIB)"
else
	$(ODIE_BUILD_TCLSH) mkVfs.tcl  ${ODIE_PLATFORM} "$(PWD)/tclkit.vfs/boot" "$(TCL_SRCROOT)"  
endif


tclkit${EXE}: tclkit_bare${EXE} null.zip tclkit.vfs
	cp tclkit_bare${EXE} tclkit.zip
	cat null.zip >> tclkit.zip
	cd $(PWD)/tclkit.vfs ; ${ZIP} -rAq ${PWD}/tclkit.zip .
Changes to src/toadkit/configure.tcl.
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
###
# 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 .. ..]]


source [file join $::project(path) odieConfig.tcl]

source [file join $::odie(sandbox) odielib modules odie index.tcl]
source [file join $::odie(sandbox) odielib modules codebale index.tcl]
source [file join $::project(path) cthulhu.ini]




if {$::odie(platform) eq "windows"} {
  set ::project(name)           odie_static
  set ::project(pkgname)        odielib_static
} else {
  set ::project(name)           odie
  set ::project(pkgname)        odielib
}
set ::project(h_file)         $::project(name).h
set ::project(h_file_int)     $::project(name)Int.h
set ::project(c_file)         lib${project(name)}.c
set ::project(init_funct)     [string totitle ${project(name)}lib]_Init
set ::project(target)         static
parray project
set ::project(standard_header) [subst {
/*
** 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 $::project(path) cmodules *]]] {
#  if {[file exists [file join $path cthulhu.ini]]} {
#    source [file join $path cthulhu.ini]
#  }
#}

#foreach dir {logicset odieutil} {
#  set path [file join $::project(path) 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_build(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(platform) eq "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_build(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_build(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_build(sandbox) tcl unix tclAppInit.c] {scan 0 extra {-DTCL_LOCAL_APPINIT=Toadkit_AppInit -DTCL_LOCAL_MAIN_HOOK=Toadkit_MainHook}}
}
if {$::odie(platform) eq "windows"} {
  if {![file exists [file join $::project(path) cmodules odieutil password.c]]} {
    puts "BUILDING PASSWORD (toadkit)"
    source [file join $::project(path) cmodules odieutil mkPassword.tcl]
  }
  ::cthulhu::add_csource [file join $::project(path) cmodules odieutil password.c]
  ::cthulhu::add_csource [file join $::project(path) cmodules odieutil memory.c]
  ::cthulhu::add_csource [file join $::project(path) cmodules odieutil md5.c]
  ::cthulhu::add_csource [file join $::project(path) cmodules odieutil rc4.c]
  ::cthulhu::add_csource [file join $::project(path) cmodules odieutil tclextra.c]
} else {
  foreach path [lsort -dictionary [glob [file join $::project(path) cmodules *]]] {
    if {[file exists [file join $path cthulhu.ini]]} {
      source [file join $path cthulhu.ini]
    }
  }
}
###
# Build mkhdr if we don't have it
###
if {![file exists [::realpath $::odie(mkhdr)]]} {
    cd $::odie_build(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 ${exec_prefix}/bin/mkhdr$::odie(exe_suffix)]
}

###
# 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 [file join $::project(src) cthulhu.mk]









>
>
|
>
|
<
|
>
>
|
>
|








|
|

|






|





|
|













|
|

|

















|
|




|


|
|

|
|
|
|
|
|
|

|
|
|

|




|
|
|
|
|







<
<
<
<
<
<
<
<
<







|
|
|
|




|

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
###
# 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 exist  ::odie(host)]} {
  # This script was called outside of cthulhu
  source [file join $::project(path) odieConfig.tcl]
  proc use args {}
  source [file join $::project(path) autosetup lib codebale.tcl]

  source [file join $::project(path) autosetup lib fileutil.tcl]
} else {
  use cthulhu
}

if {$::odie(windows)} {
  set ::project(name)           odie_static
  set ::project(pkgname)        odielib_static
} else {
  set ::project(name)           odie
  set ::project(pkgname)        odielib
}
set ::project(h_file)         $::project(name).h
set ::project(h_file_int)     $::project(name)Int.h
set ::project(c_file)         lib${::project(name)}.c
set ::project(init_funct)     [string totitle ${::project(name)}lib]_Init
set ::project(target)         static
parray ::project
set ::project(standard_header) [subst {
/*
** 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 $::project(path) cmodules *]]] {
#  if {[file exists [file join $path cthulhu.ini]]} {
#    source [file join $path cthulhu.ini]
#  }
#}

#foreach dir {logicset odieutil} {
#  set path [file join $::project(path) 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_path) 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_path) 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_path) 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_path) 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 $::project(path) cmodules odieutil password.c]]} {
    puts "BUILDING PASSWORD (toadkit)"
    source [file join $::project(path) cmodules odieutil mkPassword.tcl]
  }
  cthulhu_add_csource [file join $::project(path) cmodules odieutil password.c]
  cthulhu_add_csource [file join $::project(path) cmodules odieutil memory.c]
  cthulhu_add_csource [file join $::project(path) cmodules odieutil md5.c]
  cthulhu_add_csource [file join $::project(path) cmodules odieutil rc4.c]
  cthulhu_add_csource [file join $::project(path) cmodules odieutil tclextra.c]
} else {
  foreach path [lsort -dictionary [glob [file join $::project(path) cmodules *]]] {
    if {[file exists [file join $path cthulhu.ini]]} {
      source [file join $path cthulhu.ini]
    }
  }
}










###
# 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]