chiark / gitweb /
Bug fix
[clg] / glib / gtype.lisp
index 129d7b46ba3b2cecfbaa84867a6a0707e625f040..d6b1535ddf3a47e64c133cc0cf45e6e443912e14 100644 (file)
@@ -20,7 +20,7 @@
 ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-;; $Id: gtype.lisp,v 1.55 2006-08-25 10:37:33 espen Exp $
+;; $Id: gtype.lisp,v 1.58 2006-08-31 20:40:56 espen Exp $
 
 (in-package "GLIB")
 
@@ -208,20 +208,25 @@   (defun %find-types-in-library (pathname prefixes ignore)
           (run-program
            "/usr/bin/nm" 
            #+clisp :arguments
-           (list "--defined-only" "-D" (namestring (truename pathname)))
+           (list #-darwin"--defined-only" #-darwin"-D" "-g" #+darwin"-f" 
+                 #+darwin"-s" #+darwin"__TEXT" #+darwin"__text" 
+                 (namestring (truename pathname)))
            :output :stream :wait nil)))
       (unwind-protect
          (loop 
-          as symbol = (let ((line (read-line 
-                                   #+(or cmu sbcl)
-                                   (process-output process)
-                                   #+clisp process
-                                   nil)))
-                        (when line 
-                          (subseq line (1+ (position #\Space line :from-end t)))))
-          while symbol
+          as line = (read-line
+                     #+(or cmu sbcl) (process-output process)
+                     #+clisp process
+                     nil)
+          as symbol = (when line
+                        (let ((pos (position #\Space line :from-end t)))
+                          #-darwin(subseq line (1+ pos))
+                          #+darwin
+                          (when (char= (char line (1- pos)) #\T)
+                            (subseq line (+ pos 2)))))
+          while line
           when (and
-                (> (length symbol) 9)
+                symbol (> (length symbol) 9)
                 (or 
                  (not prefixes)
                  (some #'(lambda (prefix)
@@ -624,4 +629,4 @@ (defexport define-types-by-introspection (prefix &rest args)
 
 ;;;; Initialize all non static types in GObject
 
-(init-types-in-library #.(concatenate 'string (pkg-config:pkg-variable "glib-2.0" "libdir") "/libgobject-2.0.so"))
+(init-types-in-library #.(concatenate 'string (pkg-config:pkg-variable "glib-2.0" "libdir") "/libgobject-2.0." asdf:*dso-extension*))