0.8.12.38:
[sbcl.git] / contrib / sb-posix / sb-posix.asd
index 3fead6a..3902c11 100644 (file)
     (unless (zerop
             (run-shell-command
              "gcc ~A -o ~S ~{~S ~}"
-             (if (sb-ext:posix-getenv "LDFLAGS")
-                 (sb-ext:posix-getenv "LDFLAGS")
-               #+sunos "-shared -lresolv -lsocket -lnsl"
-               #+darwin "-bundle"
-               #-(or darwin sunos) "-shared")
+             (concatenate 'string
+                          (sb-ext:posix-getenv "EXTRA_LDFLAGS")
+                          " "
+                          #+sunos "-shared -lresolv -lsocket -lnsl"
+                          #+darwin "-bundle"
+                          #-(or darwin sunos) "-shared")
              dso-name
              (mapcar #'unix-name
                      (mapcan (lambda (c)
 (defmethod perform ((op compile-op) (c c-source-file))
   (unless
       (= 0 (run-shell-command "gcc ~A -o ~S -c ~S"
-                             (if (sb-ext:posix-getenv "CFLAGS")
-                                 (sb-ext:posix-getenv "CFLAGS")
-                               "-fPIC")
+                             (concatenate
+                              'string
+                              (sb-ext:posix-getenv "EXTRA_CFLAGS")
+                              " "
+                              "-fPIC")
                              (unix-name (car (output-files op c)))
                              (unix-name (component-pathname c))))
     (error 'operation-error :operation op :component c)))
   (let ((co (make-instance 'compile-op)))
     (let ((filename (car (output-files co c))))
       #+cmu (ext:load-foreign filename)
-      #+sbcl (sb-alien:load-1-foreign filename))))
-
+      #+sbcl (sb-alien:load-shared-object filename))))
 
 (defsystem sb-posix
     :depends-on (sb-grovel)
+    #+sb-building-contrib :pathname
+    #+sb-building-contrib "SYS:CONTRIB;SB-POSIX;"
     :components ((:file "defpackage")
                 (:file "designator" :depends-on ("defpackage"))
                  (:unix-dso "alien"
   (operate 'test-op 'sb-posix-tests))
 
 (defmethod perform ((o test-op) (c (eql (find-system :sb-posix-tests))))
-  (or (funcall (intern "DO-TESTS" (find-package "SB-RT")))
-      (error "test-op failed")))
+  (funcall (intern "DO-TESTS" (find-package "SB-RT")))
+  (let ((failures (funcall (intern "PENDING-TESTS" "SB-RT")))
+       (ignored-failures (loop for sym being the symbols of :sb-posix-tests
+                               if (search ".ERROR" (symbol-name sym))
+                               collect sym)))
+    (cond
+      ((null failures)
+       t)           
+      ((null (set-difference failures ignored-failures))
+       (warn "~@<some POSIX implementations return incorrect error values for ~
+              failing calls, but there is legitimate variation between ~
+              implementations too.  If you think the errno ~
+              from your platform is valid, please contact the sbcl ~
+              developers; otherwise, please submit a bug report to your ~
+              kernel distributor~@:>")
+       t)
+      (t
+       (error "non-errno tests failed!")))))