~mdw
/
clg
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Library extensions not hard coded any more
[clg]
/
tools
/
asdf-extensions.lisp
diff --git
a/tools/asdf-extensions.lisp
b/tools/asdf-extensions.lisp
index
b7a589b
..
14a4db7
100644
(file)
--- a/
tools/asdf-extensions.lisp
+++ b/
tools/asdf-extensions.lisp
@@
-1,6
+1,9
@@
(in-package :asdf)
(in-package :asdf)
-(export 'load-dso)
+(export '*dso-extension*)
+
+(defvar *dso-extension* #-darwin"so" #+darwin"dylib")
+
(defun concatenate-strings (strings &optional delimiter)
(if (not (rest strings))
(defun concatenate-strings (strings &optional delimiter)
(if (not (rest strings))
@@
-27,7
+30,7
@@
(defmethod output-files ((operation compile-op) (dso unix-dso))
(let ((dir (component-pathname dso)))
(list
(defmethod output-files ((operation compile-op) (dso unix-dso))
(let ((dir (component-pathname dso)))
(list
- (make-pathname :type
"so"
+ (make-pathname :type
*dso-extension*
:name (car (last (pathname-directory dir)))
:directory (butlast (pathname-directory dir))
:defaults dir))))
:name (car (last (pathname-directory dir)))
:directory (butlast (pathname-directory dir))
:defaults dir))))
@@
-51,10
+54,16
@@
(module-components dso)))))
(error 'operation-error :operation operation :component dso))))
(module-components dso)))))
(error 'operation-error :operation operation :component dso))))
+#+clisp
+(defvar *loaded-libraries* ())
(defun load-dso (filename)
#+sbcl(sb-alien:load-shared-object filename)
(defun load-dso (filename)
#+sbcl(sb-alien:load-shared-object filename)
- #+cmu(ext:load-foreign filename))
+ #+cmu(ext:load-foreign filename)
+ #+clisp
+ (unless (find filename *loaded-libraries* :test #'equal)
+ (ffi::foreign-library (namestring filename))
+ (push filename *loaded-libraries*)))
(defmethod perform ((o load-op) (c unix-dso))
(defmethod perform ((o load-op) (c unix-dso))
@@
-119,7
+128,7
@@
(defmethod component-pathname ((lib library))
(defmethod component-pathname ((lib library))
- (make-pathname :type
"so"
+ (make-pathname :type
*dso-extension*
:name (component-name lib)
:directory (split-path (slot-value lib 'libdir))))
:name (component-name lib)
:directory (split-path (slot-value lib 'libdir))))
@@
-135,7
+144,8
@@
system::*global-table*
:key #'(lambda (pathname)
(when pathname (unix::unix-namestring pathname)))
system::*global-table*
:key #'(lambda (pathname)
(when pathname (unix::unix-namestring pathname)))
- :test #'equal))
+ :test #'equal)
+ #+clisp(find (component-pathname c) *loaded-libraries* :test #'equal))
(defmethod operation-done-p ((o operation) (c library))
t)
(defmethod operation-done-p ((o operation) (c library))
t)