Index: tcc4tcl.tcl ================================================================== --- tcc4tcl.tcl +++ tcc4tcl.tcl @@ -25,11 +25,11 @@ set type "memory" } else { if {$pkgName == ""} { set type "exe" } else { - set type "dll" + set type "package" } } array set $handle [list tcc $tcc_handle code "" type $type filename $output package $pkgName] @@ -81,11 +81,11 @@ # Append additional generated code to support the output type switch -- $state(type) { "memory" { # No additional code needed } - "exe" { + "exe" - "dll" { if {[info exists state(procs)] && [llength $state(procs)] > 0} { append state(code) "int _initProcs(Tcl_Interp *interp) \{\n" foreach {procname cname} $state(procs) { append state(code) " Tcl_CreateObjCommand(interp, \"$procname\", $cname, NULL, NULL);" @@ -92,11 +92,11 @@ } append state(code) "\}" } } - "dll" { + "package" { set packageName [lindex $state(package) 0] set packageVersion [lindex $state(package) 1] if {$packageVersion == ""} { set packageVersion "0" } @@ -119,11 +119,19 @@ append state(code) "\}" } } # Generate output code - tcc4tcl $dir $state(type) tcc + switch -- $state(type) { + "package" { + set tcc_type "dll" + } + default { + set tcc_type $state(type) + } + } + tcc4tcl $dir $tcc_type tcc switch -- $state(type) { "memory" { tcc compile $state(code) @@ -130,11 +138,11 @@ foreach {procname cname} $state(procs) { tcc command $procname $cname } } - "dll" - "exe" { + "package" - "dll" - "exe" { switch -glob -- $::tcl_platform(os)-$::tcl_platform(machine) { "Linux-x86_64" { tcc add_library_path "/lib64" tcc add_library_path "/usr/lib64" tcc add_library_path "/lib"