X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=interfaces%2Fpostgresql%2Fpostgresql-loader.cl;h=bfdf60dd44e0daf60bcf57ea9feaf98156cbe8c6;hb=9f3761f57371f7d347e25d635735dcbf536e652c;hp=e57470e6322a64f0661671563da6c3857428eaac;hpb=2359c743fa126e65514454a7996e025f139a8241;p=clsql.git diff --git a/interfaces/postgresql/postgresql-loader.cl b/interfaces/postgresql/postgresql-loader.cl index e57470e..bfdf60d 100644 --- a/interfaces/postgresql/postgresql-loader.cl +++ b/interfaces/postgresql/postgresql-loader.cl @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: postgresql-loader.cl,v 1.4 2002/04/01 05:27:55 kevin Exp $ +;;;; $Id: postgresql-loader.cl,v 1.12 2002/05/27 17:19:30 kevin Exp $ ;;;; ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -19,20 +19,6 @@ (declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0))) (in-package :postgresql) -(defvar *postgresql-library-filename* - (cond - ((probe-file "/opt/postgresql/lib/libpq.so") - "/opt/postgresql/lib/libpq.so") - ((probe-file "/usr/local/lib/libpq.so") - "/usr/local/lib/libpq.so") - ((probe-file "/usr/lib/libpq.so") - "/usr/lib/libpq.so") - #+(or win32 mswindows) - ((probe-file "c:/postgresql/lib/libpq.dll") - "c:/postgresql/lib/libpq.dll") - (t - (warn "Can't find PostgresQL client library to load."))) - "Location where the PostgresSQL client library is to be found.") (defvar *postgresql-supporting-libraries* '("crypt" "c") "Used only by CMU. List of library flags needed to be passed to ld to @@ -42,21 +28,25 @@ set to the right path before compiling or loading the system.") (defvar *postgresql-library-loaded* nil "T if foreign library was able to be loaded successfully") -(defmethod clsql-sys:database-type-library-loaded ((database-type +(defmethod clsql-base-sys:database-type-library-loaded ((database-type (eql :postgresql))) *postgresql-library-loaded*) -(defmethod clsql-sys:database-type-load-foreign ((database-type +(defmethod clsql-base-sys:database-type-load-foreign ((database-type (eql :postgresql))) - (when - (uffi:load-foreign-library - (uffi:find-foreign-library - "libpq" - '("/opt/postgresql/lib/" "/usr/local/lib" "usr/lib/" - "/postgresql/lib/")) - :module "postgresql" - :supporting-libraries - *postgresql-supporting-libraries*) - (setq *postgresql-library-loaded* t))) + (let ((libpath (uffi:find-foreign-library + "libpq" + '("/opt/postgresql/lib/" "/usr/local/lib/" + "/usr/lib/" "/postgresql/lib/" + "/usr/local/pgsql/lib/" "/usr/lib/pgsql/" + "/opt/pgsql/lib/pgsql") + :drive-letters '("C" "D" "E")))) + (if (uffi:load-foreign-library libpath + :module "postgresql" + :supporting-libraries + *postgresql-supporting-libraries*) + (setq *postgresql-library-loaded* t) + (warn "Can't load PostgreSQL client library ~A" libpath)))) + +(clsql-base-sys:database-type-load-foreign :postgresql) -(clsql-sys:database-type-load-foreign :postgresql)