aboutsummaryrefslogtreecommitdiffstats
path: root/lib/gs/tcl/README
blob: 5fc18363492b42d7eac49ad8ed2be162c97484e9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
==============================================================================
                  How to create prebuilt Tcl/Tk binaries
==============================================================================

Please look further down in this text for Windows instructions...

Unixish OS
----------

For commercial releases we use a prebuilt binary release of Tcl/Tk 8.X
where X >= 2. This release is placed into "gs-VSN/priv/tcl" and the
'gstk_port_handler' module searches this directory first to find the
"wish" executable program.

It is possible to pack the files from a standard installation on a
machine into a TAR file but it is preferable to build Tcl/Tk from
sources. The steps are

  0. Set some environment variables

       % setenv BUILDDIR /tmp/build
       % setenv GNUTAR gtar

  1. Download unpack the sources from http://sourceforge.net/projects/tcl.
     Use the latest stable release. When this README was written
     the latest stable version was 8.3.4.

       % mkdir -p $BUILDDIR/tcl
       % cd $BUILDDIR
       % $GNUTAR -xzf /my/src/path/tcl8.3.4.tar.gz
       % $GNUTAR -xzf /my/src/path/tk8.3.4.tar.gz

       % cd tcl8.3.4/unix
       % ./configure --enable-gcc --enable-threads --disable-load \
                --disable-shared --prefix=$BUILDDIR/tcl
       % make
       % make install

       % cd ../../tk8.3.4/unix
       % ./configure --enable-gcc --enable-threads --disable-load \
                --disable-shared --prefix=$BUILDDIR/tcl \
                --with-tcl=$BUILDDIR/tcl/lib
       % make
       % make install

  2. Check that the executable wish program don't depend on libtcl
     or libtk. If it does we have to redo this or keep them
     where they are, else we can remove the libraries

       % cd $BUILDDIR
       % ldd tcl/bin/wish8.3

     and if the executables doesn't depend on libtcl or libtk we remove them

       % rm -f tcl/lib/libt*

  3. Remove other things we don't need. There may be other things in
     later releases but only remove the obvious things

       % rm -fr tcl/include tcl/man
       % rm -f  tcl/bin/tclsh*
       % rm -f  tcl/lib/*.sh
       % rm -fr tcl/lib/tcl*/http*
       % rm -fr tcl/lib/tcl*/tcltest*
       % rm -fr tcl/lib/tk*/demos
       % rm -fr tcl/lib/tk*/images
       % rm -f  tcl/lib/*/*.c

  4. Some releases of Tcl/Tk contains soft links that make the directory
     structure circular making it impossible to use 'cp' to copy the
     tcl directory. You can find them with

       % find tcl -type l

  5. Find out the name of the resulting TAR archive. Run the GS configure
     script on the target platform to view the name 

       % cd $ERL_TOP/lib/gs
       % rm -f config.cache
       % autoconf
       % ./configure
  
  6. Use the TAR program on the system to pack the resulting Tcl/Tk
     distribution. Keep the top "tcl" library

       % tar -cf - tcl | gzip > xxxxxxxx.tar.gz

  7. Copy and check in this TAR archive into the directory

       /clearcase/otp/erts/lib/gs/tcl/binaries

  8. We are done........


Windows
-------

These instructions are aimed at the 8.5.7 release of both tcl and tk,
but should work for 8.4 as well as 8.6 releases with appropriate
modifications.

0. Download the source tar files for both tcl and tk and unpack the
tar files from the same root.

1. Start with tcl. Open a command prompt with the appropriate Visual
C++ command environment (there is usually a shortcut under VC++ tools
or something in the start menu. With this command prompt, cd to the
tcl<version>/win directory and issue the following commands:

dos_prompt> nmake -f makefile.vc OPTS=static INSTALLDIR=<some temp dir>\tcl
...
dos_prompt> nmake -f makefile.vc OPTS=static INSTALLDIR=<some temp dir>\tcl install

2. Move further to tk. Using the same command prompt, cd
..\..\tk<version>\win and build there:

dos_prompt> nmake -f makefile.vc OPTS=static TCLDIR=<top dir of sources>\tcl<version> INSTALLDIR=<some temp dir>\tcl
...
dos_prompt> nmake -f makefile.vc OPTS=static TCLDIR=<top dir of sources>\tcl<version> INSTALLDIR=<some temp dir>\tcl install

3. Now you will need to strip the installation you put in <some temp
dir>\tcl. To do this, you will want a more appropriate command
shell. Start cygwin bash and cd to the cygwin equivalent of <some temp
dir>, i.e. where tcl/tk was installed. Now clean away what's not
needed (this is not optional, gs won't work with a full version...)

       % rm -fr tcl/include tcl/man
       % rm -f  tcl/bin/tclsh*
       % rm -f  tcl/lib/*.sh
       % rm -fr tcl/lib/tcl*/http*
       % rm -fr tcl/lib/tcl*/tcltest*
       % rm -fr tcl/lib/tcl*/tzdata
       % rm -fr tcl/lib/tcl*/msgs
       % rm -fr tcl/lib/tk*/demos
       % rm -fr tcl/lib/tk*/images
       % rm -fr tcl/lib/tk*/tzdata
       % rm -f  tcl/lib/*/*.c
       % rm -f  tcl/lib/*.lib
       % rm -fr tcl/lib/tcl8

(The last line is especially important, gs will crash otherwise...)

4. Now copy license.terms from the sources, otherwise you may break the redistribution policy.

       % cp <top of sources/tcl<version>/license.terms tcl/

5. Pack the tar file:

       % tar zcf win32.tar.gz tcl

6. Put it in $ERL_TOP/lib/gs/tcl/binaries (as described for Unixes)

7. You are done!