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 *library-file-dir* (append (pathname-directory *load-truename*)
27 (defclass clsql-uffi-source-file (c-source-file)
31 (defmethod output-files ((o compile-op) (c clsql-uffi-source-file))
32 (let* ((library-file-type
33 (funcall (intern (symbol-name'#:default-foreign-library-type)
34 (symbol-name '#:uffi))))
37 (probe-file (make-pathname
39 :name (component-name c)
40 :type library-file-type)))
41 '((:absolute "usr" "lib" "clsql")))))
44 (make-pathname :name (component-name c)
45 :type library-file-type
46 :directory *library-file-dir*)))))
48 (defmethod perform ((o load-op) (c clsql-uffi-source-file))
49 nil) ;;; library will be loaded by a loader file
51 (defmethod operation-done-p ((o load-op) (c clsql-uffi-source-file))
52 (and (symbol-function (intern (symbol-name '#:atol64)
53 (find-package '#:clsql-uffi)))
56 (defmethod perform ((o compile-op) (c clsql-uffi-source-file))
57 (unless (operation-done-p o c)
58 #-(or win32 mswindows)
59 (unless (zerop (run-shell-command
60 #-freebsd "cd ~A; make"
61 #+freebsd "cd ~A; gmake"
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 (or (and (probe-file #p"/usr/lib/clsql/clsql_uffi.so") t)
69 (let ((lib (make-pathname :defaults (component-pathname c)
70 :type (funcall (intern (symbol-name '#:default-foreign-library-type)
71 (find-package '#:uffi))))))
72 (and (probe-file lib) (probe-file (component-pathname c))
73 (> (file-write-date lib) (file-write-date (component-pathname c)))))))
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)
88 ((:file "clsql-uffi-package")
89 (:clsql-uffi-source-file "clsql_uffi" :depends-on ("clsql-uffi-package"))
90 (:file "clsql-uffi-loader" :depends-on ("clsql-uffi-package" "clsql_uffi"))
91 (:file "clsql-uffi" :depends-on ("clsql-uffi-loader"))))))