New file clsql-cffi.asd
[clsql.git] / clsql.asd
index 26ee04fafeb63850851ac7fda87b9cc1060a0935..c28225e22833284cec52833f893c937f6a60b4b2 100644 (file)
--- a/clsql.asd
+++ b/clsql.asd
@@ -3,12 +3,10 @@
 ;;;; FILE IDENTIFICATION
 ;;;;
 ;;;; Name:     clsql.asd
-;;;; Purpose:  System definition for CLSQL-CLASSIC
+;;;; Purpose:  ASDF System definition for CLSQL
 ;;;; Authors:  Marcus Pearce and Kevin M. Rosenberg
 ;;;; Created:  March 2004
 ;;;;
-;;;; $Id$
-;;;;
 ;;;; CLSQL users are granted the rights to distribute and use this software
 ;;;; as governed by the terms of the Lisp Lesser GNU Public License
 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
 (defpackage #:clsql-system (:use #:asdf #:cl))
 (in-package #:clsql-system)
 
-#+clisp
-(progn
-  (asdf:operate 'asdf:load-op 'cffi)
-  (asdf:operate 'asdf:load-op 'cffi-uffi-compat)
-  (asdf:defsystem uffi :depends-on (cffi-uffi-compat)))
+#+(and clisp (not :clsql-cffi))
+(asdf:operate 'asdf:load-op 'clsql-cffi)
 
 ;; need to load uffi for below perform :after method
 (eval-when (:compile-toplevel :load-toplevel :execute)
+  #+:clsql-cffi
+  (unless (find-package 'cffi-uffi-compat)
+    (asdf:operate 'asdf:load-op 'cffi-uffi-compat))
+  #-:clsql-cffi
   (unless (find-package 'uffi)
     (asdf:operate 'asdf:load-op 'uffi)))
 
@@ -60,7 +59,7 @@ oriented interface."
                         ((:file "initialize")
                         (:file "database" :depends-on ("initialize"))
                         (:file "recording" :depends-on ("database"))
-                        (:file "pool"))
+                        (:file "pool" :depends-on ("database")))
                         :depends-on (base))
               (:module syntax
                        :pathname ""
@@ -99,8 +98,12 @@ oriented interface."
 (defmethod perform :after ((o load-op) (c (eql (find-system 'clsql))))
   (let* ((init-var (uffi:getenv "CLSQLINIT"))
          (init-file (or (when init-var (probe-file init-var))
+                        (probe-file
+                         (concatenate 'string
+                                      (namestring (user-homedir-pathname))
+                                      ".clsql-init.lisp"))
                         (probe-file "/etc/clsql-init.lisp")
-                        #+(or mswin windows win32)
+                        #+(or mswin windows win32 win64 mswindows)
                         (probe-file "c:\\etc\\clsql-init.lisp"))))
     (when init-file (load init-file))))