42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
if {$pkgName == ""} {
set type "exe"
} else {
set type "package"
}
}
array set $handle [list code "" type $type filename $output package $pkgName add_inc_path "" add_lib_path "" add_lib "" add_macros ""]
proc $handle {cmd args} [string map [list @@HANDLE@@ $handle] {
set handle {@@HANDLE@@}
if {$cmd == "go"} {
set args [list 0 {*}$args]
}
|
|
|
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
if {$pkgName == ""} {
set type "exe"
} else {
set type "package"
}
}
array set $handle [list code "" type $type filename $output package $pkgName add_inc_path "" add_lib_path "" add_lib "" add_macros "" add_files ""]
proc $handle {cmd args} [string map [list @@HANDLE@@ $handle] {
set handle {@@HANDLE@@}
if {$cmd == "go"} {
set args [list 0 {*}$args]
}
|
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
}
proc _add_library {handle args} {
upvar #0 $handle state
lappend state(add_lib) {*}$args
}
proc _cwrap {handle name adefs rtype} {
upvar #0 $handle state
set wrap [uplevel 1 [list ::tcc4tcl::wrap $name $adefs $rtype "#" "" 1]]
set wrapped [lindex $wrap 0]
|
>
>
>
>
>
>
|
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
}
proc _add_library {handle args} {
upvar #0 $handle state
lappend state(add_lib) {*}$args
}
proc _add_file {handle args} {
upvar #0 $handle state
lappend state(add_files) {*}$args
}
proc _cwrap {handle name adefs rtype} {
upvar #0 $handle state
set wrap [uplevel 1 [list ::tcc4tcl::wrap $name $adefs $rtype "#" "" 1]]
set wrapped [lindex $wrap 0]
|
577
578
579
580
581
582
583
584
585
586
587
588
589
590
|
foreach path $state(add_lib_path) {
tcc add_library_path $path
}
foreach lib $state(add_lib) {
tcc add_library $lib
}
switch -- $state(type) {
"memory" {
tcc compile $code
if {[info exists state(procs)] && [llength $state(procs)] > 0} {
foreach {procname cname_obj} $state(procs) {
|
>
>
>
>
|
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
|
foreach path $state(add_lib_path) {
tcc add_library_path $path
}
foreach lib $state(add_lib) {
tcc add_library $lib
}
foreach addFile $state(add_files) {
tcc add_file $addFile
}
switch -- $state(type) {
"memory" {
tcc compile $code
if {[info exists state(procs)] && [llength $state(procs)] > 0} {
foreach {procname cname_obj} $state(procs) {
|