;;;-*- mode: lisp; package: common-lisp-user -*- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;File: ccpl:src;ccpl-setup.lisp
;;
;;Copyright c 1990-2011, Peter Lunden / KACOR
;;
;; Creates the cpl package and loads the basic ccpl system
;;
;;Version:
;;
;; 1.0a9
;;
;;History:
;;
;; 2011.12.22 PLu V01.01.00
;; Porting to SBCL on Linux
(eval-when (:compile-toplevel :load-toplevel :execute)
(print 'WTF))
(eval-when (:compile-toplevel :load-toplevel :execute)
(defpackage :ccpl
(:nicknames :cpl)
(:use :common-lisp)
#-SBCL(:import-from :common-lisp-user "*CCPL*")))
(eval-when (:execute)
#+SBCL(defconstant ccpl::+ccpl-home+ (sb-posix:getcwd)))
(unless (find-symbol "*building-ccpl*")
(defvar *building-ccpl* nil))
(defconstant ccpl::+ccpl-version+ '(1 1 0))
(unless (find-symbol "*creation-date*" :ccpl)
(defvar ccpl::*creation-date* nil))
; (namestring #p"Hemma:Prog:Lisp:CCPL:"))
(defconstant ccpl::+machine+
#+(and Allegro SGI4D) "sgi" ;SGI IRIX 5.2 Allegro CL 4.1
#+(and CMU SGI) "cmu-sgi" ;SGI IRIX 5.2 CMU CL 17.x
#+(and (not PPC-TARGET) mcl) "mac" ;Apple MacOS 7.5 MCL 3.0
#+PPC-TARGET "ppc" ;Apple MacOS 7.5 MCL-PPC 3.9
#+(and SBCL LINUX)"sbcl-linux"
)
(defconstant ccpl::+bin-extension+
#-PPC-TARGET (make-pathname :type "fasl")
#+PPC-TARGET (make-pathname :type "pfsl"))
;;;#+Allegro(setq excl:*print-nickname* t)
#-CLIM
(when (find-package :clim)
(pushnew :clim *features*))
#+MCL(unless (find-package :user)
(defpackage :common-lisp-user
(:nicknames user cl-user)))
#+NOT_USED
(setf (logical-pathname-translations "ccpl")
(list
(list "bin;*.*.*" (concatenate 'string "ccpl:bin;" ccpl::+machine+ ";*.*"))
(list "host;*.*.*" (concatenate 'string "ccpl:src;" ccpl::+machine+ ";*.*"))
(list "home;*.*.*" (concatenate 'string ccpl::+ccpl-home+ "*.*"))
(list "ccpl;*.*.*" (concatenate 'string ccpl::+ccpl-home+ "*.*"))
(list "**;*.*.*" (concatenate 'string ccpl::+ccpl-home+ "**:*.*"))))
(setf (logical-pathname-translations "CCPL")
`(("HOME;**;*.*.*" ,(concatenate 'string ccpl::+ccpl-home+ "/**/*.*"))
("BIN;**;*.*.*" ,(logical-pathname "CCPL:HOME;BIN;**;*.*.*"))
("SRC;**;*.*.*" ,(logical-pathname "CCPL:HOME;SRC;**;*.*.*"))
("**;*.*.*" ,(concatenate 'string ccpl::+ccpl-home+ "/*.*"))
))
(setf (logical-pathname-translations "user")
(list
(list "snd;**;*.*" "Disk2:snd:**:*.*")
(list "**;*.*" (user-homedir-pathname))))
(setf (logical-pathname-translations "home")
(list
(list "**;*.*" "Hemma:Ludde:**:*.*")))
#+Allegro
(eval-when (:compile-toplevel :load-toplevel :execute)
(setq system:*load-search-list*
`(:first
*default-pathname-defaults*
(:newest
#.(make-pathname :type "fasl")
#.(make-pathname :type "cl")
#.(make-pathname :type "lisp"))
(:newest
#.(translate-logical-pathname "ccpl:bin;*.fasl")
#.(translate-logical-pathname "ccpl:work;*.cl")
#.(translate-logical-pathname "ccpl:work;*.lisp")
#.(translate-logical-pathname "ccpl:host;*.cl")
#.(translate-logical-pathname "ccpl:host;*.lisp")
#.(translate-logical-pathname "ccpl:src;*.cl")
#.(translate-logical-pathname "ccpl:src;*.lisp"))
excl::*library-code-fasl-pathname*
excl::*library-code-cl-pathname*
excl::*library-code-bin-pathname*))
(setq system:*require-search-list* system:*load-search-list*)
(use-package :cltl1 :ccpl))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Defsystem stuff
;;;
;(load (translate-logical-pathname "ccpl:src;ccpl-package.lisp") :verbose t)
(load (translate-logical-pathname #p"ccpl:src;defsys;defsys-init.lisp"))
#+asdf
(setf asdf:*central-registry*
;; Default directories, usually just the ``current directory''
`(*default-pathname-defaults*
;; Additional places where ASDF can find
;; system definition files
,(translate-logical-pathname "ccpl:src;defsys;")))
#+asdf
(asdf:ensure-source-registry (translate-logical-pathname "ccpl:src;defsys;"))
#-asdf
(pushnew #p"ccpl:ccpl-sys;" ds:*system-directories*)
#+asdf
(asdf:operate 'asdf:load-op :ccpl)
#-asdf
(ds:load-system :kernel)
#+MCL
(progn
(pushnew #4P"ccpl:bin;" *module-search-path*)
(pushnew #4P"ccpl:src;" *module-search-path*)
(pushnew #4P"ccpl:work;" *module-search-path*)
;(import '(ccl:provide ccl:require) :cl)
(import 'ccl:require :cl)
(import 'ccl:require :ccpl)
;(export '(ccl:provide ccl:require) :cl)
#+POWERPC(ccl::add-to-shared-library-search-path "ccplLib")
)
(defvar ccpl:*ccpl-readtable* (copy-readtable nil))
(defun cplk:ccpl-load (&optional module)
(let ((*readtable* ccpl:*ccpl-readtable*))
(if module
(ds:load-system module)
(ds:load-system :ccpl))))
(pushnew :ccpl *features*)