home *** CD-ROM | disk | FTP | other *** search
- This file contains a collection of notes that various people have
- provided about porting Tk to various machines and operating systems.
- 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.
- I'd be happy to receive corrections or updates.
-
- ---------------------------------------------
- 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).
-
- ---------------------------------------------
- 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.
-
- ---------------------------------------------
- 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 */
- }
-