chiark / gitweb /
Bug fix
[clg] / tools / asdf-extensions.lisp
index 5b6870c0bdef9b1b9294872da664c648ae2982b1..c315dc43dff8e9c7ae851adf4780fbaa01a8acbb 100644 (file)
@@ -1,10 +1,12 @@
 (in-package :asdf)
 
-(export '*dso-extension*)
+(export '(*absolute-paths-as-default* *dso-extension*
+         *operation* *system* *component*))
 
 (defparameter *dso-extension* 
  #-(or darwin win32)"so" #+darwin"dylib" #+win32"dll")
 
+(defparameter *absolute-paths-as-default* nil)
 
 ;;; The following code is more or less copied from sb-bsd-sockets.asd,
 ;;; but extended to allow flags to be set in a general way. The class
@@ -13,7 +15,8 @@ (defparameter *dso-extension*
 
 (defclass shared-object (module)
   ((ldflags :initform nil :initarg :ldflags)
-   (absolute :initform nil :initarg :absolute :reader absolute-p)))
+   (absolute :initform *absolute-paths-as-default* 
+            :initarg :absolute :reader absolute-p)))
 
 (defun ensure-namestring (pathname)
   (namestring 
@@ -131,7 +134,8 @@ (defmethod perform ((operation load-op) (c c-source-file))
 (defclass library (component) 
   ((libdir :initarg :libdir :initform nil)
    (libname :initarg :libname :initform nil)
-   (absolute :initform nil :initarg :absolute :reader absolute-p)))
+   (absolute :initform *absolute-paths-as-default*
+            :initarg :absolute :reader absolute-p)))
 
 
 (defun split-path (path)
@@ -169,3 +173,16 @@ (defmethod operation-done-p ((o load-op) (lib library))
 
 (defmethod operation-done-p ((o operation) (lib library))
   t)
+
+
+;;; Binding of dynamic variables during perform
+
+(defvar *operation* nil)
+(defvar *system* nil)
+(defvar *component* nil)
+
+(defmethod perform :around ((operation operation) (c component))
+  (let ((*operation* operation)
+       (*component* c)
+       (*system* (component-system c)))
+    (call-next-method)))