r9476: 25 May 2004 Kevin Rosenberg <kevin@rosenberg.net>
authorKevin M. Rosenberg <kevin@rosenberg.net>
Tue, 25 May 2004 08:41:56 +0000 (08:41 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Tue, 25 May 2004 08:41:56 +0000 (08:41 +0000)
        * 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.

ChangeLog
clsql-oracle.asd
db-oracle/Makefile
db-oracle/README
db-oracle/make.sh [deleted file]
db-oracle/make9.sh [deleted file]
db-oracle/oracle-loader.lisp
debian/changelog

index 1a40b50e8c7b73c3263e1f1065334157c6309815..85e89e2d45862aa1aebf7fd1d41da481812fa09f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+25 May 2004 Kevin Rosenberg <kevin@rosenberg.net>
+       * 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 <kevin@rosenberg.net>
        * Version 2.11.0 released: Full Oracle support. All tests pass
         * db-oracle/oracle-sql.lisp: Add declaration so that SBCL runs efficiently.
 25 May 2004 Kevin Rosenberg <kevin@rosenberg.net>
        * Version 2.11.0 released: Full Oracle support. All tests pass
         * db-oracle/oracle-sql.lisp: Add declaration so that SBCL runs efficiently.
index ae846d5ff95c21ec81932d9503b65b5e338d3372..77436743395586effdd257f96eb824f0adbd0276 100644 (file)
 (defpackage #:clsql-oracle-system (:use #:asdf #:cl))
 (in-package #:clsql-oracle-system)
 
 (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
 ;;; System definition
 
 (defsystem clsql-oracle
index a313862ff5d458fc359e2a09268d0223544b6aa9..ae4912bf120884f76b86fed44b4f3c80965b9a56 100644 (file)
@@ -17,15 +17,5 @@ SUBDIRS=
 
 include ../Makefile.common
 
 
 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
 .PHONY: distclean
 distclean: clean
-       rm -f $(base).so
index 3164ad4269c3e8c31674724e30667e8484eb4d77..3bef886f8a8cacc7927e0b0475087d811ee9ff83 100644 (file)
@@ -1,6 +1,5 @@
 This is the header of the cadabra source file.
 
 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.
 ;;;; 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.)
 ;;;;     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 (executable)
index 504357a..0000000
+++ /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 (executable)
index 0174332..0000000
+++ /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
index d9259e0ad9213b22acc3ca833784ba354b18e5c2..6d91e8dc1847faeb1ec10ea88d9ad01b3cd32250 100644 (file)
 (in-package #:clsql-oracle)
 
 (defparameter *oracle-lib-path*
 (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"))))))
 
                        (list "lib"))))))
 
-(defparameter *clsql-oracle-library-path* 
+(defparameter *oracle-client-library-path* 
     (uffi:find-foreign-library
     (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*))
      `(,@(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")))
 
      :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,
 (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*)
 
 (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)))
 (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)
 
 
 (clsql-sys:database-type-load-foreign :oracle)
 
index ee8a2ed53cdb4b4016750469de2355ee7871ee28..b7c55ebac369cd3972b178ef949f3560e5b3f4a0 100644 (file)
@@ -1,3 +1,9 @@
+cl-sql (2.11.1-1) unstable; urgency=low
+
+  * New upstream
+
+ -- Kevin M. Rosenberg <kmr@debian.org>  Tue, 25 May 2004 02:38:21 -0600
+
 cl-sql (2.11.0-1) unstable; urgency=low
 
   * New upstream
 cl-sql (2.11.0-1) unstable; urgency=low
 
   * New upstream