Re: Starkit plus expect or expectk?

Bezoar <[email protected]> Thu, 18 Oct 2007 14:58:14 -0000
Newsgroups gmane.comp.lang.tcl.starkit
Message-ID <[email protected]>
Yes, what did you want to know?  All you really have to do is put the
shared library for expect in your vfs lib directory. For instance, I
wrote a program to run  su on unix hosts.  The reason for using expect
this is that su  requires a terminal which expect provides, it will
not run using pipes or redirection.  The layout for the project is as
follows. Note this is for unix/linux.  The key is to download a
version of expect that will compile on your platform and for each
platform you support provide the appropriate .so or dll for expect.
Some people suggest making an OS directory under the vfs/lib directory
but if you support alot of operation systems your tclkit gets very
bulky.  The key is to save the files to support expect not in your vfs
but externally and have your make process copy in the OS appropriate
files at build time.
        To make sure it works correctly make sure that you download
the tcl and tck source distributions for the version of tcl/tk that is
your tclkit ( This is not always the case since the thing that expect
needs may not change from version to version, but to be safe....)
Compile both  in a temp directory  and be  sure when you do a ./
configure you also specify the --prefix=<tempdir> so in the next step
you do not overwrite the tcl binaries in the usual spots you will also
want to make sure that you use the --enable-shared flag.  Do a make
install  for both tcl and tk  and it will install to the temporary
directory you specified in the configure. then get a version of expect
that will compile (5.42 worked for me). Extract it to the same
directory as the tcl and tk src and modifiy the appropriate configure
options ( typically its --with-tcl= --with-tk=  or --with-tcl-
include=  etc. I can't be more concrete than that since I'm doing this
from memory). The paths you specify should be to either the install
area or the src area not your local versions. Like the tcl tk you also
specify the --prefix= to the same install dir and --enable shared.  do
a make install. Change to the install dir and pull out the contents of
the  lib directory  like you see in the tree below. You can tar this
up and extract it into the vfs of any tclkit project from here on
out.

Sample tclkit project.  tclkits and sdx.kit are external in another
directory used by the build system.

runsu
|-- TMakefile
`-- src
    |-- TMakefile
    |-- build.log
    |-- runsu-linux-x86*                            <-- these are
binaries produced
    |-- runsu-linux-x86-static-8.4*            <-- these are binaries
produced
   `-- runsu.vfs
        |-- lib
        |  |-- app-runsu
        |   |   |-- pkgIndex.tcl
        |   |   `-- runsu.tcl
        |   |-- expect5.42
        |   |   `-- pkgIndex.tcl
        |   |-- libexpect5.42.so
        |   `-- tcllib-1.9
        |       |-- aes
        |       |   |-- aes.tcl
        |       < all of tcllib copied here taken out for space>
        `-- main.tcl


Hope this helps,

Carl

On Oct 17, 7:43 am, John Culleton <[email protected]> wrote:
> Has anyone attempted to use a starkit to bundle an application based on expect
> or expectk?
> --
> John Culleton
> Want to know what I really think?http://apps.wexfordpress.net/blog/
> And my must-read (free) short list:http://wexfordpress.com/tex/shortlist.pdf