diff -Naur critcl.vfs/lib/app-critcl/critcl.tcl critcl_new.vfs/lib/app-critcl/critcl.tcl --- critcl.vfs/lib/app-critcl/critcl.tcl Sat Apr 26 19:44:21 2003 +++ critcl_new.vfs/lib/app-critcl/critcl.tcl Sat May 17 23:22:59 2003 @@ -212,7 +212,7 @@ regexp {^\w+} [file tail $outname] targetname set targetname [string totitle $targetname]_Init critcl::ccode "#define $origname $targetname" - critcl::cinit $inis + critcl::cinit $inis $exts set maininfo [critcl::cbuild "" 0] if {$pkg} { set libname [file rootname [file tail $outname]] diff -Naur critcl.vfs/lib/critcl/critcl.tcl critcl_new.vfs/lib/critcl/critcl.tcl --- critcl.vfs/lib/critcl/critcl.tcl Sat Apr 26 19:39:14 2003 +++ critcl_new.vfs/lib/critcl/critcl.tcl Sat May 17 23:24:16 2003 @@ -172,13 +172,14 @@ return [setparam libs $args] } - proc cinit {text} { + proc cinit {text exts} { set digest [md5_hex $text] set file [file_normalize [info script]] lappend v::code($file,list) "" $digest ;# add so we can detect changes append v::code($file,init) $text \n + append v::code($file,ext) $exts \n } proc ccode {text} { @@ -411,7 +412,7 @@ set base [file join $cache ${v::prefix}_$digest] set libfile $base - + # the compiled library will be saved for permanent use if the outdir # option is set (in which case rebuilds will no longer be automatic) if {$v::options(outdir) != ""} { @@ -421,7 +422,7 @@ file mkdir $odir } # get the settings for this file into local variables - foreach x {hdrs srcs libs init} { + foreach x {hdrs srcs libs init ext} { set $x [append v::code($file,$x) ""] ;# make sure it exists } @@ -477,10 +478,10 @@ puts -nonewline $fd { #if USE_TCL_STUBS - TclStubs *tclStubsPtr; - TclPlatStubs *tclPlatStubsPtr; - struct TclIntStubs *tclIntStubsPtr; - struct TclIntPlatStubs *tclIntPlatStubsPtr; + extern TclStubs *tclStubsPtr; + extern TclPlatStubs *tclPlatStubsPtr; + extern struct TclIntStubs *tclIntStubsPtr; + extern struct TclIntPlatStubs *tclIntPlatStubsPtr; static int MyInitTclStubs (Tcl_Interp *ip) @@ -493,7 +494,7 @@ } HeadOfInterp; HeadOfInterp *hoi = (HeadOfInterp*) ip; - + if (hoi->stubTable == NULL || hoi->stubTable->magic != TCL_STUB_MAGIC) { ip->result = "This extension requires stubs-support."; ip->freeProc = TCL_STATIC; @@ -512,9 +513,9 @@ tclIntStubsPtr = tclStubsPtr->hooks->tclIntStubs; tclIntPlatStubsPtr = tclStubsPtr->hooks->tclIntPlatStubs; } - + return 1; - } + } #endif } # now do the Tk stuff @@ -527,7 +528,7 @@ #ifdef __cplusplus extern \"C\" { #endif - + $ext DLLEXPORT int ${ininame}_Init(Tcl_Interp *ip) { @@ -590,6 +591,11 @@ } set cmdline "$v::compile $copts -o $libfile $base.c $srcs" + if {$v::options(language) != ""} { +# Allow the compiler to determine the type of file +# otherwise it will try to compile the libs + append cmdline -x none + } append cmdline " " $libs if {$v::options(combine) == ""} {