1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
5 ;;;; Name: clsql-uffi.asd
6 ;;;; Purpose: ASDF definition file for CLSQL UFFI Helper package
7 ;;;; Programmer: Kevin M. Rosenberg
8 ;;;; Date Started: Aug 2002
12 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
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 ;;;; *************************************************************************
21 ;; need to load uffi for below output-files method
22 (eval-when (:compile-toplevel :load-toplevel :execute)
23 #+common-lisp-controller (require 'uffi)
24 #-common-lisp-controller (asdf:operate 'asdf:load-op 'uffi))
26 (defpackage clsql-uffi-system (:use #:asdf #:cl))
27 (in-package clsql-uffi-system)
29 (defvar *library-file-dir* (append (pathname-directory *load-truename*)
32 (defclass clsql-uffi-source-file (c-source-file)
36 (defmethod output-files ((o compile-op) (c clsql-uffi-source-file))
37 (let* ((library-file-type
38 (funcall (intern (symbol-name'#:default-foreign-library-type)
39 (symbol-name '#:uffi))))
42 (probe-file (make-pathname
44 :name (component-name c)
45 :type library-file-type)))
46 '((:absolute "usr" "lib" "clsql")))))
49 (make-pathname :name (component-name c)
50 :type library-file-type
51 :directory *library-file-dir*)))))
53 (defmethod perform ((o load-op) (c clsql-uffi-source-file))
54 nil) ;;; library will be loaded by a loader file
56 (defmethod operation-done-p ((o load-op) (c clsql-uffi-source-file))
59 (defmethod perform ((o compile-op) (c clsql-uffi-source-file))
60 #-(or win32 mswindows)
61 (unless (zerop (run-shell-command
63 (namestring (make-pathname :name nil
65 :directory *library-file-dir*))))
66 (error 'operation-error :component c :operation o)))
68 (defmethod operation-done-p ((o compile-op) (c clsql-uffi-source-file))
69 (let ((lib (make-pathname :defaults (component-pathname c)
70 :type (uffi:default-foreign-library-type))))
72 (> (file-write-date lib) (file-write-date (component-pathname c))))))
74 #+(or allegro lispworks cmu sbcl openmcl mcl scl)
77 :author "Kevin M. Rosenberg <kmr@debian.org>"
78 :maintainer "Kevin M. Rosenberg <kmr@debian.org>"
79 :licence "Lessor Lisp General Public License"
80 :description "Common UFFI Helper functions for Common Lisp SQL Interface Library"
81 :long-description "cl-sql-uffi package provides common helper functions using the UFFI for the CLSQL package."
83 :depends-on (uffi clsql-base)
88 ((:clsql-uffi-source-file "uffi")
89 (:file "clsql-uffi-package")
90 (:file "clsql-uffi-loader" :depends-on ("clsql-uffi-package" "uffi"))
91 (:file "clsql-uffi" :depends-on ("clsql-uffi-loader"))))))