old-www/LDP/LG/issue11/tclinst.html

216 lines
7.9 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<title>Tcl/Tk install</title>
</HEAD>
<BODY>
<H4><IMG ALIGN=MIDDLE SRC="./gx/bat-l.gif">
&quot;Linux Gazette...<I>making Linux just a little less scary!</I>
&quot;<IMG ALIGN=MIDDLE SRC="./gx/bat-r.gif"> </H4>
<P> <HR> <P>
<!--===================================================================-->
<center> <H1>My Experience Installing TCL/TK <BR>
from 7.4 to 7.5</h1></center>
<center> <H2>on Red Hat Linux 2.1, kernel release 1.2.13</h2></center>
<center> <H3>By Earl Brown,
<A HREF="mailto:gleep@lvinet.com">gleep@lvinet.com</a></h3></center>
<P> <HR> <P>
<H4>In which I chronicle my experiences attempting to upgrade my version of
TCL/TK to match the web-based help files I had already obtained.</h4><p>
For the short version, click <A href="tclinst.html#Summary">here</a><p>
On with the story!<p>
Naturally, the first thing I looked for was the RPM. Found it,
couldn't get it because Red Hat FTP was _slow_ during daytime. So I
went to sun.<p>
There I found tcl7.5 (I'm cautious - don't want to use beta stuff when
I can avoid it. That is until I'm independently wealthy with time on
my hands!). Look for:
<pre> ftp://ftp.sunlabs.com/pub/tcl/tcl7.5p1.tar.gz</pre>
That's the file I got. Download it. While you're there, get:
<pre> tk4.1p1.tar.gz</pre>
I created a directory off my home:
<pre> ~/tcl</pre>
and put both files in there. From there I unzipped them to get two subdirectories:<p>
<pre> ~/tcl/tcl7.5
~/tcl/tk4.1</pre>
Both of these contain a README file - I read it (but only closely
enough to see that there was a README in the 'unix' subdirectory that
would give me info on how to compile.<p>
So, I changed to the unix subdirectory:<p>
<pre> ~/tcl/tcl7.5/unix</pre>
And read the README file. It said run "configure" (which just checked out
my machine), and then run "make" (which does about what you'd expect),
then run "make install". All of these appeared to work, but when I ran
'wish', I still had the old versions. Hmmmm. Damn.<p>
Put it on the back burner for a while - I've other work to do. When I
got home, I looked up the files again (and found the RPM this time),
and downloaded them (at 28.8, instead of T-1 :(<p>
<hr>
Next morning...<p>
First thing is try the RPM. No luck - it said the .rpm was a 'version
3' RPM, and that I needed to upgrade my version of RPM. Okay - glad
I've got two machines at home (Thank you, Mom, for giving me your old
'486!), I started up the Windows box (I'm looking forward to getting
WABI so my wife can play FreeCell in a _real_ OS :) and started surfing
again...<p>
Does anybody know why the rpm says that rpm2.2.rpm is a version 3 rpm
and I need to upgrade?<p>
While I was finding this out, I was exploring other avenues. I got the
files from sun installed on my machine at home. But they wouldn't
compile (something about missing include files - this didn't surprise
me, I've stripped that machine back in the name of hard drive space).<p>
So, being the explorer I am, I got out the 'sun archives' CD from my
Red Hat install set. Did a 'find' for "*.tcl" and was happy to see
there was a tcl7.5p1.tar.gz file. Good. Ungzipped the thing and 'tar
tvf'ed it to see what was in it. Hmmm. "./usr/..." Looks like I
should just untar it from the root directory. I'm not so cautious when
I'm frustrated.<p>
This option took a _lot_ of drive space. I wish I could undo it. It
didn't really work (and it complained about not being able to form
links. I tried to do the links myself, but it still failed).<p>
<hr>
Nap time...<p>
That was relaxing. I realized I'd been able to compile at the office,
where it was all the same setup, so I could play with "make install" at
home and see what I could do.<p>
While I was connected to work, I had the idea to try "wish" from the
compiled directory at work. IT WORKED! Headway at last! (Did I also
mention that I'm sometimes a bit slow?) But I've got this really ugly
hierarchy of files to my compiled copy of 'wish', and I don't know what
it's going to look for. Copy to my home machine.<p>
Here's the part where things go quickly.<p>
On the home machine, I set up the directory structure I had at work and
untarred the files. Now I've got a working copy of wish and tclsh.<p>
I created a 'bin' directory off my home directory and copied 'wish' and
'tclsh' into that directory. I also copied the two 'lib' files
"libtcl7.5.a" and "libtk4.1.a" into the bin directory. I don't know
where they really go, but this place makes good sense.<p>
So I run 'wish' from there. Error message - unable to load 'libtcl'
from a list of directories. I'm not sure what they all were, but one
was '~/library'. Since it worked from ~/tcl/tk4.1/unix, I just copied
the '~/tcl/tk4.1/library' directory to '~/library', and then copied
'~/tcl/tcl7.5/library' to '~/library'.<p>
Now wish ran with the right version. Delete the ~/tcl structure
(backup just in case!) and it worked. Good enough. I played with my
working install of tcl/tk quite happily the rest of the day.<p>
<hr>
But during the night...<p>
"I've got to set it up to work better!"<p>
So, I get to work and get 'wish' to give me an error message - it
complained that the 'init.tcl' was not found in
'/usr/local/lib/tcl7.5'.<p>
Okay. I went to '~/tcl/tcl7.5/library' and copied the files I found
there to '/usr/local/lib/tcl7.5' (a directory which I had to create, by
the way).<p>
Run 'wish' again, and this time it complains about 'tk.tcl' not being
found in '/usr/local/lib/tk4.1'. I'd expected something like that.
So, create '/usr/local/lib/tk4.1' and 'cp ~/tcl/tk4.1/library/*
/usr/local/lib/tk4.1'. And it worked!<p>
Then 'cp ~/tcl/tcl7.5/unix/tclsh /usr/bin/tclsh7.5' and 'cp
~/tcl/tl4.1/unix/wish /usr/bin/wish4.1'. Go to ~ and run 'wish4.1'.
It worked again! Good, create the link 'ln -sf /usr/bin/wish4.1
/usr/bin/wish' and 'ln -sf /usr/bin/tclsh7.5 /usr/bin/tclsh'<p>
Try it again; 'wish' - and success!<p>
Things I found out:<p>
<UL><LI>In Red Hat 2.1, the tcl/tk libraries are in /usr/lib, but the upgrade
looks for stuff in /usr/local/lib. Can anybody explain this
relationship to me?<p></li>
<LI>The script '~/tcl/tcl7.5/unix/configure' has a pair of options:
--prefix and --exec-prefix. They have something to do with where
tcl/tk expect things to be. Anybody know exactly what?<p></li>
</ul>
<A name="Summary"><hr>
<H2>Short Summary:</h2></a>
<pre>
Get ftp://ftp.sunlabs.com/pub/tcl/tcl7.5p1.tar.gz and tk4.1p1.tar.gz
'gunzip' them and 'tar xvf' them
'cd ./tcl7.5/unix'
'configure'
'make'
'make install'
'cd ../..'
'cd ./tk4.1/unix'
'configure'
'make'
'make install'
cd ../..
'cp ./tk4.1/unix/wish /usr/bin/wish4.1'
'cp ./tcl7.5/unix/tclsh /usr/bin/tclsh7.5'
'ln -sf /usr/bin/wish4.1 /usr/bin/wish'
'ln -sf /usr/bin/tclsh7.5 /usr/bin/tclsh'
'mkdir /usr/local/lib/tcl7.5'
'mkdir /usr/local/lib/tk4.1'
'cp ./tcl7.5/library/* /usr/local/lib/tcl7.5'
'cp ./tk4.1/library/* /usr/local/lib/tk4.1'
</pre>
<p>
At this point, I'm pretty sure 'wish' will work. But no guarantees.<p>
And there will also be a bunch of files left over from any previous
installation of TCL/TK. Maybe someday I'll clean them up. Probably
not till I get the new Red Hat 4, tho...(I've got to remember to tar &
gzip my 'home' tree before that install!)<p>
Earl
<!--===================================================================-->
<P> <hr> <P>
<center><H5>Copyright &copy; 1996, by Earl Brown</H5></center>
<center> <H5>Published in Issue 11 of the Linux Gazette</H5></center>
<!--===================================================================-->
<P> <hr> <P>
<A HREF="./index.html"><IMG ALIGN=BOTTOM SRC="../gx/indexnew.gif"
ALT="[ TABLE OF CONTENTS ]"></A>
<A HREF="../index.html"><IMG ALIGN=BOTTOM SRC="../gx/homenew.gif"
ALT="[ FRONT PAGE ]"></A>
<A HREF="./tapr.html"><IMG SRC="../gx/back2.gif"
ALT=" Back "></A>
<A HREF="./wkndmech.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>
<P> <hr> <P>
</body> </html>