0.7.12.50
authorDaniel Barlow <dan@telent.net>
Fri, 21 Feb 2003 16:21:02 +0000 (16:21 +0000)
committerDaniel Barlow <dan@telent.net>
Fri, 21 Feb 2003 16:21:02 +0000 (16:21 +0000)
It's easier to port a shell than a shell script. -- Larry Wall

Contrib-related fixes -
... multiple uses of test -e are now test -f
... don't run make test in install, it's more work than we
    want to do as root
... instead, touch $i/test-passed in make-target-contrib.sh
            (if, indeed, it has) and test for presence of that file
    when installing
... Rationalise AF-* constants in sb-bsd-sockets: AF-LOCAL
            is the One True Name.
... In sb-bsd-sockets build, don't hardcode gcc to be in /usr/bin

binary-distribution.sh
contrib/sb-bsd-sockets/Makefile
contrib/sb-bsd-sockets/constants.lisp
contrib/sb-bsd-sockets/defpackage.lisp
contrib/sb-bsd-sockets/local.lisp [new file with mode: 0644]
contrib/sb-bsd-sockets/sb-bsd-sockets.asd
contrib/sb-bsd-sockets/tests.lisp
contrib/sb-bsd-sockets/unix.lisp [deleted file]
install.sh
make-target-contrib.sh
version.lisp-expr

index 0bd5557..fc6cd37 100755 (executable)
@@ -18,7 +18,7 @@ tar -cf $b-binary.tar \
     $b/pubring.pgp \
     $b/contrib/vanilla-module.mk \
     `for dir in $b/contrib/*; do 
-         if test -d $dir && test -e $dir/Makefile; then 
+         if test -d $dir && test -f $dir/test-passed; then 
              echo $dir
          fi
      done`
index ebb6c68..0cfab33 100644 (file)
@@ -1,4 +1,6 @@
 SYSTEM=sb-bsd-sockets
+CC=gcc
+export CC
 
 all: 
        $(MAKE) -C ../asdf
