diff options
author | Daniel Barlow <dan@telent.net> | 2003-02-21 16:21:02 +0000 |
---|---|---|
committer | Daniel Barlow <dan@telent.net> | 2003-02-21 16:21:02 +0000 |
commit | 3b91bf9e9daf110b35dd8d5b6ca5a88e0fb0f13b (patch) | |
tree | 8b86cd8015974ebe67cede5e755d46a34b3fee3e | |
parent | f27b79bae24285a896c9b0ee1a421818eaf8e6db (diff) |
0.7.12.50
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
-rwxr-xr-x | binary-distribution.sh | 2 | ||||
-rw-r--r-- | contrib/sb-bsd-sockets/Makefile | 2 | ||||
-rw-r--r-- | contrib/sb-bsd-sockets/constants.lisp | 13 | ||||
-rw-r--r-- | contrib/sb-bsd-sockets/defpackage.lisp | 13 | ||||
-rw-r--r-- | contrib/sb-bsd-sockets/local.lisp (renamed from contrib/sb-bsd-sockets/unix.lisp) | 18 | ||||
-rw-r--r-- | contrib/sb-bsd-sockets/sb-bsd-sockets.asd | 7 | ||||
-rw-r--r-- | contrib/sb-bsd-sockets/tests.lisp | 8 | ||||
-rw-r--r-- | install.sh | 4 | ||||
-rw-r--r-- | make-target-contrib.sh | 10 | ||||
-rw-r--r-- | version.lisp-expr | 2 |
10 files changed, 41 insertions, 38 deletions
diff --git a/binary-distribution.sh b/binary-distribution.sh index 0bd5557c4..fc6cd3714 100755 --- a/binary-distribution.sh +++ b/binary-distribution.sh @@ -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` diff --git a/contrib/sb-bsd-sockets/Makefile b/contrib/sb-bsd-sockets/Makefile index ebb6c68dc..0cfab33c0 100644 --- a/contrib/sb-bsd-sockets/Makefile +++ b/contrib/sb-bsd-sockets/Makefile @@ -1,4 +1,6 @@ SYSTEM=sb-bsd-sockets +CC=gcc +export CC all: $(MAKE) -C ../asdf diff --git a/contrib/sb-bsd-sockets/constants.lisp b/contrib/sb-bsd-sockets/constants.lisp index e79288838..e52aab1a5 100644 --- a/contrib/sb-bsd-sockets/constants.lisp +++ b/contrib/sb-bsd-sockets/constants.lisp @@ -11,12 +11,13 @@ ;;; 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" diff --git a/contrib/sb-bsd-sockets/defpackage.lisp b/contrib/sb-bsd-sockets/defpackage.lisp index 58e52704d..f424ee8d3 100644 --- a/contrib/sb-bsd-sockets/defpackage.lisp +++ b/contrib/sb-bsd-sockets/defpackage.lisp @@ -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, &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/unix.lisp b/contrib/sb-bsd-sockets/local.lisp index bd9835dd2..363f05147 100644 --- a/contrib/sb-bsd-sockets/unix.lisp +++ b/contrib/sb-bsd-sockets/local.lisp @@ -1,23 +1,23 @@ (in-package :sb-bsd-sockets) -#|| <h2>File-domain sockets</h2> +#|| <h2>Local (unix) domain sockets</h2> -File-domain (AF_FILE) sockets are also known as Unix-domain sockets, but were +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 file-domain socket address is a string, which is used to create a node +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 unix-socket (socket) - ((family :initform sockint::af-unix))) +(defclass local-socket (socket) + ((family :initform sockint::af-local))) -(defmethod make-sockaddr-for ((socket unix-socket) &optional sockaddr &rest address &aux (filename (first address))) +(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-unix) + (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 @@ -28,10 +28,10 @@ a network. (setf (sockint::sockaddr-un-path sockaddr (1+ i)) 0))) sockaddr)) -(defmethod size-of-sockaddr ((socket unix-socket)) +(defmethod size-of-sockaddr ((socket local-socket)) sockint::size-of-sockaddr-un) -(defmethod bits-of-sockaddr ((socket unix-socket) sockaddr) +(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) diff --git a/contrib/sb-bsd-sockets/sb-bsd-sockets.asd b/contrib/sb-bsd-sockets/sb-bsd-sockets.asd index d9125247b..a5ab7d2e2 100644 --- a/contrib/sb-bsd-sockets/sb-bsd-sockets.asd +++ b/contrib/sb-bsd-sockets/sb-bsd-sockets.asd @@ -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))) @@ -111,7 +110,7 @@ (: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")) diff --git a/contrib/sb-bsd-sockets/tests.lisp b/contrib/sb-bsd-sockets/tests.lisp index 40af6c25e..deb208f00 100644 --- a/contrib/sb-bsd-sockets/tests.lisp +++ b/contrib/sb-bsd-sockets/tests.lisp @@ -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/install.sh b/install.sh index d14ddc1e3..44318793c 100644 --- a/install.sh +++ b/install.sh @@ -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 diff --git a/make-target-contrib.sh b/make-target-contrib.sh index ace42e847..50ae24353 100644 --- a/make-target-contrib.sh +++ b/make-target-contrib.sh @@ -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 diff --git a/version.lisp-expr b/version.lisp-expr index e74fa1a2e..514f76e9c 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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" |