Typo
[linux_from_scratch_hints.git] / OLD / tcltk.txt
blob3ea93bbf2a5890e4825c802105a5dcce2b8e6032
1 TITLE:          Installing tcl/tk
3 LFS VERSION:    Any.
5 AUTHOR:         Tushar Teredesai <Tush@Yahoo.Com>
7 SYNOPSIS:
8         How to install tcl/tk without having to keep the source tree around.
10 HINT:
12 The primary location for this site is <http://tushar.lfsforum.org>, thanks to
13 Deutsche LFS Foren. The latest version of the hint and any relevant patches are
14 available at that site. Please refer to the primary location before submitting
15 bug-reports/enhancements to this hint.
17 You may freely copy this document or create derivate works or distribute the
18 document in any format. At your discretion, you may give credit to the original
19 author:)
21 Use the hint at your own risk. Neither the author, nor the Linux From Scratch
22 project accepts any reponsibility for anything that happens when using these
23 documents or associated files.
25 An appropriate place to discuss this hint is blfs-support MailingList/NewsGroup
26 at LinuxFromScratch.Org.
28 What is TCL/TK?
30 From http://www.tck.tk:
31 * Tcl (Tool Command Language) is used by over half a million developers
32 worldwide and has become a critical component in thousands of corporations. It
33 has a simple and programmable syntax and can be either used as a standalone
34 application or embedded in application programs. Best of all, Tcl is open source
35 so it's completely free.
36 * Tk is a graphical user interface toolkit that makes it possible to create
37 powerful GUIs incredibly quickly. It proved so popular that it now ships with
38 all distributions of Tcl. 
40 Why the hint?
42 I needed tcl/tk so that I could run AMSN Messegner to communicate with my
43 buddies who have MSN (pretend you didn't hear that). The thing that I found
44 idiotic was that even after installing the compiled code, it kept searching for
45 files at the location where I compiled the sources. Went digging around and
46 ended up at Gentoo. Their instructions were nice, but I needed a way so that I
47 could script the entire install and didn't have to change the script with
48 every upgrade of tcl/tk. Hence this hint.
50 Change Log:
51 [2002-10-24]
52         * First public version.
54 Pre-requisites (post LFS):
55         * XFree86
56                 <http://freshmeat.net/projects/xfree86/>
58 Packages to download:
59         * tcl/tk:)
60                 <http://freshmeat.net/projects/tcltk/>
63 Installing TCL:
65 First we define varaibales for the package and the version.
66         PACKAGE=tcl
67         VERSION=8.4.0
68         SRC_FILE=${PACKAGE}${VERSION}-src.tar.gz
69         SRC_DIR=${PACKAGE}${VERSION}
70         V=`echo $VERSION | cut -d "." -f 1,2`
72 Xtract the archive.
73         tar -xvzf ${SRC_FILE}
74         cd ${SRC_DIR}
75         DIR="${PWD}"
76         cd unix/
78 Configure and compile the package.
79         ./configure --prefix=/usr --disable-symbols --enable-threads
80         make
82 Now remove the references to the source tree.
83         cp tclConfig.sh tclConfig.sh.orig
84         sed -e "s:${DIR}/unix:/usr/lib:" \
85                 -e "s:${DIR}:/usr/include/tcl${V}:" \
86                 tclConfig.sh.orig > tclConfig.sh
88 Install the standard way.
89         make install
91 Copy the header files.
92         install -d /usr/include/tcl${V}/unix
93         install -m644 *.h /usr/include/tcl${V}/unix/
94         install -d /usr/include/tcl${V}/generic
95         install -c -m644 ../generic/*.h /usr/include/tcl${V}/generic/
96         rm -f /usr/include/tcl${V}/generic/{tcl,tclDecls,tclPlatDecls}.h
97         ln -nsf /usr/include/tcl${V} /usr/lib/tcl${V}/include
99 Make compatibility links
100         ln -sf libtcl${V}.so /usr/lib/libtcl.so
101         ln -sf libtclstub${V}.a /usr/lib/libtclstub.a
102         ln -sf tclsh${V} /usr/bin/tclsh
105 Installing tk:
107 First we define varaibales for the package and the version.
108         PACKAGE=tk
109         VERSION=8.4.0
110         SRC_FILE=${PACKAGE}${VERSION}-src.tar.gz
111         SRC_DIR=${PACKAGE}${VERSION}
112         V=`echo $VERSION | cut -d "." -f 1,2`
114 Xtract the archive.
115         tar -xvzf ${SRC_FILE}
116         cd ${SRC_DIR}
117         DIR="${PWD}"
118         cd unix/
120 Configure and compile the package.
121         ./configure --prefix=/usr --disable-symbols --enable-threads
122         make
124 Now remove the references to the source tree.
125         cp tkConfig.sh tkConfig.sh.orig
126         sed -e "s:${DIR}/unix:/usr/lib:" \
127                 -e "s:${DIR}:/usr/include/tk${V}:" \
128                 tkConfig.sh.orig > tkConfig.sh
130 Install the standard way.
131         make install
133 Copy the header files.
134         install -d /usr/include/tk${V}/unix
135         install -m644 *.h /usr/include/tk${V}/unix/
136         install -d /usr/include/tk${V}/generic
137         install -m644 ../generic/*.h /usr/include/tk${V}/generic/
138         rm -f /usr/include/tk${V}/generic/{tk,tkDecls,tkPlatDecls}.h
139         ln -nsf /usr/include/tk${V} /usr/lib/tk${V}/include
141 Make compatibility links
142         # Compatibility links
143         ln -sf libtk${V}.so /usr/lib/libtk.so
144         ln -sf libtkstub${V}.a /usr/lib/libtkstub.a
145         ln -sf wish${V} /usr/bin/wish
148 Don't forget to send me bug reports and enhancements so that I can keep the hint
149 updated.