step 1 and 2 are ok.
step 3:
I build the expect successfully.
To install it, I copy it to the same directory as tclkit.
I am not the system administrator.
setenv LD_LIBRARY_PATH /home/tcma/starkit
step 4 is ok.
5. Run it - it should produce a single line - the version of expect that
you have installed.
$ ./tkex.tcl
tkex.tcl
can't find package Expect
while executing
"package require Expect"
(file "tkex.tcl" line 8)
---
>From: lvi...@yahoo.com (lvi...@yahoo.com)
> Subject: Re: create a single self-contained standalone expect binary on solaris
> 8
> Newsgroups: comp.lang.tcl
> Date: 2003-08-18 08:03:06 PST
>
>
>According to TingChong <ma77...@hotmail.com>:
>:I want to create a standalone expect binary on solaris 8.
>:i.e. without worrying tcl installation.
>
>3. get the source code for expect. configure it with the --enable-shared
>option. Build and install it.
TingChong wrote:
> I follows your instructions but fails at step 5.
>
> step 1 and 2 are ok.
>
> step 3:
> I build the expect successfully.
> To install it, I copy it to the same directory as tclkit.
> I am not the system administrator.
> setenv LD_LIBRARY_PATH /home/tcma/starkit
This is likely not sufficient, as step 5 fails on the package
require. Expect is the library + pkgIndex.tcl that loads it
correctly. Are you looking for prebuilt binaries? If so, see
http://www.activestate.com/Tcl
which includes Solaris binaries for Tcl that has Expect. If
you really want to create deployable applications, then look at
the Tcl Dev Kit at the same site that allows for create single
file executables that can include Expect.
--
Jeff Hobbs The Tcl Guy
Senior Developer http://www.ActiveState.com/
Tcl Support and Productivity Solutions
Jeff Hobbs <je...@activestate.com> wrote in message news:<3F9F915F...@activestate.com>...
Did you specify --enable-stubs as one of the configure arguments?
:To install it, I copy it to the same directory as tclkit.
Actually, you could at the time you run configure, specify something like
--prefix=$HOME and have then install expect into your home directory.
:setenv LD_LIBRARY_PATH /home/tcma/starkit
Why do you do this? I would avoid setting this variable as much as
possible...
:5. Run it - it should produce a single line - the version of expect that
:you have installed.
:$ ./tkex.tcl
:tkex.tcl
:can't find package Expect
: while executing
:"package require Expect"
: (file "tkex.tcl" line 8)
This says that the tcl you are using is not using the directory
structure that you think it is using.
I just built a starpack - i.e. stand alone starkit.
Here's the directory structure that I used - note however that I editted
expect's pkgIndex.tcl so that things worked.
ls -R test.vfs
test.vfs:
lib main.tcl
test.vfs/lib:
app-test expect
test.vfs/lib/app-test:
pkgIndex.tcl test.tcl
test.vfs/lib/expect:
libexpect5.39g.so pkgIndex.tcl
The default expect pkgIndex.tcl wanted to be a directory lower. But
when I had it there, tclkit wasn't finding the library for some
reason. When I moved pkgIndex.tcl up, and editted it to fix the
directory path built, things ran just fine.
--
<URL: http://wiki.tcl.tk/ > In God we trust.
Even if explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.
<URL: mailto:lvi...@yahoo.com > <URL: http://www.purl.org/NET/lvirden/ >
expect, as built from the source distribution, is not a tcl script but
a binary executable.
So you wouldn't use starkit to achieve what you want.
Anyone know what expect configure options need to be used to result in
the expect binary being generated with all libraries statically linked in?
I do this because I don't have the root password (permission) to
install expect.
>
> :setenv LD_LIBRARY_PATH /home/tcma/starkit
>
> Why do you do this? I would avoid setting this variable as much as
> possible...
>
> I just built a starpack - i.e. stand alone starkit.
> Here's the directory structure that I used - note however that I editted
> expect's pkgIndex.tcl so that things worked.
>
>
> ls -R test.vfs
> test.vfs:
> lib main.tcl
>
> test.vfs/lib:
> app-test expect
>
> test.vfs/lib/app-test:
> pkgIndex.tcl test.tcl
>
> test.vfs/lib/expect:
> libexpect5.39g.so pkgIndex.tcl
>
> The default expect pkgIndex.tcl wanted to be a directory lower. But
> when I had it there, tclkit wasn't finding the library for some
> reason. When I moved pkgIndex.tcl up, and editted it to fix the
> directory path built, things ran just fine.
Because I do not install expect (I have no root password), I do not
created the expect directory, this is what I got:
sdx.kit qwrap t.tcl
sdx.kit unwrap t.kit
ls -R t.vfs
t.vfs:
lib main.tcl
t.vfs/lib:
app-t
t.vfs/lib/app-t:
pkgIndex.tcl t.tcl
---
The pkgIndex.tcl in your
test.vfs/lib/expect
is modified, isn't it?
Please post the contents of your modified default expect pkgIndex.tcl
to this newsgroup because I still have problem creating this file.
I think I will create the expect directory manually and modify your
default expect pkgIndex.tcl.
The pkgIndex.tcl in
test.vfs/lib/app-test is unmodified, isn't it?
Thanks again.
Cameron Laird <cla...@phaseit.net>
Business: http://www.Phaseit.net
% make
which create libexpect5.39.so
% tclkit
% load libexpect5.39.so
Segmentation Fault (core dumped)
Why?
I just did the same, using latest source from expect CVS:
$ cd /home/shared/tclbuilds/lib
$ tclkit
% info pat
8.4.4
% lappend auto_path .
/home/jcw/bin/tclkit/lib/tcl8.4 /home/jcw/bin/tclkit/lib .
% package require Expect
5.39.0
%
This is on Linux, so it won't help you much. But my hunch is that you
may have to configure against a Tcl/Tk 8.4 - you left it out, so
configure might have found another Tcl (8.3.x?) on your system. It
*should* work as you do it even then (due to stubs), but just to avoid
any problems I would really build Tcl and Tk 8.4.x, and then build
expect, pointing to their install prefix dir (which can be anywhere).
Here's how I ran configure:
cd /home/shared/tclbuilds/expect-cvs
./configure --with-tcl=../lib --with-tk=../lib --enable-shared \
--enable-stubs --prefix=/home/shared/tclbuilds
(Not sure if all those flags are needed, but this worked for me on the
first try)
Be sure to build everything from scratch. It really looks like a
version mixup to me.
-jcw
./configure --with-tcl=/home/tcma/tclbuilds/install/wcars27e/lib
--with-tk=/home/tcma/tclbuilds/install/wcars27e/lib --enable-shared
--enable-stubs --prefix=/home/tcma/tclbuilds
Both configure commands failed with the same message:
wcars27e-29> ./configure
--with-tcl=/home/tcma/tclbuilds/install/wcars27e/lib
--with-tk=/home/tcma/tclbuilds/install/wcars27e/lib --enable-shared
--enable-stubs --prefix=/home/tcma/tclbuilds
configuring Expect 5.38.0
checking for autoconf... yes
checking configure up to date... yes
checking host system type... sparc-sun-solaris2.8
checking target system type... sparc-sun-solaris2.8
checking build system type... sparc-sun-solaris2.8
checking shell to use within Make...
checking for gcc... gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for building with threads... no (default)
checking for Tcl configuration... found
/home/tcma/tclbuilds/install/wcars27e/lib/tclConfig.sh
checking Tcl build library... -L/home/tcma/zip/tars/build/wcars27e/tcl
-ltcl8.4 -ldl -lsocket -lnsl -lm
checking for Tcl_CreateCommand... no
checking if Tcl library build specification is valid... no
checking for Tk configuration... found
/home/tcma/tclbuilds/install/wcars27e/lib/tkConfig.sh
checking for Tk_Init... no
checking if Tk library build specification is valid... no
checking whether the compiler (gcc -pipe) actually works... yes
checking for a BSD compatible install...
/opt/corp/unsupported/bin/ginstall -c
checking for ranlib... ranlib
checking how to run the C preprocessor... gcc -pipe -E
checking if running LynxOS... no
checking for ANSI C header files... yes
checking for pid_t... yes
checking return type of signal handlers... int
checking whether time.h and sys/time.h may both be included... no
checking for sys/wait.h that is POSIX.1 compatible... no
checking if running Mach... no
checking if running MachTen... no
checking if on Pyramid... no
checking if on Apollo... no
checking if on Interactive... no
checking if stty reads stdout... no
checking if running Solaris... yes
checking for sin... no
checking for Tcl private headers... checking for tclInt.h... no
configure: error: Can't find Tcl private headers
Please help.
Thanks.
j...@equi4.com (Jean-Claude Wippler) wrote in message news:<415cbd25.03110...@posting.google.com>...
Try:
./configure --with-tcl=/home/tcma/tclbuilds/build/wcars27e/tcl
--with-tk=/home/tcma/tclbuilds/build/wcars27e/tk --enable-shared
--enable-stubs --prefix=/home/tcma/tclbuilds/install/wcars27e
-jcw
The directory
/home/tcma/tclbuilds/build/wcars27e/tk does not exist, but
/home/tcma/tclbuilds/build/wcars27e/tkdyn exist.
./configure --with-tcl=/home/tcma/tclbuilds/build/wcars27e/tcl
--with-tk=/home/tcma/tclbuilds/build/wcars27e/tkdyn --enable-shared
--enable-stubs --prefix=/home/tcma/tclbuilds/install/wcars27e
configuring Expect 5.38.0
checking for autoconf... yes
checking configure up to date... yes
checking host system type... sparc-sun-solaris2.8
checking target system type... sparc-sun-solaris2.8
checking build system type... sparc-sun-solaris2.8
checking shell to use within Make...
checking for gcc... gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for building with threads... no (default)
checking for Tcl configuration... found
/home/tcma/tclbuilds/build/wcars27e/tcl/tclConfig.sh
checking Tcl build library...
-L/home/tcma/tclbuilds/build/wcars27e/tcl -ltcl8.4 -ldl -lsocket
-lnsl -lm
checking for Tcl_CreateCommand... yes
checking if Tcl library build specification is valid... yes
checking for Tk configuration... found
/home/tcma/tclbuilds/build/wcars27e/tkdyn/tkConfig.sh
checking for Tk_Init... yes
checking if Tk library build specification is valid... yes
checking whether the compiler (gcc -pipe) actually works... yes
checking for a BSD compatible install...
/opt/corp/unsupported/bin/ginstall -c
checking for ranlib... ranlib
checking how to run the C preprocessor... gcc -pipe -E
checking if running LynxOS... no
checking for ANSI C header files... yes
checking for pid_t... yes
checking return type of signal handlers... void
checking whether time.h and sys/time.h may both be included... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking if running Mach... no
checking if running MachTen... no
checking if on Pyramid... no
checking if on Apollo... no
checking if on Interactive... no
checking if stty reads stdout... no
checking if running Solaris... yes
checking for sin... no
checking for Tcl private headers... checking for tclInt.h... no
configure: error: Can't find Tcl private headers
wcars27e-66> cd /home/tcma/tclbuilds
wcars27e-67> find . -name tclInt.h -print
./src/tcl/generic/tclInt.h
Please help.
Thanks.
Ah, yes, sorry about that.
[...]
> checking for Tcl private headers... checking for tclInt.h... no
> configure: error: Can't find Tcl private headers
>
> wcars27e-66> cd /home/tcma/tclbuilds
> wcars27e-67> find . -name tclInt.h -print
> ./src/tcl/generic/tclInt.h
Drat, so Expect doesn't seem to want to build against an uninstalled
directory. Too bad.
Ok, last try:
- get Tcl and Tk sources (ignore tclkit)
- build those and install in some temp spot
- build Expect against that spot
The explanation is that Expect seems to require a *full* install of
Tcl and Tk to get at more header files, while Tclkit only builds and
installs a minimal set, sufficient to link agains and create the
standalone exe.
You can re-use the src/tcl and src/tk files, no need to download
tcl/tk again, just ignore the genkit script and build both tcl and tk
in the traditional "./configure ...; make; make install" way.
-jcw
The _default_ pkgIndex.tcl from expect says:
package ifneeded Expect 5.38.0 [list load [file join $dir .. libexpect5.38g.so]]
I change this one to say:
package ifneeded Expect 5.38.0 [list load [file join $dir libexpect5.38g.so]]
and, as I mentioned in my previous posting, placed my libexpect5.38g.so (in
my case) in the same directory as the pkgIndex.tcl because for some reason,
doing it the way that expect installs things didn't seem to work for me
within my tclkit.
# ./configure --with-tcl=/home/tcma/tclbuilds/build/wcars27e/tcl
--with-tclinclude=/home/tcma/tclbuilds/src/tcl/generic/
--with-tk=/home/tcma/tclbuilds/build/wcars27e/tkdyn --enable-shared
--enable-stubs --prefix=/home/tcma/expectinstall
# make
# file libexpect5.38.so
libexpect5.38.so: ELF 32-bit MSB dynamic lib SPARC Version 1,
dynamically linked, not stripped
I install expect by
# make install
This program fail to find expect (why?):
#!/home/tcma/starkit/tclkit
package require Expect
puts [package versions Expect]
can't find package Expect
while executing
"package require Expect"
(file "test.tcl" line 4)
This program find expect but does not print out its version (why?):
#!/home/tcma/starkit/tclkit
load /home/tcma/expect-5.38/libexpect5.38.so
package require Expect
puts [package versions Expect]
Great! Success! At last! Amazing! Usenet rules! Long live c.l.t!
> This program fail to find expect (why?):
[...]
Look at docs for "package", "pkgIndex.tcl", and so on. This looks
like a standard package location/search issue.
-jcw
Is it ok to have the file libc_psr.so.1 there?
ma77...@hotmail.com (TingChong) wrote in message news:<451a2a55.03110...@posting.google.com>...
Not just "ok" but actually I believe that is the case for all my
sparc solaris shared libraries.
When you see this error, modify your script to add this line:
puts $::auto_path
before the call to "package require". The output shows you where
the program is going to be looking for the package.
By default, tclkit looks only within itself for packages. To alter that,
you have to alter things a bit.
When you build a starkit, I believe that starkit adds directories to
the auto_path so that tclkit also looks there. If you are not using
a starkit yet, then you need to alter that variable yourself.
Personally, if I were you, I would take the above script, turn it into
a starkit via sdx.kit qwrap, then unwrap it via sdx.kit unwrap, and
then run my tests by having tclkit invoke the new file.vfs/main.tcl
file that is created by these steps.
:
:
:This program find expect but does not print out its version (why?):
:#!/home/tcma/starkit/tclkit
:
:load /home/tcma/expect-5.38/libexpect5.38.so
:package require Expect
:puts [package versions Expect]
I don't know why you do not get the version output for this. But note
that because you directly loaded the shared library, package require
found the extension, even though it wasn't present in the tclkit.