> Vadim wrote: > > Jeff Hobbs wrote: > >> I have nothing in particular against this patch, but I > think that we > >> are working on something similar in ActivePerl that will > be available > >> "real soon now". > > > > Good; that change is quite neutral.
now its in. Next time I'll remove "create-moveable-dist.pl" -- looks like its useless. > I am currently not in the office myself, but I'd be interested to see > the general structure of your design. things are quite simple. But when I deal with all C code inside Perl DLL, things are even simplier, because I no more seeking for right tcl/tk DLL, or in danger of finding wrong one. When build is done, only 4 files are required for any Tcl/tk configuration: Tcl.dll -- contains compiled Tcl.xs *and* Tcl and Tk and (optionally Tix) C code. Tcl.pm - from Tcl-0.89 Tclaux.pm - generated auxiliary perl module tclscripts.zip.pm - generated ZIP archive (.pm extension only to convince Makefile.PM to copy it as required; wrong extension - is a temporary hack) tclscripts.zip.pm contains all needed tcl scripts and library files (now it contain even unneeded files, more accurate zipping should be done manually) Tclaux.pm contains two helper subroutines $Tcl::tcl_init0 = sub {....} # provides init.tcl $Tcl::tcl_init = sub {....} # runs Tcl's Vfs_Init, Trf_Init, Tk_Init, so to make tclscripts.zip.pm available to Tcl/Tk yet it contains few startup Tcl files as Perl hash, so to provide it when needed inside mentioned subroutines, during bootstrap. Example file please download at http://tcltkce.sourceforge.net/files/Tcl-0.89-with-tclaux.zip It is just the build of current Tcl-0.89 with these features turned on It also contains the file "try.pl" to prove the concept. Here it is (with my comments inserted here) use blib; # use w/o install use Tclaux; # 1 use Tcl; my $int = new Tcl; $int->SetVar('tcl_library','.'); #2 $Tcl::tcl_init0->($int); #3 $Tcl::tcl_init->($int); #4 $int->Eval('puts this'); $int->Tk_Init; # but this is already done inside #4. bummer $int->Eval('puts that pack [text .t] pack [button .b -text {foo, bar, fluffy!}] tkwait window . '); Lines marked with comments #1, #2, #3 and #4 are required lines for my approach. They could be inserted into Tcl.pm, or could be hidden somewhere else. (I used this approach during larger bootstrap sequence, so these *were* hidden somewhere else :) ) So startup of Tcl/Tk's ZIP VFS is running Required LIB files for static build are here: http://tcltkce.sourceforge.net/files/tcl-libs-stat.zip The helper script for Win32 is here: http://tcltkce.sourceforge.net/files/build-tcltk-stat.pl.html It facilitates static builds and creates proper Tclaux.pm, tclscripts.zip.pm Presumably I'll do linux also, within day or two. I'll be happy to hear any comments or questions. > > BTW will it allow to "hide"/pack some perl modules (.pm > files) into stardll? > > > > Is my understanding correct, that TCL will see its > stardll-files within > > "vfs" but placing Perl files inside it quite useless? > > Yes, you are correct. It is for encapsulating all the Tcl stuff only. I cheated: you can also encapsulate Perl stuff there and extract it with Tcl. :) Best regards, Vaidm.