index e792888..e52aab1 100644 (file)
 ;;; then the stuff we're looking for
 ((:integer af-inet "AF_INET" "IP Protocol family")
  (:integer af-unspec "AF_UNSPEC" "Unspecified.")
-#-solaris (:integer af-local "AF_LOCAL" "Local to host (pipes and file-domain).")
- (:integer af-unix "AF_UNIX" "Old BSD name for af-local. ")
-#-(or solaris freebsd) (:integer af-file "AF_FILE" "POSIX name for af-local. ")
-#+linux (:integer af-inet6 "AF_INET6"   "IP version 6. ")
-#+linux (:integer af-route "AF_NETLINK" "Alias to emulate 4.4BSD ")
-
+ (:integer af-local
+          #+(or sunos solaris) "AF_UNIX"
+          #-(or sunos solaris) "AF_LOCAL"
+          "Local to host (pipes and file-domain).")
+ #+linux (:integer af-inet6 "AF_INET6"   "IP version 6. ")
+ #+linux (:integer af-route "AF_NETLINK" "Alias to emulate 4.4BSD ")
  (:integer sock-stream "SOCK_STREAM"
            "Sequenced, reliable, connection-based byte streams.")
  (:integer sock-dgram "SOCK_DGRAM"
index 58e5270..f424ee8 100644 (file)
@@ -30,8 +30,8 @@
   (add-package-nickname "SYSTEM" "SB-SYS"))
 
 (defpackage "SB-BSD-SOCKETS"
-  (:export socket unix-socket inet-socket
-           make-unix-socket make-inet-socket
+  (:export socket local-socket inet-socket
+           make-local-socket make-inet-socket
            socket-bind socket-accept socket-connect
            socket-send socket-receive socket-recv
            socket-name socket-peername socket-listen
@@ -92,7 +92,7 @@ arguments to fit Lisp style more closely.
 <li> Methods applicable to a particular subclass
 <ol>
 <li> <a href="#internet">INET-SOCKET</a> - Internet Protocol (TCP, UDP, raw) sockets
-<li> Methods on <a href="#UNIX-SOCKET">UNIX-SOCKET</a> - Unix-domain sockets 
+<li> Methods on <a href="#LOCAL-SOCKET">LOCAL-SOCKET</a> - Local-domain sockets 
 </ol>
 <li> <a href="#name-service">Name resolution</a> (DNS, /etc/hosts, &amp;c)
 </ol>
@@ -105,11 +105,12 @@ available on a variety of systems, and documented.  There are some
 differences in approach where we have taken advantage of some of the more useful features of Common Lisp - briefly
 
 <ul>
-<li> Where the C API would typically return -1 and set errno, bsd-sockets
-signals an error.  All the errors are subclasses of SOCKET-CONDITION
+<li> Where the C API would typically return -1 and set errno, we
+signal an error.  All the errors are subclasses of SOCKET-CONDITION
 and generally correspond one for one with possible <tt>errno</tt> values
 
-<li> We use multiple return values in many places where the C API would use p[ass-by-reference values
+<li> We use multiple return values in many places where the C API would use
+pass-by-reference values
 
 <li> We can often avoid supplying an explicit <i>length</i> argument to
 functions because we already know how long the argument is.
diff --git a/contrib/sb-bsd-sockets/local.lisp b/contrib/sb-bsd-sockets/local.lisp
new file mode 100644 (file)
index 0000000..363f051
--- /dev/null
@@ -0,0 +1,40 @@
+(in-package :sb-bsd-sockets)
+
+#|| <h2>Local (unix) domain sockets</h2>
+
+Local domain (AF_LOCAL) sockets are also known as Unix-domain sockets, but were
+renamed by POSIX presumably on the basis that they may be
+available on other systems too.  
+
+A local socket address is a string, which is used to create a node
+in the local filesystem.  This means of course that they cannot be used across
+a network.
+
+||#
+
+(defclass local-socket (socket)
+  ((family :initform sockint::af-local)))
+
+(defmethod make-sockaddr-for ((socket local-socket) &optional sockaddr &rest address &aux (filename (first address)))
+  (let ((sockaddr (or sockaddr (sockint::allocate-sockaddr-un))))
+    (setf (sockint::sockaddr-un-family sockaddr) sockint::af-local)
+    (when filename
+      (loop for c across filename
+           ;; XXX magic constant ew ew ew.  should grovel this from
+           ;; system headers
+           for i from 0 to (min 107 (1- (length filename)))
+           do (setf (sockint::sockaddr-un-path sockaddr i) (char-code c))
+           finally
+           (setf (sockint::sockaddr-un-path sockaddr (1+ i)) 0)))
+    sockaddr))
+
+(defmethod size-of-sockaddr ((socket local-socket))
+  sockint::size-of-sockaddr-un)
+
+(defmethod bits-of-sockaddr ((socket local-socket) sockaddr)
+  "Returns filename of SOCKADDR"
+  (let ((name (sb-c-call::%naturalize-c-string
+              (sb-sys:sap+ (sockint::array-data-address sockaddr)
+                           sockint::offset-of-sockaddr-un-path))))
+    (if (zerop (length name)) nil name)))
+
index d912524..a5ab7d2 100644 (file)
@@ -28,8 +28,7 @@
                     (find-package "SB-BSD-SOCKETS-SYSTEM"))
             filename tmp-c-source :sb-bsd-sockets-internal)
     (and
-     (= (run-shell-command
-        "/usr/bin/gcc -o ~S ~S" (namestring tmp-a-dot-out)
+     (= (run-shell-command "gcc -o ~S ~S" (namestring tmp-a-dot-out)
         (namestring tmp-c-source)) 0)
      (= (run-shell-command "~A >~A"
                           (namestring tmp-a-dot-out)
@@ -78,7 +77,7 @@
                  (component-pathname c))))
 (defmethod perform ((op compile-op) (c c-source-file))
   (unless
-      (= 0 (run-shell-command "/usr/bin/gcc -fPIC -o ~S -c ~S"
+      (= 0 (run-shell-command "gcc -fPIC -o ~S -c ~S"
                              (unix-name (car (output-files op c)))
                              (unix-name (component-pathname c))))
     (error 'operation-error :operation op :component c)))
                 
                 (:file "sockopt" :depends-on ("sockets"))
                 (:file "inet" :depends-on ("sockets" "split"  "constants" ))
-                (:file "unix" :depends-on ("sockets" "split" "constants" ))
+                (:file "local" :depends-on ("sockets" "split" "constants" ))
                 (:file "name-service" :depends-on ("sockets" "constants" "alien"))
                 (:file "misc" :depends-on ("sockets" "constants"))
 
index 40af6c2..deb208f 100644 (file)
@@ -129,20 +129,20 @@ Tests are in the file <tt>tests.lisp</tt> and also make good examples.
   t)
 
 #||
-<h2>Unix-domain sockets</h2>
+<h2>Local-domain sockets</h2>
 
 A fairly rudimentary test that connects to the syslog socket and sends a 
 message.  Priority 7 is kern.debug; you'll probably want to look at
 /etc/syslog.conf or local equivalent to find out where the message ended up
 ||#
 
-(deftest simple-unix-client
-    (let ((s (make-instance 'unix-socket :type :datagram)))
+(deftest simple-local-client
+    (let ((s (make-instance 'local-socket :type :datagram)))
       (format t "~A~%" s)
       (socket-connect s "/dev/log")
       (let ((stream (socket-make-stream s :input t :output t :buffering :none)))
        (format stream
-               "<7>bsd-sockets: Don't panic.  We're testing unix-domain client code; this message can safely be ignored")
+               "<7>bsd-sockets: Don't panic.  We're testing local-domain client code; this message can safely be ignored")
        t))
   t)
 
diff --git a/contrib/sb-bsd-sockets/unix.lisp b/contrib/sb-bsd-sockets/unix.lisp
deleted file mode 100644 (file)
index bd9835d..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-(in-package :sb-bsd-sockets)
-
-#|| <h2>File-domain sockets</h2>
-
-File-domain (AF_FILE) sockets are also known as Unix-domain sockets, but were
-renamed by POSIX presumably on the basis that they may be
-available on other systems too.  
-
-A file-domain socket address is a string, which is used to create a node
-in the local filesystem.  This means of course that they cannot be used across
-a network.
-
-||#
-
-(defclass unix-socket (socket)
-  ((family :initform sockint::af-unix)))
-
-(defmethod make-sockaddr-for ((socket unix-socket) &optional sockaddr &rest address &aux (filename (first address)))
-  (let ((sockaddr (or sockaddr (sockint::allocate-sockaddr-un))))
-    (setf (sockint::sockaddr-un-family sockaddr) sockint::af-unix)
-    (when filename
-      (loop for c across filename
-           ;; XXX magic constant ew ew ew.  should grovel this from
-           ;; system headers
-           for i from 0 to (min 107 (1- (length filename)))
-           do (setf (sockint::sockaddr-un-path sockaddr i) (char-code c))
-           finally
-           (setf (sockint::sockaddr-un-path sockaddr (1+ i)) 0)))
-    sockaddr))
-
-(defmethod size-of-sockaddr ((socket unix-socket))
-  sockint::size-of-sockaddr-un)
-
-(defmethod bits-of-sockaddr ((socket unix-socket) sockaddr)
-  "Returns filename of SOCKADDR"
-  (let ((name (sb-c-call::%naturalize-c-string
-              (sb-sys:sap+ (sockint::array-data-address sockaddr)
-                           sockint::offset-of-sockaddr-un-path))))
-    (if (zerop (length name)) nil name)))
-
index d14ddc1..4431879 100644 (file)
@@ -41,7 +41,7 @@ export SBCL SBCL_BUILDING_CONTRIB
 
 gnumake=${GNUMAKE:-gmake}
 for i in contrib/*; do
-    test -d $i && test -e $i/Makefile || continue;
+    test -d $i && test -f $i/test-passed || continue;
     export INSTALL_DIR=$SBCL_HOME/`basename $i `
-    $gnumake -C $i test && ensure_dirs $INSTALL_DIR && $gnumake -C $i install
+    ensure_dirs $INSTALL_DIR && $gnumake -C $i install
 done
index ace42e8..50ae243 100644 (file)
@@ -1,9 +1,8 @@
 #!/bin/sh
 
 # This is a script to be run as part of make.sh. The only time you'd
-# probably want to run it by itself is if you're trying to
-# cross-compile the system or if you're doing some kind of
-# troubleshooting.
+# probably want to run it by itself is if you're cross-compiling the
+# system or doing some kind of troubleshooting.
 
 # This software is part of the SBCL system. See the README file for
 # more information.
@@ -27,7 +26,8 @@ export SBCL SBCL_BUILDING_CONTRIB
 gnumake=${GNUMAKE:-gmake}
 
 for i in contrib/*; do
-    test -d $i && test -e $i/Makefile || continue;
+    test -d $i && test -f $i/Makefile || continue;
     # export INSTALL_DIR=$SBCL_HOME/`basename $i `
-    $gnumake -C $i test 
+    test -f $i/test-passed && rm $i/test-passed 
+    $gnumake -C $i test && touch $i/test-passed
 done
index e74fa1a..514f76e 100644 (file)
@@ -18,4 +18,4 @@
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
 
-"0.7.12.49"
+"0.7.12.50"