home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 116.lha / SmallTalk / Manual / INSTALL.MS < prev    next >
Encoding:
Text File  |  1986-11-20  |  7.3 KB  |  200 lines

  1. .SH
  2. Installing Little Smalltalk
  3. .PP
  4. For most users the following simple steps should suffice to build the
  5. system.
  6. .IP \(bu
  7. Unpack the sources.
  8. .IP \(bu
  9. Edit the file env.h, changing the metadefine to an already known system
  10. type.
  11. .IP \(bu
  12. Type \fImake\fP.
  13. .PP
  14. There are a few systems for which more extensive work is required;
  15. and of course porting the system to new environments may entail
  16. considerable work.
  17. The remainder of this document is intended to provide more detailed
  18. information for the curious, and to help those individuals for whom the
  19. previous instructions don't work.
  20. .SH
  21. IBM PC and Turbo C
  22. .PP
  23. For these systems there are two small changes that are required, in addition
  24. to those noted above.  In the method for saveImage, class Smalltalk, file
  25. unix.c, the mode for the open statement must be 'wb', not 'w'.
  26. And in method delete, class File, file unix.c, the command used to delete
  27. files should be ``DEL'', not ``rm''.
  28. It may also be necessary to redefine the value of the global variable
  29. \fIeditor\fP (set by the script found in file script.ini, used when making
  30. the initial image).  Also the name of a temporary file (found in method
  31. scratchFile, class File, file unix.st) may have to be changed.
  32. .SH
  33. Tektronix 4404
  34. .PP
  35. There are several changes that are required to get the system to run on the
  36. 4404.  Start by defining the metadefine constant SYSV in env.h.
  37. Next, change the Makefile in the following ways,
  38. .IP \(bu
  39. Translate all the .o extensions to .r .
  40. .IP \(bu
  41. Remove any CFLAGS definitions.
  42. .IP \(bu
  43. Change the rules for parse and st to use +o= notation, which must appear at
  44. the end.  Also add a call on headset, setting the program size to at least
  45. 512K (more if you have it).
  46. .DS I
  47. st: \fIfile names\fP
  48.     cc \fIfile names\fP +o=st
  49.     headset st +b=512K
  50. .DE
  51. .SH
  52. Porting to new systems
  53. .PP
  54. There are many ways in which compilers and operating systems differ 
  55. from each other.
  56. A fair amount of work has been expanded in making sure the software will
  57. operate on most machines, which requires that different code fragements be
  58. used on different systems.  In large part these are controlled by a single
  59. ``meta-define'' in the file env.h.  Setting this one value then causes the
  60. expansion of another code segment, which then defines many more options.
  61. .PP
  62. In the event that you are attempting to port the software to a system that
  63. has not previously been defined, you will need to decide which set of
  64. options to enable.  The next two sections contain information you may need
  65. in making this determination.
  66. .SH
  67. Define Options
  68. .PP
  69. Many options are specified merely by giving or not giving a DEFINE
  70. statement in the file env.h.  The following table presents the meaning for
  71. each of these values:
  72. .de Op
  73. .IP \\fB\\$1\\fP
  74. .br
  75. ..
  76. .Op ALLOC
  77. Defined If there is an include file called alloc.h which defines calloc, 
  78. malloc, and the like.
  79. .Op BINREADWRITE
  80. Defined if the fopen specification for binary files must include the "b"
  81. modifier.  This is true on many MS-DOS inspired systems.
  82. .Op NOENUMS
  83. Defined if enumerated datatypes are not supported.  If defined, these will
  84. be replaced by #define constants.
  85. .Op NOTYPEDEF
  86. Defined if the typedef construct is not supported.  If defined, these will
  87. be replaced by #define constructs.
  88. .Op NOVOID
  89. Defined if the void keyword is not recognized.
  90. If defined, expect \fIlint\fP to complain a lot about functions returning
  91. values which are sometimes (or always) ignored.
  92. .Op SIGNALS
  93. Used if \fIboth\fP the <signals.h> package and the <longjmp.h> package are
  94. avilable, and if the routine used to set signals is signal.
  95. Incompatible with \fBSSIGNALS\fP.
  96. .Op SSIGNALS
  97. Used if \fIboth\fP the <signals.h> package and the <longjmp.h> package are
  98. available, and if the routine used to set signals is ssignal.
  99. Incompatible with \fBSIGNALS\fP.
  100. .Op STRING
  101. Used if the string functions (strcpy, strcat and the like) are found in
  102. <string.h>.  This switch is incompatible with \fBSTRINGS\fP.
  103. .Op STRINGS
  104. Used if the string functions (strcpy, strcat and the like) are found in
  105. <strings.h>.  This switch is incompatible with \fBSTRING\fP.
  106. .LP
  107. In addition, several routines can optionally be replaced by macros for
  108. greater efficiency.  See the file memory.h for more information.
  109. .SH
  110. Object Memory
  111. .PP
  112. There are several datatypes, not directly supported by C, that are used in
  113. the Little Smalltalk system.  The first of these is the datatype byte.
  114. A byte is an eight bit unsigned (hence positive) quantity.
  115. On many systems the appropriate datatype is unsigned char, however on other
  116. systems this declaration is not recognized and other forms may be required.
  117. To aid in coverting to and from bytes the macro byteToInt() is used, which
  118. converts a byte value into an integer.  In addition, the routines byteAt
  119. and byteAtPut are used to get and put bytes from byte strings.
  120. .PP
  121. The other datatype is that used to represent object points.  On most
  122. machines in which a short is 16 bits, the datatype short should suffice.
  123. Much more information on the memory module can be found in the file
  124. memory.h.
  125. .SH
  126. Options in Building the System
  127. .PP
  128. To create the parser type
  129. .DS I
  130. make parse
  131. .DE
  132. .PP
  133. The resulting program, called parse, is used to generate the object image
  134. initially loaded into the bytecode interpreter.
  135. .PP
  136. Next, make the interpreter itself by typing
  137. .DS I
  138. make st
  139. .DE
  140. .PP
  141. Note that the interpreter and the parser share some files.
  142. .PP
  143. Finally, produce an initial object image.  The image created when you type
  144. .DS I
  145. make sunix
  146. .DE
  147. .LP
  148. is the smallest and fastest.  It is a single process version of smalltalk.
  149. A slower multiprocess version can be created by typing ``make munix''*.
  150. .FS
  151. * Multi processing from munix is done entirely in Smalltalk.
  152. While this is a good idea from the point of view of keeping the bytecode
  153. interpreter small and giving one the greatest flexibility, there seems to
  154. be a dramatic performance penalty.  I'm considering the alternatives.
  155. .FE
  156. Of more interest, an image containing test cases
  157. can be generated by typing ``make stest''.
  158. This command compiles several test cases, then runs st on a script which
  159. invokes all the test cases.  There is a similar command mtest for the
  160. multiprocessing version.
  161. .PP
  162. Once you have created an object image, type 
  163. .DS I
  164. st
  165. .DE
  166. .LP
  167. to run the system.
  168. By default the image file ``imageFile'' is read.  You can optionally
  169. use a different image file by giving the name on the command line following
  170. the st command.
  171. .SH
  172. Compiler Bogosities
  173. .PP
  174. This section will detail some of the unnatural actions you may have to
  175. perform to get Little Smalltalk to work with a few brain damaged compilers.
  176. Since there are so few of these, it I see it as a problem more with the
  177. compilers than with the system, the code make no accomodation for these.
  178. .PP
  179. On some older Sequent Balance C compilers, incorrect code is produced for
  180. .DS I
  181. hash %= (objectSize(symbols) / 2)
  182. .DE
  183. .LP
  184. In the file image.c.  This should be replaced by
  185. .DS I
  186. hash = hash % (objectSize(symbols) / 2)
  187. .DE
  188. .PP
  189. On many systems external names are restricted to six (or even five!)
  190. characters.  This causes significant problems.  I have heard of systems
  191. which automatically generate a sed script to take care of this, but have
  192. not found one yet.  If you know of such a thing let me know.
  193. .SH
  194. Helping Others
  195. .PP
  196. If you succeed in getting Little Smalltalk ported to a machine or operating
  197. system not described in env.h, I would be most pleased to get a listing of
  198. the changes you made.  These can then be incorporated into the latest
  199. distribution.
  200.