home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / k / ksh48.zip / ReadMe.jrm < prev    next >
Text File  |  1992-02-06  |  5KB  |  119 lines

  1. BUILDING THE PD KSH
  2. ===================
  3.  
  4. As usual, there are differences between BSD and System V
  5. versions.  Ideally, all you have to do is edit the Makefile in
  6. this directory to set the CONFIG macro to the appropriate value.
  7. (Actually, you may wish to change the CONFIG macro in all
  8. Makefiles; if you always invoke make(1) from here, CONFIG will
  9. be passed down, but if you invoke make(1) from a subdirectory
  10. you'll want the appropriate definition in that Makefile.)
  11.  
  12. Of course it's not quite that simple.  You may, however, take
  13. solace in the knowledge that it used to be worse.
  14.  
  15. The Compatibility Libraries
  16. ---------------------------
  17.  
  18. Eric Gisin wrote this shell using ANSI C and POSIX as
  19. portability guidlines.  Realizing that nobody had a POSIX
  20. system and almost no one had an ANSI C environment, he provided
  21. minimal compatibility libraries.
  22.  
  23. There are two libraries, one for POSIX (libposix.a) and one for
  24. ANSI C (libstdc.a).
  25.  
  26. Libposix.a is pretty simple.  Nothing in it has ever broken on
  27. me, so I'd just leave it.  It provides a version of dup2() for
  28. System V systems.
  29.  
  30. Libstdc.a is a bit hairy.  I recommend looking at the routines
  31. provided and, and editing the std/stdc Makefile and only
  32. including objects that have routines your system libc.a is
  33. lacking.  Various of the provided routines are just plain
  34. flaky, but only when they're not really needed.  The other
  35. hairy thing he does is craft an ANSI stdio.h from the system
  36. supplied one and one of his own.  Again, it's better than it
  37. used to be, but it's still a hack, and you may have to modify
  38. it by hand.
  39.  
  40. You will also need a POSIX compatible set of directory reading
  41. routines.  System V.3 systems have this in libc.a.  The
  42. std/posix directory provides a something for BSD systems.  I
  43. use a slightly modified version of Doug Gwyn's PD version.
  44.  
  45. (The ``slightly modified'' is to work around a bug in Gwyn's version.
  46. The POSIX routines are documented as returning failure if the file for
  47. opendir(3) is not a directory.  Gwyn attempts to open(2) the file, and
  48. then stats it to see if the file is a directory.  However, if the file
  49. is a special file, and the open(2) doesn't return, you're screwed.  My
  50. change was to open the file with the O_NDELAY flag, but Gwyn didn't
  51. feel this was portable (true, but I only do it where it works) and
  52. that stat-ing before the open would be too slow (true).  The upshot is
  53. if you use his routines unmodified, don't ever do an "ls -l /dev/*/*".)
  54.  
  55. The Shell Source
  56. ----------------
  57.  
  58. The source for the shell itself is in the sh directory.  There you
  59. will want to edit config.h to determine the configuration options.  Vi
  60. mode is in kind of rough shape, but does work.  DIRSTACK routines
  61. aren't implemented yet, so again, why bother.  SWTCH is a bit arcane,
  62. but it you use shl(1) and you define EMACS or VI you want to define
  63. this.  JOBS is really only useful on BSD systems.  It might work on
  64. systems that have POSIX job control, but I wouldn't bet on it.
  65. SHARPBANG is only useful on systems where the exec() family don't
  66. honour the #!/prog/path convention.
  67.  
  68. This is where the shell gets built so you may wish to change
  69. the OTHERLIBS macro in the Makefile to point to your POSIX
  70. directory routines, or to use -lc_s, or whatever.
  71.  
  72. Miscellaneous
  73. -------------
  74.  
  75. The Makefiles that actually compile things use the macro
  76. CCOPTS, so you can change it in individual Makefiles or specify
  77. it on the command line, eg. "make CCOPTS=-O OTHERLIBS=-lc_s".
  78. LDOPTS is used in the Makefile where the ksh is actually built.
  79.  
  80. The very first time on a new system, do a "make clobber"
  81.  
  82. Good luck.
  83.  
  84. Documentation
  85. -------------
  86.  
  87. The ksh.1 is a man page for the PD ksh, although it lags
  88. somewhat behind the code.  You get what you pay for.
  89.  
  90. The ksh88.1 is a man page for AT&T's ksh88 (the latest version)
  91. provided for comparison.
  92.  
  93. History
  94. -------
  95.  
  96. Much of the shell was written by Eric Gisin at the University
  97. of Waterloo, using some pieces of other stuff, notably Charles
  98. Forsythe's V7 shell, and some enhancements from the BRL shell.
  99. He placed it (in a alpha test state) into the public domain
  100. while I was at UW.  I snarfed a copy, and got it running on my
  101. UNIXpc, and later some machines at work.  I sent Gisin some bug
  102. reports, but he seems to have lost interest in the project.
  103. This may be because he now does some work for MKS, who produce a
  104. commercial version of the ksh for MS-DOS machines, so there may
  105. be a conflict of interest.
  106.  
  107. So I gave up on getting future versions, and adopted it.  I've
  108. made some enhancements, and quite a few bug fixes, and various
  109. people at work have contributed as well.  It remains in the
  110. public domain, although I imagine the people involved would
  111. appreciate leaving their names attached (I'm exempt; I haven't
  112. actually included my name anywhere but here).
  113.  
  114. The README in the sh directory is Gisin's, and tells a bit of
  115. the story from his point of view.  Note that his compilation
  116. instructions don't really apply anymore.
  117.  
  118. John R. MacMillan
  119.