#!/bin/sh
# Sketch of build script for LKB-FOS. Not properly parameterised and most definitely
# work-in-progress...

cd ~/Documents/delphin 
sbcl --dynamic-space-size 64GB > /tmp/lkb-build <<EOF
(load "~/common-lisp/quicklisp/setup.lisp")
(ql:quickload :mcclim)
(ql:quickload :mcclim-tooltips)

;;; Don't load swank here if you load it yourself as part of your programming environment
;(ql:quickload :swank)
;;; if saving an image for redistribution, stop swank trying to compile source files that
;;; will probably be not present or in expected place on user's computer
;(defun swank-loader::compile-contribs (&key &allow-other-keys) nil)

;;; get process-room function
#+(and :sbcl :64-bit (or :linux :darwin)) (ql:quickload :machine-state)

;;; load ad-hoc patches and enhancements to McCLIM which address in-progress issues or
;;; are waiting for more generic solutions - therefore not included in source code tree
;(load "McCLIM/interface-fixes.lisp")
;(load "McCLIM/fontconfig.lisp")

(declaim (optimize (speed 2) (safety 1) (compilation-speed 0) (space 0) (debug 1)))
#+:ccl (pushnew :mcl *features*) ; to ensure that defsystem loads correctly
(setq *compile-print* nil)
(load "fos/src/general/loadup")

(defparameter make::*building-image-p* t)
(setq make:*compile-during-load* t)
(pushnew :lkb *features*)
(pushnew :lkb-fos *features*)

(setq make::*oos-verbose* nil)
(make:compile-system "tsdb" :force t)
(setq make::*building-image-p* nil)

(clim-user::dump-lkb "lkb")
EOF
