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
10 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
12 ;;;; CLSQL users are granted the rights to distribute and use this software
13 ;;;; as governed by the terms of the Lisp Lesser GNU Public License
14 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
15 ;;;; *************************************************************************
19 (defpackage clsql-uffi-system (:use #:asdf #:cl))
20 (in-package clsql-uffi-system)
22 (defvar *clsql-uffi-library-dir*
23 (merge-pathnames "uffi/"
24 (make-pathname :name nil :type nil :defaults *load-truename*)))
26 (defclass clsql-uffi-source-file (c-source-file)
30 (defmethod output-files ((o compile-op) (c clsql-uffi-source-file))
31 (let* ((library-file-type
32 (funcall (intern (symbol-name'#:default-foreign-library-type)
33 (symbol-name '#:uffi))))
36 (probe-file (make-pathname
38 :name (component-name c)
39 :type library-file-type)))
40 '((:absolute "usr" "lib" "clsql")))))
43 (make-pathname :name (component-name c)
44 :type library-file-type
45 :defaults *clsql-uffi-library-dir*)))))
47 (defmethod perform ((o load-op) (c clsql-uffi-source-file))
48 nil) ;;; library will be loaded by a loader file
50 (defmethod operation-done-p ((o load-op) (c clsql-uffi-source-file))
51 (and (symbol-function (intern (symbol-name '#:atol64)
52 (find-package '#:clsql-uffi)))
55 (defmethod perform ((o compile-op) (c clsql-uffi-source-file))
56 (unless (operation-done-p o c)
57 #-(or win32 win64 windows mswindows)
58 (unless (zerop (run-shell-command
59 #-(or freebsd netbsd) "cd ~A; make"
60 #+(or freebsd netbsd) "cd ~A; gmake"
61 (namestring *clsql-uffi-library-dir*)))
62 (error 'operation-error :component c :operation o))))
64 (defmethod operation-done-p ((o compile-op) (c clsql-uffi-source-file))
65 (or (and (probe-file #p"/usr/lib/clsql/clsql_uffi.so") t)
66 (let ((lib (make-pathname :defaults (component-pathname c)
67 :type (funcall (intern (symbol-name '#:default-foreign-library-type)
68 (find-package '#:uffi))))))
69 (and (probe-file lib) (probe-file (component-pathname c))
70 (> (file-write-date lib) (file-write-date (component-pathname c)))))))
74 :author "Kevin M. Rosenberg <kmr@debian.org>"
75 :maintainer "Kevin M. Rosenberg <kmr@debian.org>"
76 :licence "Lessor Lisp General Public License"
77 :description "Common UFFI Helper functions for Common Lisp SQL Interface Library"
78 :long-description "cl-sql-uffi package provides common helper functions using the UFFI for the CLSQL package."
80 :depends-on (clsql #-:clsql-cffi uffi #+:clsql-cffi cffi-uffi-compat)
85 ((:file "clsql-uffi-package")
86 (:clsql-uffi-source-file "clsql_uffi" :depends-on ("clsql-uffi-package"))
87 (:file "clsql-uffi-loader" :depends-on ("clsql-uffi-package" "clsql_uffi"))
88 (:file "clsql-uffi" :depends-on ("clsql-uffi-loader"))))))