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. --------------------------------------------- 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"). Also, if you want to access remote servers you may need to link with "-lsun", e.g. "-lX11_s -lsun". 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. --------------------------------------------- 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 #include #include /* 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. 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). ------------------------------------------------- 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 2. Edit Makefile: -add '-m' to MATH_LIBS MATH_LIBS = -m -lm