| 1 |
;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*- |
|---|
| 2 |
;;; $Header: /usr/local/cvsrep/cl-fad/load.lisp,v 1.8 2008/03/12 00:10:43 edi Exp $ |
|---|
| 3 |
|
|---|
| 4 |
;;; Copyright (c) 2004-2008, Dr. Edmund Weitz. All rights reserved. |
|---|
| 5 |
|
|---|
| 6 |
;;; Redistribution and use in source and binary forms, with or without |
|---|
| 7 |
;;; modification, are permitted provided that the following conditions |
|---|
| 8 |
;;; are met: |
|---|
| 9 |
|
|---|
| 10 |
;;; * Redistributions of source code must retain the above copyright |
|---|
| 11 |
;;; notice, this list of conditions and the following disclaimer. |
|---|
| 12 |
|
|---|
| 13 |
;;; * Redistributions in binary form must reproduce the above |
|---|
| 14 |
;;; copyright notice, this list of conditions and the following |
|---|
| 15 |
;;; disclaimer in the documentation and/or other materials |
|---|
| 16 |
;;; provided with the distribution. |
|---|
| 17 |
|
|---|
| 18 |
;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED |
|---|
| 19 |
;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|---|
| 20 |
;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
|---|
| 21 |
;;; ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY |
|---|
| 22 |
;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
|---|
| 23 |
;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE |
|---|
| 24 |
;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
|---|
| 25 |
;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
|---|
| 26 |
;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
|---|
| 27 |
;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
|---|
| 28 |
;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|---|
| 29 |
|
|---|
| 30 |
(in-package :cl-user) |
|---|
| 31 |
|
|---|
| 32 |
(defparameter *cl-fad-base-directory* |
|---|
| 33 |
(make-pathname :name nil :type nil :version nil |
|---|
| 34 |
:defaults (parse-namestring *load-truename*))) |
|---|
| 35 |
|
|---|
| 36 |
#+:allegro (require :osi) |
|---|
| 37 |
#+:sbcl (require :sb-executable) |
|---|
| 38 |
#+:sbcl (require :sb-posix) |
|---|
| 39 |
|
|---|
| 40 |
(let ((cl-fad-base-directory |
|---|
| 41 |
(make-pathname :name nil :type nil :version nil |
|---|
| 42 |
:defaults (parse-namestring *load-truename*)))) |
|---|
| 43 |
(let (must-compile) |
|---|
| 44 |
#+:cormanlisp (declare (ignore must-compile)) |
|---|
| 45 |
(dolist (file '("packages" |
|---|
| 46 |
#+:cormanlisp "corman" |
|---|
| 47 |
#+:openmcl "openmcl" |
|---|
| 48 |
"fad")) |
|---|
| 49 |
(let ((pathname (make-pathname :name file :type "lisp" :version nil |
|---|
| 50 |
:defaults cl-fad-base-directory))) |
|---|
| 51 |
;; don't use COMPILE-FILE in Corman Lisp, it's broken - LOAD |
|---|
| 52 |
;; will yield compiled functions anyway |
|---|
| 53 |
#-:cormanlisp |
|---|
| 54 |
(let ((compiled-pathname (compile-file-pathname pathname))) |
|---|
| 55 |
(unless (and (not must-compile) |
|---|
| 56 |
(probe-file compiled-pathname) |
|---|
| 57 |
(< (file-write-date pathname) |
|---|
| 58 |
(file-write-date compiled-pathname))) |
|---|
| 59 |
(setq must-compile t) |
|---|
| 60 |
(compile-file pathname)) |
|---|
| 61 |
(setq pathname compiled-pathname)) |
|---|
| 62 |
(load pathname))))) |
|---|