home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 379b.lha / p2c_v1.13a / README.AMIGA < prev    next >
Text File  |  1990-06-03  |  2KB  |  58 lines

  1. For the Amiga version it is necessary that you have P2C: assigned to
  2. this root directory. It must contain :
  3.  
  4. p2c
  5. home <dir>
  6.  
  7. If home doesn't exist, then you must have a source distribution, in
  8. which case go to the src directory and make install.
  9.  
  10. When compiling (the c file produced) with MANX, you may have to define -DAMIGA
  11. to ensure you get the Amiga specific defines (see P2C:home/p2c/p2c.h)).
  12. However I don't know if MANX requires these defines (I only have Lattice).
  13. NOTE: UNIX C compilers has the function gets() flush the
  14.       stdout buffer before it executes. Amiga Lattice C doesn't do this.
  15.       This is corrected for by having a #define in P2C:home/p2c/p2c.h
  16.       that causes this behaviour. I don't know if this is needed
  17.       for MANX. Oh ya, this is the only reason that you need -DAMIGA
  18.       when compiling the c code produced.
  19.  
  20. I use a stack of 50000 (always) and I didn't have any problems with p2c. I
  21. don't know what the minimum useable stack size is.
  22.  
  23. When compiling with Lattice 5.04 (and earlier versions as well I imagine)
  24. do not use the -ms and -O options - they are broke and will produce bad
  25. code with p2c. They work fine sometimes, but not here. Sigh.
  26.  
  27. In the src directory there are two files: #lint.out and #LATTICE_OPTIMIZER.OUT
  28. Something to do (when extremely bored :-) is to remove all the lint errors
  29. (functions, variables, etc. that aren't used - to decrease executable size).
  30.  
  31. Also, to decrease the executable size, one should put #ifdef's around all
  32. the debug code in p2c.
  33.  
  34. In porting this to the Amiga I did the following :
  35.  
  36. 1) added ifdef's to makeproto.c, p2c.h, and trans.h so that BSD not defined
  37.  
  38. 2) added ifdef's to trans.h so that P2C_HOME was defined.
  39.    My version of make wouldn't let me define P2C_HOME="P2C:home".
  40.  
  41. 3) broke up lex.c, parse.c, decl.c, expr.c, pexpr.c and funcs.c into
  42.    smaller files (necessary so that my compiler would compile them properly)
  43.    and updated the comments in trans.c pertaining to file names
  44.  
  45. 4) added the target-type AMIGA to trans.c
  46.  
  47. 5) modified the makefiles so that they would work with my make and compiler
  48.  
  49. NOTE: you really don't need to use makeproto to generate prototypes; you
  50. could use the Lattice compiler to generate these. However, the author uses
  51. "Static" which he ?sometimes? #define's as "static", so I use makeproto
  52. since Lattice doesn't know about this.
  53.  
  54. The original sources can be found at csvax.caltech.edu.
  55.  
  56. G. R. Walter grwalter@watmath.waterloo.edu
  57.  
  58.