From: Kevin M. Rosenberg Date: Tue, 25 May 2004 08:41:56 +0000 (+0000) Subject: r9476: 25 May 2004 Kevin Rosenberg X-Git-Tag: v3.8.6~375 X-Git-Url: http://git.kpe.io/?p=clsql.git;a=commitdiff_plain;h=319c3f230d40fe8d37203a9a53129ffe6a095c62 r9476: 25 May 2004 Kevin Rosenberg * Version 2.11.1 released: Much simpler Oracle client library loading. Now uses ORACLE_HOME environmental variable as well as tests default path for Oracle Instant Client. --- diff --git a/ChangeLog b/ChangeLog index 1a40b50..85e89e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +25 May 2004 Kevin Rosenberg + * Version 2.11.1 released: Much simpler Oracle client library loading. + Now uses ORACLE_HOME environmental variable as well as tests default + path for Oracle Instant Client. + 25 May 2004 Kevin Rosenberg * Version 2.11.0 released: Full Oracle support. All tests pass * db-oracle/oracle-sql.lisp: Add declaration so that SBCL runs efficiently. diff --git a/clsql-oracle.asd b/clsql-oracle.asd index ae846d5..7743674 100644 --- a/clsql-oracle.asd +++ b/clsql-oracle.asd @@ -19,58 +19,6 @@ (defpackage #:clsql-oracle-system (:use #:asdf #:cl)) (in-package #:clsql-oracle-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-oracle"))) - -(defclass clsql-oracle-source-file (c-source-file) - ()) - -(defmethod output-files ((o compile-op) (c clsql-oracle-source-file)) - (let* ((library-file-type - (funcall (intern (symbol-name'#:default-foreign-library-type) - (symbol-name '#:uffi)))) - (found (some #'(lambda (dir) - (probe-file (make-pathname :directory dir - :name (component-name c) - :type library-file-type))) - '((:absolute "usr" "lib" "clsql"))))) - (list (if found - found - (make-pathname :name (component-name c) - :type library-file-type - :directory *library-file-dir*))))) - -(defmethod perform ((o load-op) (c clsql-oracle-source-file)) - t) - -(defmethod operation-done-p ((o load-op) (c clsql-oracle-source-file)) - (and (symbol-function (intern (symbol-name '#:oracle-get-client-info) - (find-package '#:oracle))) - t)) - -(defmethod perform ((o compile-op) (c clsql-oracle-source-file)) - (unless (operation-done-p o c) - #-(or win32 mswindows) - (unless (zerop (run-shell-command - #-freebsd "cd ~A; make" - #+freebsd "cd ~A; gmake" - (namestring (make-pathname :name nil - :type nil - :directory *library-file-dir*)))) - (error 'operation-error :component c :operation o)))) - -(defmethod operation-done-p ((o compile-op) (c clsql-oracle-source-file)) - (or (and (probe-file #p"/usr/lib/clsql/oracle.so") t) - (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 (defsystem clsql-oracle diff --git a/db-oracle/Makefile b/db-oracle/Makefile index a313862..ae4912b 100644 --- a/db-oracle/Makefile +++ b/db-oracle/Makefile @@ -17,15 +17,5 @@ SUBDIRS= include ../Makefile.common -base=oracle -shared_lib=$(base).so - -.PHONY: all -all: $(shared_lib) - -$(shared_lib): Makefile make.sh - CFLAGS="" LDFLAGS="" BASE=$(base) OBJECT=$(object) SOURCE=$(source) SHARED_LIB=$(shared_lib) sh make.sh - .PHONY: distclean distclean: clean - rm -f $(base).so diff --git a/db-oracle/README b/db-oracle/README index 3164ad4..3bef886 100644 --- a/db-oracle/README +++ b/db-oracle/README @@ -1,6 +1,5 @@ This is the header of the cadabra source file. - ;;;; a CMUCL/OCI implementation of a subset of the DBI interface ;;;; ;;;; The original version of this code was copyright (c) 1999-2000 Cadabra Inc. @@ -23,52 +22,3 @@ This is the header of the cadabra source file. ;;;; from the Oracle header files. Thus, changes in the header files ;;;; may require manual maintenance of the code. (This version was written ;;;; for Oracle 8.1.5.) -;;;; * various KLUDGEs noted in the code - -;;;; log: -;;;; 6. * moved test suite to separate file -;;;; * removed trailing spaces from all strings returned from database -;;;; * fixed error in LIST-ALL-DATABASE-TABLES interface: DB should be -;;;; a &KEY argument, not an &OPTIONAL argument -;;;; 7. * merged Winton's code to allow the SQL function to ask OCI -;;;; whether an operation returns a table, and not to worry about -;;;; the TYPE keyword argument if no table is returned -;;;; * reduced +N-BUF-ROWS+ from 1000 to reduce probability of -;;;; hitting CMUCL 18b 8Mb-of-C-data limit -;;;; * changed NOT-USED argument of FETCH-ROW to EOF-ERRORP, to -;;;; conform to Allegro interface -;;;; * found apparent bug in OCI (wrong size of value returned for the -;;;; +oci-attr-data-size+ attribute); added workaround -;;;; * found and documented the unnecessariness of "workaround" for -;;;; "WITH-ALIEN not working" (which was actually a conceptual error -;;;; on WHN's part, expecting WITH-ALIEN to work the same way as -;;;; MAKE-ALIEN, not expecting one less level of indirection) -;;;; * cleaned up NULLS-OK-USE-THIS-ERRHP weirdness and inflexibility, -;;;; splitting the one argument into separate NULLS-OK and ERRHP -;;;; arguments -;;;; * added :ERRHP optional arguments to various OERR expressions, -;;;; so that now failures are more likely to generate informative -;;;; error messages instead of just "OCI Error (and no ERRHP -;;;; available to find subcode)" -;;;; 8. * added code to deallocate C resources -;;;; 9. * Added in an extra field for DATE-FORMAT and DATE-FORMAT-LENGTH -;;;; Munged the code for datatype and colsize. Winton Davies. -;;;; 10. * cleaned up remnants of old date-is-fixed-length-field design -;;;; assumption, getting rid of +OCi-date-bytes+ -;;;; * reduced consing in FETCH-ROW and associated functions -;;;; * replaced WARN with IWARN for implementor-only warnings -;;;; 11. * fixed bad (THE (ALIEN (* FLOAT)) B) declaration for -;;;; SQLT_FLT buffers (should be (ALIEN (* DOUBLE)) instead; -;;;; and for some reason fell through the cracks of CMUCL's -;;;; "declarations are assertions" principle) -;;;; * deleted various FIXME notes a la "does this code ever get -;;;; exercised?" and "are these really all the cases we need?" -;;;; * changed the IWARN call to a KLUDGE comment, deleted IWARN -;;;; * tidied up comments -;;;; * changed page breaks from lots-of-semicolons Cadabra style -;;;; to ^L CMUCL style -;;;; * declared DBI-ERROR to be INLINE -;;;; * fixed definition of +oci-htype-env+ -;;;; * reviewed and corrected C resource deallocation code -;;;; 12. * Made load-foreign depend on ORACLE-HOME for more portability. - diff --git a/db-oracle/make.sh b/db-oracle/make.sh deleted file mode 100755 index 504357a..0000000 --- a/db-oracle/make.sh +++ /dev/null @@ -1,12 +0,0 @@ -# Make shared library for Oracle 10 - -if [ -z "$ORACLE_HOME" ]; then - ORACLE_HOME=/10g/app/product/10.1.0/db_1 -fi - -EMPTY_LIBS=-lclntst10 -LIBS="-lagent10 -lagtsh -lclntsh -lclient10 -lvsn10 -lcommon10 -lskgxp10 -lmm -lnls10 -lcore10 -lgeneric10 -ldl -lgcc -lm" -OBJECTS="rdbms/lib/defopt.o" -LIBNAME=oracle - -gcc -shared -L $ORACLE_HOME -L ${ORACLE_HOME}/lib $ORACLE_HOME/rdbms/lib/homts.o $LIBS -o ${LIBNAME}.so diff --git a/db-oracle/make9.sh b/db-oracle/make9.sh deleted file mode 100755 index 0174332..0000000 --- a/db-oracle/make9.sh +++ /dev/null @@ -1,12 +0,0 @@ -# Make shared library for Oracle 9 - -if [ -z "$ORACLE_HOME" ]; then - ORACLE_HOME=/9i -fi - -EMPTY_LIBS=-lclntst9 -LIBS="-lagent9 -lagtsh -lclntsh -lclntst9 -lclient9 -lvsn9 -lcommon9 -lskgxp9 -lmm -lnls9 -lcore9 -lgeneric9 -ltrace9 -ldl -lgcc -lm" -OBJECTS="rdbms/lib/defopt.o" -LIBNAME=oracle - -gcc -shared ${ORACLE_HOME}/rdbms/lib/homts.o -L ${ORACLE_HOME}/lib $LIBS -o ${LIBNAME}.so diff --git a/db-oracle/oracle-loader.lisp b/db-oracle/oracle-loader.lisp index d9259e0..6d91e8d 100644 --- a/db-oracle/oracle-loader.lisp +++ b/db-oracle/oracle-loader.lisp @@ -17,27 +17,22 @@ (in-package #:clsql-oracle) (defparameter *oracle-lib-path* - (let ((oracle-home (getenv "ORACLE_HOME"))) - (when oracle-home - (make-pathname :directory - (append - (pathname-directory - (parse-namestring (concatenate 'string oracle-home "/"))) + (let ((oracle-home (getenv "ORACLE_HOME"))) + (when oracle-home + (make-pathname :directory + (append + (pathname-directory + (parse-namestring (concatenate 'string oracle-home "/"))) (list "lib")))))) -(defparameter *clsql-oracle-library-path* +(defparameter *oracle-client-library-path* (uffi:find-foreign-library - '("libclntsh" "oracle") + "libclntsh" `(,@(when *load-truename* (list (make-pathname :directory (pathname-directory *load-truename*)))) ,@(when *oracle-lib-path* (list *oracle-lib-path*)) - "/9i/lib/" - "/usr/lib/clsql/" - "/sw/lib/clsql/" - "/home/kevin/debian/src/clsql/db-oracle/") + "/usr/lib/oracle/10.1.0.2/client/lib/") :drive-letters '("C"))) -(defvar *oracle-library-candidate-drive-letters* '("C" "D" "E")) - (defvar *oracle-supporting-libraries* '("c") "Used only by CMU. List of library flags needed to be passed to ld to load the Oracle client library succesfully. If this differs at your site, @@ -49,17 +44,15 @@ set to the right path before compiling or loading the system.") (defmethod clsql-sys:database-type-library-loaded ((database-type (eql :oracle))) *oracle-library-loaded*) -(setf *oracle-lib-path* #p"/usr/lib/oracle/10.1.0.2/client/lib/") - (defmethod clsql-sys:database-type-load-foreign ((database-type (eql :oracle))) - #+ignore - (uffi:load-foreign-library - (make-pathname :defaults *oracle-lib-path* :name "libclntsh" :type "so")) - (uffi:load-foreign-library *clsql-oracle-library-path* - :module "clsql-oracle" - :supporting-libraries *oracle-supporting-libraries*) - (setq *oracle-library-loaded* t)) - + (if (pathnamep *oracle-client-library-path*) + (progn + (uffi:load-foreign-library *oracle-client-library-path* + :module "clsql-oracle" + :supporting-libraries + *oracle-supporting-libraries*) + (setq *oracle-library-loaded* t)) + (warn "Unable to load oracle client library."))) (clsql-sys:database-type-load-foreign :oracle) diff --git a/debian/changelog b/debian/changelog index ee8a2ed..b7c55eb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cl-sql (2.11.1-1) unstable; urgency=low + + * New upstream + + -- Kevin M. Rosenberg Tue, 25 May 2004 02:38:21 -0600 + cl-sql (2.11.0-1) unstable; urgency=low * New upstream