home *** CD-ROM | disk | FTP | other *** search
/ ftp.uni-stuttgart.de/pub/systems/acorn/ / Acorn.tar / Acorn / acornet / dev / scheme / scmdist.spk / scm / !ReHacking < prev    next >
Text File  |  1993-11-04  |  4KB  |  97 lines

  1. !Port
  2. -----
  3.  
  4. Having uploaded scm4c5 a few weeks ago after having hacked it into shape I 
  5. got a piece of email asking about distributing the source for the port.
  6. I am loathe to do this as basically I don't like the idea of different
  7. versions kicking around when I have tested this version to the best of the
  8. test-suite and found that it works fine.
  9. However...
  10. I believe there are some people that have a penchant for windowing apps 
  11. - I am not one of these people, I feel that command line apps are infinitely 
  12. preferable for this sort of thing in terms of speed and general application.
  13. (Also I havent got a ghost of a clue how to make windows etc appear on
  14. screen and I simply have not got the time..)
  15. Secondly the thing I cant stand is software that wont run in either a 
  16. windwing environment or command line - this can as it stands - either run it
  17. to get it by itself or run a taskwindow and then it multitasks. Voila.
  18. (I have seen but one other piece of software thats a free port that runs
  19. either in a window or in a command line (ok so Ive cheated but :-)
  20.  
  21. Anyways thats the preamble.
  22. If you want to hack up your own version of scm4d0 for whatever deviant
  23. purposes heres how to get it running with unixlib (Ill assume you are using
  24. 3.6c as I know that works)  - if you want to try native compilation with
  25. the C stubs or riscos_lib then you are on your own....
  26.  
  27. edit config.h so that you ae something like :
  28. #define IMPLINIT "<scm$dir>.scm.Init"  /* or whereever you want it */
  29. #define IO_EXTENSIONS
  30. #define STACK_LIMIT (HEAP_SEG_SIZE/2)
  31.  
  32. everything else is as default.
  33.  
  34. now have a look at the makefile Ive bundled along :
  35. change the paths to unixlib headrs and library code so that it points to
  36. where you keep it.
  37.  
  38. ok now we are ready to trundle...
  39. bring up a command line and try 
  40.       amu @.scm
  41. now you should have a few errors about cant open <sys/ioctl.h>
  42.  - wherever this happens - comment this line outm it doesnt apply to unixlib
  43.  and we havent got it...
  44. Other problems are that it complains about <sys/times.h> - there might be 
  45. at most two places it does this - change to <time.h> - if it does it more
  46. than that then you have probably removed the -DLACK_FTIME -DLACK_TIMES
  47. flags to the C compiler - put em back in...
  48. Eventually it should get past that and trundle thru the rest of the source 
  49. without griping ...
  50.  
  51. Now we come to the fun part.
  52. Scheme has a rather fun habit of loading in sizeable chunks of itself at
  53. run-time.
  54. Ive had to change a couple of pieces of the Init source so that it would
  55. even run without gagging halfway thru - relevant fragments to replace with
  56. bits given below are :
  57.  
  58. (define scheme-file-suffix
  59.   (case (software-type)
  60.     ((NOSVE) (lambda () "_scm"))
  61. ;;; (else (lambda () ".scm"))))              ;;; --- ams
  62.     (else (lambda () "")))) 
  63.  
  64.  
  65. ;;; This is the vicinity where this file resides.
  66. ;;; --- ams this is disgusting but works..
  67. ;;; (define implementation-vicinity
  68. ;;;  (let ((vic (program-vicinity)))
  69. ;;;    (lambda () vic)))
  70. (define implementation-vicinity
  71.     (let ((vic "<scm$dir>."))
  72.     (lambda () vic)))
  73.  
  74.     
  75. ;;; note we want require not require.scm
  76. ;;;
  77. (cond ((try-load
  78.     (in-vicinity (library-vicinity) "require" (scheme-file-suffix))))
  79.       (else
  80.        (perror "WARNING")
  81.        (display "WARNING: Couldn't find require.scm in (library-vicinity)"
  82.         (current-error-port))
  83.        (write (library-vicinity) (current-error-port))
  84.        (newline (current-error-port))
  85.        (errno 0)))
  86.        
  87.        
  88.        
  89. and thats it. any other problems with it then email me and Ill try and help
  90. you out - although I cant promise to assist unless Ive got some free time.
  91. (Coursework is such a joy :-)
  92.  
  93.  
  94. Hope this is of some use ...
  95.  
  96.  
  97. alastair.