build0.lsp 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. %
  2. % Create fasl files for compiler, ccomp and extras and build a CSL
  3. % checkpoint image for a system that includes them.
  4. %
  5. % Run this using
  6. % csl -z build0.lsp -l build0.log
  7. %
  8. %
  9. % This code may be used and modified, and redistributed in binary
  10. % or source form, subject to the "CCL Public License", which should
  11. % accompany it. This license is a variant on the BSD license, and thus
  12. % permits use of code derived from this in either open and commercial
  13. % projects: but it does require that updates to this code be made
  14. % available back to the originators of the package. Note that as with
  15. % any BSD-style licenses the terms here are not compatible with the GNU
  16. % public license, and so GPL code should not be combined with the material
  17. % here in any way.
  18. %
  19. (verbos 3)
  20. (rdf "$cslbase/compat.lsp")
  21. (rdf "$cslbase/extras.lsp")
  22. (rdf "$cslbase/compiler.lsp")
  23. (clear_source_database)
  24. % First I compile those things that appear to be most heavily used in the
  25. % compiler. This should speed up the whole bootstrap compilation process
  26. (compile '(
  27. s!:improve s!:literal_order s!:comval s!:outopcode0
  28. s!:plant_basic_block s!:remlose s!:islocal
  29. s!:is_lose_and_exit s!:comatom s!:destination_label
  30. s!:record_literal s!:resolve_labels s!:expand_jump
  31. s!:outopcode1lit stable!-sortip s!:iseasy s!:outjump
  32. s!:add_pending s!:comcall s!:resolve_literals))
  33. (compile!-all)
  34. % Build fasl files for the compatibility code and the two
  35. % versions of the compiler.
  36. (clear_source_database)
  37. (faslout 'compat)
  38. (rdf "$cslbase/compat.lsp")
  39. (rdf "$cslbase/extras.lsp")
  40. (faslend)
  41. (faslout 'compiler)
  42. (rdf "$cslbase/compiler.lsp")
  43. (faslend)
  44. (faslout 'ccomp)
  45. (rdf "$cslbase/ccomp.lsp")
  46. (faslend)
  47. (bytecounts)
  48. (save_source_database "$cslbase/whereis.lsp")
  49. %
  50. % (restart-csl nil) is a fairly dramatic, and maybe dangerous function. It
  51. % abandons all existing Lisp data and restarts the system from scratch,
  52. % with only minimal built-in functionality.
  53. %
  54. (restart!-csl nil)
  55. (load!-module 'compat)
  56. (setq !*comp nil)
  57. (set!-autoload 'compile 'compiler)
  58. (set!-autoload 'compile!-all 'compiler)
  59. (set!-autoload 'faslout 'compiler)
  60. (set!-autoload 'c_out 'compiler)
  61. (setq !*comp t)
  62. (preserve)