OSDN Git Service

Initial revision
[pf3gnuchains/pf3gnuchains3x.git] / tk / unix / porting.old
1 This is an old version of the file "porting.notes".  It contains
2 porting information that people submitted for Tk releases numbered
3 3.6 and earlier.  You may find information in this file useful if
4 there is no information available for your machine in the current
5 version of "porting.notes".
6
7 I don't have personal access to any of these machines, so I make
8 no guarantees that the notes are correct, complete, or up-to-date.
9 If you see the word "I" in any explanations, it refers to the person
10 who contributed the information, not to me;  this means that I
11 probably can't answer any questions about any of this stuff. In
12 some cases, a person has volunteered to act as a contact point for
13 questions about porting Tcl to a particular machine;  in these
14 cases the person's name and e-mail address are listed.  I'd be
15 happy to receive corrections or updates.
16
17 sccsid = SCCS: @(#) porting.old 1.2 96/02/16 10:27:30
18
19 ---------------------------------------------
20 DEC Alphas:
21 ---------------------------------------------
22
23 1. There appears to be a compiler/library bug that prevents tkTrig.c
24 from compiling unless you turn off optimization (remove the -O compiler
25 switch).  The problem appears to have been fixed in the 1.3-4 version
26 of the compiler.
27
28 ---------------------------------------------
29 HP-UX systems:
30 ---------------------------------------------
31
32 1. Configuration:
33             HP-UX Release 7.05 on a series 300 (68k) machine.
34             The native cc has been used for production.
35             X11r4 libraries and include files were taken from
36             internet archives, where as the server came with HPUX release 7.05.
37     
38     Problems:
39             Symbol table space for cc had to be increased with: -Wc,-Ns3000
40             tkBind.c did not compile under -O:
41                     C1 internal error in "GetField": Set Error Detected
42                     *** Error code 1
43             tkBind.c did compile without optimization (no -O).
44
45 2. Note: if you have trouble getting xauth-style access control to work
46 (and you'll need xauth if you want to use "send"), be sure to uncomment
47 the line
48
49 # Vuelogin*authorize:         True
50
51 in the file /usr/vue/config/Xconfig, so that the server starts up with
52 authorization enabled.  Also, you may have to reboot the machine in
53 order to force the server to restart.
54
55 ---------------------------------------------
56 SCO Unix:
57 ---------------------------------------------
58
59 Getting Tk to run under SCO Unix:
60
61 Add a "#undef select" to tkEvent.c, and remove the reference to TK_EXCEPTION
62 around line 460 of main.c.
63
64 Tk uses its own scheme for allocating the border colors for its 3D widgets,
65 which causes problems when running TK on a system with "PseudoColor"
66 display class, and a 16-cell colormap.
67
68 If you can't go to eight bitplanes, you can instead start the server with a
69 "-static" (Xsco) or "-analog" (Xsight) option, making the display class 
70 become "StaticColor".  This makes the entire colormap read-only, and it will
71 return the color that most closely maps to the desired color as possible.
72
73 ---------------------------------------------
74 Silicon Graphics systems:
75 ---------------------------------------------
76
77 1. Change the CC variable in the Makefile to:
78
79 CC =            cc -xansi -D__STDC__ -signed
80
81 2. Change the LIBS variable in the Makefile to use the X11 shared library
82    ("-lX11_s" instead of "-lX11").
83
84 3. Under some versions of IRIX (e.g. 4.0.1) you have to turn off
85    optimization (e.g.  change "-O" in CFLAGS to "-O0" or remove it
86    entirely) because of faulty code generation.  If the Tcl or Tk test
87    suites fail, turn off optimization.
88
89 4. Add a "-lsun" switch just before "-lm" in the LIBS definition.
90    Under some versions of IRIX (5.1.1.3?) you'll need to omit the
91    "-lsun" switch, plus remove the "-lsocket" and "-lnsl" switches
92    added by the configure script;  otherwise you won't be able to
93    use symbolic host names for the display, only numerical Internet
94    addresses.
95
96 5. Rumor has it that you'll also need a "-lmalloc" switch in the
97    LIBS definition.
98
99 6. In IRIX 5.2 you'll have to modify Makefile to fix the following problems:
100     - The "-c" option is illegal with this version of install, but
101       the "-F" switch is needed instead.  Change this in the "INSTALL ="
102       definition line.
103     - The order of file and directory have to be changed in all the
104       invocations of INSTALL_DATA or INSTALL_PROGRAM.
105
106 ---------------------------------------------
107 IBM RS/6000's:
108 ---------------------------------------------
109 1. To allow ALT- sequences to work on the RS-6000, the following
110 line should be changed in tkBind.c:
111
112     OLD LINE:
113      {"Alt",    Mod2Mask,       0},
114     NEW LINE:
115      {"Alt",    Mod1Mask,       0},
116
117 ---------------------------------------------
118 AT&T SVR4:
119 ---------------------------------------------
120
121 1. The first major hurdle is that SVR4's select() subtly differs
122 from BSD select.  This impacts Tk in two ways, some of the Xlib calls
123 make use of select() and are inherently broken and Tk itself makes
124 extensive use of select().  The first problem can't be fixed without
125 rebuilding one's Xlib, but can be avoided.  I intend to submit part
126 of my work the XFree86 guys so that the next version of XFree86 for
127 SVR4 will not be broken.  Until then, it is necessary to comment out
128 this section of code from Tk_DoOneEvent() (which is near line 1227):
129
130 #if !defined(SVR4)
131                     void (*oldHandler)();
132
133                     oldHandler = (void (*)()) signal(SIGPIPE, SIG_IGN);
134                     XNoOp(display);
135                     XFlush(display);
136                     (void) signal(SIGPIPE, oldHandler);
137 #endif /* SVR4 */
138
139 if you don't comment it out, some scripts cause wish to go into
140 an infinite loop of sending no-ops to the X server.
141
142 2. As for fixing Tk's calls to select(), I've taken the simple
143 approach of writing a wrapper for select and then using #define to
144 replace all calls to select with the wrapper.  I chose tkConfig.h
145 to load the wrapper.  So at the very end of tkConfig.h, it now looks
146 like:
147
148 #if defined(SVR4)
149 #  include "BSDselect.h"
150 #endif 
151
152 #endif /* _TKCONFIG */
153
154 The file BSDselect.h looks like this:
155
156 #include <sys/types.h>
157 #include <sys/time.h>
158 #include <sys/select.h>
159
160 /*  This is a fix for the difference between BSD's select() and
161  *  SVR4's select().  SVR4's select() can never return a value larger
162  *  than the total number of file descriptors being checked.  So, if
163  *  you select for read and write on one file descriptor, and both
164  *  are true, SVR4 select() will only return 1.  BSD select in the
165  *  same situation will return 2.
166  *
167  *      Additionally, BSD select() on timing out, will zero the masks,
168  *      while SVR4 does not.  This is fixed here as well.
169  *
170  *      Set your tabstops to 4 characters to have this code nicely formatted.
171  *
172  *      Jerry Whelan, guru@bradley.edu, June 12th, 1993
173  */
174
175
176 int
177 BSDselect(nfds, readfds, writefds, exceptfds, timeout)
178 int nfds;
179 fd_set *readfds, *writefds, *exceptfds;
180 struct timeval *timeout;
181 {
182         int             rval,
183                         i;
184
185         rval = select(nfds, readfds, writefds, exceptfds, timeout);
186
187         switch(rval) {
188                 case -1:        return(rval);
189                                         break;
190
191                 case 0:         if(readfds != NULL)
192                                                 FD_ZERO(readfds);
193                                         if(writefds != NULL)
194                                                 FD_ZERO(writefds);
195                                         if(exceptfds != NULL)
196                                                 FD_ZERO(exceptfds);
197
198                                         return(rval);
199                                         break;
200
201                 default:        for(i=0, rval=0; i < nfds; i++) {
202                                                 if((readfds != NULL) && FD_ISSET
203 (i, readfds)) rval++;
204                                                 if((writefds != NULL) && FD_ISSE
205 T(i, writefds)) rval++;
206                                                 if((writefds != NULL) && FD_ISSE
207 T(i, exceptfds)) rval++;
208                                         }
209                                         return(rval);
210                 }
211 /* Should never get here */
212 }
213
214 ---------------------------------------------
215 CDC 4680MP, EP/IX 1.4.3:
216 ---------------------------------------------
217
218 The installation was done in the System V environment (-systype sysv)
219 with the BSD extensions available (-I/usr/include/bsd and -lbsd).  It was
220 built with the 2.20 level C compiler.  The 2.11 level can be used, but
221 it is better to match what TCL is built with, which must be 2.20 or
222 higher (see the porting notes with TCL for the details).
223
224 To make the configure script find the BSD extensions, I set environment
225 variable DEFS to "-I/usr/include/bsd" and LIBS to "-lbsd" before
226 running it.  I would have also set CC to "cc2.20", but that compiler
227 driver has a bug that loader errors (e.g. not finding a library routine,
228 which the script uses to tell what is available) do not cause an error
229 status to be returned to the shell (but see the Tcl 2.1.1 porting notes
230 for comments about using "-non_shared").
231
232 After running configure, I changed the CC definition line in Makefile
233 from:
234         CC=cc
235 to
236         CC=cc2.20
237 to match the TCL build.  Skip this if the default compiler is already 2.20
238 (or later).
239
240 ---------------------------------------------
241 CDC 4680MP, EP/IX 2.1.1:
242 ---------------------------------------------
243
244 The installation was done in the System V environment (-systype sysv)
245 with the BSD extensions available (-I/usr/include/bsd and -lbsd).  It was
246 built with the 3.11 level C compiler.  Earlier levels can be used, but it
247 is better to match what TCL is built with, which must be 2.20 or higher
248 (see the porting notes with TCL for the details).
249
250 To make the configure script find the BSD extensions, I set environment
251 variable DEFS to "-I/usr/include/bsd -non_shared" and LIBS to "-lbsd"
252 before running it.
253
254 See the Tcl porting notes for comments on why "-non_shared" is needed
255 during the configuration step.  It was removed from AC_FLAGS before
256 building.
257
258 -------------------------------------------------
259 Pyramid, OSx 5.1a (UCB universe, GCC installed):
260 -------------------------------------------------
261
262 Instead of typing "./configure" to configure, type
263
264     DEFS="-I/usr/include/X11/attinc" ./configure
265
266 to sh to do the configuration.
267
268 -------------------------------------------------
269 NextSTEP 3.1:
270 -------------------------------------------------
271
272 1. Run configure with predefined CPP:
273         CPP='cc -E' ./configure
274    (If your shell is [t]csh, do a "setenv CPP 'cc -E'")
275
276 2. Edit Makefile: 
277   -add the following to AC_FLAGS:
278         -Dstrtod=tcl_strtod
279
280 Note: Tk's raise test may fail when running the tvtwm window manager.
281 Changing to either twm or even better fvwm ensures that this test will
282 succeed. 
283
284 -------------------------------------------------
285 Encore 91, UMAX V 3.0.9.3:
286 -------------------------------------------------
287
288 1. Modify the CFLAGS definition in Makefile to include -DENCORE:
289
290     CFLAGS = -O -DENCORE
291
292 2. "mkdir" does not by default create the parent directories.  The mkdir
293 directives should be modified to "midir -p".
294
295 3. An error of a redeclaration of read, can be resolved by conditionally
296 not compiling if an ENCORE system.
297
298 #ifndef ENCORE
299 extern int              read _ANSI_ARGS_((int fd, char *buf, size_t size));
300 #endif
301
302 -------------------------------------------------
303 Sequent machines running Dynix:
304 Contact: Andrew Swan (aswan@soda.berkeley.edu)
305 -------------------------------------------------
306
307 1. Use gcc instead of the cc distributed by Sequent
308
309 2. There are problems with the distributed version of
310    <stddef.h>.  The easiest solution is probably to create a
311    copy of stddef.h, make sure it comes early in the include
312    path and then edit it as need be to eliminate conflicts
313    with the X11 header files.
314
315 3. The same comments about the tanh function from the notes on
316    porting Tcl apply to Tk.
317
318 -------------------------------------------------
319 Systems running Interactive 4.0:
320 -------------------------------------------------
321
322 1. Add "-posix" to CFLAGS in Makefile (or Makefile.in).
323
324 2. Add "-lnsl_s" to LIBS in Makefile (or Makefile.in).