[elephant-cvs] CVS elephant

ieslick ieslick at common-lisp.net
Mon Apr 30 00:38:31 UTC 2007


Update of /project/elephant/cvsroot/elephant
In directory clnet:/tmp/cvs-serv8074

Modified Files:
	config.sexp ele-clsql.asd elephant.asd 
Log Message:
Final changes to build process for prebuilt windows files, documenting user configuration options, enabling clsql-lib load paths and some installation manual edits

--- /project/elephant/cvsroot/elephant/config.sexp	2007/04/25 02:27:56	1.11
+++ /project/elephant/cvsroot/elephant/config.sexp	2007/04/30 00:38:29	1.12
@@ -1,48 +1,63 @@
-#+(or sbcl allegro)
-((:berkeley-db-include-dir . "/opt/local/include/db45/")
+#+(and (or sbcl allegro) (not mswindows) (not windows))
+((:compiler . :gcc)
+ (:berkeley-db-include-dir . "/opt/local/include/db45/")
  (:berkeley-db-lib-dir . "/opt/local/lib/db45/")
  (:berkeley-db-lib . "/opt/local/lib/db45/libdb-4.5.dylib")
  (:berkeley-db-deadlock . "/opt/local/bin/db45_deadlock")
- (:pthread-lib . nil)
  (:berkeley-db-cachesize . 20971520)
- (:clsql-lib . nil)
- (:compiler . :gcc))
+ (:berkeley-db-map-degree2 . t)
+ (:clsql-lib-paths . nil)
+ (:prebuilt-libraries . nil))
+ 
 
 #+openmcl
-((:berkeley-db-include-dir . "/usr/local/BerkeleyDB.4.5/include/")
+((:compiler . :gcc)
+ (:berkeley-db-include-dir . "/usr/local/BerkeleyDB.4.5/include/")
  (:berkeley-db-lib-dir . "/usr/local/BerkeleyDB.4.5/lib/")
  (:berkeley-db-lib . "/usr/local/BerkeleyDB.4.5/lib/libdb-4.5.dylib")
- (:pthread-lib . nil)
- (:clsql-lib . nil)
- (:compiler . :gcc))
+ (:berkeley-db-cachesize . 20971520)
+ (:berkeley-db-map-degree2 . t)
+ (:prebuilt-libraries . nil)
+ (:clsql-lib-paths . nil))
 
 #+(and lispworks (not mswindows))
-((:berkeley-db-include-dir . "/opt/local/include/db45/")
- (:berkeley-db-lib-dir . "/opt/local/lib/db45/")
- (:berkeley-db-lib . "/opt/local/lib/db45/libdb-4.5.dylib")
- (:berkeley-db-deadlock . "/opt/local/bin/db45_deadlock")
- (:pthread-lib . nil)
- (:clsql-lib . nil)
- (:compiler . :gcc))
+((:compiler . :gcc)
+ (:berkeley-db-include-dir . "/usr/local/BerkeleyDB.4.5/include/")
+ (:berkeley-db-lib-dir . "/usr/local/BerkeleyDB.4.5/lib/")
+ (:berkeley-db-lib . "/usr/local/BerkeleyDB.4.5/lib/libdb-4.5.dylib")
+ (:berkeley-db-deadlock . "/usr/local/BerkeleyDB.4.5/bin/db_deadlock")
+ (:berkeley-db-cachesize . 20971520)
+ (:berkeley-db-map-degree2 . t)
+ (:prebuilt-libraries . nil)
+ (:clsql-lib-paths . nil))
 
 #+(or mswindows windows)
-((:berkeley-db-include-dir . "C:/Program Files/Oracle/Berkeley DB 4.5.20/include/")
+((:compiler . :cygwin)
+ (:berkeley-db-include-dir . "C:/Program Files/Oracle/Berkeley DB 4.5.20/include/")
  (:berkeley-db-lib-dir . "C:/Program Files/Oracle/Berkeley DB 4.5.20/bin/")
  (:berkeley-db-lib . "C:/Program Files/Oracle/Berkeley DB 4.5.20/bin/libdb45.dll")
  (:berkeley-db-deadlock . "C:/Program Files/Oracle/Berkeley DB 4.5.20/bin/db_deadlock.exe")
- (:pthread-lib . nil)
- (:clsql-lib . nil)
- (:compiler . :cygwin))
+ (:berkeley-db-cachesize . 20971520)
+ (:berkeley-db-map-degree2 . t)
+ (:clsql-lib-paths . nil)
+ (:prebuilt-libraries . t))
 
 ;; Berkeley 4.5 is required, each system will have different settings for
 ;; these directories, use this as an indication of what each key means
 ;;
