Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[28e3a1]: src / bare.lsp.in Maximize Restore History

Download this file

bare.lsp.in    86 lines (75 with data), 2.7 kB

;;; @configure_input@
;;;
;;; This file can be loaded either in ECL_MIN or in the final executable
;;; ECL. In both cases, it ensures that we have a working Common-Lisp
;;; environment (either interpreted, as in ECL_MIN, or compiled, as in ECL),
;;; that the compiler is loaded, that we use the headers in this directory,
;;; etc.
;;;
;;; * By redefining "SYS:" ECL will be able to
;;;   find headers and libraries in the build directory.
;;;
(si::pathname-translations "SRC" `(("**;*.*.*" "@true_srcdir@/**/*.*")))
(si::pathname-translations "EXT" `(("**;*.*.*" "@true_srcdir@/../contrib/**/*.*")))
(si::pathname-translations "BUILD" `(("**;*.*.*" "@true_builddir@/**/*.*")))
(si::pathname-translations "SYS" '(("**;*.*.*" "@true_builddir@/**/*.*")))

;;;
;;; * Set ourselves in the 'SYSTEM package
;;;
(setq *package* (find-package "SYSTEM"))
(setq si::*keep-definitions* nil)

;;;
;;; * Load Common-Lisp base library
;;;
(if (or (member "ECL-MIN" *features* :test #'string-equal)
	(member "CROSS" *features* :test #'string-equal))
  (load "lsp/load.lsp" :verbose nil))

(defun si::process-command-args () )

;;;
;;; * Load PCL-based Common-Lisp Object System
;;;
(setf sys::*gc-verbose* nil)
(print *features*)
#+(or (and wants-clos ecl-min) cross)
(load "clos/load.lsp")
#+cmu-format
(load "src:lsp;format.lsp" :verbose nil)

;;;
;;; * Load the compiler.
;;;
#-threads
(defmacro c::with-lock ((lock) &body body)
  `(progn ,@body))
(load #+(or cross ecl-min) "cmp/load.lsp"
      #-(or cross ecl-min) "cmp.so")

;;;
;;; * Remove documentation from compiled files
;;;
(setq si::*keep-documentation* nil)

;;;
;;; * Timed compilation facility.
;;;
(defun compile-if-old (destdir sources &rest options)
  (unless (probe-file destdir)
    (si::mkdir destdir #o0777))
  (mapcar #'(lambda (source)
	      (let ((object (merge-pathnames destdir (compile-file-pathname source :type :object))))
		(unless (and (probe-file object)
			     (>= (file-write-date object) (file-write-date source)))
		  (apply #'compile-file source :output-file object options))
		object))
	  sources))

(defun build-module (name sources &key (dir "build:") ((:prefix si::*init-function-prefix*) "EXT"))
  (proclaim '(optimize (safety 2) (speed 1)))
  (let* ((objects (compile-if-old "build:ext;" sources :system-p t :c-file t :data-file t :h-file t))
	 (name (string-downcase name)))
    #-dlopen
    (warn "~%Unable to build module ~A because dynamic linking is not available on this platform"
	  name)
    #+dlopen
    (c::build-fasl name :lisp-files objects)))


;;;
;;; * Go back to build directory to start compiling
;;;
#+ecl-min
(setq *features* (cons :stage1 (remove :ecl-min *features*)))