clsql-sys:database-type-load-foreign

Petter Gustad <[email protected]>
Newsgroups gmane.lisp.clsql.devel
Message-ID <[email protected]>

Thank you for releasing ClSQL to the Lisp community. It's a great
tool!

I've tried clsql-2.11.4 under several different Linux distributions.
Here's some and their respective locations and filenames for the
postgresql libraries:


Linux                                arch   libpq (ls -1 /usr/lib/libpq.so*)
Red Hat Linux release 9 (Shrike)     i686   /usr/lib/libpq.so.3
                                            /usr/lib/libpq.so.3.0

Red Hat Linux release 7.3 (Valhalla) i686   /usr/lib/libpq.so
                                            /usr/lib/libpq.so.2
                                            /usr/lib/libpq.so.2.0
                                            /usr/lib/libpq.so.2.2

Red Hat Linux release 7.1 (Seawolf)  i686   /usr/lib/libpq.so
                                            /usr/lib/libpq.so.2
                                            /usr/lib/libpq.so.2.0
                                            /usr/lib/libpq.so.2.1

SuSE SLES-8 (AMD64) VERSION = 8.1    x86_64 /usr/lib/libpq.so.2
                                            /usr/lib/libpq.so.2.0
                                            /usr/lib/libpq.so.2.2

The current clsql-sys:database-type-load-foreign method in
db-postgresql/postgresql-loader.lisp is defined as:

     1	(defmethod clsql-sys:database-type-load-foreign ((database-type
     2							  (eql :postgresql)))
     3	  (let ((libpath (uffi:find-foreign-library 
     4			  "libpq"
     5			  '("/opt/postgresql/lib/" "/usr/local/lib/" 
     6			    #+64bit "/usr/lib64/"
     7			    "/usr/lib/" "/postgresql/lib/"
     8			    "/usr/local/pgsql/lib/" "/usr/lib/pgsql/"
     9			    "/opt/pgsql/lib/pgsql" "/sw/lib/pgsql/")
    10			  :drive-letters '("C" "D" "E")
    11			  #+(or macosx darwin ccl-5.0) :types
    12			  #+(or macosx darwin ccl-5.0) '("so")
    13			  )))

I beleive that the following modification would make it compile on
more Linux distributions:

     1	(defmethod clsql-sys:database-type-load-foreign ((database-type
     2							  (eql :postgresql)))
     3	  (let ((libpath (uffi:find-foreign-library 
     4			  "libpq"
     5			  '("/opt/postgresql/lib/" "/usr/local/lib/" 
     6			    #+64bit "/usr/lib64/"
     7			    "/usr/lib/" "/postgresql/lib/"
     8			    "/usr/local/pgsql/lib/" "/usr/lib/pgsql/"
     9			    "/opt/pgsql/lib/pgsql" "/sw/lib/pgsql/")
    10			  :drive-letters '("C" "D" "E")
    11			  #+(or macosx darwin ccl-5.0 (and unix cmu)) :types
    12			  #+(or macosx darwin ccl-5.0 (and unix cmu)) '("so" "so.2" "so.3")
    13			  )))

Only line 11 and 12 was modified.

Petter
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.