+(in-package cl-user)
+
+(defpackage clsql-uffi-system (:use #:asdf #:cl))
+(in-package clsql-uffi-system)
+
+(defvar *clsql-uffi-library-dir*
+ (merge-pathnames "uffi/"
+ (make-pathname :name nil :type nil :defaults *load-truename*)))
+
+(defclass clsql-uffi-source-file (c-source-file)
+ ())
+
+
+(defmethod output-files ((o compile-op) (c clsql-uffi-source-file))
+ (let* ((library-file-type
+ (funcall (intern (symbol-name'#:default-foreign-library-type)
+ (symbol-name '#:uffi))))
+ (found
+ (some #'(lambda (dir)
+ (probe-file (make-pathname
+ :directory dir
+ :name (component-name c)
+ :type library-file-type)))
+ '((:absolute "usr" "lib" "clsql")))))
+ (list (if found
+ found
+ (make-pathname :name (component-name c)
+ :type library-file-type
+ :defaults *clsql-uffi-library-dir*)))))