Oops! Intended for the cygwin mailing list.
Probably because cygwin installs tcl somewhere where the tcllib install
script doesn't expect. Run the followin command in tclsh to find out
where your library should be installed:
puts $tcl_library
Then run ./configure with the --prefix set to the correct path. For
example if $tcl_library is "/usr/lib/tcl8.4" then run "./configure
--prefix /usr". I think by default the configure script expects tcl to
be installed in /usr/local and a lot of people including myself have
tcl in /usr.
Hope that helps.
puts $tcl_library returns "/usr/share/tcl8.4" tcllib is now in
"/usr/share/lib/tcllib1.8", after following your suggestion. The .tcl
files are there, including fileutil.tcl
The makefile reads:
srcdir = .
top_srcdir = .
prefix = /usr/share
exec_prefix = ${prefix}
libdir = ${exec_prefix}/lib
mandir = ${prefix}/man
bindir = ${exec_prefix}/bin
But I still get:
$ tclsh
% package require fileutil
can't find package fileutil
%
Please try to install tcllib using the installer.tcl file, running from
your cygwin tclsh instead of doing make install..., make install should
work, it basically calls installer.tcl but may pick up the wrong path.,,
Make install should do the right thing on cygwin, if not, please file a
bug report at:
Please file a bug report for this at
https://sourceforge.net/tracker/?group_id=12883&atid=112883
Category Installation...
Michael
Thanks. installer.tcl works, .\configure; make install does not.
Will file bug report.
> But I still get:
>
> $ tclsh
> % package require fileutil
> can't find package fileutil
What does:
puts $auto_path
return? The pkgIndex.tcl files will need to be in or under an immediate
subdirectory of one of the directories in the auto_path list.
Michael
I now have a working installation, which shows:
tcl_library=
C:/cygwin/usr/share/tcl8.4
auto_path=
C:/cygwin/usr/share/tcl8.4 C:/cygwin/usr/share C:/cygwin/lib
The pkgIndex.tcl fies are under, for example, share/tclib1.8/fileutil/
Unless "in or under an immediate subdirectory" means the same as "in or
under a subdirectory," I am missing some subtlety.
yes you are ;)
immediate subdirectory - means 1 level down, not recursively down an
arbitrary amount of subdirectories so since C:/cygwin/usr/share is in
the path, it will look in share and share/tcllib1.8 but NOT in
share/tclib1.8/fileutil by default. Now, there may be a pkgIndex.tcl
file in the tcllib1.8 directory that will add the subdirectories itself,
but the auto-searching functionality of the package system does not keep
going down to lower levels.
Bruce
I see. I now notice another pkgIndex.tcl directly under tclib1.8/ which
appears to reference the pkgIndex.tcl files in the subdirectories.
By the way, does the interpreter search for these files just once per
invocation and then retain an index to the location of the actual
package codes?
>
> I see. I now notice another pkgIndex.tcl directly under tclib1.8/ which
> appears to reference the pkgIndex.tcl files in the subdirectories.
> By the way, does the interpreter search for these files just once per
> invocation and then retain an index to the location of the actual
> package codes?
Yes it does. the first time you do a package require, it does the search for all
the pkgIndex files and then "knows" about all the packages they describe, then
when a package require is done again for one of the packages, the code defined
in the pkgIndex file is run to actualy load the code.
mode reading can be found at
which has some discussion and many links, some interesting ones being
http://www.tcl.tk/man/tcl8.4/TclCmd/pkgMkIndex.htm
http://wiki.tcl.tk/3382
http://math.nist.gov/~DPorter/tcltk/package/
Bruce