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 (unless (zerop (run-shell-command
62 (namestring (make-pathname :name nil
64 :directory *library-file-dir*))))
65 (error 'operation-error :component c :operation o)))
67 (defmethod operation-done-p ((o compile-op) (c clsql-uffi-source-file))
68 (let ((lib (make-pathname :defaults (component-pathname c)
69 :type (uffi:default-foreign-library-type))))
71 (> (file-write-date lib) (file-write-date (component-pathname c))))))
73 #+(or allegro lispworks cmu sbcl openmcl mcl scl)
76 :author "Kevin M. Rosenberg <kmr@debian.org>"
77 :maintainer "Kevin M. Rosenberg <kmr@debian.org>"
78 :licence "Lessor Lisp General Public License"
79 :description "Common UFFI Helper functions for Common Lisp SQL Interface Library"
80 :long-description "cl-sql-uffi package provides common helper functions using the UFFI for the CLSQL package."
82 :depends-on (uffi clsql-base)
87 ((:clsql-uffi-source-file "uffi")
88 (:file "clsql-uffi-package")
89 (:file "clsql-uffi-loader" :depends-on ("clsql-uffi-package" "uffi"))
90 (:file "clsql-uffi" :depends-on ("clsql-uffi-loader"))))))