r8176: changes for macosx, documentation fixes
[clsql.git] / clsql-mysql.asd
1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
4 ;;;;
5 ;;;; Name:          clsql-mysql.asd
6 ;;;; Purpose:       ASDF definition file for CLSQL MySQL backend
7 ;;;; Programmer:    Kevin M. Rosenberg
8 ;;;; Date Started:  Aug 2002
9 ;;;;
10 ;;;; $Id$
11 ;;;;
12 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
13 ;;;;
14 ;;;; CLSQL users are granted the rights to distribute and use this software
15 ;;;; as governed by the terms of the Lisp Lesser GNU Public License
16 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
17 ;;;; *************************************************************************
18
19 (defpackage #:clsql-mysql-system (:use #:asdf #:cl))
20 (in-package #:clsql-mysql-system)
21
22 (defvar *library-file-dir* (append (pathname-directory *load-truename*)
23                                    (list "db-mysql")))
24
25 (defclass clsql-mysql-source-file (c-source-file)
26   ())
27
28 (defmethod output-files ((o compile-op) (c clsql-mysql-source-file))
29   (let ((found (some #'(lambda (dir)
30                             (probe-file (make-pathname :directory dir
31                                                        :name (component-name c)
32                                                        :type "so")))
33                         '((:absolute "usr" "lib" "clsql"))))) 
34     (list (if found
35               found
36               (make-pathname :name (component-name c)
37                              :type "so"
38                              :directory *library-file-dir*)))))
39
40 (defmethod perform ((o load-op) (c clsql-mysql-source-file))
41   nil) ;;; library will be loaded by a loader file
42
43 (defmethod perform ((o compile-op) (c clsql-mysql-source-file))
44   (unless (zerop (run-shell-command
45                   "cd ~A; make"
46                   (namestring (make-pathname :name nil
47                                              :type nil
48                                              :directory *library-file-dir*))))
49     (error 'operation-error :component c :operation o)))
50
51 ;;; System definition
52
53 #+(or allegro lispworks cmu sbcl openmcl mcl scl)
54 (defsystem :clsql-mysql
55   :name "cl-sql-mysql"
56   :author "Kevin M. Rosenberg <kmr@debian.org>"
57   :maintainer "Kevin M. Rosenberg <kmr@debian.org>"
58   :licence "Lessor Lisp General Public License"
59   :description "Common Lisp SQL MySQL Driver"
60   :long-description "cl-sql-mysql package provides a database driver to the MySQL database system."
61
62   :components
63   ((:module :db-mysql
64             :components
65             ((:clsql-mysql-source-file "mysql")
66              (:file "mysql-package")
67              (:file "mysql-loader" :depends-on ("mysql-package" "mysql"))
68              (:file "mysql-api" :depends-on ("mysql-loader"))
69              (:file "mysql-sql" :depends-on ("mysql-api"))
70              (:file "mysql-usql" :depends-on ("mysql-sql")))))
71   :depends-on (:uffi :clsql-base :clsql-uffi))