home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Tcl-Tk 8.0 / Pre-installed version / tcl8.0 / unix / porting.notes < prev    next >
Encoding:
Text File  |  1997-08-15  |  12.7 KB  |  393 lines  |  [TEXT/ALFA]

  1. This file contains a collection of notes that various people have
  2. provided about porting Tcl to various machines and operating systems.
  3. I don't have personal access to any of these machines, so I make
  4. no guarantees that the notes are correct, complete, or up-to-date.
  5. If you see the word "I" in any explanations, it refers to the person
  6. who contributed the information, not to me;  this means that I
  7. probably can't answer any questions about any of this stuff.  In
  8. some cases, a person has volunteered to act as a contact point for
  9. questions about porting Tcl to a particular machine;  in these
  10. cases the person's name and e-mail address are listed.  I'm
  11. interested in getting new porting information to add to the file;
  12. please mail updates to "john.ousterhout@eng.sun.com".
  13.  
  14. This file reflects information provided for Tcl 7.4 and later releases.
  15. If there is no information for your configuration in this file, check
  16. the file "porting.old" too;  it contains information that was
  17. submitted for Tcl 7.3 and earlier releases, and some of that information
  18. may still be valid.
  19.  
  20. A new porting database has recently become available on the Web at
  21. the following URL:
  22.     http://www.sunlabs.com/cgi-bin/tcl/info.4.0
  23. This page provides information about the platforms on which Tcl 7.4
  24. and Tk 4.0 have been compiled and what changes were needed to get Tcl
  25. and Tk to compile.  You can also add new entries to that database
  26. when you install Tcl and Tk on a new platform.  The Web database is
  27. likely to be more up-to-date than this file.
  28.  
  29. sccsid = SCCS: @(#) porting.notes 1.18 96/12/31 14:50:27
  30.  
  31. --------------------------------------------
  32. Solaris, various versions
  33. --------------------------------------------
  34.  
  35. 1. If typing "make test" results in an error message saying that
  36. there are no "*.test" files, or you get lots of globbing errors,
  37. it's probably because your system doesn't have cc installed and
  38. you used gcc.  In order for this to work, you have to set your
  39. CC environment variable to gcc and your CPP environment variable
  40. to "gcc -E" before running the configure script.
  41.  
  42. 2. Make sure that /usr/ucb is not in your PATH or LD_LIBRARY_PATH
  43. environment variables;  this will cause confusion between the new
  44. Solaris libraries and older UCB versions (Tcl will expect one version
  45. and get another).
  46.  
  47. 3. There have been several reports of problems with the "glob" command.
  48. So far these reports have all been for older versions of Tcl, but
  49. if you run into problems, edit the Makefile after "configure" is
  50. run and add "-DNO_DIRENT_H=1" to the definitions of DEFS.  Do this
  51. before compiling.
  52.  
  53. --------------------------------------------
  54. Pyramid DC/OSx SVr4, DC/OSx version 94c079
  55. --------------------------------------------
  56.  
  57. Tcl seems to dump core in cmdinfo.test when compiled with the
  58. optimiser turned on in TclEval which calls 'free'.  To get around
  59. this, turn the optimiser off.
  60.  
  61. --------------------------------------------
  62. SGI machines, IRIX 5.2, 5.3, IRIX64 6.0.1
  63. --------------------------------------------
  64.  
  65. 1. If you compile with gcc-2.6.3 under some versions of IRIX (e.g.
  66.    4.0.5), DBL_MAX is defined too large for gcc and Tcl complains
  67.    about all floating-point values being too large to represent.
  68.    If this happens, redefining DBL_MAX to 9.99e299.
  69.  
  70. 2. Add "-D_BSD_TIME" to CFLAGS in Makefile.  This avoids type conflicts
  71. in the prototype for the gettimeofday procedure.
  72.  
  73. 2. If you're running under Irix 6.x and tclsh dumps core, try
  74. removing -O from the CFLAGS in Makefile and recompiling;  compiler
  75. optimizations seem to cause problems on some machines.
  76.  
  77. --------------------------------------------
  78. IBM RTs, AOS
  79. --------------------------------------------
  80.  
  81. 1. Steal fmod from 4.4BSD
  82. 2. Add a #define to tclExpr such that:
  83. extern double fmod(); 
  84. is defined conditionally on ibm032
  85.  
  86. --------------------------------------------
  87. QNX 4.22
  88. --------------------------------------------
  89.  
  90. tclPort.h
  91.     - commented out 2 lines containing #include <sys/param.h>
  92.  
  93. tcl.h
  94.     - changed  #define VARARGS ()
  95.     - to       #ifndef __QNX__
  96.                  #define VARARGS ()
  97.                #else
  98.                  #define VARARGS (void *, ...)
  99.                #endif
  100.  
  101. --------------------------------------------
  102. Interactive UNIX
  103. --------------------------------------------
  104.  
  105. Add the switch -Xp to LIBS in Makefile;  otherwise strftime will not
  106. be found when linking.
  107.  
  108. --------------------------------------------
  109. Motorola SVR4 V4.2 (m88k)
  110. --------------------------------------------
  111.  
  112. For Motorola Unix R40V4.2 (m88k architechure), use /usr/ucb/cc instead of
  113. /usr/bin/cc.  Otherwise, the compile will fail because of conflicts over
  114. the gettimeofday() call.
  115.  
  116. Also, -DNO_DIRENT_H=1 is required for the "glob" command to work.
  117.  
  118. --------------------------------------------
  119. NeXTSTEP 3.x
  120. --------------------------------------------
  121.  
  122. Here's the set of changes I made to make 7.5b3 compile cleanly on
  123. NeXTSTEP3.x.
  124.  
  125. Here are a couple lines from unix/Makefile:
  126.  
  127. # Added utsname.o, which implements a uname() emulation for NeXTSTEP.
  128. COMPAT_OBJS =         getcwd.o strtod.o tmpnam.o utsname.o
  129.  
  130. TCL_NAMES=\
  131.     -Dstrtod=tcl_strtod -Dtmpnam=tcl_tmpnam -Dgetcwd=tcl_getcwd \
  132.     -Dpanic=tcl_panic -Dmatherr=tcl_matherr \
  133.     -Duname=tcl_uname -Dutsname=tcl_utsname
  134.  
  135. # Added mode_t, pid_t, and O_NONBLOCK definitions.
  136. AC_FLAGS =         -DNO_DIRENT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_TIME_H=1  
  137. -DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_TM_GMTOFF=1 -DHAVE_TIMEZONE_VAR=1  
  138. -DSTDC_HEADERS=1 -Dmode_t=int -Dpid_t=int -DO_NONBLOCK=O_NDELAY ${TCL_NAMES}
  139.  
  140.  
  141. Here are diffs for other files.  utsname.[hc] are a couple files I added
  142. to compat/  I'm not clear whether that's where they legitimately belong
  143. - I considered stashing them in tclLoadNext.c instead.  The tclIO.c
  144. change was a bug, I believe, which I reported on comp.lang.tcl and
  145. has apparently been noted and fixed.  The objc_loadModules() change
  146. allows "load" to load object code containing Objective-C code in
  147. addition to plain C code.
  148.  
  149. ---
  150. scott hess <shess@winternet.com> (WWW to "http://www.winternet.com/~shess/")
  151. Work: 12550 Portland Avenue South #121, Burnsville, MN  55337  (612)895-1208
  152.  
  153.  
  154. diff -rc tcl7.5b3.orig/compat/utsname.c tcl7.5b3/compat/utsname.c
  155. *** tcl7.5b3.orig/compat/utsname.c    Tue Apr  2 13:57:23 1996
  156. --- tcl7.5b3/compat/utsname.c    Mon Mar 18 11:05:54 1996
  157. ***************
  158. *** 0 ****
  159. --- 1,27 ----
  160. + /*
  161. +  * utsname.c --
  162. +  *
  163. +  *    This file is an emulation of the POSIX uname() function
  164. +  *    under NeXTSTEP 3.x.
  165. +  *
  166. +  */
  167.  
  168. + #include "utsname.h"
  169. + #include <mach-o/arch.h>
  170. + #include <stdio.h>
  171.  
  172. + int uname( struct utsname *name)
  173. + {
  174. +     const NXArchInfo *arch;
  175. +     if( gethostname( name->nodename, sizeof( name->nodename))==-1) {
  176. +     return -1;
  177. +     }
  178. +     if( (arch=NXGetLocalArchInfo())==NULL) {
  179. +     return -1;
  180. +     }
  181. +     strncpy( name->machine, arch->description, sizeof( name->machine));
  182. +     strcpy( name->sysname, "NEXTSTEP");
  183. +     strcpy( name->release, "0");
  184. +     strcpy( name->version, "3");
  185. +     return 0;
  186. + }
  187. diff -rc tcl7.5b3.orig/compat/utsname.h tcl7.5b3/compat/utsname.h
  188. *** tcl7.5b3.orig/compat/utsname.h    Tue Apr  2 13:57:26 1996
  189. --- tcl7.5b3/compat/utsname.h    Mon Mar 18 10:34:05 1996
  190. ***************
  191. *** 0 ****
  192. --- 1,22 ----
  193. + /*
  194. +  * utsname.h --
  195. +  *
  196. +  *    This file is an emulation of the POSIX uname() function
  197. +  *    under NeXTSTEP.
  198. +  *
  199. +  */
  200.  
  201. + #ifndef _UTSNAME
  202. + #define _UTSNAME
  203.  
  204. + struct utsname {
  205. +     char sysname[ 32];
  206. +     char nodename[ 32];
  207. +     char release[ 32];
  208. +     char version[ 32];
  209. +     char machine[ 32];
  210. + };
  211.  
  212. + extern int uname( struct utsname *name);
  213.  
  214. + #endif /* _UTSNAME */
  215. diff -rc tcl7.5b3.orig/generic/tclIO.c tcl7.5b3/generic/tclIO.c
  216. *** tcl7.5b3.orig/generic/tclIO.c    Fri Mar  8 12:59:53 1996
  217. --- tcl7.5b3/generic/tclIO.c    Mon Mar 18 11:38:57 1996
  218. ***************
  219. *** 2542,2548 ****
  220.               }
  221.               result = GetInput(chanPtr);
  222.               if (result != 0) {
  223. !                 if (result == EWOULDBLOCK) {
  224.                       chanPtr->flags |= CHANNEL_BLOCKED;
  225.                       return copied;
  226.                   }
  227. --- 2542,2548 ----
  228.               }
  229.               result = GetInput(chanPtr);
  230.               if (result != 0) {
  231. !                 if (result == EAGAIN) {
  232.                       chanPtr->flags |= CHANNEL_BLOCKED;
  233.                       return copied;
  234.                   }
  235. diff -rc tcl7.5b3.orig/unix/tclLoadNext.c tcl7.5b3/unix/tclLoadNext.c
  236. *** tcl7.5b3.orig/unix/tclLoadNext.c    Sat Feb 17 16:16:42 1996
  237. --- tcl7.5b3/unix/tclLoadNext.c    Mon Mar 18 10:02:36 1996
  238. ***************
  239. *** 55,61 ****
  240.     char *files[]={fileName,NULL};
  241.     NXStream *errorStream=NXOpenMemory(0,0,NX_READWRITE);
  242.   
  243.  
  244. !   if(!rld_load(errorStream,&header,files,NULL)) {
  245.       NXGetMemoryBuffer(errorStream,&data,&len,&maxlen);
  246.       Tcl_AppendResult(interp,"couldn't load file \"",fileName,"\": ",data,NULL);
  247.       NXCloseMemory(errorStream,NX_FREEBUFFER);
  248. --- 55,61 ----
  249.     char *files[]={fileName,NULL};
  250.     NXStream *errorStream=NXOpenMemory(0,0,NX_READWRITE);
  251.   
  252.  
  253. !   if(objc_loadModules(files,errorStream,NULL,&header,NULL)) {
  254.       NXGetMemoryBuffer(errorStream,&data,&len,&maxlen);
  255.       Tcl_AppendResult(interp,"couldn't load file \"",fileName,"\": ",data,NULL);
  256.       NXCloseMemory(errorStream,NX_FREEBUFFER);
  257. diff -rc tcl7.5b3.orig/unix/tclUnixFile.c tcl7.5b3/unix/tclUnixFile.c
  258. *** tcl7.5b3.orig/unix/tclUnixFile.c    Thu Mar  7 18:16:34 1996
  259. --- tcl7.5b3/unix/tclUnixFile.c    Mon Mar 18 11:10:03 1996
  260. ***************
  261. *** 31,37 ****
  262. --- 31,41 ----
  263.   
  264.  
  265.   static int executableNameExitHandlerSet = 0;
  266.   
  267.  
  268. + #if NeXT
  269. + #define waitpid( p, s, o) wait4( p, s, o, NULL)
  270. + #else
  271.   extern pid_t waitpid _ANSI_ARGS_((pid_t pid, int *stat_loc, int options));
  272. + #endif
  273.   
  274.  
  275.   /*
  276.    * Static routines for this file:
  277. diff -rc tcl7.5b3.orig/unix/tclUnixInit.c tcl7.5b3/unix/tclUnixInit.c
  278. *** tcl7.5b3.orig/unix/tclUnixInit.c    Sat Feb 17 16:16:39 1996
  279. --- tcl7.5b3/unix/tclUnixInit.c    Mon Mar 18 11:50:28 1996
  280. ***************
  281. *** 14,20 ****
  282.   #include "tclInt.h"
  283.   #include "tclPort.h"
  284.   #ifndef NO_UNAME
  285. ! #   include <sys/utsname.h>
  286.   #endif
  287.   #if defined(__FreeBSD__)
  288.   #include <floatingpoint.h>
  289. --- 14,24 ----
  290.   #include "tclInt.h"
  291.   #include "tclPort.h"
  292.   #ifndef NO_UNAME
  293. ! #    if NeXT
  294. ! #        include "../compat/utsname.h"
  295. ! #    else
  296. ! #        include <sys/utsname.h>
  297. ! #    endif
  298.   #endif
  299.   #if defined(__FreeBSD__)
  300.   #include <floatingpoint.h>
  301. diff -rc tcl7.5b3.orig/unix/tclUnixPort.h tcl7.5b3/unix/tclUnixPort.h
  302. *** tcl7.5b3.orig/unix/tclUnixPort.h    Thu Mar  7 18:16:31 1996
  303. --- tcl7.5b3/unix/tclUnixPort.h    Mon Mar 18 11:53:14 1996
  304. ***************
  305. *** 76,82 ****
  306.    */
  307.   
  308.  
  309.   #include <sys/socket.h>        /* struct sockaddr, SOCK_STREAM, ... */
  310. ! #include <sys/utsname.h>    /* uname system call. */
  311.   #include <netinet/in.h>        /* struct in_addr, struct sockaddr_in */
  312.   #include <arpa/inet.h>        /* inet_ntoa() */
  313.   #include <netdb.h>        /* gethostbyname() */
  314. --- 76,88 ----
  315.    */
  316.   
  317.  
  318.   #include <sys/socket.h>        /* struct sockaddr, SOCK_STREAM, ... */
  319. ! #ifndef NO_UNAME
  320. ! #    if NeXT
  321. ! #        include "../compat/utsname.h"
  322. ! #    else
  323. ! #        include <sys/utsname.h>    /* uname system call. */
  324. ! #    endif
  325. ! #endif
  326.   #include <netinet/in.h>        /* struct in_addr, struct sockaddr_in */
  327.   #include <arpa/inet.h>        /* inet_ntoa() */
  328.   #include <netdb.h>        /* gethostbyname() */
  329.  
  330. --------------------------------------------
  331. SCO Unix 3.2.4 (ODT 3.0)
  332. --------------------------------------------
  333.  
  334. The macro va_start in /usr/include/stdarg.h is incorrectly terminated by
  335. a semi-colon.  This causes compile of generic/tclBasic.c to fail.  The
  336. best solution is to edit the definition of va_start to remove the `;'.
  337. This will fix this file for anything you want to compile.  If you don't have
  338. permission to edit /usr/include/stdarg.h in place, copy it to the tcl unix
  339. directory and change it there.
  340.  
  341. Contact me directly if you have problems on SCO systems.
  342. Mark Diekhans <markd@grizzly.com>
  343.  
  344. --------------------------------------------
  345. SCO Unix 3.2.5 (ODT 5.0)
  346. --------------------------------------------
  347.  
  348. Expect failures from socket tests 2.9 and 3.1.
  349.  
  350. Contact me directly if you have problems on SCO systems.
  351. Mark Diekhans <markd@grizzly.com>
  352.  
  353. --------------------------------------------
  354. Linux 1.2.13 (gcc 2.7.0, libc.so.5.0.9)
  355. --------------------------------------------
  356.  
  357. Symptoms:
  358.  
  359. *    Some extensions could not be loaded dynamically, most
  360.     prominently Blt 2.0
  361.  
  362.     The given error message essentially said:
  363.     Could not resolve symbol '__eprintf'.
  364.  
  365.     (This procedure is used by the macro 'assert')
  366.  
  367. Cause
  368.  
  369. *    '__eprintf' is defined in 'libgcc.a', not 'libc.so.x.y'.
  370.     It is therefore impossible to load it dynamically.
  371.  
  372. *    Neither tcl nor tk make use of 'assert', thereby
  373.     preventing a static linkage.
  374.  
  375. Workaround
  376.  
  377. *    I included <assert.h> in 'tclAppInit.c' / 'tkAppInit.c'
  378.     and then executed 'assert (argc)' just before the call
  379.     to Tcl_Main / Tk_Main.
  380.  
  381.     This forced the static linkage of '__eprintf' and
  382.     everything went fine from then on.
  383.  
  384.     (Something like 'assert (1)', 'assert (a==a)' is not
  385.     sufficient, it will be optimized away).
  386.  
  387.