0.8.6.14:
[sbcl.git] / contrib / sb-bsd-sockets / sb-bsd-sockets.asd
index 4aa65e1..fd251d6 100644 (file)
   (let ((dso-name (unix-name (car (output-files operation dso)))))
     (unless (zerop
             (run-shell-command
-             #+sunos "gcc -shared -lresolv -lsocket -lnsl -o ~S ~{~S ~}"
-             #-sunos "gcc -shared -o ~S ~{~S ~} "
+             "gcc ~A -o ~S ~{~S ~}"
+             (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)
                  (component-pathname c))))
 (defmethod perform ((op compile-op) (c c-source-file))
   (unless
-      (= 0 (run-shell-command "gcc -fPIC -o ~S -c ~S"
+      (= 0 (run-shell-command "gcc ~A -o ~S -c ~S"
+                             (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)))
@@ -62,7 +71,9 @@
 
 (defsystem sb-bsd-sockets
     :version "0.58"
-    :depends-on (sb-rt sb-grovel)
+    :depends-on (sb-grovel)
+    #+sb-building-contrib :pathname
+    #+sb-building-contrib "SYS:CONTRIB;SB-BSD-SOCKETS;"
     :components ((:file "defpackage")
                 (:file "split" :depends-on ("defpackage"))
                  (:file "array-data" :depends-on ("defpackage"))
@@ -73,7 +84,7 @@
                 (:file "foreign-glue" :depends-on ("defpackage" "malloc"))
                 (sb-grovel:grovel-constants-file
                  "constants"
-                 :package :sockint  :pathname "constants.lisp"
+                 :package :sockint
                  :depends-on  ("def-to-lisp" "defpackage" "foreign-glue"))
                 (:file "sockets"
                        :depends-on ("constants" "array-data"))
@@ -85,7 +96,6 @@
                 (:file "misc" :depends-on ("sockets" "constants"))
 
                 (:file "def-to-lisp")
-                (:file "tests" :depends-on ("inet" "sockopt"))
 
                 (:static-file "NEWS")
                 ;; (:static-file "INSTALL")
   (provide 'sb-bsd-sockets))
 
 (defmethod perform ((o test-op) (c (eql (find-system :sb-bsd-sockets))))
+  (operate 'load-op 'sb-bsd-sockets-tests)
+  (operate 'test-op 'sb-bsd-sockets-tests))
+
+(defsystem sb-bsd-sockets-tests
+  :depends-on (sb-rt sb-bsd-sockets sb-posix)
+  :components ((:file "tests")))
+
+(defmethod perform ((o test-op) (c (eql (find-system :sb-bsd-sockets-tests))))
   (or (funcall (intern "DO-TESTS" (find-package "SB-RT")))
       (error "test-op failed")))
-