;;; -*- Mode:Lisp; Readtable:ZL; Package:USER; Base:8; Patch-File:T -*-
;;; Patch file for System version 126.139
;;; Reason:
;;;  The global value of COMPILER:*COMPILATION-ENVIRONMENT* is now NIL, not unbound.
;;;  Fixed MAKE-SYSTEM so it doesn't need to make a compilation environment when not
;;;  compiling, which was screwing cold load use of MAKE-SYSTEM.
;;; Written 4-Nov-88 14:35:56 by keith (Keith Corbett) at site Gigamos Cambridge
;;; while running on Johannes Brahms from band 1
;;; with Experimental System 126.138, Experimental ZWEI 126.28, Experimental ZMail 74.14, Experimental Local-File 76.0, Experimental File-Server 25.0, Experimental Lambda-Diag 18.0, Experimental Unix-Interface 15.0, Experimental Tape 26.4, Microcode 1762, SDU Boot Tape 3.14, SDU ROM 103, 10/17.



; From modified file DJ: L.SYS; QFCTNS.LISP#863 at 4-Nov-88 14:36:09
#8R SYSTEM-INTERNALS#: 
(COMPILER-LET ((*PACKAGE* (PKG-FIND-PACKAGE "SYSTEM-INTERNALS")))
  (COMPILER::PATCH-SOURCE-FILE "SYS: SYS; QFCTNS  "


(DEFUN PUTDECL (NAME PROP VALUE)
  "Executed while compiling a file, creates a compile-time property.
Compile-time properties are accessed using GETDECL."
  ;; Theoretically, when not somewhere inside a COMPILE-FILE, i.e. when there is no
  ;; *COMPILATION-ENVIRONMENT* established, PUTDECL should not be called at all.
  ;; Unfortunately, certain obnoxious macros like DEFSTRUCT expand to
  ;; EVAL-WHEN-COMPILE DEFDECL forms, effectively solving a problem twice instead
  ;; instead of just once, thereby causing much grief.  So we make PUTDECL do
  ;; the right thing if there is no *COMPILATION-ENVIRONMENT*.
  (if (and (boundp 'compiler:*compilation-environment*)	; $$$ <04-Nov-88 Fixed for makesystem. smh&keith>
	   compiler:*compilation-environment*)
      ;; A more trusting loser might try to do this atomically without the intermediate
      ;; fetch of the whole plist.
      (let ((plist (gethash name
			    (compiler:compilation-environment-plist-hashtab
			      compiler:*compilation-environment*))))
	(setf (getf plist prop) value)
	(setf (gethash name (compiler:compilation-environment-plist-hashtab
			      compiler:*compilation-environment*))
	      plist))
    (putprop name value prop)))

;;; Get either the current loaded definition or a property
;;; or the actual value of the property.

))

; From modified file DJ: L.SYS2; MAKSYS.LISP#219 at 4-Nov-88 14:36:14
#8R SYSTEM-INTERNALS#: 
(COMPILER-LET ((*PACKAGE* (PKG-FIND-PACKAGE "SYSTEM-INTERNALS")))
  (COMPILER::PATCH-SOURCE-FILE "SYS: SYS2; MAKSYS  "


(define-make-system-special-variable compiler:*compilation-environment*	; $$$ fixes cold load <04-Nov-88 smh&keith>
				     (and (boundp 'compiler:*compilation-environment*)
					  compiler:*compilation-environment*)
  nil)

))

; From modified file DJ: L.SYS; QCDEFS.LISP#261 at 4-Nov-88 14:38:21
#8R COMPILER#: 
(COMPILER-LET ((*PACKAGE* (PKG-FIND-PACKAGE "COMPILER")))
  (PATCH-SOURCE-FILE "SYS: SYS; QCDEFS  "

(defvar *compilation-environment* nil		;Bind -- do not set! $$$ Was :unbound <04-Nov-88 smh&keith>
  "The compilation-environment in which compile-time definitions should be recorded.")

))
