Skip to content
ecl.lisp 1.73 KiB
Newer Older
;;; -*- Mode: Lisp ; Syntax: ANSI-Common-Lisp -*-

Francois-Rene Rideau's avatar
Francois-Rene Rideau committed
#+xcvb (module (:depends-on ("specials")))
(defmethod output-files ((o fasl-op) (c system))
  (declare (ignorable o c))
  (loop :for file :in (call-next-method)
        :collect (make-pathname :type "fasb" :defaults file)))

(defmethod perform ((o bundle-op) (c system))
  (let* ((object-files (remove "fas" (input-files o c)
                               :key #'pathname-type :test #'string=))
         (output (output-files o c)))
    (ensure-directories-exist (first output))
    (apply #'c::builder (bundle-op-type o) (first output) :lisp-files object-files
           (append (bundle-op-build-args o)
                   (when (and (typep o 'monolithic-bundle-op)
                              (monolithic-op-prologue-code o))
                     `(:prologue-code ,(monolithic-op-prologue-code o)))
                   (when (and (typep o 'monolithic-bundle-op)
                              (monolithic-op-epilogue-code o))
                     `(:epilogue-code ,(monolithic-op-epilogue-code o)))))))


;;;
;;; Final integration steps
;;;

(export '(make-build load-fasl-op prebuilt-system))
(push '("fasb" . si::load-binary) ext:*load-hooks*)

(defun register-pre-built-system (name)
  (register-system (make-instance 'system :name name :source-file nil)))

(setf ext:*module-provider-functions*
      (loop :for f :in ext:*module-provider-functions*
        :unless (eq f 'module-provide-asdf)
        :collect #'(lambda (name)
                     (let ((l (multiple-value-list (funcall f name))))
                       (and (first l) (register-pre-built-system (coerce-name name)))
                       (values-list l)))))
#+win32 (push '("asd" . si::load-source) ext:*load-hooks*)