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 (unless (find-package 'uffi)
24 (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))
57 (and (symbol-function (intern (symbol-name '#:atol64)
58 (find-package '#:clsql-uffi)))
61 (defmethod perform ((o compile-op) (c clsql-uffi-source-file))
62 (unless (operation-done-p o c)
63 #-(or win32 mswindows)
64 (unless (zerop (run-shell-command
65 #-freebsd "cd ~A; make"
66 #+freebsd "cd ~A; gmake"
67 (namestring (make-pathname :name nil
69 :directory *library-file-dir*))))
70 (error 'operation-error :component c :operation o))))
72 (defmethod operation-done-p ((o compile-op) (c clsql-uffi-source-file))
73 (or (and (probe-file #p"/usr/lib/clsql/uffi.so") t)
74 (let ((lib (make-pathname :defaults (component-pathname c)
75 :type (uffi:default-foreign-library-type))))
77 (> (file-write-date lib) (file-write-date (component-pathname c)))))))
81 :author "Kevin M. Rosenberg <kmr@debian.org>"
82 :maintainer "Kevin M. Rosenberg <kmr@debian.org>"
83 :licence "Lessor Lisp General Public License"
84 :description "Common UFFI Helper functions for Common Lisp SQL Interface Library"
85 :long-description "cl-sql-uffi package provides common helper functions using the UFFI for the CLSQL package."
87 :depends-on (uffi clsql)
92 ((:file "clsql-uffi-package")
93 (:clsql-uffi-source-file "uffi" :depends-on ("clsql-uffi-package"))
94 (:file "clsql-uffi-loader" :depends-on ("clsql-uffi-package" "uffi"))
95 (:file "clsql-uffi" :depends-on ("clsql-uffi-loader"))))))