modernize autotools usage
[cl-satwrap.git] / asdf-component-shared-unix-library.asd
blob5214a21dcd179262c606dab98adc25cec85c160b
1 ;;; ASDF Definition.  -*- lisp -*-
3 (defpackage :asdf-component-shared-unix-library-system
4   (:use :cl :asdf)
5   (:export #:shared-unix-library))
7 (in-package :asdf-component-shared-unix-library-system)
9 (defclass shared-unix-library (source-file)
10   ())
12 (defmethod source-file-type ((component shared-unix-library) system)
13   "so")
15 (defmethod input-files (operation (component shared-unix-library))
16   nil)
18 (defmethod output-files ((operation compile-op) (component shared-unix-library))
19   nil)
21 (defmethod perform ((operation compile-op) (component shared-unix-library))
22   nil)
23 (defmethod operation-done-p ((o compile-op) (c shared-unix-library))
24   t)
25 (defmethod operation-done-p ((o load-op) (c shared-unix-library))
26   nil)
28 (defmethod perform ((operation load-op) (component shared-unix-library))
29   (flet ((load-lib (lib)
30            #+cffi
31            (cffi:load-foreign-library lib)
32            #+(and (not cffi) sbcl)
33            (sb-alien:load-shared-object lib)
34            #+(and (not cffi) allegro)
35            (load lib :foreign t)
36            #-(or sbcl allegro cffi)
37            (error "No foreign library support")))
38     (handler-case (load-lib (component-pathname component))
39         (error (e) (declare (ignore e))
40                nil))))
42 (pushnew :asdf-component-shared-unix-library *features*)
44 (asdf:defsystem :asdf-component-shared-unix-library
45   :name "ASDF component :shared-unix-library"
46   :components ())