From: Kevin M. Rosenberg Date: Tue, 6 Apr 2004 08:30:57 +0000 (+0000) Subject: r8830: improve system loading X-Git-Tag: v3.8.6~738 X-Git-Url: http://git.kpe.io/?p=clsql.git;a=commitdiff_plain;h=8b42ade98431d9089422974c26d7ec593173d062 r8830: improve system loading --- diff --git a/clsql-mysql.asd b/clsql-mysql.asd index 41a661c..88abbad 100644 --- a/clsql-mysql.asd +++ b/clsql-mysql.asd @@ -19,6 +19,10 @@ (defpackage #:clsql-mysql-system (:use #:asdf #:cl)) (in-package #:clsql-mysql-system) +(eval-when (:compile-toplevel :load-toplevel :execute) + #+common-lisp-controller (require 'uffi) + #-common-lisp-controller (asdf:operate 'asdf:load-op 'uffi)) + (defvar *library-file-dir* (append (pathname-directory *load-truename*) (list "db-mysql"))) @@ -43,6 +47,9 @@ (defmethod perform ((o load-op) (c clsql-mysql-source-file)) nil) ;;; library will be loaded by a loader file +(defmethod operation-done-p ((o load-op) (c clsql-mysql-source-file)) + nil) + (defmethod perform ((o compile-op) (c clsql-mysql-source-file)) (unless (zerop (run-shell-command "cd ~A; make" @@ -51,6 +58,12 @@ :directory *library-file-dir*)))) (error 'operation-error :component c :operation o))) +(defmethod operation-done-p ((o compile-op) (c clsql-mysql-source-file)) + (let ((lib (make-pathname :defaults (component-pathname c) + :type (uffi:default-foreign-library-type)))) + (and (probe-file lib) + (> (file-write-date lib) (file-write-date (component-pathname c)))))) + ;;; System definition #+(or allegro lispworks cmu sbcl openmcl mcl scl) diff --git a/clsql-uffi.asd b/clsql-uffi.asd index 4235649..077b578 100644 --- a/clsql-uffi.asd +++ b/clsql-uffi.asd @@ -53,6 +53,9 @@ (defmethod perform ((o load-op) (c clsql-uffi-source-file)) nil) ;;; library will be loaded by a loader file +(defmethod operation-done-p ((o load-op) (c clsql-uffi-source-file)) + nil) + (defmethod perform ((o compile-op) (c clsql-uffi-source-file)) (unless (zerop (run-shell-command "cd ~A; make" @@ -61,6 +64,12 @@ :directory *library-file-dir*)))) (error 'operation-error :component c :operation o))) +(defmethod operation-done-p ((o compile-op) (c clsql-uffi-source-file)) + (let ((lib (make-pathname :defaults (component-pathname c) + :type (uffi:default-foreign-library-type)))) + (and (probe-file lib) + (> (file-write-date lib) (file-write-date (component-pathname c)))))) + #+(or allegro lispworks cmu sbcl openmcl mcl scl) (defsystem clsql-uffi :name "cl-sql-base" diff --git a/uffi/clsql-uffi.lisp b/uffi/clsql-uffi.lisp index e1f687b..331db7d 100644 --- a/uffi/clsql-uffi.lisp +++ b/uffi/clsql-uffi.lisp @@ -21,7 +21,7 @@ (defun canonicalize-type-list (types auto-list) "Ensure a field type list meets expectations" - (declaim (optimize (speed 3) (safety 0))) + (declare (optimize (speed 3) (safety 0))) (do ((i 0 (1+ i)) (new-types '()) (length-types (length types))