home *** CD-ROM | disk | FTP | other *** search
/ Ultra Pack / UltraComputing Partner Applications.iso / SunLabs / tclTK / src / tcl7.4 / porting.old < prev    next >
Encoding:
Text File  |  1994-12-19  |  14.3 KB  |  385 lines

  1. This is an old version of the file "porting.notes".  It contains
  2. porting information that people submitted for Tcl releases numbered
  3. 7.3 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.
  15.  
  16. sccsid = @(#) porting.old 1.2 94/12/19 11:23:18
  17.  
  18. ---------------------------------------------
  19. Cray machines running UNICOS:
  20. Contact: John Freeman (jlf@cray.com)
  21. ---------------------------------------------
  22.  
  23. 1. There is an error in the strstr function in UNICOS such that if the
  24. string to be searched is empty (""), the search will continue past the
  25. end of the string.  Because of this, the history substitution loop
  26. will sometimes run past the end of its target string and trash
  27. malloc's free list, resulting in a core dump some time later.  (As you
  28. can probably guess, this took a while to diagnose.)  I've submitted a
  29. problem report to the C library maintainers, but in the meantime here
  30. is a workaround.
  31.  
  32. -----------------------------------------------------------------
  33. diff -c1 -r1.1 tclHistory.c
  34. *** 1.1    1991/11/12 16:01:58
  35. --- tclHistory.c    1991/11/12 16:14:22
  36. ***************
  37. *** 23,24 ****
  38. --- 23,29 ----
  39.   #include "tclInt.h"
  40. + #ifdef _CRAY
  41. + /* There is a bug in strstr in UNICOS; this works around it. */
  42. + #define strstr(s1,s2) ((s1)?(*(s1)?strstr((s1),(s2)):0):0)
  43. + #endif _CRAY
  44.  
  45. ---------------------------------------------
  46. MIPS systems runing EP/IX:
  47. ---------------------------------------------
  48.  
  49. 1. Need to add a line "#include <bsd/sys/time.h>" in tclUnix.h.
  50.  
  51. 2. Need to add "-lbsd" into the line that makes tclTest:
  52.  
  53.     ${CC} ${CFLAGS} tclTest.o libtcl.a -lbsd -o tclTest
  54.  
  55. ---------------------------------------------
  56. IBM RS/6000 systems running AIX:
  57. ---------------------------------------------
  58.  
  59. 1. The system version of strtoul is buggy, at least under some
  60. versions of AIX.  If the expression tests fail, try forcing Tcl
  61. to use its own version of strtoul instead of the system version.
  62. To do this, first copy strtoul.c from the compat subdirectory up
  63. to the main Tcl directory.  Then modify the Makefile so that
  64. the definition for COMPAT_OBJS includes "strtoul.o".  Note:  the
  65. "config" script should now detect the buggy strtoul and substitute
  66. Tcl's version automatically.
  67.  
  68. 2. You may have to comment out the declaration of open in tclUnix.h.
  69.  
  70. 3. You may need to add "-D_BSD -lbsd" to the CFLAGS definition.  This
  71. causes the system include files to look like BSD include files and
  72. causes C library routines to act like bsd library routines.  Without
  73. this, the system may choke on "struct wait".
  74.  
  75. ---------------------------------------------
  76. AT&T 4.03 OS:
  77. ---------------------------------------------
  78.  
  79. Machine: i386/33Mhz i387 32k Cache 16MByte 
  80. OS: AT&T SYSV Release 4 Version 3
  81. X: X11R5 fixlevel 9
  82. Xserver: X386 1.2
  83.  
  84. 1. Change the Tk Makefile as follows:
  85. XLIB            = -lX11
  86.     should be changed to:
  87. XLIB            = -lX11 -lsocket -lnsl
  88.  
  89. -------------------------------------------------------
  90. Silicon Graphics systems:
  91. -------------------------------------------------------
  92.  
  93. 1. Change the CC variable in the Makefile to:
  94.  
  95. CC =        cc -xansi -D__STDC__ -signed
  96.  
  97. 2. In  Irix releases 4.0.1 or earlier the C compiler has a buggy optimizer.
  98.    If Tcl fails its test suite or generates inexplicable errors,
  99.    compile tclVar.c with -O0 instead of -O.
  100.  
  101. 3. For IRIX 5.1 or later, comments 1 and 2 are no longer relevant,
  102. but you must add -D_BSD_SIGNALS to CFLAGS to get the proper signal
  103. routines.
  104.  
  105. 4. Add a "-lsun" switch in the targets for tclsh and tcltest,
  106. just before ${MATH_LIBS}.
  107.  
  108. 5. Rumor has it that you also need to add the "-lmalloc" library switch
  109. in the targets for tclsh and tcltest.
  110.  
  111. 6. In IRIX 5.2 you'll have to modify Makefile to fix the following problems:
  112.     - The "-c" option is illegal with this version of install, but
  113.       the "-F" switch is needed instead.  Change this in the "INSTALL ="
  114.       definition line.
  115.     - The order of file and directory have to be changed in all the
  116.       invocations of INSTALL_DATA or INSTALL_PROGRAM.
  117.  
  118. ---------------------------------------------
  119. NeXT machines running NeXTStep 3.1:
  120. ---------------------------------------------
  121.  
  122. 1. Run configure with predefined CPP:
  123.     CPP='cc -E' ./configure
  124.    (If your shell is [t]csh, do a "setenv CPP 'cc -E' ")
  125.     
  126. 2. Edit Makefile: 
  127.   -add tmpnam.o to COMPAT_OBJS:
  128.     COMPAT_OBJS =         getcwd.o waitpid.o strtod.o tmpnam.o
  129.   -add the following to AC_FLAGS:
  130.     -Dstrtod=tcl_strtod 
  131.  
  132. 3. Edit compat/tmpnam.c and replace "/usr/tmp" with "/tmp"
  133.  
  134. After this, tcl7.0 will be build fine on NeXT (ignore linker warning)
  135. and run all the tests. There are some formatting problems in printf() or
  136. scanf() which come from NeXT's lacking POSIX conformance. Ignore those
  137. errors, they don't matter much.
  138.  
  139. 4. Additional information that may apply to NeXTStep 3.2 only:
  140.  
  141.     The problem on NEXTSTEP 3.2 is that the configure script makes some
  142.     bad assumptions about the uid_t and gid_t types.  Actually, the may
  143.     have been valid for NEXTSTEP 3.0, or it may be NEXTSTEP's rudimentary
  144.     attempt at POSIX support under 3.2, but no matter what the reason, the
  145.     configure script sets up the Makefile with CFLAGS '-Duid_t=int' and
  146.     '-Dgid_t=int', which are, unfortunately, incorrect, since they shoudl
  147.     actually be (I think) unsigned shorts.  This causes problems when the
  148.     'stat' structure is included, since it throws off the field offsets
  149.     from what the 'fstat' function thinks they should be.
  150.     
  151.     Anyway, the quick fix is to run configure and then edit the Makefile
  152.     to remove the uid_t and gid_t defines.  This will allow tcl and Tk to
  153.     compile and run.  There are some other problems on NEXTSTEP,
  154.     specifically with %g in the printf family of functions, but making the
  155.     uid_t and gid_t change will get it up and running.
  156.  
  157. ---------------------------------------------
  158. NeXT machines running NeXTStep 3.2:
  159. ---------------------------------------------
  160.  
  161. 1. Run configure with predefined CPP:
  162.     CPP='cc -E' ./configure
  163.    (If your shell is [t]csh, do a "setenv CPP 'cc -E' ")
  164.     
  165. 2. Edit Makefile: 
  166.   -add tmpnam.o to COMPAT_OBJS:
  167.     COMPAT_OBJS =         getcwd.o waitpid.o strtod.o tmpnam.o
  168.   -add the following to AC_FLAGS:
  169.     -Dstrtod=tcl_strtod
  170.   -add '-m' to MATH_LIBS:
  171.         MATH_LIBS = -m -lm
  172.   -add '-O2 -arch m68k -arch i386' to CFLAGS:
  173.     CFLAGS = -O2 -arch m68k -arch i386 
  174.  
  175. -------------------------------------------------
  176. ISC 2.2 UNIX (using standard ATT SYSV compiler):
  177. -------------------------------------------------
  178.  
  179. In Makefile, change
  180.  
  181. CFLAGS =      -g -I. -DTCL_LIBRARY=\"${TCL_LIBRARY}\"
  182.  
  183. to
  184.  
  185. CFLAGS =      -g -I. -DPOSIX_JC -DTCL_LIBRARY=\"${TCL_LIBRARY}\"
  186.  
  187. This brings in the typedef for pid_t, which is needed for
  188. /usr/include/sys/wait.h in tclUnix.h.
  189.  
  190. ---------------------------------------------
  191. DEC Alphas:
  192. ---------------------------------------------
  193.  
  194. 1. There appears to be a compiler/library bug that causes core-dumps
  195. unless you compile tclVar.c without optimization (remove the -O compiler
  196. switch).  The problem appears to have been fixed in the 1.3-4 version
  197. of the compiler.
  198.  
  199. ---------------------------------------------
  200. CDC 4680MP, EP/IX 1.4.3:
  201. ---------------------------------------------
  202.  
  203. The installation was done in the System V environment (-systype sysv)
  204. with the BSD extensions available (-I/usr/include/bsd and -lbsd).  It was
  205. built with the 2.20 level C compiler.  The 2.11 level should not be used
  206. because it has a problem with detecting NaN values in lines like:
  207.     if (x != x) ...
  208. which appear in the TCL code.
  209.  
  210. To make the configure script find the BSD extensions, I set environment
  211. variable DEFS to "-I/usr/include/bsd" and LIBS to "-lbsd" before
  212. running it.  I would have also set CC to "cc2.20", but that compiler
  213. driver has a bug that loader errors (e.g. not finding a library routine,
  214. which the script uses to tell what is available) do not cause an error
  215. status to be returned to the shell (but see the comments about "-non_shared"
  216. below in the 2.1.1 notes).
  217.  
  218. There is a bug in the <sys/wait.h> include file that mis-defines the
  219. structure fields and causes WIFEXITED and WIFSIGNALED to return incorrect
  220. values.  My solution was to create a subdirectory "sys" of the main TCL
  221. source directory and put a corrected wait.h in it.  The "-I." already on
  222. all the compile lines causes it to be used instead of the system version.
  223. To fix this, compare the structure definition in /usr/include/bsd/sys/wait.h
  224. with /bsd43/include/sys/wait.h (or mail to John Jackson, jrj@cc.purdue.edu,
  225. and he'll send you a context diff).
  226.  
  227. After running configure, I made the following changes to Makefile:
  228.  
  229.     1)  In AC_FLAGS, change:
  230.         -DNO_WAIT3=1
  231.     to
  232.         -DNO_WAIT3=0 -Dwait3=wait2
  233.     EP/IX (in the System V environment) provides a wait2() system
  234.     call with what TCL needs (the WNOHANG flag).  The extra parameter
  235.     TCL passes to what it thinks is wait3() (the resources used by
  236.     the child process) is always zero and will be safely ignored.
  237.  
  238.     2)  Change:
  239.         CC=cc
  240.     to
  241.         CC=cc2.20
  242.     because of the NaN problem mentioned earlier.  Skip this if the
  243.     default compiler is already 2.20 (or later).
  244.  
  245.     3)  Add "-lbsd" to the commands that create tclsh and tcltest
  246.     (look for "-o").
  247.  
  248. ---------------------------------------------
  249. CDC 4680MP, EP/IX 2.1.1:
  250. ---------------------------------------------
  251.  
  252. The installation was done in the System V environment (-systype sysv)
  253. with the BSD extensions available (-I/usr/include/bsd and -lbsd).  It was
  254. built with the 3.11 level C compiler.  The 2.11 level should not be used
  255. because it has a problem with detecting NaN values in lines like:
  256.     if (x != x) ...
  257. which appear in the TCL code.  The 2.20 compiler does not have this
  258. problem.
  259.  
  260. To make the configure script find the BSD extensions, I set environment
  261. variable DEFS to:
  262.  
  263.     "-I/usr/include/bsd -D__STDC__=0 -non_shared"
  264.  
  265. and LIBS to:
  266.  
  267.     "-lbsd"
  268.  
  269. before running it.  The "-non_shared" is needed because with shared
  270. libraries, the compiler (actually, the loader) does not report an
  271. error for "missing" routines.  The configuration script depends on this
  272. error to know what routines are available.  This is the real problem
  273. I reported above for EP/IX 1.4.3 that I incorrectly attributed to a
  274. compiler driver bug.  I don't have 1.4.3 available any more, but it's
  275. possible using "-non_shared" on it would have solved the problem.
  276.  
  277. The same <sys/wait.h> bug exists at 2.1.1 (yes, I have reported it to
  278. CDC), and the same fix as described in the 1.4.3 porting notes works.
  279.  
  280. In addition to the three Makefile changes described in the 1.4.3 notes,
  281. you can remove the "-non_shared" flag from AC_FLAGS.  It is only needed
  282. for the configuration step, not the build.
  283.  
  284. You will get duplicate definition compilation warnings of:
  285.  
  286.     DBL_MIN
  287.     DBL_MAX
  288.     FLT_MIN
  289.     FLT_MAX
  290.  
  291. during tclExpr.c.  These can be ignored.
  292.  
  293. During expr.test, you will get a failure for one of the "fmod" tests
  294. unless you have CDC patch CC40038311 installed.
  295.  
  296. ---------------------------------------------
  297. Convex systems, OS 10.1 and 10.2:
  298. Contact: Lennart Sorth (ls@dmi.min.dk)
  299. ---------------------------------------------
  300.  
  301. 1. tcl7.0b2 compiles on Convex systems (OS 10.1 and 10.2) by just running 
  302.   configure, typing make, except tclUnixUtil.c needs to be compiled
  303.   with option "-pcc" (portable cc, =!ANSI) due to:
  304.   cc: Error on line 1111 of tclUnixUtil.c: 'waitpid' redeclared:
  305.   incompatible types.
  306.  
  307. -------------------------------------------------
  308. Pyramid, OSx 5.1a (UCB universe, GCC installed):
  309. -------------------------------------------------
  310.  
  311. 1. The procedures memcpy, strchr, fmod, and strrchr are all missing,
  312. so you'll need to provide substitutes for them.  After you do that
  313. everything should compile fine.  There will be one error in a scan
  314. test, but it's an obscure one because of a non-ANSI implementation
  315. of sscanf on the machine;  you can ignore it.
  316.  
  317. 2. You may also have to add "tmpnam.o" to COMPAT_OBJS in Makefile:
  318. the system version appears to be bad.
  319.  
  320. -------------------------------------------------
  321. Encore 91, UMAX V 3.0.9.3:
  322. -------------------------------------------------
  323.  
  324. 1. Modify the CFLAGS assignment in file Makefile.in to include the 
  325. -DENCORE flag in Makefile:
  326.  
  327.     CFLAGS = -O -DENCORE
  328.  
  329. 2. "mkdir" does not by default create the parent directories.  The mkdir
  330. directives should be modified to "midir -p".
  331.  
  332. -------------------------------------------------
  333. Sequent machines running Dynix:
  334. Contact: Andrew Swan (aswan@soda.berkeley.edu)
  335. -------------------------------------------------
  336.  
  337. 1. Use gcc instead of the cc distributed by Sequent
  338.  
  339. 2. The distributed math library does not include the fmod
  340.    function.  Source for fmod can be retrieved from a BSD
  341.    source archive (such as ftp.uu.net) and included in the
  342.    compat directory.  Add fmod.o to the COMPAT_OBJS variable
  343.    in the Makefile.  You may need to comment out references
  344.    to 'isnan' and 'finite' in fmod.c
  345.  
  346. 3. If the linker complains that there are two copies of the
  347.    'tanh' function, use the ar command to extract the objects
  348.    from the math library and build a new one without tanh.o
  349.  
  350. 4. The *scanf functions in the Sequent libraries are apparently
  351.    broken, which will cause the scanning tests to fail.  The
  352.    cases that fail are fairly obscure.  Using GNU libc apparently
  353.    solves this problem.
  354.  
  355. -------------------------------------------------
  356. Systems running Interactive 4.0:
  357. -------------------------------------------------
  358.  
  359. 1. Add "-posix -D_SYSV3" to CFLAGS in Makefile (or Makefile.in).
  360.  
  361. -------------------------------------------------
  362. Systems running FreeBSD 1.1.5.1:
  363. -------------------------------------------------
  364.  
  365. The following changes comprise the entire porting effort of tcl7.3 to
  366. FreeBSD (i.e. these were the changes to tclTest.c) and should probably
  367. be made part of the tcl distribution. The changes only effect the way that
  368. floating point exceptions are reported. I've choosen to move the changes
  369. out of tclTest.c and into tclBasic.c.
  370.  
  371. in tclBasic.c at top-of-file:
  372.  
  373. #ifdef BSD_NET2
  374. #include <floatingpoint.h>
  375. #endif
  376.  
  377. in tclBasic.c in Tcl_Init():
  378.  
  379. #ifdef BSD_NET2
  380.     fpsetround(FP_RN);
  381.     fpsetmask(0L);
  382. #endif
  383.  
  384.