-;; Typical pthread settings are: /lib/tls/libpthread.so.0
-;;
-;; nil means that the library in question is not loaded
-;;
-;; NOTE: The latest SBCL (0.9.17+) on linux no longer needs the pthread library,
-;;       it is statically linked against it now with the new thread support
+;; :prebuilt-libraries is true by default for windows machines.  It causes
+;; the library loader to look in the elephant root directory for the shared 
+;; libraries.  (nil or t)
+;;
+;; :clsql-lib-paths tell clsql where to look for which ever SQL distribution
+;; library files you need it to look for.  For example...
+;;
+;;  (:clsql-lib-paths . ("/Users/me/Work/SQlite3/" "/Users/me/Work/Postgresql/"))
+;;
+;; :pthread-lib is deprecated, for old versions of sbcl prior to 0.9.17 that 
+;; did not have pthreads compiled in.  If you are using an old version, we 
+;; recommend that you upgrade!  
+;; Typical pthread settings were: /lib/tls/libpthread.so.0
 ;;
 ;; :compiler options are 
 ;;           :gcc (default: for unix platforms with /usr/bin/gcc)
@@ -52,16 +67,18 @@
 ;; Additional supported parameters include:
 ;;
 ;;
-;; :berkeley-db-cachesize - an integer indicating the number of bytes
-;;                          for the page cache, default 10MB which is
-;;                          about enough storage for 10k-30k indexed
-;;                          persistent objects
-;;
-;; :map-using-degree2 - Boolean parameter that indicates whether map
-;;                      operations lock down the btree for the entire
-;;                      transaction or whether they allow other
-;;                      transactions to add/delete/modify values
-;;                      before the map operation is completed.  The
-;;                      map operation remains stable and any writes
-;;                      are kept transactional, see user manual as
-;;                      well as berkeley DB docs for more details
+;; :berkeley-db-cachesize
+;;          An integer indicating the number of bytes
+;;          for the page cache, default 20MB which is
+;;          about enough storage for 10k-30k indexed
+;;          persistent objects
+;;
+;; :berkeley-db-map-degree2 
+;;          Boolean parameter that indicates whether map
+;;          operations lock down the btree for the entire
+;;          transaction or whether they allow other
+;;          transactions to add/delete/modify values
+;;          before the map operation is completed.  The
+;;          map operation remains stable and any writes
+;;          are kept transactional, see user manual as
+;;          well as berkeley DB docs for more details.
--- /project/elephant/cvsroot/elephant/ele-clsql.asd	2007/03/23 16:31:52	1.10
+++ /project/elephant/cvsroot/elephant/ele-clsql.asd	2007/04/30 00:38:29	1.11
@@ -16,29 +16,33 @@
 ;;; as governed by the terms of the Lisp Lesser GNU Public License
 ;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
 
