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 (defpackage clsql-uffi-system (:use #:asdf #:cl))
22 (in-package clsql-uffi-system)
24 (defvar *clsql-uffi-library-dir*
25 (merge-pathnames "uffi/"
26 (make-pathname :name nil :type nil :defaults *load-truename*)))
28 (defclass clsql-uffi-source-file (c-source-file)
32 (defmethod output-files ((o compile-op) (c clsql-uffi-source-file))
33 (let* ((library-file-type
34 (funcall (intern (symbol-name'#:default-foreign-library-type)
35 (symbol-name '#:uffi))))
38 (probe-file (make-pathname
40 :name (component-name c)
41 :type library-file-type)))
42 '((:absolute "usr" "lib" "clsql")))))
45 (make-pathname :name (component-name c)
46 :type library-file-type
47 :defaults *clsql-uffi-library-dir*)))))
49 (defmethod perform ((o load-op) (c clsql-uffi-source-file))
50 nil) ;;; library will be loaded by a loader file
52 (defmethod operation-done-p ((o load-op) (c clsql-uffi-source-file))
53 (and (symbol-function (intern (symbol-name '#:atol64)
54 (find-package '#:clsql-uffi)))
57 (defmethod perform ((o compile-op) (c clsql-uffi-source-file))
58 (unless (operation-done-p o c)
59 #-(or win32 win64 windows mswindows)
60 (unless (zerop (run-shell-command
61 #-(or freebsd netbsd) "cd ~A; make"
62 #+(or freebsd netbsd) "cd ~A; gmake"
63 (namestring *clsql-uffi-library-dir*)))
64 (error 'operation-error :component c :operation o))))
66 (defmethod operation-done-p ((o compile-op) (c clsql-uffi-source-file))
67 (or (and (probe-file #p"/usr/lib/clsql/clsql_uffi.so") t)
68 (let ((lib (make-pathname :defaults (component-pathname c)
69 :type (funcall (intern (symbol-name '#:default-foreign-library-type)
70 (find-package '#:uffi))))))
71 (and (probe-file lib) (probe-file (component-pathname c))
72 (> (file-write-date lib) (file-write-date (component-pathname c)))))))
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)
87 ((:file "clsql-uffi-package")
88 (:clsql-uffi-source-file "clsql_uffi" :depends-on ("clsql-uffi-package"))
89 (:file "clsql-uffi-loader" :depends-on ("clsql-uffi-package" "clsql_uffi"))
90 (:file "clsql-uffi" :depends-on ("clsql-uffi-loader"))))))