From: Kevin M. Rosenberg Date: Mon, 13 May 2002 00:45:43 +0000 (+0000) Subject: r1995: rework logical pathnames to better fit common-lisp-controller X-Git-Tag: v3.8.6~1115 X-Git-Url: http://git.kpe.io/?a=commitdiff_plain;ds=sidebyside;h=a64de0e661a3fa56b572320c2c68abb0c658f2b2;p=clsql.git r1995: rework logical pathnames to better fit common-lisp-controller --- diff --git a/clsql-mysql.system b/clsql-mysql.system index e3068e7..5d80be1 100644 --- a/clsql-mysql.system +++ b/clsql-mysql.system @@ -1,42 +1,42 @@ -;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*- -;;;; ************************************************************************* -;;;; FILE IDENTIFICATION -;;;; -;;;; Name: clsql-mysql.system -;;;; Purpose: Defsystem-3/4 definition file for CLSQL MySQL backend -;;;; Programmer: Kevin M. Rosenberg -;;;; Date Started: Feb 2002 -;;;; -;;;; $Id: clsql-mysql.system,v 1.5 2002/04/01 05:27:54 kevin Exp $ -;;;; -;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg -;;;; -;;;; CLSQL users are granted the rights to distribute and use this software -;;;; as governed by the terms of the Lisp Lesser GNU Public License -;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. -;;;; ************************************************************************* - -(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0))) - -(in-package :make) - -;;; System definition - -(defsystem :clsql-mysql - :source-pathname "CLSQL:interfaces;mysql;" - :source-extension "cl" - :binary-pathname "CLSQL:interfaces;mysql;bin;" - :components ((:file "mysql-package") - (:file "mysql-loader" :depends-on ("mysql-package")) - (:file "mysql-api" :depends-on ("mysql-loader")) - (:file "mysql-sql" :depends-on ("mysql-api")) - (:file "mysql-usql" :depends-on ("mysql-sql"))) - :depends-on (:uffi :clsql :clsql-uffi) - :finally-do - (when (clsql-sys:database-type-library-loaded :mysql) - (clsql-sys:initialize-database-type :database-type :mysql) - (setq clsql:*default-database-type* :mysql) - (pushnew :mysql cl:*features*))) - - - +;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*- +;;;; ************************************************************************* +;;;; FILE IDENTIFICATION +;;;; +;;;; Name: clsql-mysql.system +;;;; Purpose: Defsystem-3/4 definition file for CLSQL MySQL backend +;;;; Programmer: Kevin M. Rosenberg +;;;; Date Started: Feb 2002 +;;;; +;;;; $Id: clsql-mysql.system,v 1.6 2002/05/13 00:45:10 kevin Exp $ +;;;; +;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg +;;;; +;;;; CLSQL users are granted the rights to distribute and use this software +;;;; as governed by the terms of the Lisp Lesser GNU Public License +;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. +;;;; ************************************************************************* + +(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0))) + +(in-package :make) + +;;; System definition + +(defsystem :clsql-mysql + :source-pathname "CL-LIBRARY:clsql;interfaces;mysql;" + :source-extension "cl" + :binary-pathname "CL-LIBRARY:clsql;interfaces;mysql;bin;" + :components ((:file "mysql-package") + (:file "mysql-loader" :depends-on ("mysql-package")) + (:file "mysql-api" :depends-on ("mysql-loader")) + (:file "mysql-sql" :depends-on ("mysql-api")) + (:file "mysql-usql" :depends-on ("mysql-sql"))) + :depends-on (:uffi :clsql-base :clsql-uffi) + :finally-do + (when (clsql-sys:database-type-library-loaded :mysql) + (clsql-sys:initialize-database-type :database-type :mysql) + (setq clsql:*default-database-type* :mysql) + (pushnew :mysql cl:*features*))) + + + diff --git a/clsql-postgresql-socket.system b/clsql-postgresql-socket.system index 1c7d016..197b289 100644 --- a/clsql-postgresql-socket.system +++ b/clsql-postgresql-socket.system @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: clsql-postgresql-socket.system,v 1.5 2002/05/12 23:31:51 kevin Exp $ +;;;; $Id: clsql-postgresql-socket.system,v 1.6 2002/05/13 00:45:10 kevin Exp $ ;;;; ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -22,15 +22,15 @@ ;;; System definition (defsystem :clsql-postgresql-socket - :source-pathname "CLSQL:interfaces;postgresql-socket;" + :source-pathname "CL-LIBRARY:clsql;interfaces;postgresql-socket;" :source-extension "cl" - :binary-pathname "CLSQL:interfaces;postgresql-socket;bin;" + :binary-pathname "CL-LIBRARY:clsql;interfaces;postgresql-socket;bin;" :components ((:file "postgresql-socket-package") (:file "postgresql-socket-api" :depends-on ("postgresql-socket-package")) (:file "postgresql-socket-sql" :depends-on ("postgresql-socket-api"))) - :depends-on (:clsql :uffi) + :depends-on (:clsql-base :uffi) :finally-do (when (clsql-sys:database-type-library-loaded :postgresql-socket) (clsql-sys:initialize-database-type :database-type :postgresql-socket))) diff --git a/clsql-postgresql.system b/clsql-postgresql.system index 9b1cabd..d84a102 100644 --- a/clsql-postgresql.system +++ b/clsql-postgresql.system @@ -1,37 +1,37 @@ -;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*- -;;;; ************************************************************************* -;;;; FILE IDENTIFICATION -;;;; -;;;; Name: clsql-postgresql.system -;;;; Purpose: Defsystem-3/4 file for CLSQL PostgresSQL backend -;;;; Programmer: Kevin M. Rosenberg -;;;; Date Started: Feb 2002 -;;;; -;;;; $Id: clsql-postgresql.system,v 1.5 2002/04/01 05:27:55 kevin Exp $ -;;;; -;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg -;;;; -;;;; CLSQL users are granted the rights to distribute and use this software -;;;; as governed by the terms of the Lisp Lesser GNU Public License -;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. -;;;; ************************************************************************* - -(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0))) -(in-package :make) - -(defsystem :clsql-postgresql - :source-pathname "CLSQL:interfaces;postgresql;" - :source-extension "cl" - :binary-pathname "CLSQL:interfaces;postgresql;bin;" - :source-extension "cl" - :components ((:file "postgresql-package") - (:file "postgresql-loader" :depends-on ("postgresql-package")) - (:file "postgresql-api" :depends-on ("postgresql-loader")) - (:file "postgresql-sql" :depends-on ("postgresql-api")) - (:file "postgresql-usql" :depends-on ("postgresql-sql"))) - :depends-on (:uffi :clsql :clsql-uffi) - :finally-do - (when (clsql-sys:database-type-library-loaded :postgresql) - (clsql-sys:initialize-database-type :database-type :postgresql) - (pushnew :postgresql cl:*features*))) - +;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*- +;;;; ************************************************************************* +;;;; FILE IDENTIFICATION +;;;; +;;;; Name: clsql-postgresql.system +;;;; Purpose: Defsystem-3/4 file for CLSQL PostgresSQL backend +;;;; Programmer: Kevin M. Rosenberg +;;;; Date Started: Feb 2002 +;;;; +;;;; $Id: clsql-postgresql.system,v 1.6 2002/05/13 00:45:10 kevin Exp $ +;;;; +;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg +;;;; +;;;; CLSQL users are granted the rights to distribute and use this software +;;;; as governed by the terms of the Lisp Lesser GNU Public License +;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. +;;;; ************************************************************************* + +(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0))) +(in-package :make) + +(defsystem :clsql-postgresql + :source-pathname "CL-LIBRARY:clsql;interfaces;postgresql;" + :source-extension "cl" + :binary-pathname "CL-LIBRARY:clsql;interfaces;postgresql;bin;" + :source-extension "cl" + :components ((:file "postgresql-package") + (:file "postgresql-loader" :depends-on ("postgresql-package")) + (:file "postgresql-api" :depends-on ("postgresql-loader")) + (:file "postgresql-sql" :depends-on ("postgresql-api")) + (:file "postgresql-usql" :depends-on ("postgresql-sql"))) + :depends-on (:uffi :clsql-base :clsql-uffi) + :finally-do + (when (clsql-sys:database-type-library-loaded :postgresql) + (clsql-sys:initialize-database-type :database-type :postgresql) + (pushnew :postgresql cl:*features*))) + diff --git a/clsql.system b/clsql.system index 6d1a13d..f8143c1 100644 --- a/clsql.system +++ b/clsql.system @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: clsql.system,v 1.8 2002/05/11 22:23:52 kevin Exp $ +;;;; $Id: clsql.system,v 1.9 2002/05/13 00:45:10 kevin Exp $ ;;;; ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -19,34 +19,32 @@ (declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0))) (in-package :cl-user) -(load (make-pathname :name "set-logical" :type "cl" - :defaults *load-truename*)) -(set-logical-host-for-pathname "CLSQL" *load-truename*) +(handler-case + (logical-pathname-translations "CL-LIBRARY") + (error () + (load (make-pathname :name "set-cl-library" :type "cl" + :defaults *load-truename*)))) ;;; System definitions (mk:defsystem :cmucl-compat - :source-pathname "CLSQL:cmucl-compat;" + :source-pathname "CL-LIBRARY:clsql;cmucl-compat;" :source-extension "cl" - :binary-pathname "CLSQL:cmucl-compat;bin;" + :binary-pathname "CL-LIBRARY:clsql;cmucl-compat;bin;" :components ((:file "cmucl-compat") (:file "loop-extension"))) (mk:defsystem :clsql - :source-pathname "CLSQL:sql;" + :source-pathname "CL-LIBRARY:clsql;sql;" :source-extension "cl" - :binary-pathname "CLSQL:sql;bin;" - :components ((:file "package") - (:file "classes" :depends-on ("package")) - (:file "conditions" :depends-on ("classes")) - (:file "db-interface" :depends-on ("conditions")) - (:file "pool" :depends-on ("db-interface")) + :binary-pathname "CL-LIBRARY:clsql;sql;bin;" + :components ((:file "pool") (:file "sql" :depends-on ("pool")) (:file "transactions" :depends-on ("sql")) - (:file "utils" :depends-on ("package")) + (:file "utils") (:file "functional" :depends-on ("sql")) (:file "usql" :depends-on ("sql"))) - :depends-on (:cmucl-compat) + :depends-on (:clsql-base) :finally-do (pushnew :clsql cl:*features*) ) diff --git a/set-cl-library.cl b/set-cl-library.cl new file mode 100644 index 0000000..51aa42e --- /dev/null +++ b/set-cl-library.cl @@ -0,0 +1,31 @@ +;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*- +;;;; ************************************************************************* +;;;; FILE IDENTIFICATION +;;;; +;;;; Name: set-cl-library.cl +;;;; Purpose: Sets CL-LIBRARY logical host name if it does not exist +;;;; Programmer: Kevin M. Rosenberg +;;;; Date Started: May 2002 +;;;; +;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg +;;;; +;;;; CLSQL users are granted the rights to distribute and use this software +;;;; as governed by the terms of the Lisp Lesser GNU Public License +;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. +;;;; ************************************************************************* + +;; Set logical pathname CL-LIBRARY to be directory above *load-truename* +;; This mirrors the expectation of Common Lisp Controller's pathnames + +(handler-case + (logical-pathname-translations "CL-LIBRARY") + (error () + (let* ((dir (pathname-directory *load-truename*)) + (parent-dir (subseq dir 0 (1- (length dir))))) + (load (make-pathname :name "set-logical" :type "cl" + :defaults *load-truename*)) + (set-logical-host-for-pathname + "CL-LIBRARY" + (make-pathname :host (pathname-host *load-truename*) + :device (pathname-device *load-truename*) + :directory parent-dir))))) diff --git a/set-logical.cl b/set-logical.cl index cb4224d..e69de29 100644 --- a/set-logical.cl +++ b/set-logical.cl @@ -1,63 +0,0 @@ -;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*- -;;;; ************************************************************************* -;;;; FILE IDENTIFICATION -;;;; -;;;; Name: set-logical.cl -;;;; Purpose: Sets a logical host for src/binaries based on a pathname. -;;;; Programmer: Kevin M. Rosenberg -;;;; Date Started: Feb 2002 -;;;; -;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg -;;;; -;;;; CLSQL users are granted the rights to distribute and use this software -;;;; as governed by the terms of the Lisp Lesser GNU Public License -;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. -;;;; ************************************************************************* - - -;;; Setup logical pathname translaton with separate binary directories -;;; for each implementation - -;; push allegro case sensitivity on *features* -#+allegro -(eval-when (:compile-toplevel :load-toplevel :execute) - (if (or (eq excl:*current-case-mode* :case-sensitive-lower) - (eq excl:*current-case-mode* :case-sensitive-upper)) - (pushnew :case-sensitive cl:*features*) - (pushnew :case-insensitive cl:*features*))) - -(defconstant +set-logical-compiler-name+ - #+(and allegro ics case-sensitive) "acl-modern" - #+(and allegro (not ics) case-sensitive) "acl-modern8" - #+(and allegro ics (not case-sensitive)) "acl-ansi" - #+(and allegro (not ics) (not case-sensitive)) "acl-ansi8" - #+lispworks "lispworks" - #+clisp "clisp" - #+cmu "cmucl" - #+sbcl "sbcl" - #+corman "corman" - #+mcl "mcl" - #+openmcl "openmcl" - #-(or allegro lispworks clisp cmu sbcl corman mcl openmcl) "unknown") - -(defun set-logical-host-for-pathname (host base-pathname) - (setf (logical-pathname-translations host) - `(("ROOT;" ,(make-pathname - :host (pathname-host base-pathname) - :device (pathname-device base-pathname) - :directory (pathname-directory base-pathname))) - ("**;bin;*.*.*" ,(merge-pathnames - (make-pathname - :name :wild - :type :wild - :directory - (append '(:relative :wild-inferiors - ".bin" #.+set-logical-compiler-name+))) - base-pathname)) - ("**;*.*.*" ,(merge-pathnames - (make-pathname - :name :wild - :type :wild - :directory '(:relative :wild-inferiors)) - base-pathname)))) - )