home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / t3_1 / risc_src.lha / risc_sources / comp / build / sparcbuild.t < prev   
Encoding:
Text File  |  1990-10-16  |  4.4 KB  |  127 lines

  1. (herald sparcbuild)
  2. #|
  3.  
  4. To build a new system from sources:
  5.  
  6. 1. You should be in a directory with sources and tsystem as subdirectories
  7.    Execute the shell script in tsystem/envset
  8. 2. Start up tsystem/xt and load this file into orbit-env
  9. 3. (compile-support) and (exit)
  10. 4. Start up tsystem/xt again and load this file into orbit-env
  11. 5. (compile-sources) and (link-t '(tsystem new)) and (exit)
  12. 6. cd tsystem; linkt new.o new; cd ..
  13. 7. tsystem/new is a T without compiler. Start up new with a large heap.
  14. 8. ((*value t-implementation-env 'load-and-suspend-system) '(tsystem new) t)
  15.    (exit)
  16. 9. cd tsystem; linkt new.o new    That's it.
  17.  
  18. |#
  19.  
  20. ;;; Build compiler early binding environment
  21. (set (syntax-table-entry (env-syntax-table t-implementation-env) 'expand) nil)
  22. (set (syntax-table-entry (env-syntax-table orbit-env) 'expand) nil)
  23. (set (syntax-table-entry (env-syntax-table standard-env) 'expand) nil)
  24.  
  25. (*define user-env 'compile-support
  26. (lambda ()
  27. (create-support '(t3_primops spconstants) '(t3_primops spconstants))
  28. (load '(t3_primops spconstants t) orbit-env)
  29. (orbit-sparc-setup 't3_primops)
  30. (orbit-init 'base)
  31. (set (orbit-syntax-table) primop-syntax-table)
  32. (set *compile-primops?* nil)
  33. (create-support '(t3_primops spprimops)   '(t3_primops spprimops))
  34. (create-support '(t3_primops sparith)     '(t3_primops sparith))
  35. (create-support '(t3_primops locations)    '(t3_primops locations))
  36. (create-support '(t3_primops splow)       '(t3_primops splow))
  37. (create-support '(t3_primops predicates)       '(t3_primops predicates))
  38. (orbit-init 'base  
  39.             'constants 'primops 'arith 'locations 'low 'predicates)
  40. (create-support '(t3_primops open)    '(t3_primops open))
  41. (create-support '(t3_primops aliases) '(t3_primops aliases))
  42. (create-support '(t3_primops carcdr)  '(t3_primops carcdr))
  43. (create-support '(t3_primops spgenarith)  '(t3_primops spgenarith))))
  44.  
  45. ;;; compile compiler code in early binding environment, runtime system
  46.  
  47. (*define user-env 'compile-sources
  48. (lambda ()
  49. (set (orbit-syntax-table) primop-syntax-table)
  50. (comfile '(t3_primops base))
  51. (compile-primop-source '(t3_primops spprimops   si))
  52. (compile-primop-source '(t3_primops sparith     si))
  53. (compile-primop-source '(t3_primops locations    si))
  54. (compile-primop-source '(t3_primops splow       si))
  55. (compile-primop-source '(t3_primops spgenarith    si))
  56. (set *compile-primops?* nil)
  57. (set (table-entry *modules* 'bignum) '(osys risc_bignum))
  58. (load-quietly '(t3_primops spconstants t) orbit-env)
  59. (set (orbit-syntax-table) (env-syntax-table t-implementation-env))
  60. (orbit-sparc-init 't3_primops)
  61. ;(set primop/computed-goto (table-entry primop-table 'computed-goto))
  62. (define (comsys system . start)
  63.   (walk (lambda (file)
  64.       (xcase (car file)
  65.             ((osys)
  66.          (set (tc-syntax-table) (env-syntax-table t-implementation-env))
  67.          (comfile file))
  68.         ((t3_primops)
  69.          (set (tc-syntax-table) primop-syntax-table)
  70.          (bind ((write-support-file false))
  71.            (comfile file)))))
  72.     (let ((files (xcase system
  73.                ((z) *zvm-system*)
  74.                ((t) *t-system*))))
  75.       (if start (mem alikev? (car start) files) files))))
  76. (load '(osys sparc_files) orbit-env)
  77. (comsys 't)
  78. (comfile '(link defs))
  79. (comfile '(link linker))
  80. (comfile '(link sparc_link))
  81. (comfile '(link lp_table))
  82. (comfile '(link suspend))
  83. (comfile '(link sparcsuspend))
  84. (comfile '(tscheme scheme))
  85. (comfile '(tscheme syntax))
  86. (comfile '(tscheme system))
  87. (comfile '(tscheme runtime))
  88. (comfile '(tscheme compiler))
  89. (set (tc-syntax-table) (env-syntax-table orbit-env))
  90. (comfile '(front_end spfix))
  91. (walk comfile
  92.       (append *orbit-files*
  93.           *top-files*
  94.           *front-files*
  95. ;          '((front_end computed_goto))
  96.           *back-end-files*
  97.           *orbit-sparc-files*
  98.           *tas-sparc-files*))))
  99.  
  100.  
  101. (define (load-linker . system)
  102.   (let* ((system (if (null? system) 
  103.                      ((*value t-implementation-env 'machine-type) 
  104.                       ((*value t-implementation-env 'local-machine)))
  105.                      (car system)))
  106.          (link-env (make-locale orbit-env 'link-env)))
  107.     (*define standard-env 'link-env link-env)
  108.     (load '(link defs )         link-env)
  109.     (load '(link linker )       link-env)
  110.     (load 
  111.      '(link sparc_link)
  112.      link-env)
  113.     (load '(t3_primops spconstants t)  link-env)
  114.     (*define standard-env  'link
  115.          (lambda (files outfile)
  116.            (set (repl-results) nil)
  117.            (gc)
  118.            ((*value link-env 'link) files outfile)))))
  119.  
  120. (*define user-env 'link-t
  121. (lambda (file)
  122. (load-linker)
  123. (load '(osys sparc_files) orbit-env)
  124. (link *t-system* file)))
  125.  
  126.  
  127.