Thread: [tcltk-perl] Tcl::Tk and Tcl/Tk files within Perl installation
Brought to you by:
hobbs
From: Konovalov, V. <vko...@sp...> - 2004-10-12 15:09:42
|
While playing with Perl and Tcl::Tk module on Win32, I discovered that it is relatively easy to build Tcl.dll (derived from Tcl.xs) that contains entire Tcl/Tk binaries. (all my experiments are on Win32 for now) I built tcl and tk statically, and then specified those libraries in Makefile.PL, so I got large Tcl.dll and it worked. It was easy to arrange so that Tcl/Tk gets all scripts from zipped archive "tcltk.zip" So I ended with about 3 or 4 files for entire Perl + Tk. Adding Tix makes only one file more (tix8184.dll) and tcltk.zip becomes a bit larger. All pure-Tcl extension go to that "tcltk.zip" I did it further: after few touches in Perl's makefile it is possible to embed extension into perl.dll (it was possible earlier, and I mostly restored and extended such a possibility) So I have 2Mbyte perl58.dll that contains Perl itself, Tcl/Tk, and some Perl extensions (Compress::Zlib for example). I'll perform many cleanup and will describe in manual pages somehow. Why do I write all this? 1. to let you know it is available. Will share any knowledge on this on request. 2. it could be reasonable to decide what "official" way of doing things is. Having only limited set of files in module's distribution is a great plus. 3. Besides Win32, there are many other platforms to do. Although I can do some minimal testing and development on Linux and FreeBSD, I will need advices from experts for sure. Timeline for completing this on Win32 (including description/documentation) is few weeks or several weeks (as usual). Best regards, Vadim. |
From: Jan D. <ja...@Ac...> - 2004-10-12 15:29:27
|
On Tue, 12 Oct 2004, Konovalov, Vadim wrote: > While playing with Perl and Tcl::Tk module on Win32, I discovered > that it is relatively easy to build Tcl.dll (derived from Tcl.xs) > that contains entire Tcl/Tk binaries. (all my experiments are on > Win32 for now) > > I built tcl and tk statically, and then specified those libraries in > Makefile.PL, so I got large Tcl.dll and it worked. > > It was easy to arrange so that Tcl/Tk gets all scripts from zipped > archive "tcltk.zip" > > So I ended with about 3 or 4 files for entire Perl + Tk. Adding Tix > makes only one file more (tix8184.dll) and tcltk.zip becomes a bit > larger. All pure-Tcl extension go to that "tcltk.zip" All of the above sounds pretty cool. This will make it a lot easier for people to use Tcl::Tk without having to install a whole Tcl installation. > I did it further: after few touches in Perl's makefile it is possible > to embed extension into perl.dll (it was possible earlier, and I > mostly restored and extended such a possibility) > > So I have 2Mbyte perl58.dll that contains Perl itself, Tcl/Tk, and > some Perl extensions (Compress::Zlib for example). I don't understand the value of this later part. Why would you want to do this? The big advantage of DynaLoader is that you no longer need to statically link extensions into core Perl (except for DynaLoader itself, of course). Am I missing something? Cheers, -Jan |
From: Vadim K. <va...@vk...> - 2004-10-12 16:49:12
|
>> It was easy to arrange so that Tcl/Tk gets all scripts from zipped >> archive "tcltk.zip" >> >> So I ended with about 3 or 4 files for entire Perl + Tk. Adding Tix >> makes only one file more (tix8184.dll) and tcltk.zip becomes a bit >> larger. All pure-Tcl extension go to that "tcltk.zip" JD> All of the above sounds pretty cool. This will make it a lot easier JD> for people to use Tcl::Tk without having to install a whole Tcl JD> installation. Yes, I also think so. So I plan to reach a final goal in my spare time within few weeks. >> I did it further: after few touches in Perl's makefile it is possible >> to embed extension into perl.dll (it was possible earlier, and I >> mostly restored and extended such a possibility) >> >> So I have 2Mbyte perl58.dll that contains Perl itself, Tcl/Tk, and >> some Perl extensions (Compress::Zlib for example). JD> I don't understand the value of this later part. Why would you want to JD> do this? The big advantage of DynaLoader is that you no longer need JD> to statically link extensions into core Perl (except for DynaLoader JD> itself, of course). Am I missing something? Indeed, mostly modules should be loaded dynamically. And I will mostly use Tcl::Tk using DynaLoader. 99.5% of the time There are reasons I did this step: - to prove the concept it is able to work, and flexible enough to allow different configurations. - I was fixing Perl's makefile-s and dynaloader in respect to statically building of extensions and decided to do some testing. - I was requested to implement some GUI application, and it will always start with GUI. So there exist some sence to reduce startup time. At least it is reasonable to include Compress::Zlib into perl58.dll within my distro, because otherwise it always will start from loading Zlib.dll, and I will save in startup time a bit. Still, I am not sure whether my final distribution will have Tcl statically built into Perl, because having it separatedly increases flexibility in that sence that I can upgrade Tcl/Tk without rebuilding Perl each time. But I do agree that normally Tcl::Tk should be dynamically loaded when needed, so my extending of Perl's DLL is rather playing. Best regards, Vadim. |
From: Vadim K. <va...@vk...> - 2004-11-02 23:56:44
|
I developed small Perl script that aims in Tcl/Tk build process for creation of Tcl/Tk being used from Perl's Tcl::Tk modules only. All steps are very very first preliminary and only work on Win32. However following currently works: - after Tcl, Tk, trf, memchan, vfs built, they could be linked with Tcl.xs we get single Tcl.dll, (otherwise Perl's Tcl.dll calls Tcl/Tk's tcl84.dll and tk84.dll) - "tcl-scripts.zip" created during build - all related *.tcl scripts being used from "tcl-scripts.zip" archive directly using Tcl's vfs::zip vrtual FS. Following are not currently working but expect those really soon (after weekend) - tk.res not linked with Tcl.dll but it should - process requires Compress::Zlib static lib behind the scenes - non-Win32 - Tcl/Tk versions other than 8.4.7 Alternatively, it is quite possible to create distribution without any compressing/zip tricks, so using all Tcl/Tk without trf, memchan, vfs. This will be easier and not harder. When all will be settled, I suppose creating CPAN distribution with names like TclTk-zpackaged - Tcl/Tk+Tix+some others, trf, memchan, vfs and Tcl scripts zipped TclTk-packaged - same but no zipping I like first one much better than second. I placed my "build area" with mentioned script at www.vkonovalov.ru/tcltk-misc File tcltk-packaged.zip contains current build tree. All things are not settled, and after a week or two things will stabilize much more, so people who do not have enough time to look into broken scripts should wait a bit. On the contrary, those who want help things to grow in a sane way, should speak early. -- Best regards, Vadim |
From: Jeff H. <je...@Ac...> - 2004-11-11 22:55:05
|
Vadim wrote: > I developed small Perl script that aims in Tcl/Tk build > process for creation of Tcl/Tk being used from Perl's Tcl::Tk > modules only. > However following currently works: > > - after Tcl, Tk, trf, memchan, vfs built, they could be linked with > Tcl.xs we get single Tcl.dll, (otherwise Perl's Tcl.dll calls > Tcl/Tk's tcl84.dll and tk84.dll) > - "tcl-scripts.zip" created during build > - all related *.tcl scripts being used from "tcl-scripts.zip" archive > directly using Tcl's vfs::zip vrtual FS. This is interesting. We (ActiveState) have done something similar for our own purposes. We did this by basing the work on starpacks as dlls. You will see some of the code that I commited to Tcl.xs to support this. The Tcl-side of that is proprietary, as it is a part of the Tcl Dev Kit, but we posted all the basic coding bits for it to the starkit mailing list during development for others to consider. We will likely use this same approach for the Tcl web browser plugin. Jeff Hobbs, The Tcl Guy http://www.ActiveState.com/, a division of Sophos |