source: trunk/source/level-1/l1-boot-1.lisp @ 11887

Last change on this file since 11887 was 11768, checked in by gz, 11 years ago

Propagate r11762-r11764 to trunk

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 KB
Line 
1;;;-*-Mode: LISP; Package: CCL -*-
2;;;
3;;;   Copyright (C) 1994-2001 Digitool, Inc
4;;;   This file is part of OpenMCL. 
5;;;
6;;;   OpenMCL is licensed under the terms of the Lisp Lesser GNU Public
7;;;   License , known as the LLGPL and distributed with OpenMCL as the
8;;;   file "LICENSE".  The LLGPL consists of a preamble and the LGPL,
9;;;   which is distributed with OpenMCL as the file "LGPL".  Where these
10;;;   conflict, the preamble takes precedence. 
11;;;
12;;;   OpenMCL is referenced in the preamble as the "LIBRARY."
13;;;
14;;;   The LLGPL is also available online at
15;;;   http://opensource.franz.com/preamble.html
16
17;; L1-boot.lisp
18
19(in-package "CCL")
20
21(defparameter *gensym-counter* 0 "counter for generating unique GENSYM symbols")
22
23(defparameter *inhibit-greeting* nil)
24
25;the below 3 variables are expected to be redefined in the user's init file
26(defparameter *short-site-name* nil)
27(defparameter *long-site-name* nil)
28#|
29(defparameter *machine-instance* nil)
30|#
31
32(defun lisp-implementation-type ()
33  #+clozure-common-lisp "Clozure Common Lisp"
34  #-clozure-common-lisp "OpenMCL")
35
36
37(defparameter *platform-os-names*
38  `((,platform-os-vxworks . :vxwork)
39    (,platform-os-linux . :linux)
40    (,platform-os-solaris . :solaris)
41    (,platform-os-darwin . :darwin)
42    (,platform-os-freebsd . :freebsd)
43    (,platform-os-windows . :windows)))
44
45(defparameter *platform-cpu-names*
46  `((,platform-cpu-ppc . :ppc)
47    (,platform-cpu-sparc . :sparc)
48    (,platform-cpu-x86 . :x86)))
49
50(defun host-platform ()
51  (let* ((pf (%get-kernel-global 'host-platform)))
52    (values
53     (or (cdr (assoc (logand pf platform-os-mask)
54                     *platform-os-names*))
55         :unknown)
56     (if (logtest pf platform-word-size-mask)
57       64
58       32)
59     (or (cdr (assoc (logand pf platform-cpu-mask)
60                     *platform-cpu-names*))
61         :unknown))))
62
63
64(defun platform-description ()
65  (multiple-value-bind (os bits cpu) (host-platform)
66    (format nil "~a~a~d" (string-capitalize os) cpu bits)))
67
68(defun lisp-implementation-version ()
69  (%str-cat "Version " (format nil *openmcl-version* (platform-description))))
70
71
72
73
74(defun replace-base-translation (host-dir new-base-dir)
75  (let* ((host (pathname-host host-dir))
76         (device (pathname-device new-base-dir))
77         (host-dir (full-pathname host-dir))
78         (trans (logical-pathname-translations host))
79         (host-wild (merge-pathnames "**/*.*" host-dir)))
80    (setq host-dir (pathname-directory host-dir))
81    (setq new-base-dir (pathname-directory new-base-dir))
82    (setf 
83     (logical-pathname-translations host)
84     (mapcar
85      #'(lambda (pair)
86          (let ((rhs (cadr pair)))
87            (if (and (physical-pathname-p rhs)
88                     (pathname-match-p rhs host-wild))
89              (list (car pair)
90                    (merge-pathnames 
91                     (make-pathname 
92                      :defaults nil
93                      :device device
94                      :directory (append new-base-dir
95                                         (nthcdr (length host-dir) 
96                                                 (pathname-directory rhs))))
97                     rhs))
98              pair)))
99      trans))))
100
101(defun set-ccl-directory (path)
102  (replace-base-translation "ccl:" (translate-logical-pathname path)))
103
104
105
106
107; only do these if exist
108(defun init-logical-directories ()
109  (replace-base-translation "home:"  (user-homedir-pathname))
110  (replace-base-translation "ccl:" (ccl-directory)))
111
112(push #'init-logical-directories *lisp-system-pointer-functions*)
113
114
115(catch :toplevel
116  (init-logical-directories)
117  )
118
119
120
121
122
123
Note: See TracBrowser for help on using the repository browser.