install.txt 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. -*- Mode: Indented-text; -*-
  2. Here are some remarks to complement what's in the INSTALL file.
  3. Customizing the installation
  4. 1. If you don't believe in configure scripts, or don't have a
  5. /bin/sh that can handle the configure script, you can make
  6. sysdep.h and Makefile manually from sysdep.h.in and Makefile.in.
  7. The technique is fairly obvious. For Makefile, just give
  8. reasonable values for all of the variables at the top that are
  9. defined as "foo = @foo@", e.g. srcdir=., CC=cc, LIBS=-lm,
  10. INSTALL=cp, etc. For sysdep.h, read the comments. If your OS is
  11. Posix compliant, you should be able to copy sysdep.h.in to
  12. sysdep.h unmodified and everything should work.
  13. 2. If you definitely won't be installing Scheme 48, you should set
  14. libdir to the distribution directory (e.g. "make libdir=`pwd`").
  15. This will make the ,open and ,load-package commands work for the
  16. library packages defined in more-packages.scm.
  17. 3. If desired, customize the contents of the development environment
  18. heap image by editing the definitions of USUAL-COMMANDS and/or
  19. USUAL-FEATURES in more-packages.scm; see below.
  20. 4. If you're using a DEC MIPS, and want to use the foreign function
  21. interface, specify LDFLAGS=-N (with e.g. "make LDFLAGS=-N").
  22. -----
  23. Customizing scheme48.image
  24. By default, the image consists of a core Scheme system (Revised^5
  25. Scheme plus a very minimal read-eval-print loop) together with a
  26. standard set of "options" (command processor, debugging commands,
  27. inspector, disassembler, generic arithmetic). The set of options is
  28. controlled by the definitions of USUAL-COMMANDS and USUAL-FEATURES in
  29. more-packages.scm. If you make the (open ...) clause empty, then
  30. "make scheme48.image" will create a Scheme system without any extras
  31. (such as error recovery), and the image will be smaller. The files
  32. are listed in approximate order of decreasing desirability; you'll
  33. probably want at least these:
  34. package-commands, build
  35. - necessary for the scheme48.image script to work
  36. debuginfo, disclosers
  37. - necessary if you want error messages to be at all helpful
  38. debugging
  39. - defines important debugging commands such as ,preview and ,trace
  40. After editing the definition of usual-features, simply
  41. make scheme48.image
  42. to rebuild the image.
  43. -----
  44. Deeper changes to the system -- for example, edits to most of the
  45. files in the rts/ directory -- will require using the static linker to
  46. make a new initial.image. After you have a working scheme48.image
  47. (perhaps a previous version of Scheme 48), you can create a linker
  48. image with
  49. make linker
  50. after which you can say
  51. make image
  52. to get the linker to build a new initial.image and initial.debug.
  53. scheme48.image will then be built from those.
  54. You might think that "make scheme48.image" ought to do this, but the
  55. circular dependencies
  56. scheme48.image on initial.image
  57. initial.image on link/linker.image
  58. link/linker.image on scheme48.image
  59. needs to be broken somewhere, or else make will (justifiably) barf. I
  60. chose to break the cycle by making scheme48.image not depend on
  61. initial.image, since this is most robust for installation purposes.
  62. -----
  63. Editor support
  64. We recommend interacting with the Scheme 48 command processor using the
  65. emacs/scheme interface written by Olin Shivers at CMU. Copies of the
  66. relevant .el files, together with a "cmuscheme48.el", are in the
  67. emacs/ subdirectory of the release. Usage information is in
  68. doc/user-guide.txt.
  69. You will probably want to byte-compile the .el files to get .elc
  70. files. Use M-x byte-compile-file to do this.
  71. -----
  72. Performance
  73. If you don't have a C compiler that optimizes as well as gcc does,
  74. then performance may suffer. Take a look at the automatically
  75. generated code in scheme48vm.c to find out why. With a good register
  76. allocator, all those variables (including some of the virtual
  77. machine's virtual registers) get allocated to hardware registers, and
  78. it really flies. Without one, performance can be pretty bad.
  79. The configure script automatically sets the Makefile variable CFLAGS
  80. to -O2 -g if gcc is available, or to -O if it isn't. This can be
  81. overriden by specifying a different CFLAGS, e.g. "make CFLAGS=-g" for
  82. no optimization.
  83. Even if you do have a good compiler, you should be able to improve
  84. overall performance even more, maybe about 6-10%, by removing the
  85. range check from the interpreter's instruction dispatch. To do this,
  86. use the -S flag to get assembly code for scheme48vm.c, then find the
  87. instructions in scheme48vm.s corresponding to the big dispatch in
  88. restart():
  89. L19173: {
  90. code_pointer_83X = arg1K0;
  91. switch ((*((unsigned char *) code_pointer_83X))) {
  92. ... }
  93. There will be one or two comparison instructions to see whether the
  94. opcode is in range; just remove them. For the 68000 I use a "sed"
  95. script
  96. /cmpl #137,d0/ N
  97. /cmpl #137,d0\n jhi L/ d
  98. but of course the constant will probably have to change when a new
  99. release comes along.
  100. See the user's guide for information on the ,bench command, which
  101. makes programs run faster.
  102. -----
  103. filenames.make is "include"d by the Makefile, but is automatically
  104. generated from the module dependencies laid out in the various
  105. configuration files (*-packages.scm). If you edit any of these .scm
  106. files, you may want to do a "make filenames.make" before you do any
  107. further "make"s in order to update the depedencies. This step isn't
  108. necessary if you're using Gnu make, because Gnu make will make
  109. included files automatically.