-;; (eval-when (:compile-toplevel :load-toplevel  :execute)
-;;   (unless (find-package 'clsql)
-;;     (asdf:operate 'asdf:load-op 'clsql)))
-
-;; ;; clsql needs to know how to find libaries to various databases....
-;;    (defvar *clsql-foreign-lib-path* "/usr/lib")
-;;    (defvar *elephant-lib-path* "/usr/local/share/common-lisp/elephant/")
-;;    (clsql:push-library-path *clsql-foreign-lib-path*)
-;;    (clsql:push-library-path *elephant-lib-path*)
-;; )
-
-;;(defparameter *clsql-foreign-lib-path* #p"/usr/lib")
-;;(defparameter *elephant-lib-path* #p"/usr/local/share/common-lisp/elephant/")
-
-;;(defmethod asdf:perform :after ((o asdf:load-op) 
-;				(c (eql (asdf:find-system 'clsql))))
-;;  (let ((plp (find-symbol (symbol-name '#:push-library-path)
-;;			  (find-package 'clsql))))
-;;  (funcall plp
-;;	   *clsql-foreign-lib-path*)
-;;  (funcall plp
-;;	   *elephant-lib-path*)
-;;))
+(in-package :cl-user)
+
+;; Forward definition
+(defpackage elephant-system
+  (:use :cl :asdf)
+  (:export :elephant-c-source :compiler-options :foreign-libraries-to-load-first :get-config-option))
+
+(defpackage ele-clsql-system
+  (:use :cl :asdf :elephant-system))
+
+(in-package :ele-clsql-system)
+
+;;
+;; Make sure asdf is loaded prior to evaluating the rest of the file (tacky)
+;;
+(eval-when (:compile-toplevel :load-toplevel  :execute)
+  (unless (find-package 'clsql)
+    (asdf:operate 'asdf:load-op 'clsql)))
+
+(defmethod asdf:perform :after ((o asdf:load-op)
+				(c (eql (asdf:find-system 'clsql))))
+  (let ((paths (get-config-option :clsql-lib-paths (find-system :elephant)))
+	(plp (find-symbol (symbol-name '#:push-library-path)
+			  (find-package 'clsql))))
+    (loop for path in paths do
+	 (format t "Pushing ~A onto clsql::*FOREIGN-LIBRARY-SEARCH-PATHS*~%" path)
+	 (funcall plp (pathname path)))))
 
 (defsystem ele-clsql
   :name "elephant"
--- /project/elephant/cvsroot/elephant/elephant.asd	2007/04/29 02:10:54	1.46
+++ /project/elephant/cvsroot/elephant/elephant.asd	2007/04/30 00:38:29	1.47
@@ -94,6 +94,7 @@
   "Run the appropriate compiler for this platform on the source, getting
    the specific options from 'compiler-options method.  Default options 
    can be overridden or augmented by subclass methods"
+  (unless (get-config-option :prebuilt-libraries c)
   #+(or mswindows windows)
   (progn
     (let* ((pathname (component-pathname c))
@@ -144,7 +145,7 @@
 		  (compiler-options (c-compiler c) c
 				    :input-file (namestring (component-pathname c))
 				    :output-file (namestring (first (output-files o c))))))
-    (error 'operation-error :component c :operation o)))
+    (error 'operation-error :component c :operation o))))
 
 #|
 (defmethod perform ((o compile-op) (c elephant-c-source))
@@ -247,9 +248,21 @@
 	    (error "Could not load ~A into ~A" file module)))))
   ;; Load the compiled libraries
   (dolist (file (output-files (make-instance 'compile-op) c))
-    (format t "Loading ~A~%" file)
-    (or (uffi-funcall :load-foreign-library file :module (component-name c))
-	(error "Could not load ~A" file))))
+    (format t "Attempting to load ~A...~%" (file-namestring file))
+    (if (and (probe-file file)
+	     (not (get-config-option :prebuilt-libraries c)))
+	(progn
+	  (or (uffi-funcall :load-foreign-library file :module (component-name c))
+	      (error "Could not load ~A" file))
+	  (format t "Loaded ~A~%" file))
+	(let* ((root-dir (asdf:component-pathname (asdf:component-system c)))
+	       (root-library-file (merge-pathnames (file-namestring file) root-path)))
+	  (or (uffi-funcall :load-foreign-library 
+			    root-library-file
+			    :module (component-name c))
+	      (error "Output file ~A not found in elephant root" (namestring root-library-file)))
+	  (format t "Loaded ~A~%" root-library-file)))))
+	
 
 (defmethod operation-done-p ((o load-op) (c elephant-c-source))
   nil)
@@ -264,7 +277,7 @@
 (defsystem elephant
   :name "elephant"
   :author "Ben Lee <blee at common-lisp.net>"
-  :version "0.6.1"
+  :version "0.9"
   :maintainer "Robert Read <read at robertlread.net>"
   :licence "LLGPL"
   :description "Object database for Common Lisp"




More information about the Elephant-cvs mailing list