r8176: changes for macosx, documentation fixes
authorKevin M. Rosenberg <kevin@rosenberg.net>
Thu, 13 Nov 2003 05:58:22 +0000 (05:58 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Thu, 13 Nov 2003 05:58:22 +0000 (05:58 +0000)
12 files changed:
clsql-mysql.asd
clsql-tests.asd
clsql-uffi.asd
clsql.asd
db-mysql/make.sh
db-postgresql/postgresql-loader.lisp
debian/changelog
doc/bookinfo.lisp
doc/entities.xml
doc/intro.xml
tests/tests.lisp
uffi/make.sh

index feb6d29377dddc75d4729fdfff6684563ca36371..ec4e5efea6c9de6c7c2004dac2989c4817adb585 100644 (file)
 (defpackage #:clsql-mysql-system (:use #:asdf #:cl))
 (in-package #:clsql-mysql-system)
 
-(defvar *asd-file-dir* (pathname-directory *load-truename*))
+(defvar *library-file-dir* (append (pathname-directory *load-truename*)
+                                  (list "db-mysql")))
 
 (defclass clsql-mysql-source-file (c-source-file)
   ())
 
 (defmethod output-files ((o compile-op) (c clsql-mysql-source-file))
-  (let ((searched (or
-                  (probe-file #p"/usr/lib/clsql/uffi.so")
-                  (probe-file (make-pathname
-                               :directory *asd-file-dir*
-                               :name "db-mysql"
-                               :type "so")))))
-    (if searched
-       (list searched)
-       (list (merge-pathnames
-              (make-pathname :name (component-name c)
-                             :type "so"
-                             :directory '(:relative "db-mysql"))
-              (make-pathname :directory *asd-file-dir*))))))
+  (let ((found (some #'(lambda (dir)
+                           (probe-file (make-pathname :directory dir
+                                                      :name (component-name c)
+                                                      :type "so")))
+                       '((:absolute "usr" "lib" "clsql"))))) 
+    (list (if found
+             found
+             (make-pathname :name (component-name c)
+                            :type "so"
+                            :directory *library-file-dir*)))))
 
 (defmethod perform ((o load-op) (c clsql-mysql-source-file))
   nil) ;;; library will be loaded by a loader file
 (defmethod perform ((o compile-op) (c clsql-mysql-source-file))
   (unless (zerop (run-shell-command
                  "cd ~A; make"
-                 (namestring (merge-pathnames
-                              (make-pathname
-                               :name nil
-                               :type nil
-                               :directory '(:relative "db-mysql"))
-                              (make-pathname
-                               :directory *asd-file-dir*)))))
+                 (namestring (make-pathname :name nil
+                                            :type nil
+                                            :directory *library-file-dir*))))
     (error 'operation-error :component c :operation o)))
 
 ;;; System definition
index 7e12fb2409f386c129ee3391b9cd840f1faeef48..a9c8729ff060a4b951fabcbe4c382b47b89464ee 100644 (file)
@@ -33,7 +33,7 @@
            )))
 
 (defmethod perform ((o test-op) (c (eql (find-system 'clsql-tests))))
-  (or (funcall (intern (symbol-name '#:do-tests)
-                      (find-package '#:regression-test)))
-      (error "test-op failed")))
+  (unless (funcall (intern (symbol-name '#:run-tests)
+                          (find-package '#:clsql-tests)))
+    (error "test-op failed")))
 
index ddd3c912dd5e124fe779618e6447cb0c432ee5d5..42356496f8e4b7e8b6ffc6cb288e1450d94e1d56 100644 (file)
 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
 ;;;; *************************************************************************
 
+(in-package cl-user)
 
-(defpackage #:clsql-uffi-system (:use #:asdf #:cl))
-(in-package #:clsql-uffi-system)
+;; need to load uffi for below output-files method 
+(eval-when (:compile-toplevel :load-toplevel :execute)
+  #+common-lisp-controller (require 'uffi)
+  #-common-lisp-controller (asdf:operate 'asdf:load-op 'uffi))
 
-(defvar *asd-file-dir* (pathname-directory *load-truename*))
+(defpackage clsql-uffi-system (:use #:asdf #:cl))
+(in-package clsql-uffi-system)
+
+(defvar *library-file-dir* (append (pathname-directory *load-truename*)
+                                  (list "uffi")))
 
 (defclass clsql-uffi-source-file (c-source-file)
   ())
 
+
 (defmethod output-files ((o compile-op) (c clsql-uffi-source-file))
-  (let ((searched (or
-                  (probe-file #p"/usr/lib/clsql/uffi.so")
-                  (probe-file (make-pathname
-                               :directory *asd-file-dir*
-                               :name "uffi"
-                               :type "so")))))
-    (if searched
-       (list searched)
-       (list (merge-pathnames
-              (make-pathname :name (component-name c)
-                             :type "so"
-                             :directory '(:relative "tests"))
-              (make-pathname :directory *asd-file-dir*))))))
+  (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-uffi-source-file))
   nil) ;;; library will be loaded by a loader file
 (defmethod perform ((o compile-op) (c clsql-uffi-source-file))
   (unless (zerop (run-shell-command
                  "cd ~A; make"
-                 (namestring (merge-pathnames
-                              (make-pathname
-                               :name nil
-                               :type nil
-                               :directory '(:relative "uffi"))
-                              (make-pathname
-                               :directory *asd-file-dir*)))))
+                 (namestring (make-pathname :name nil
+                                            :type nil
+                                            :directory *library-file-dir*))))
     (error 'operation-error :component c :operation o)))
 
 #+(or allegro lispworks cmu sbcl openmcl mcl scl)
   :description "Common UFFI Helper functions for Common Lisp SQL Interface Library"
   :long-description "cl-sql-uffi package provides common helper functions using the UFFI for the CLSQL package."
 
+  :depends-on (:uffi :clsql-base)
+  
   :components
   ((:module :uffi
            :components
            ((:clsql-uffi-source-file "uffi")
             (:file "clsql-uffi-package")
             (:file "clsql-uffi-loader" :depends-on ("clsql-uffi-package" "uffi"))
-            (:file "clsql-uffi" :depends-on ("clsql-uffi-loader")))))
-  :depends-on (:uffi :clsql-base))
+            (:file "clsql-uffi" :depends-on ("clsql-uffi-loader"))))))
index 7ad36fa1f664be515973cb1314ea44bd6bd95732..15a3249ada4fe72f19837478c6a1a6ab186fa957 100644 (file)
--- a/clsql.asd
+++ b/clsql.asd
@@ -2,8 +2,8 @@
 ;;;; *************************************************************************
 ;;;; FILE IDENTIFICATION
 ;;;;
-;;;; Name:          clsql.system
-;;;; Purpose:       Defsystem-3/4 for CLSQL
+;;;; Name:          clsql.asd
+;;;; Purpose:       System definition for CLSQL
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Feb 2002
 ;;;;
index 8ad0950a5397eebf05d00a79103f1c712cde3161..24412b89615a6a6a5e5bed5960eede4e0c68b604 100644 (file)
@@ -1,26 +1,30 @@
 #!/bin/sh
 
-UNAME=`uname -a`
-LINUX=`expr "$UNAME" : '.*Linux.*'`
-DARWIN=`expr "$UNAME" : '.*Darwin.*'`
-SOLARIS=`expr "$UNAME" : '.*sun4u.*'`
-AIX=`expr "$UNAME" : '.*aix.*'`
+case "`uname`" in
+    Linux) os_linux=1 ;;
+    Darwin) os_darwin=1 ;;
+    SunOs) os_sunos=1 ;;
+    AIX) os_aix=1 ;;
+    *) echo "Unable to identify uname " `uname`
+       exit 1 ;;       
+esac
+    
+if [ "$os_linux" ]; then
+    gcc $CFLAGS -fPIC -c $SOURCE -o $OBJECT
+    gcc -shared $OBJECT $LDFLAGS -o $SHARED_LIB
 
+elif [ "$os_darwin" ]; then
+    cc $CFLAGS -dynamic -c $SOURCE -o $OBJECT
+    ld -bundle /usr/lib/bundle1.o -flat_namespace -undefined suppress -o $BASE.dylib $OBJECT
+    ld -bundle /usr/lib/bundle1.o $LDFLAGS -flat_namespace -undefined suppress /usr/lib/libz.dylib -o z.dylib
 
-if [ $LINUX -ne 0 ]; then
-    gcc -fPIC -DPIC $CFLAGS -c $SOURCE -o $OBJECT
-    gcc -shared $OBJECT $LDFLAGS -o $SHARED_LIB
-    #gcc -shared -Wl,-soname,uffi-c-test-lib $OBJECT -o $SHARED_LIB
-elif [ $DARWIN -ne 0 ]; then
-    cc -dynamic $CFLAGS -c $SOURCE -o $OBJECT
-    ld -bundle /usr/lib/bundle1.o -flat_namespace -undefined suppress -o $BASE.dylib $OBJECT $LDFLAGS
-    ld -bundle /usr/lib/bundle1.o -flat_namespace -undefined suppress /usr/lib/libz.dylib -o z.dylib
-elif [ $SOLARIS -ne 0 ]; then
-    cc -KPIC $CFLAGS -c $SOURCE -o $OBJECT
-    cc -G $OBJECT  $LDFLAGS -o $SHARED_LIB
-elif [ $AIX -ne 0 ]; then
+elif [ "$os_sunos" ]; then
+    cc $CFLAGS -KPIC -c $SOURCE -o $OBJECT
+    cc -G $OBJECT $LDFLAGS -o $SHARED_LIB
+
+elif [ "$os_aix" ]; then
     gcc $CFLAGS -c -D_BSD -D_NO_PROTO -D_NONSTD_TYPES -D_MBI=void $SOURCE
-    make_shared  $LDFLAGS -o $SHARED_LIB $OBJECT
+    make_shared $LDFLAGS -o $SHARED_LIB $OBJECT
 fi
 
-
+exit 0
index 9a3539e97e7722b2e6dceeb3c88e224bca41f560..e46ec773150276d0c76c1dbdff207b211aab0fb6 100644 (file)
@@ -40,7 +40,10 @@ set to the right path before compiling or loading the system.")
                    "/usr/lib/" "/postgresql/lib/"
                    "/usr/local/pgsql/lib/" "/usr/lib/pgsql/"
                    "/opt/pgsql/lib/pgsql" "/sw/lib/pgsql/")
-                 :drive-letters '("C" "D" "E"))))
+                 :drive-letters '("C" "D" "E")
+                 #+(or macosx darwin ccl-5.0) :types
+                 #+(or macosx darwin ccl-5.0) '("so")
+                 )))
     (if        (uffi:load-foreign-library libpath
                                   :module "postgresql"
                                   :supporting-libraries 
index 4c6ecc1207f596d00dffa391f54d5de3ba0ae610..3e5458916ea19a56068c0970069ef78909096aa5 100644 (file)
@@ -1,3 +1,15 @@
+cl-sql (1.8.2-1) unstable; urgency=low
+
+  * Documentation fixes, MacOSX changes
+
+ -- Kevin M. Rosenberg <kmr@debian.org>  Wed, 12 Nov 2003 22:52:45 -0700
+
+cl-sql (1.8.1-1) unstable; urgency=low
+
+  * Improved shared library building
+
+ -- Kevin M. Rosenberg <kmr@debian.org>  Tue, 11 Nov 2003 15:26:55 -0700
+
 cl-sql (1.8.0-1) unstable; urgency=low
 
   * Make asdf-installable
index 594d4c115ad3e65be3ac0ce410ba489d3caa8d71..d32258f9af2cb4ac090b8eb910d843931c3c9835 100644 (file)
@@ -1,4 +1,6 @@
-(docbook
+(load "docbook")
+
+(docbook-file "bookinfo2.xml"
  (:bookinfo
   (:title "&clsql; Users' Guide")
   (:authorgroup
@@ -7,7 +9,7 @@
     (:othername "M.")
     (:surname "Rosenberg")
     (:affiliation
-     (:jobtitle "Maintainer of CLSQL"]]]
+     (:jobtitle "Maintainer of CLSQL")))
    (:author
     (:firstname "Pierre")
     (:othername "R.")
@@ -43,3 +45,4 @@
       "Other brand or
            product names are the registered trademarks or trademarks of
            their respective holders."))))))
+
index faa9168251ae76af66702ba8f5e4f60b36580cbc..2d6731e0e0cddca8d5b51a2d00c448f89d1937db 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1" ?>
 
-<!ENTITY defsystem "<application>Defsystem</application>">
 <!ENTITY asdf "<application>ASDF</application>">
 <!ENTITY clocc "<application><emphasis>CLOCC</emphasis></application>">
 <!ENTITY cclan "<application><emphasis>CCLAN</emphasis></application>">
@@ -24,7 +23,6 @@
 <!ENTITY nil "<symbol>NIL</symbol>">
 <!ENTITY null "<constant>NULL</constant>">
 <!ENTITY c "<symbol>C</symbol>">
-<!ENTITY defsystem "<application>defsystem</application>">
 
 
 
index ac54ec4e866c6e5a45a11a97d556719cfabb8463..f227f2f0724e4d23008d21f24d3cbfb5cf7f01b4 100644 (file)
@@ -58,7 +58,7 @@
     <title>Prerequisites</title>
     
     <sect2>
-      <title>&defsystem;</title>
+      <title>&asdf;</title>
       <para> &clsql; uses &asdf; to compile and load its
        components.  &asdf; is included in the <ulink
        url="http://cclan.sourceforge.net"><citetitle>&cclan;</citetitle></ulink> collection.
     <title>Installation</title>
     
     <sect2>
-      <title>Ensure &defsystem; is loaded</title>
+      <title>Ensure &asdf; is loaded</title>
       <para>
-       Simply load the file <filename>defsystem.lisp</filename>.
+       Simply load the file <filename>asdf.lisp</filename>.
        <programlisting>
-(load "defsystem.lisp")
+(load "asdf.lisp")
        </programlisting>
       </para>
     </sect2>
@@ -168,7 +168,7 @@ make libs
       <title>Load &uffi;</title>
       <para>
        Unzip or untar the &uffi; distribution which creates a directory
-       for the &uffi; files. Add that directory to Defsystem's <varname>asdf:*central-registry*</varname>.
+       for the &uffi; files. Add that directory to &asdf;'s <varname>asdf:*central-registry*</varname>.
        You can do that by pushing the pathname of the directory onto this variable.
        The following example code assumes the &uffi; files reside in the
        <filename>/usr/share/lisp/uffi/</filename> 
@@ -184,7 +184,7 @@ make libs
      <para>
        If you plan to use the  clsql-postgresql-socket interface, you must load the md5 module.
        Unzip or untar the cl-md5 distribution, which creates a directory for the cl-md5 files.
-       Add that directory to Defsystem's <varname>asdf:*central-registry*</varname>. 
+       Add that directory to &asdf;'s <varname>asdf:*central-registry*</varname>. 
        You can do that by pushing the pathname of the directory onto this variable.
         The following example code assumes the cl-md5 files reside in the
        <filename>/usr/share/lisp/cl-md5/</filename> 
@@ -200,7 +200,7 @@ make libs
      <title>Load &clsql; modules</title>
      <para>
        Unzip or untar the &clsql; distribution which creates a directory
-       for the &clsql; files. Add that directory to Defsystem's <varname>asdf:*central-registry*</varname>.
+       for the &clsql; files. Add that directory to &asdf;'s <varname>asdf:*central-registry*</varname>.
        You can do that by pushing the pathname of the directory onto this variable.
        The following example code assumes the &clsql; files reside in the
        <filename>/usr/share/lisp/clsql/</filename> 
@@ -208,12 +208,12 @@ make libs
        the main <symbol>:clsql</symbol> system and at least one interface system.
        <programlisting>
 (push #P"/usr/share/lisp/clsql/" asdf:*central-repository*)
-(asdf:oos 'asdf:load-op :clsql-base)        ; base clsql package
-(asdf:oos 'asdf:load-op :clsql-mysql)       ; MySQL interface
-(asdf:oos 'asdf:load-op :clsql-postgresql)  ; PostgreSQL interface
-(asdf:oos 'asdf:load-op :clsql-postgresql-socket) ; Socket PGSQL interface
-(asdf:oos 'asdf:load-op :clsql-aodbc)       ; Allegro ODBC interface
-(asdf:oos 'asdf:load-op :clsql)             ; main clsql package
+(asdf:operate 'asdf:load-op 'clsql-base)        ; base clsql package
+(asdf:operate 'asdf:load-op 'clsql-mysql)       ; MySQL interface
+(asdf:operate 'asdf:load-op 'clsql-postgresql)  ; PostgreSQL interface
+(asdf:operate 'asdf:load-op 'clsql-postgresql-socket) ; Socket PGSQL interface
+(asdf:operate 'asdf:load-op 'clsql-aodbc)       ; Allegro ODBC interface
+(asdf:operate 'asdf:load-op 'clsql)             ; main clsql package
        </programlisting>
       </para>
     </sect2>
@@ -221,15 +221,19 @@ make libs
     <sect2>
       <title>Run test suite</title>
       <para>
-       After loading &clsql;, you can execute the test program in
-       the directory <filename>./test-suite</filename>. The test file,
-       <filename>tester-clsql</filename>
-       has instructions for creating a <filename>test.config</filename>.
-       After creating that file, simple load the test file with Lisp
-       and the tests should automatically execute.
+       After loading &clsql;, you can execute the test suite. A configuration
+       file named <filename>.clsql-test.config</filename> must be created
+       in your home directory. There are instructures on the format of that file
+       in the <filename>tests/tests.lisp</filename> file in the &clsql;
+       source directory. After creating that file, you can run the test suite
+       with &asdf;:
+       <programlisting>
+(asdf:operate 'asdf:test-op 'clsql)
+        </programlisting>.     .
       </para>
     </sect2>
     
   </sect1>
-  
+
 </chapter>
+
index 22e7f690f790d5cca04bf9968e0984331690b58d..dd609f08d865ef3a524355a155270e77568c7e19 100644 (file)
@@ -55,7 +55,9 @@
          (setf (pgsql-socket-spec specs) 
                (cadr (assoc :postgresql-socket config)))
          specs))
-      (warn "CLSQL tester config file ~S not found" path)))
+      (progn
+       (warn "CLSQL tester config file ~S not found" path)
+       nil)))
 
 (defmethod mysql-table-test ((test conn-specs))
   (test-table (mysql-spec test) :mysql))
 (defun drop-test-table (db)
   (clsql:execute-command "DROP TABLE test_clsql" :database db))
 
-(defun clsql-tests ()
+(defun run-tests ()
     (let ((specs (read-specs)))
+      (unless specs
+       (warn "Not running test because test configuration file is missing")
+       (return-from run-tests :skipped))
       (with-tests (:name "CLSQL")
        (mysql-low-level specs)
        (mysql-table-test specs)
       ))
     t)
 
-;(deftest clsql.all (clsql-tests) t)
-(clsql-tests)
-
-
-
index f239372de3b8d292d33c5eb933042be5b637de16..8bb895c3de52017f71999e21267a6a22c0b73686 100644 (file)
@@ -1,26 +1,30 @@
 #!/bin/sh
 
-UNAME=`uname -a`
-LINUX=`expr "$UNAME" : '.*Linux.*'`
-DARWIN=`expr "$UNAME" : '.*Darwin.*'`
-SOLARIS=`expr "$UNAME" : '.*sun4u.*'`
-AIX=`expr "$UNAME" : '.*aix.*'`
-
-
-if [ $LINUX -ne 0 ]; then
+case "`uname`" in
+    Linux) os_linux=1 ;;
+    Darwin) os_darwin=1 ;;
+    SunOs) os_sunos=1 ;;
+    AIX) os_aix=1 ;;
+    *) echo "Unable to identify uname " `uname`
+       exit 1 ;;       
+esac
+    
+if [ "$os_linux" ]; then
     gcc -fPIC -DPIC -c $SOURCE -o $OBJECT
     gcc -shared $OBJECT -o $SHARED_LIB
-    #gcc -shared -Wl,-soname,uffi-c-test-lib $OBJECT -o $SHARED_LIB
-elif [ $DARWIN -ne 0 ]; then
+
+elif [ "$os_darwin" ]; then
     cc -dynamic -c $SOURCE -o $OBJECT
     ld -bundle /usr/lib/bundle1.o -flat_namespace -undefined suppress -o $BASE.dylib $OBJECT
     ld -bundle /usr/lib/bundle1.o -flat_namespace -undefined suppress /usr/lib/libz.dylib -o z.dylib
-elif [ $SOLARIS -ne 0 ]; then
+
+elif [ "$os_sunos" ]; then
     cc -KPIC -c $SOURCE -o $OBJECT
     cc -G $OBJECT -o $SHARED_LIB
-elif [ $AIX -ne 0 ]; then
+
+elif [ "$os_aix" ]; then
     gcc -c -D_BSD -D_NO_PROTO -D_NONSTD_TYPES -D_MBI=void $SOURCE
     make_shared -o $SHARED_LIB $OBJECT
 fi
 
-
+exit 0