CLX registers itself with *MODULES* and requires SOCKETS. Split SOCKETS's package definition into a different file so that CLX can load it before being compiled.

This commit is contained in:
Juan Jose Garcia Ripoll 2009-02-24 12:45:54 +01:00
parent 402e59f82f
commit af158f819a
5 changed files with 61 additions and 38 deletions

View file

@ -0,0 +1,24 @@
;; -*- Mode: Lisp; Syntax: Common-Lisp -*-
;; $Id$
;; This file is based on SBCL's SB-BSD-SOCKET module and has been
;; heavily modified to work with ECL by Julian Stecklina.
;; Port to Windows Sockets contributed by M. Goffioul.
;; You may do whatever you want with this file. (PUBLIC DOMAIN)
;; Trivial stuff is copied from SBCL's SB-BSD-SOCKETS, which is also
;; in the public domain.
(defpackage "SB-BSD-SOCKETS"
(:use "CL" "FFI" "SI")
(:export "GET-HOST-BY-NAME" "GET-HOST-BY-ADDRESS"
"SOCKET-BIND" "SOCKET-ACCEPT" "SOCKET-CONNECT"
"SOCKET-PEERNAME" "SOCKET-NAME" "SOCKET-LISTEN"
"SOCKET-RECEIVE" "SOCKET-CLOSE" "SOCKET-MAKE-STREAM"
"GET-PROTOCOL-BY-NAME" "MAKE-INET-ADDRESS" "LOCAL-SOCKET"
"SOCKET" "INET-SOCKET" "SOCKET-FILE-DESCRIPTOR" #+:win32 "NAMED-PIPE-SOCKET"
"SOCKET-FAMILY" "SOCKET-PROTOCOL" "SOCKET-TYPE"
"SOCKET-ERROR" "NAME-SERVICE-ERROR" "NON-BLOCKING-MODE"
"HOST-ENT-NAME" "HOST-ENT-ALIASES" "HOST-ENT-ADDRESS-TYPE"
"HOST-ENT-ADDRESSES" "HOST-ENT" "HOST-ENT-ADDRESS" "SOCKET-SEND"))

View file

@ -10,18 +10,6 @@
;; Trivial stuff is copied from SBCL's SB-BSD-SOCKETS, which is also
;; in the public domain.
(defpackage "SB-BSD-SOCKETS"
(:use "CL" "FFI" "SI")
(:export "GET-HOST-BY-NAME" "GET-HOST-BY-ADDRESS"
"SOCKET-BIND" "SOCKET-ACCEPT" "SOCKET-CONNECT"
"SOCKET-PEERNAME" "SOCKET-NAME" "SOCKET-LISTEN"
"SOCKET-RECEIVE" "SOCKET-CLOSE" "SOCKET-MAKE-STREAM"
"GET-PROTOCOL-BY-NAME" "MAKE-INET-ADDRESS" "LOCAL-SOCKET"
"SOCKET" "INET-SOCKET" "SOCKET-FILE-DESCRIPTOR" #+:win32 "NAMED-PIPE-SOCKET"
"SOCKET-FAMILY" "SOCKET-PROTOCOL" "SOCKET-TYPE"
"SOCKET-ERROR" "NAME-SERVICE-ERROR" "NON-BLOCKING-MODE"
"HOST-ENT-NAME" "HOST-ENT-ALIASES" "HOST-ENT-ADDRESS-TYPE"
"HOST-ENT-ADDRESSES" "HOST-ENT" "HOST-ENT-ADDRESS" "SOCKET-SEND"))
(in-package "SB-BSD-SOCKETS")
;; Obviously this requires the one or other form of BSD compatible

View file

@ -61,6 +61,9 @@ ECL 9.1.0:
- Fixed problems with C/C++ forward declarations of static arrays in compiled
code that prevented ECL from building with a C++ compiler.
- The CLX module now adds itself to *MODULES* and also requires SOCKETS
automatically on startup.
* AMOP:
- In DEFCLASS, the :TYPE of slots was ignored.

View file

@ -227,10 +227,11 @@
#+clx-ansi-common-lisp
(common-lisp:in-package :common-lisp-user)
#+(and ecl (not stage1))
(eval-when (:compile-toplevel :load-toplevel :execute)
#+ecl
(eval-when (#-stage1 :compile-toplevel :load-toplevel #-stage1 :execute)
(require 'sockets))
#+clx-ansi-common-lisp
(defpackage xlib
(:use common-lisp)

View file

@ -175,7 +175,8 @@
#+WANTS-SOCKETS
(build-module "sockets"
'("ext:sockets;sockets.lisp")
'("ext:sockets;package.lisp"
"ext:sockets;sockets.lisp")
:dir "build:ext;"
:prefix "EXT")
@ -205,29 +206,35 @@
;;;
#+WANTS-CLX
(let ((+clx-src-files+ '("src:clx;package.lisp"
"src:clx;depdefs.lisp"
"src:clx;clx.lisp"
"src:clx;dependent.lisp"
"src:clx;macros.lisp"
"src:clx;bufmac.lisp"
"src:clx;buffer.lisp"
"src:clx;display.lisp"
"src:clx;gcontext.lisp"
"src:clx;input.lisp"
"src:clx;requests.lisp"
"src:clx;fonts.lisp"
"src:clx;graphics.lisp"
"src:clx;text.lisp"
"src:clx;attributes.lisp"
"src:clx;translate.lisp"
"src:clx;keysyms.lisp"
"src:clx;manager.lisp"
"src:clx;image.lisp"
"src:clx;resource.lisp"))
#+:msvc
(c::*cc-flags* (concatenate 'string c::*cc-flags* " -Zm150")))
(pushnew :clx-ansi-common-lisp *features*)
(let* ((*features* (cons :clx-ansi-common-lisp *features*))
(+clx-src-files+ '("src:clx;package.lisp"
"src:clx;depdefs.lisp"
"src:clx;clx.lisp"
"src:clx;dependent.lisp"
"src:clx;macros.lisp"
"src:clx;bufmac.lisp"
"src:clx;buffer.lisp"
"src:clx;display.lisp"
"src:clx;gcontext.lisp"
"src:clx;input.lisp"
"src:clx;requests.lisp"
"src:clx;fonts.lisp"
"src:clx;graphics.lisp"
"src:clx;text.lisp"
"src:clx;attributes.lisp"
"src:clx;translate.lisp"
"src:clx;keysyms.lisp"
"src:clx;manager.lisp"
"src:clx;image.lisp"
"src:clx;resource.lisp"
"build:clx;module.lisp"))
#+:msvc
(c::*cc-flags* (concatenate 'string c::*cc-flags* " -Zm150")))
(with-open-file (s "build:clx;module.lisp" :direction :output :if-exists :overwrite
:if-does-not-exist :create)
(print '(provide :clx) s))
(unless (find-package "SB-BSD-SOCKETS")
(load "ext:sockets;package.lisp"))
(mapcar #'load +clx-src-files+)
(build-module "clx" +clx-src-files+ :dir "build:clx;" :prefix "CLX"))