r8830: improve system loading
authorKevin M. Rosenberg <kevin@rosenberg.net>
Tue, 6 Apr 2004 08:30:57 +0000 (08:30 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Tue, 6 Apr 2004 08:30:57 +0000 (08:30 +0000)
clsql-mysql.asd
clsql-uffi.asd
uffi/clsql-uffi.lisp

index 41a661c5fe3ee9490e74a9993cb32a0d5dc87aee..88abbada6ba7a286333695c5720cb3c2ab360e83 100644 (file)
 (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"
                                             :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)
index 42356496f8e4b7e8b6ffc6cb288e1450d94e1d56..077b578fe55ce6d41312fb1685ca583ce3392c1a 100644 (file)
@@ -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"
                                             :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"
index e1f687b53494cd28b2f9471bff3d0a444e49207e..331db7d3ab795d3f974dc09f834ca180f452532b 100644 (file)
@@ -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))