home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 2 / 2394 < prev    next >
Encoding:
Internet Message Format  |  1990-12-28  |  7.0 KB

  1. From: karl@sugar.hackercorp.com (Karl Lehenbauer)
  2. Newsgroups: alt.sources
  3. Subject: Tcl - a tool command language for Unix   patch 1
  4. Message-ID: <7346@sugar.hackercorp.com>
  5. Date: 22 Dec 90 02:10:45 GMT
  6.  
  7. Archive-name: tcl4.0/patch1
  8.  
  9. Patch #: 1
  10. Priority: MEDIUM
  11.  
  12. patch 1 to Tcl 4.0
  13. ==================
  14.  
  15. This patch fixes three relatively minor problems with Tcl, described in detail
  16. below.
  17.  
  18. Fix:    From rn, say "| patch -p -N -d DIR", where DIR is your Tcl 4.0 source
  19.     directory.  Outside of rn, say "cd DIR; patch -p -N <thisarticle".
  20.     If you don't have the patch program, apply the following by hand,
  21.     or get patch (version 2.0, latest patchlevel).
  22.  
  23.     After patching:
  24.         Configure
  25.         make
  26.         make bldhelp
  27.         make install
  28.  
  29.     If patch indicates that patchlevel is the wrong version, the patch
  30.     may already have been applied.  See the patchlevel.h file to find out
  31.     what has or has not been applied.  In any event, don't continue with 
  32.     the patch.
  33.  
  34.  
  35. strerror function
  36. -----------------
  37.  
  38. Some BSD variants (Sun-OS, apparently BSD-tahoe) do not have the strerror
  39. function.  Tcl has one for these cases, but Configure doesn't realize
  40. that it is needed.  Consequently, if you are configuring for BSD the
  41. Configure script will ask if you have strerror in your C library.  If you
  42. don't know, answer "y" and if you get a link error saying it's not found, run
  43. Configure again and say "n" to that question.
  44.  
  45.  
  46. getenv
  47. ------
  48.  
  49. getenv -- a memory overwrite would occur if an environment variable body
  50. returned by getenv was greater in length that TCL_RESULT_SIZE, i.e. 199 bytes.
  51.  
  52.  
  53. help and other procedures not being found after an install
  54. ----------------------------------------------------------
  55.  
  56. The problem here is a very simple one.  "make install" copies the Tcl
  57. source files and libraries from the directory they were unpacked/built
  58. from to the place they are to reside.  Unfortunately, the .tndx files
  59. (there could be many of them, but right now there's only one) get copied
  60. and really they shouldn't, they should be rebuilt by the install procedure
  61. and, after this patch, they are.
  62.  
  63.  
  64. MEMORY DEBUGGING WARNING
  65. ------------------------
  66.  
  67. Modules compiled with memory debugging enabled are incompatible with
  68. modules that were not compiled with it.  If you reconfigure to have
  69. memory debugging or to not have it, you should do a make clean and
  70. rebuild to insure that all C source is recompiled.  If you suddenly
  71. start getting overwrites on a system that used to work, you might
  72. check for some .o files that didn't get deleted or something after
  73. the "make clean".
  74.  
  75.  
  76. DOCUMENTATION PATCH IS FORTHCOMING
  77. ----------------------------------
  78.  
  79. If you've printed the man pages, no doubt you've found some annoying little
  80. problems with them, plus some entries need to be updated.  We are preparing
  81. a documentation patch, hopefully it will be ready within the next week.
  82.  
  83. And now, the patch...
  84.  
  85.  
  86. Index: tclsh/src/patchlevel.h
  87. Prereq: 0
  88. ***************
  89. *** 1,2
  90.   
  91. ! #define PATCHLEVEL 0
  92.  
  93. --- 1,2 -----
  94.   
  95. ! #define PATCHLEVEL 1
  96. Index: extend/src/unixcmds.c
  97. ***************
  98. *** 357,363
  99.           return TCL_OK;
  100.           }
  101.   
  102. ! if (envstr != NULL) 
  103.           strcpy(interp->result, envstr);
  104.   return TCL_OK;
  105.   }
  106.  
  107. --- 357,368 -----
  108.           return TCL_OK;
  109.           }
  110.   
  111. ! if (envstr != NULL) {       /* Section modified by Glenn M. Lewis - 12/20/90 */
  112. !         int size = strlen(envstr);
  113. !         if (size >= TCL_RESULT_SIZE) {
  114. !             interp->result = ckalloc(size + 1);
  115. !             interp->dynamic = TCL_DYNAMIC;
  116. !         }
  117.           strcpy(interp->result, envstr);
  118.       }
  119.   return TCL_OK;
  120. ***************
  121. *** 359,364
  122.   
  123.   if (envstr != NULL) 
  124.           strcpy(interp->result, envstr);
  125.   return TCL_OK;
  126.   }
  127.   
  128.  
  129. --- 364,370 -----
  130.               interp->dynamic = TCL_DYNAMIC;
  131.           }
  132.           strcpy(interp->result, envstr);
  133. +     }
  134.   return TCL_OK;
  135.   }
  136.   
  137. Index: Configure
  138. ***************
  139. *** 112,117
  140.     fi
  141.   done
  142.   
  143.   if [ "$TCL_BINDIR" = "" ]
  144.   then
  145.     TCL_BINDIR=$CWD
  146.  
  147. --- 112,132 -----
  148.     fi
  149.   done
  150.   
  151. + if [ "$UNIX_TYPE" = "bsd" ]
  152. + then
  153. +   if [ "$HAS_STRERROR" = "" ]
  154. +   then
  155. +     HAS_STRERROR="y"
  156. +   fi
  157. +   echo "Does your C library have the strerror function?"
  158. +   echo "[$HAS_STRERROR]: \c"
  159. +   read A
  160. +   if [ "$A" != "" ]
  161. +   then
  162. +     HAS_STRERROR=$A
  163. +   fi
  164. + fi
  165.   if [ "$TCL_BINDIR" = "" ]
  166.   then
  167.     TCL_BINDIR=$CWD
  168. ***************
  169. *** 297,302
  170.   echo "TCL_MEM_DEBUG=\""$TCL_MEM_DEBUG\" >>$CONFIG
  171.   echo "TCL_MEM_VALIDATE=\""$TCL_MEM_VALIDATE\" >>$CONFIG
  172.   echo "TCL_DEFAULTFILE=\""$TCL_DEFAULTFILE\" >>$CONFIG
  173.   
  174.   echo creating $CONFIG_H
  175.   echo "/* generated by Configure script -- don't edit by hand */" >$CONFIG_H
  176.  
  177. --- 312,318 -----
  178.   echo "TCL_MEM_DEBUG=\""$TCL_MEM_DEBUG\" >>$CONFIG
  179.   echo "TCL_MEM_VALIDATE=\""$TCL_MEM_VALIDATE\" >>$CONFIG
  180.   echo "TCL_DEFAULTFILE=\""$TCL_DEFAULTFILE\" >>$CONFIG
  181. + echo "HAS_STRERROR=\""$HAS_STRERROR\" >>$CONFIG
  182.   
  183.   echo creating $CONFIG_H
  184.   echo "/* generated by Configure script -- don't edit by hand */" >$CONFIG_H
  185. ***************
  186. *** 341,347
  187.             bsd) MF_SYSDEF="SYSDEF= -DBSD";
  188.                  MF_RANLIB="RANLIB=ranlib";
  189.                  MF_OS_OBJS="strtol.o strtoul.o strstr.o putenv.o panic.o ascftime.o";;
  190.            hpux) MF_SYSDEF="SYSDEF= -DSYSV -DHPUX";
  191.                  MF_LIBS="LIBS=-lBSD -lPW";
  192.                  MF_OS_OBJS="panic.o";;
  193.  
  194. --- 357,362 -----
  195.             bsd) MF_SYSDEF="SYSDEF= -DBSD";
  196.                  MF_RANLIB="RANLIB=ranlib";
  197.                  MF_OS_OBJS="strtol.o strtoul.o strstr.o putenv.o panic.o ascftime.o";;
  198.            hpux) MF_SYSDEF="SYSDEF= -DSYSV -DHPUX";
  199.                  MF_LIBS="LIBS=-lBSD -lPW";
  200.                  MF_OS_OBJS="panic.o";;
  201. ***************
  202. *** 360,365
  203.                  MF_OS_OBJS="strstr.o strtoul.o panic.o ascftime.o";;
  204.   esac
  205.   
  206.   MF_COMPOPTS="COMPOPTS= $VOID"  
  207.   
  208.   if [ "$TCL_HISTORY" = "n" ]
  209.  
  210. --- 375,386 -----
  211.                  MF_OS_OBJS="strstr.o strtoul.o panic.o ascftime.o";;
  212.   esac
  213.   
  214. + if [ "$UNIX_TYPE" = "bsd" -a "$HAS_STRERROR" = "n" ]
  215. + then
  216. +  MF_OS_OBJS="$MF_OS_OBJS strerror.o"
  217. + fi
  218.   MF_COMPOPTS="COMPOPTS= $VOID"  
  219.   
  220.   if [ "$TCL_HISTORY" = "n" ]
  221. ***************
  222. *** 450,455
  223.       echo "    -rm -rf $TCL_SOURCEDIR/help" >> Makefile
  224.       echo "    -mkdir $TCL_SOURCEDIR/help" >> Makefile
  225.       echo "    -./tcl -f tclsh/tclsrc/copydir.tcl tclsh/tclsrc $TCL_SOURCEDIR" >> Makefile
  226.       echo "    -find $TCL_SOURCEDIR -type f -exec chmod go-w,a+r {} \;" >>Makefile
  227.       echo "    -find $TCL_SOURCEDIR -type d -exec chmod go-w,a+rx {} \;" >>Makefile
  228.   fi
  229.  
  230. --- 471,478 -----
  231.       echo "    -rm -rf $TCL_SOURCEDIR/help" >> Makefile
  232.       echo "    -mkdir $TCL_SOURCEDIR/help" >> Makefile
  233.       echo "    -./tcl -f tclsh/tclsrc/copydir.tcl tclsh/tclsrc $TCL_SOURCEDIR" >> Makefile
  234. +     echo "    -rm -f $TCL_SOURCEDIR/*.ndx" >> Makefile
  235. +     echo "    -./tcl \"source tclsh/tclsrc/packages.tcl; set TCL_PATHLIST $TCL_SOURCEDIR; build_package_indexes\"" >> Makefile
  236.       echo "    -find $TCL_SOURCEDIR -type f -exec chmod go-w,a+r {} \;" >>Makefile
  237.       echo "    -find $TCL_SOURCEDIR -type d -exec chmod go-w,a+rx {} \;" >>Makefile
  238.   fi
  239.  
  240.  
  241. -- 
  242. -- uunet!sugar!karl
  243. -- Usenet access: (713) 438-5018
  244. -- 
  245. -- uunet!sugar!karl
  246. -- Usenet access: (713) 438-5018
  247.