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

  1. BUILDING THE PD KSH
  2. ===================
  3.  
  4. The PD KSH can be built in two ways.  The default method uses
  5. the POSIX/ANSI compatability libraries in ./std.  The
  6. alternative method is to build the ksh in ./sh without the ./std
  7. tree.  The second method should be used only if a) you have a
  8. real POSIX environemnt or b) you have major difficulties with
  9. building the ./std tree.
  10.  
  11. I have modified the source slightly to make standalone building
  12. simpler.  Using -DNOSTDHDRS avoids attempts to include ANSI
  13. headers that may be lacking.  I have built the shell this way on
  14. all Sun platforms and on a Bull DPX/2 (which has good POSIX
  15. support).  The config file defines USE_SIGACT so that the shell
  16. will use the XPG3 signalaction() and friends.  You should leave
  17. USE_SIGACT defined, sh/sigact.c contains an implementation for
  18. systems that lack this facility. 
  19.  
  20. It is recommended that you try using the ./std tree first.  This
  21. avoids problems like BSD times() calls that do not return an
  22. indication of elapsed time and so on.
  23.  
  24. Using ./std:
  25. ------------
  26.  
  27. If you are on a Sun building it quite simple:
  28.  
  29.     make CONFIG=-D_BSD
  30.  
  31. will do it.  If you have a sun386 or sun3 and have gcc, it is
  32. worth using, just add CC="gcc -pipe" to the above command line.
  33. If you have SunOS 4.1 or later you probably need to add
  34. -DHAVE_SYS_STDTYPES
  35.  
  36. Building on other systems may well be more difficult.
  37. Apparently the creating of the ./std/h tree causes problems on
  38. some systems.
  39.  
  40.  
  41. Notes on ./std:
  42. ---------------
  43.  
  44. I have updated the Makefiles in ./std/stdc and ./tsd/posix to
  45. maintain the objects within the libraries.  Ie.
  46. libstdc.a(strstr.o) If your make(1) doesn't know how to do this
  47. then you will need to modify the makefiles accordingly.
  48.  
  49. In ReadMe.jrm, John MacMillan recommends being cautious of
  50. std/libstdc.a and using only those routines which your system
  51. lacks.  Please note that I have tested virtually none of
  52. ./std/stdc.  The Makefile contains target lines for most modules
  53. but most are commented out.  I suggest you uncomment _only_
  54. those that you need.
  55.  
  56. On the other hand std/libposix.a seems quite safe, and
  57. indeed provides a better times() call for BSD systems.
  58.  
  59. Read ReadMe.jrm for more...
  60.  
  61.  
  62. Building without ./std:
  63. -----------------------
  64.  
  65. On some systems it might be worth forgetting about ./std/lib*
  66. either because they proved too difficult to build or they seem
  67. unnecessary.  As previously indicated I have done this on Sun's
  68. and on a Bull system.  On Sun's it is perhaps not a great idea
  69. as you then get the system's times() call which does not behave
  70. the way the shell wants.
  71.  
  72. In anycase to build without ./std, you simply cd to ./sh and
  73. either edit the Makefile accordingly, or use an appropriate
  74. command line.  For instance:
  75.  
  76. Sun with SunOS 4.0:
  77.  
  78.     cd ./sh
  79.     ln -s ../std/stdc/strstr.c .
  80.     ln -s ../std/stdc/memmove.c .
  81.     make CFLAGS="-D_BSD -DNOSTDHDRS" \
  82.         XOBJS="strstr.o memmove.o" LDLIBS="" LDFLAGS=""
  83.  
  84. Note that we still need a couple of functions from ./std/stdc
  85.  
  86. On the Bull system which is a POSIX compliant System V machine:
  87.  
  88.     cd ./sh
  89.     make CFLAGS="-D_SYSV" LDLIBS="-lc_s" LDFLAGS=""
  90.     make CC=gcc CFLAGS="-D_POSIX_SOURCE" LDLIBS="-lc_s" LDFLAGS=""
  91.  
  92. INSTALLING:
  93. ===========
  94.  
  95. This is quite simple.
  96.  
  97.     # cp ./ksh /bin
  98.     # chmod 555 /bin/ksh
  99.  
  100. The above assumes of course that you don't already have a
  101. /bin/ksh :-)
  102. The manual page ksh.1 should be copied to an appropriate
  103. location.
  104. BSD:
  105.     # cp ksh.1 /usr/man/man1
  106. SYSV:
  107.     # nroff -man ksh.1 > /usr/catman/u_man/man1/ksh.1
  108.     # pack /usr/catman/u_man/man1/ksh.1
  109.  
  110. Or something similar.  For systems such as Sun's that really
  111. only ship with a C-shell environment, the ./etc directory
  112. contains a useful /etc/profile and /etc/ksh.kshrc file to
  113. provide a suitable environemnt for /bin/sh and /bin/ksh users,
  114. they should work, they are straight of my system and I use them
  115. on Sun,Bull and even an SCO system.
  116.  
  117.  
  118. PROBLEMS:
  119. =========
  120.  
  121. Clearly building will not be so simple on all systems.
  122. Apparently some of the enum manipulations border on ilegal and
  123. cause some compilers problems.  Curiously both gcc -ansi and the
  124. GreenHills compiler on the Bull system are quite picky and did
  125. not complain.  Note if you want to use gcc -ansi you may well
  126. need to add some definitions, for instance the following all
  127. work on the sun386:
  128.  
  129.     CC=cc
  130.     CC=gcc
  131.     CC=gcc -ansi -Dsun -Di386 -Dsun386
  132.  
  133. The last three items on the last line are normally all defined
  134. automatically, but this is disabled when -ansi is used.  The
  135. system headers do not work unless they know what architecture is
  136. in use.
  137.  
  138. On the Bull DPX/2 I used gcc-2.1, my gcc port will be available
  139. as of release 2.2.  To save effort I found it necessary to copy
  140. stdio.h and stdlib.h to gcc's private include directory and edit
  141. them to remove unnecessary #ifdef's and unwanted #include's.
  142.  
  143. If you find and fix a problem please fill in a copy of
  144. ./bug-report and e-mail it to pdksh-bug@zen.void.oz.au
  145.  
  146. Enjoy!
  147.  
  148. Simon J. Gerraty <sjg@zen.void.oz.au>
  149.  
  150.