summaryrefslogtreecommitdiffstats
path: root/unix/porting.old
blob: de41beb0065fd239e6be3a3c2d92c88836d77c76 (plain)
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
This is an old version of the file "porting.notes".  It contains
porting information that people submitted for Tk releases numbered
3.6 and earlier.  You may find information in this file useful if
there is no information available for your machine in the current
version of "porting.notes".

I don't have personal access to any of these machines, so I make
no guarantees that the notes are correct, complete, or up-to-date.
If you see the word "I" in any explanations, it refers to the person
who contributed the information, not to me;  this means that I
probably can't answer any questions about any of this stuff. In
some cases, a person has volunteered to act as a contact point for
questions about porting Tcl to a particular machine;  in these
cases the person's name and e-mail address are listed.  I'd be
happy to receive corrections or updates.

RCS: @(#) $Id: porting.old,v 1.2 1998/09/14 18:23:54 stanton Exp $

---------------------------------------------
DEC Alphas:
---------------------------------------------

1. There appears to be a compiler/library bug that prevents tkTrig.c
from compiling unless you turn off optimization (remove the -O compiler
switch).  The problem appears to have been fixed in the 1.3-4 version
of the compiler.

---------------------------------------------
HP-UX systems:
---------------------------------------------

1. Configuration:
	    HP-UX Release 7.05 on a series 300 (68k) machine.
	    The native cc has been used for production.
	    X11r4 libraries and include files were taken from
	    internet archives, where as the server came with HPUX release 7.05.
    
    Problems:
	    Symbol table space for cc had to be increased with: -Wc,-Ns3000
	    tkBind.c did not compile under -O:
		    C1 internal error in "GetField": Set Error Detected
		    *** Error code 1
	    tkBind.c did compile without optimization (no -O).

2. Note: if you have trouble getting xauth-style access control to work
(and you'll need xauth if you want to use "send"), be sure to uncomment
the line

# Vuelogin*authorize:         True

in the file /usr/vue/config/Xconfig, so that the server starts up with
authorization enabled.  Also, you may have to reboot the machine in
order to force the server to restart.

---------------------------------------------
SCO Unix:
---------------------------------------------

Getting Tk to run under SCO Unix:

Add a "#undef select" to tkEvent.c, and remove the reference to TK_EXCEPTION
around line 460 of main.c.

Tk uses its own scheme for allocating the border colors for its 3D widgets,
which causes problems when running TK on a system with "PseudoColor"
display class, and a 16-cell colormap.

If you can't go to eight bitplanes, you can instead start the server with a
"-static" (Xsco) or "-analog" (Xsight) option, making the display class 
become "StaticColor".  This makes the entire colormap read-only, and it will
return the color that most closely maps to the desired color as possible.

---------------------------------------------
Silicon Graphics systems:
---------------------------------------------

1. Change the CC variable in the Makefile to:

CC =		cc -xansi -D__STDC__ -signed

2. Change the LIBS variable in the Makefile to use the X11 shared library
   ("-lX11_s" instead of "-lX11").

3. Under some versions of IRIX (e.g. 4.0.1) you have to turn off
   optimization (e.g.  change "-O" in CFLAGS to "-O0" or remove it
   entirely) because of faulty code generation.  If the Tcl or Tk test
   suites fail, turn off optimization.

4. Add a "-lsun" switch just before "-lm" in the LIBS definition.
   Under some versions of IRIX (5.1.1.3?) you'll need to omit the
   "-lsun" switch, plus remove the "-lsocket" and "-lnsl" switches
   added by the configure script;  otherwise you won't be able to
   use symbolic host names for the display, only numerical Internet
   addresses.

5. Rumor has it that you'll also need a "-lmalloc" switch in the
   LIBS definition.

6. In IRIX 5.2 you'll have to modify Makefile to fix the following problems:
    - The "-c" option is illegal with this version of install, but
      the "-F" switch is needed instead.  Change this in the "INSTALL ="
      definition line.
    - The order of file and directory have to be changed in all the
      invocations of INSTALL_DATA or INSTALL_PROGRAM.

---------------------------------------------
IBM RS/6000's:
---------------------------------------------
1. To allow ALT- sequences to work on the RS-6000, the following
line should be changed in tkBind.c:

    OLD LINE:
     {"Alt",	Mod2Mask, 	0},
    NEW LINE:
     {"Alt",	Mod1Mask, 	0},

---------------------------------------------
AT&T SVR4:
---------------------------------------------

1. The first major hurdle is that SVR4's select() subtly differs
from BSD select.  This impacts Tk in two ways, some of the Xlib calls
make use of select() and are inherently broken and Tk itself makes
extensive use of select().  The first problem can't be fixed without
rebuilding one's Xlib, but can be avoided.  I intend to submit part
of my work the XFree86 guys so that the next version of XFree86 for
SVR4 will not be broken.  Until then, it is necessary to comment out
this section of code from Tk_DoOneEvent() (which is near line 1227):

#if !defined(SVR4)
                    void (*oldHandler)();

                    oldHandler = (void (*)()) signal(SIGPIPE, SIG_IGN);
                    XNoOp(display);
                    XFlush(display);
                    (void) signal(SIGPIPE, oldHandler);
#endif /* SVR4 */

if you don't comment it out, some scripts cause wish to go into
an infinite loop of sending no-ops to the X server.

2. As for fixing Tk's calls to select(), I've taken the simple
approach of writing a wrapper for select and then using #define to
replace all calls to select with the wrapper.  I chose tkConfig.h
to load the wrapper.  So at the very end of tkConfig.h, it now looks
like:

#if defined(SVR4)
#  include "BSDselect.h"
#endif 

#endif /* _TKCONFIG */

The file BSDselect.h looks like this:

#include <sys/types.h>
#include <sys/time.h>
#include <sys/select.h>

/*  This is a fix for the difference between BSD's select() and
 *  SVR4's select().  SVR4's select() can never return a value larger
 *  than the total number of file descriptors being checked.  So, if
 *  you select for read and write on one file descriptor, and both
 *  are true, SVR4 select() will only return 1.  BSD select in the
 *  same situation will return 2.
 *
 *	Additionally, BSD select() on timing out, will zero the masks,
 *	while SVR4 does not.  This is fixed here as well.
 *
 *	Set your tabstops to 4 characters to have this code nicely formatted.
 *
 *	Jerry Whelan, guru@bradley.edu, June 12th, 1993
 */


int
BSDselect(nfds, readfds, writefds, exceptfds, timeout)
int nfds;
fd_set *readfds, *writefds, *exceptfds;
struct timeval *timeout;
{
	int		rval,
			i;

	rval = select(nfds, readfds, writefds, exceptfds, timeout);

	switch(rval) {
		case -1:	return(rval);
					break;

		case 0:		if(readfds != NULL)
						FD_ZERO(readfds);
					if(writefds != NULL)
						FD_ZERO(writefds);
					if(exceptfds != NULL)
						FD_ZERO(exceptfds);

					return(rval);
					break;

		default:	for(i=0, rval=0; i < nfds; i++) {
						if((readfds != NULL) && FD_ISSET
(i, readfds)) rval++;
						if((writefds != NULL) && FD_ISSE
T(i, writefds)) rval++;
						if((writefds != NULL) && FD_ISSE
T(i, exceptfds)) rval++;
					}
					return(rval);
		}
/* Should never get here */
}

---------------------------------------------
CDC 4680MP, EP/IX 1.4.3:
---------------------------------------------

The installation was done in the System V environment (-systype sysv)
with the BSD extensions available (-I/usr/include/bsd and -lbsd).  It was
built with the 2.20 level C compiler.  The 2.11 level can be used, but
it is better to match what TCL is built with, which must be 2.20 or
higher (see the porting notes with TCL for the details).

To make the configure script find the BSD extensions, I set environment
variable DEFS to "-I/usr/include/bsd" and LIBS to "-lbsd" before
running it.  I would have also set CC to "cc2.20", but that compiler
driver has a bug that loader errors (e.g. not finding a library routine,
which the script uses to tell what is available) do not cause an error
status to be returned to the shell (but see the Tcl 2.1.1 porting notes
for comments about using "-non_shared").

After running configure, I changed the CC definition line in Makefile
from:
	CC=cc
to
	CC=cc2.20
to match the TCL build.  Skip this if the default compiler is already 2.20
(or later).

---------------------------------------------
CDC 4680MP, EP/IX 2.1.1:
---------------------------------------------

The installation was done in the System V environment (-systype sysv)
with the BSD extensions available (-I/usr/include/bsd and -lbsd).  It was
built with the 3.11 level C compiler.  Earlier levels can be used, but it
is better to match what TCL is built with, which must be 2.20 or higher
(see the porting notes with TCL for the details).

To make the configure script find the BSD extensions, I set environment
variable DEFS to "-I/usr/include/bsd -non_shared" and LIBS to "-lbsd"
before running it.

See the Tcl porting notes for comments on why "-non_shared" is needed
during the configuration step.  It was removed from AC_FLAGS before
building.

-------------------------------------------------
Pyramid, OSx 5.1a (UCB universe, GCC installed):
-------------------------------------------------

Instead of typing "./configure" to configure, type

    DEFS="-I/usr/include/X11/attinc" ./configure

to sh to do the configuration.

-------------------------------------------------
NextSTEP 3.1:
-------------------------------------------------

1. Run configure with predefined CPP:
	CPP='cc -E' ./configure
   (If your shell is [t]csh, do a "setenv CPP 'cc -E'")

2. Edit Makefile: 
  -add the following to AC_FLAGS:
	-Dstrtod=tcl_strtod

Note: Tk's raise test may fail when running the tvtwm window manager.
Changing to either twm or even better fvwm ensures that this test will
succeed. 

-------------------------------------------------
Encore 91, UMAX V 3.0.9.3:
-------------------------------------------------

1. Modify the CFLAGS definition in Makefile to include -DENCORE:

    CFLAGS = -O -DENCORE

2. "mkdir" does not by default create the parent directories.  The mkdir
directives should be modified to "midir -p".

3. An error of a redeclaration of read, can be resolved by conditionally
not compiling if an ENCORE system.

#ifndef ENCORE
extern int              read _ANSI_ARGS_((int fd, char *buf, size_t size));
#endif

-------------------------------------------------
Sequent machines running Dynix:
Contact: Andrew Swan (aswan@soda.berkeley.edu)
-------------------------------------------------

1. Use gcc instead of the cc distributed by Sequent

2. There are problems with the distributed version of
   <stddef.h>.  The easiest solution is probably to create a
   copy of stddef.h, make sure it comes early in the include
   path and then edit it as need be to eliminate conflicts
   with the X11 header files.

3. The same comments about the tanh function from the notes on
   porting Tcl apply to Tk.

-------------------------------------------------
Systems running Interactive 4.0:
-------------------------------------------------

1. Add "-posix" to CFLAGS in Makefile (or Makefile.in).

2. Add "-lnsl_s" to LIBS in Makefile (or Makefile.in).