(in-package "COMMON-LISP-USER")

;;; New compilation file for KPML for use in the AGILE project...
;;; John. Uni Stirling. May 98.
;;; Revised for KPML3, Bremen, April 2000
;;;
;;; Assumes that KPML3 is being used as part of the Agile interface,
;;; so we pretend we are loading the full system (but are not).
;;; Flag: *kpml-loading-only* If set, lets you use this file to
;;;                           loadup KPML 3.2 for Agile without the
;;;                           Agile interface around it.
;;;
;;; PLACE THIS FILE IN THE AGILE ROOT DIRECTORY.

(defvar **agile-root** 
  (make-pathname :host (pathname-host cl-user::*load-truename*) 
		 :directory (pathname-directory cl-user::*load-truename*)))

;;; ----------------------------------------------------------------------
;;; Set up the environment variables... Only (0) may need some change...
;;; ----------------------------------------------------------------------

;;;
;;;                      0. So where is KPML?
;;;
(defvar *root-of-kpml* (format nil "~a~a" cl-user::**agile-root** "kpml32\\"))

;;; ----------------------------------------------------------------------
;;; Following should probably be left as they are...
;;; ----------------------------------------------------------------------

;;;
;;;         1. Setup the following path so that KPML can find
;;;            the CLOS Domain Model Code...          
;;;
(defvar *agile-pathname-default*
  (format nil "~a~a" cl-user::**agile-root** "agile\\domain\\"))

;;;         2. Set the following variable to the name of the file that does
;;;            all the CLOS Domain Model loading. As of May 98, this file
;;;            is called agile.lisp. As long as it remains so, the following
;;;            should not need to be changed....
;;;
(defvar *agile-dm-loader* "agile.lisp")

;;;         3. Setup the following path so that KPML can find
;;;            the linguistic resources... (not needed for compilation)
;;;
(defvar *root-of-resources* nil)

;;;         4. Setup KPML so that it uses the CLOS Domain Model
;;;            Code as its knowledge representation...
;;;
(defvar *kpml-kr-loader* 
    (merge-pathnames "agile-kpml-kr" *root-of-kpml*))

;;; ----------------------------------------------------------------------
;;; As in start-agile.lisp. The following pretends we are in the
;;; Agile integrated system startup phase...
;;;
;;; Startup CLIM and the necessary patches... and load the minimal
;;; stuff that gets us to compile (i.e., Iface package definition..
;;; because now used in domain/agile.lisp and flags package
;;; symbols are used in dm.lisp,  etc.).
;;; ----------------------------------------------------------------------
(require "clim")
(require "specmac")
(require "arraymac")
(require "complex-defsetf")
(require "xref")
(scm:require-private-patch 
 (format nil "~aLispWorksPrivatePatches\\~a" 
	 **agile-root** "realize-radio-check-buttons.fsl")
 :clim-win32)

(defpackage "IFACE"
  (:nicknames "IF")
  (:use "CLIM-LISP" "CLIM"))
(defvar iface::*agile-lpoint* 
  (format nil "~a~a" cl-user::**agile-root** "agile\\"))

(defpackage flags)
(defvar flags::*oblig-slots* nil)
(defvar flags::*oblig-concept-name* nil)
(setf flags::*oblig-slots* '((procedure goal) (method-list first)))
;;; ----------------------------------------------------------------------

;;;
;;; Finally, proceed to install KPML...
;;; If nothing is done prior to loading this file, the KPML system will
;;; be compiled from scratch and configured for Agile use. If the following
;;; flag is set, then it is loaded as if it were for Agile use.

(defvar *kpml-loading-only* nil)

(if *kpml-loading-only*
    (load 
     (merge-pathnames "AGILE-KPML-INSTALLATION.lisp" cl-user::*root-of-kpml*))
  (load 
   (merge-pathnames "install-kpml.lisp" cl-user::*root-of-kpml*)))

;;; Done.

