0.9.10.20:
authorChristophe Rhodes <csr21@cam.ac.uk>
Tue, 7 Mar 2006 12:04:24 +0000 (12:04 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Tue, 7 Mar 2006 12:04:24 +0000 (12:04 +0000)
Move the stub definitions for contrib-type stuff into the
main runtime
... and don't build unix-dsos in contribs any more;
... should make binary distribution easier.

NEWS
contrib/sb-bsd-sockets/alien/get-h-errno.c [deleted file]
contrib/sb-bsd-sockets/alien/undefs.c [deleted file]
contrib/sb-bsd-sockets/sb-bsd-sockets.asd
contrib/sb-posix/alien/stat-macros.c [deleted file]
contrib/sb-posix/alien/waitpid-macros.c [deleted file]
contrib/sb-posix/sb-posix.asd
src/runtime/wrap.c
version.lisp-expr

diff --git a/NEWS b/NEWS
index 8caf4d8..69c4092 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,9 +1,13 @@
 ;;;; -*- coding: utf-8; -*-
 changes in sbcl-0.9.11 relative to sbcl-0.9.10:
-  * new port: SBCL now works on x86/Darwin, including MacOS X 10.4.5
-    on Intel.
+  * new platform: experimental support for SBCL x86/Darwin, including
+    MacOS X 10.4.5 on Intel.
   * new feature: Unicode character names are now known to the system
     (through CHAR-NAME and NAME-CHAR).
+  * minor incompatible change: the contrib modules SB-POSIX and
+    SB-BSD-SOCKETS no longer depend on stub C libraries; the intent of
+    this change is to make it easier to distribute
+    location-independent binaries.
   * bug fix: as implied by AMOP, standardized classes no longer have
     slots named by external symbols of public packages.  (reported by
     Pascal Costanza)
diff --git a/contrib/sb-bsd-sockets/alien/get-h-errno.c b/contrib/sb-bsd-sockets/alien/get-h-errno.c
deleted file mode 100755 (executable)
index a1d22a6..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <netdb.h>
-
-int get_h_errno()
-{
-    return h_errno;
-}
diff --git a/contrib/sb-bsd-sockets/alien/undefs.c b/contrib/sb-bsd-sockets/alien/undefs.c
deleted file mode 100644 (file)
index fca6cde..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-/* create a .o file with undefined references to all the C stuff we need
- * that cmucl hasn't already fouind for us.  Not needed on Linux/i386
- * because it has dynamic loading anyway
- */
-
-void likewecare() {
-    getprotobyname();
-}
-
index 267cbc3..7da9c86 100644 (file)
@@ -4,71 +4,6 @@
 (defpackage #:sb-bsd-sockets-system (:use #:asdf #:sb-grovel #:cl))
 (in-package #:sb-bsd-sockets-system)
 
-;;; we also have a shared library with some .o files in it
-
-(defclass unix-dso (module) ())
-(defun unix-name (pathname)
-  (namestring 
-   (typecase pathname
-     (logical-pathname (translate-logical-pathname pathname))
-     (t pathname))))
-
-(defmethod asdf::input-files ((operation compile-op) (dso unix-dso))
-  (mapcar #'component-pathname (module-components dso)))
-
-(defmethod output-files ((operation compile-op) (dso unix-dso))
-  (let ((dir (component-pathname dso)))
-    (list
-     (make-pathname :type "so"
-                   :name (car (last (pathname-directory dir)))
-                   :directory (butlast (pathname-directory dir))
-                   :defaults dir))))
-
-
-(defmethod perform :after ((operation compile-op) (dso unix-dso))
-  (let ((dso-name (unix-name (car (output-files operation dso)))))
-    (unless (zerop
-            (run-shell-command
-             "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)
-                               (output-files operation c))
-                             (module-components dso)))))
-      (error 'operation-error :operation operation :component dso))))
-
-;;; if this goes into the standard asdf, it could reasonably be extended
-;;; to allow cflags to be set somehow
-(defmethod output-files ((op compile-op) (c c-source-file))
-  (list 
-   (make-pathname :type "o" :defaults
-                 (component-pathname c))))
-(defmethod perform ((op compile-op) (c c-source-file))
-  (unless
-      (= 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)))
-
-(defmethod perform ((operation load-op) (c c-source-file))
-  t)
-  
-(defmethod perform ((o load-op) (c unix-dso))
-  (let ((co (make-instance 'compile-op)))
-    (let ((filename (car (output-files co c))))
-      #+cmu (ext:load-foreign filename)
-      #+sbcl (sb-alien:load-shared-object filename))))
-
 (defsystem sb-bsd-sockets
     :version "0.58"
     :depends-on (sb-grovel)
@@ -76,9 +11,6 @@
     #+sb-building-contrib "SYS:CONTRIB;SB-BSD-SOCKETS;"
     :components ((:file "defpackage")
                 (:file "split" :depends-on ("defpackage"))
-                (:unix-dso "alien"
-                           :components ((:c-source-file "undefs")
-                                        (:c-source-file "get-h-errno")))
                 (:file "malloc" :depends-on ("defpackage"))
                 (sb-grovel:grovel-constants-file
                  "constants"
@@ -90,7 +22,7 @@
                 (:file "sockopt" :depends-on ("sockets"))
                 (:file "inet" :depends-on ("sockets" "split"  "constants" ))
                 (:file "local" :depends-on ("sockets" "split" "constants" ))
-                (:file "name-service" :depends-on ("sockets" "constants" "alien"))
+                (:file "name-service" :depends-on ("sockets" "constants"))
                 (:file "misc" :depends-on ("sockets" "constants"))
 
                 (:static-file "NEWS")
diff --git a/contrib/sb-posix/alien/stat-macros.c b/contrib/sb-posix/alien/stat-macros.c
deleted file mode 100644 (file)
index 80e94cd..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * stat-macros.c
- *
- * Inspired mostly by section 4.3 and 4.21 of APUE
- *
- */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-int s_isreg(mode_t mode)
-{
-    return S_ISREG(mode);
-}
-
-
-int s_isdir(mode_t mode)
-{
-    return S_ISDIR(mode);
-}
-
-
-int s_ischr(mode_t mode)
-{
-    return S_ISCHR(mode);
-}
-
-
-int s_isblk(mode_t mode)
-{
-    return S_ISBLK(mode);
-}
-
-
-int s_isfifo(mode_t mode)
-{
-    return S_ISFIFO(mode);
-}
-
-
-int s_islnk(mode_t mode)
-{
-#ifdef S_ISLNK
-    return S_ISLNK(mode);
-#else
-    return ((mode & S_IFMT) == S_IFLNK);
-#endif
-}
-
-
-int s_issock(mode_t mode)
-{
-#ifdef S_ISSOCK
-    return S_ISSOCK(mode);
-#else
-    return ((mode & S_IFMT) == S_IFSOCK);
-#endif
-}
-
-
diff --git a/contrib/sb-posix/alien/waitpid-macros.c b/contrib/sb-posix/alien/waitpid-macros.c
deleted file mode 100644 (file)
index 10eee01..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#include <sys/types.h>
-#include <sys/wait.h>
-
-int wifexited(int status) {
-    return WIFEXITED(status);
-}
-
-int wexitstatus(int status) {
-    return WEXITSTATUS(status);
-}
-
-int wifsignaled(int status) {
-    return WIFSIGNALED(status);
-}
-
-int wtermsig(int status) {
-    return WTERMSIG(status);
-}
-
-int wifstopped(int status) {
-    return WIFSTOPPED(status);
-}
-
-int wstopsig(int status) {
-    return WSTOPSIG(status);
-}
-
-/* FIXME: POSIX also defines WIFCONTINUED, but that appears not to
-   exist on at least Linux... */
index b3fd54d..3fe72a0 100644 (file)
@@ -4,90 +4,17 @@
 (defpackage #:sb-posix-system (:use #:asdf #:cl #:sb-grovel))
 (in-package #:sb-posix-system)
 
-
-;;; we also have a shared library with some .o files in it
-;;;
-;;; FIXME: we share this with SB-BSD-SOCKETS.  This should either (a)
-;;; be part of ASDF itself, or (b) be in a shared file that we can
-;;; LOAD at this point.
-(defclass unix-dso (module) ())
-(defun unix-name (pathname)
-  (namestring 
-   (typecase pathname
-     (logical-pathname (translate-logical-pathname pathname))
-     (t pathname))))
-
-(defmethod asdf::input-files ((operation compile-op) (dso unix-dso))
-  (mapcar #'component-pathname (module-components dso)))
-
-(defmethod output-files ((operation compile-op) (dso unix-dso))
-  (let ((dir (component-pathname dso)))
-    (list
-     (make-pathname :type "so"
-                   :name (car (last (pathname-directory dir)))
-                   :directory (butlast (pathname-directory dir))
-                   :defaults dir))))
-
-
-(defmethod perform :after ((operation compile-op) (dso unix-dso))
-  (let ((dso-name (unix-name (car (output-files operation dso)))))
-    (unless (zerop
-            (run-shell-command
-             "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)
-                               (output-files operation c))
-                             (module-components dso)))))
-      (error 'operation-error :operation operation :component dso))))
-
-;;; if this goes into the standard asdf, it could reasonably be extended
-;;; to allow cflags to be set somehow
-(defmethod output-files ((op compile-op) (c c-source-file))
-  (list 
-   (make-pathname :type "o" :defaults
-                 (component-pathname c))))
-(defmethod perform ((op compile-op) (c c-source-file))
-  (unless
-      (= 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)))
-
-(defmethod perform ((operation load-op) (c c-source-file))
-  t)
-  
-(defmethod perform ((o load-op) (c unix-dso))
-  (let ((co (make-instance 'compile-op)))
-    (let ((filename (car (output-files co c))))
-      #+cmu (ext:load-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"
-                           :components ((:c-source-file "stat-macros")
-                                        (:c-source-file "waitpid-macros")))
                 (:file "macros" :depends-on ("designator"))
                 (sb-grovel:grovel-constants-file
                  "constants"
                  :package :sb-posix :depends-on  ("defpackage"))
-                (:file "interface" :depends-on ("constants" "macros" "designator" "alien"))))
+                (:file "interface" :depends-on ("constants" "macros" "designator"))))
 
 (defsystem sb-posix-tests
     :depends-on (sb-rt)
index 29a79e1..153ebd5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * wrappers around low-level operations to provide a simpler interface
- * to the operations that Lisp needs
+ * to the operations that Lisp (and some contributed modules) needs.
  *
  * The functions in this file are typically called directly from Lisp.
  * Thus, when their signature changes, they don't need updates in a .h
@@ -34,6 +34,8 @@
 #include <unistd.h>
 #ifndef LISP_FEATURE_WIN32
 #include <pwd.h>
+#include <sys/wait.h>
+#include <netdb.h>
 #endif
 #include <stdio.h>
 
@@ -420,3 +422,75 @@ int gettimeofday(long *timeval, long *timezone)
     return 0;
 }
 #endif
+
+
+/* We will need to define these things or their equivalents for Win32
+   eventually, but for now let's get it working for everyone else. */
+#ifndef LISP_FEATURE_WIN32
+/* From SB-BSD-SOCKETS, to get h_errno */
+int get_h_errno()
+{
+    return h_errno;
+}
+
+/* From SB-POSIX, wait-macros */
+int wifexited(int status) {
+    return WIFEXITED(status);
+}
+int wexitstatus(int status) {
+    return WEXITSTATUS(status);
+}
+int wifsignaled(int status) {
+    return WIFSIGNALED(status);
+}
+int wtermsig(int status) {
+    return WTERMSIG(status);
+}
+int wifstopped(int status) {
+    return WIFSTOPPED(status);
+}
+int wstopsig(int status) {
+    return WSTOPSIG(status);
+}
+
+/* FIXME: POSIX also defines WIFCONTINUED, but that appears not to
+   exist on at least Linux... */
+
+/* From SB-POSIX, stat-macros */
+int s_isreg(mode_t mode)
+{
+    return S_ISREG(mode);
+}
+int s_isdir(mode_t mode)
+{
+    return S_ISDIR(mode);
+}
+int s_ischr(mode_t mode)
+{
+    return S_ISCHR(mode);
+}
+int s_isblk(mode_t mode)
+{
+    return S_ISBLK(mode);
+}
+int s_isfifo(mode_t mode)
+{
+    return S_ISFIFO(mode);
+}
+int s_islnk(mode_t mode)
+{
+#ifdef S_ISLNK
+    return S_ISLNK(mode);
+#else
+    return ((mode & S_IFMT) == S_IFLNK);
+#endif
+}
+int s_issock(mode_t mode)
+{
+#ifdef S_ISSOCK
+    return S_ISSOCK(mode);
+#else
+    return ((mode & S_IFMT) == S_IFSOCK);
+#endif
+}
+#endif /* !LISP_FEATURE_WIN32 */
index 5b66969..8991c75 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.9.10.19"
+"0.9.10.20"