0.8.3.83:
[sbcl.git] / contrib / sb-bsd-sockets / sb-bsd-sockets.asd
index 9fa49e5..09a1054 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 ~}"
-             #+darwin "gcc -bundle -o ~S ~{~S ~}"
-             #-(or darwin sunos) "gcc -shared -o ~S ~{~S ~} "
+             "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!")
              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"
+                             (if (sb-ext:posix-getenv "CFLAGS")
+                                 (sb-ext:posix-getenv "CFLAGS")
+                               "-fPIC!")
                              (unix-name (car (output-files op c)))
                              (unix-name (component-pathname c))))
     (error 'operation-error :operation op :component c)))