~ubuntu-branches/ubuntu/quantal/gclcvs/quantal

« back to all changes in this revision

Viewing changes to unixport/init_ansi_gcl.lsp.in

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2004-06-24 15:13:46 UTC
  • Revision ID: james.westby@ubuntu.com-20040624151346-xh0xaaktyyp7aorc
Tags: 2.7.0-26
C_GC_OFFSET is 2 on m68k-linux

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(make-package "COMPILER" :use '("LISP"))
 
2
(make-package "SLOOP" :use '("LISP"))
 
3
(make-package "SERROR" :use '("LISP" "SLOOP"))
 
4
(make-package "ANSI-LOOP" :use '("LISP"))
 
5
(make-package "DEFPACKAGE" :use '("LISP"))
 
6
(make-package "TK" :use '("LISP" "SLOOP"))
 
7
 
 
8
@LI-PCL-PACKAGE@
 
9
 
 
10
(in-package :pcl)
 
11
(defvar *the-pcl-package* (find-package :pcl))
 
12
(defun load-truename (&optional (errorp nil))
 
13
  (flet () si:*load-pathname* nil))
 
14
 
 
15
@LI-CLCS-PACKAGE@
 
16
 
 
17
(rename-package 'user 'common-lisp-user '(cl-user user))
 
18
 
 
19
(in-package "SYSTEM")
 
20
 
 
21
(defvar *command-args* nil)
 
22
 ;; if ANY header or license information is printed by the
 
23
 ;; program, then the following License and Enhancement notice
 
24
 ;; must be printed (see License).
 
25
(progn 
 
26
 
 
27
 (system:init-system) 
 
28
 (gbc t)
 
29
 
 
30
(progn
 
31
  (in-package "lisp")
 
32
;; FIXME integrate this into the stream objects et.al. and/or
 
33
;; just use defclass
 
34
  (defstruct (UNBOUND-SLOT (:constructor %make-UNBOUND-SLOT)))
 
35
  (defstruct ( TWO-WAY-STREAM (:constructor %make-TWO-WAY-STREAM)))
 
36
  (defstruct ( SYNONYM-STREAM (:constructor %make-SYNONYM-STREAM)))
 
37
  (defstruct ( STYLE-WARNING (:constructor %make-STYLE-WARNING)))
 
38
  (defstruct ( STRING-STREAM (:constructor %make-STRING-STREAM)))
 
39
  (defstruct ( STREAM (:constructor %make-STREAM)))
 
40
  (defstruct ( READTABLE (:constructor %make-READTABLE) (:copier %copy-readtable)))
 
41
  (defstruct ( READER-ERROR (:constructor %make-READER-ERROR)))
 
42
  (defstruct ( RANDOM-STATE (:constructor %make-RANDOM-STATE) (:predicate %random-state-p)))
 
43
  (defstruct ( PRINT-NOT-READABLE (:constructor %make-PRINT-NOT-READABLE)))
 
44
  (defstruct (PATHNAME (:constructor %make-PATHNAME)))
 
45
  (defstruct ( PACKAGE (:constructor %make-PACKAGE)))
 
46
  (defstruct ( LOGICAL-PATHNAME (:constructor %make-LOGICAL-PATHNAME)))
 
47
  (defstruct ( HASH-TABLE (:constructor %make-HASH-TABLE) (:predicate %hash-table-p)))
 
48
  (defstruct ( FUNCTION (:constructor %make-FUNCTION)))
 
49
  (defstruct (FLOATING-POINT-INVALID-OPERATION (:constructor %make-FLOATING-POINT-INVALID-OPERATION)))
 
50
  (defstruct ( FLOATING-POINT-INEXACT (:constructor %make-FLOATING-POINT-INEXACT)))
 
51
  (defstruct ( FILE-STREAM (:constructor %make-FILE-STREAM)))
 
52
  (defstruct (ECHO-STREAM (:constructor %make-ECHO-STREAM)))
 
53
  (defstruct ( CONCATENATED-STREAM (:constructor %make-CONCATENATED-STREAM)))
 
54
  (defstruct ( BROADCAST-STREAM (:constructor %make-BROADCAST-STREAM))))
 
55
 
 
56
 (in-package "USER")
 
57
 
 
58
 (or lisp::*link-array*
 
59
     (setq lisp::*link-array*
 
60
           (make-array (ash 1 11)  :element-type 'string-char :fill-pointer 0)))
 
61
 (si::use-fast-links t)
 
62
 
 
63
 (let* ((x (append (pathname-directory si::*system-directory*) (list :parent)))
 
64
        (lsp (append x (list "lsp")))
 
65
        (cmpnew (append x (list "cmpnew")))
 
66
        (h (append x (list "h")))
 
67
        (pcl (append x (list "pcl")))
 
68
        (clcs (append x (list "clcs")))
 
69
        (gtk (append x (list "gcl-tk"))))
 
70
   (dolist (d (list lsp cmpnew pcl clcs))
 
71
       (load (make-pathname :name "sys-proclaim" :type "lisp" :directory d)))
 
72
   (load (make-pathname :name "tk-package" :type "lsp" :directory gtk))
 
73
   (load (make-pathname :name "gcl_cmpmain" :type "lsp" :directory cmpnew))
 
74
   (load (make-pathname :name "gcl_lfun_list" :type "lsp" :directory cmpnew))
 
75
   (load (make-pathname :name "gcl_cmpopt" :type "lsp" :directory cmpnew))
 
76
   (load (make-pathname :name "gcl_auto_new" :type "lsp" :directory lsp))
 
77
 
 
78
   (gbc t)
 
79
 
 
80
   (setq compiler::*cmpinclude* "\"cmpinclude.h\"") 
 
81
 
 
82
   (when compiler::*cmpinclude-string*
 
83
     (with-open-file (st (make-pathname :directory h :name "cmpinclude" :type "h"))
 
84
                     (let
 
85
                         ((tem (make-array (file-length st) :element-type 'standard-char
 
86
                                           :static t)))
 
87
                       (if (si::fread tem 0 (length tem) st)
 
88
                           (setq compiler::*cmpinclude-string* tem))))))
 
89
 
 
90
 (setf (symbol-function 'si:clear-compiler-properties)
 
91
       (symbol-function 'compiler::compiler-clear-compiler-properties))
 
92
 (setq system::*old-top-level* (symbol-function 'system:top-level))
 
93
 
 
94
 (defvar si::*lib-directory* (namestring (make-pathname :directory (list :parent))))
 
95
 
 
96
 (defun system::gcl-top-level (&aux tem)
 
97
   (si::set-up-top-level)
 
98
   
 
99
   (if (si::get-command-arg "-compile")
 
100
       (let (;(system::*quit-tag* (cons nil nil))
 
101
                ;(system::*quit-tags* nil) (system::*break-level* '())
 
102
                ;(system::*break-env* nil) (system::*ihs-base* 1)
 
103
                ;(system::*ihs-top* 1) (system::*current-ihs* 1)
 
104
             (*break-enable* nil) result)
 
105
         (setq result
 
106
               (system:error-set
 
107
                '(progn
 
108
                   (compile-file
 
109
                    (si::get-command-arg "-compile")
 
110
                    :output-file 
 
111
                    (or (si::get-command-arg "-o")
 
112
                        (si::get-command-arg "-compile"))
 
113
                    :o-file
 
114
                    (cond ((equalp
 
115
                            (si::get-command-arg "-o-file")
 
116
                            "nil") nil)
 
117
                          ((si::get-command-arg "-o-file" t))
 
118
                          (t t))
 
119
                    :c-file (si::get-command-arg "-c-file" t)
 
120
                    :h-file (si::get-command-arg "-h-file" t)
 
121
                    :data-file (si::get-command-arg "-data-file" t)
 
122
                    :system-p (si::get-command-arg "-system-p" t)))))
 
123
         (bye (if (or compiler::*error-p* (equal result '(nil))) 1 0))))
 
124
   (cond ((si::get-command-arg "-batch")
 
125
          (setq si::*top-level-hook* 'bye))
 
126
         ((si::get-command-arg "-f"))
 
127
         (t (format t si::*system-banner*)))
 
128
   (setq si::*ihs-top* 1)
 
129
   (in-package 'system::user) (incf system::*ihs-top* 2)
 
130
   (funcall system::*old-top-level*))
 
131
 
 
132
 (terpri)
 
133
 (setq si:*inhibit-macro-special* t)
 
134
 (gbc t) (system:reset-gbc-count)
 
135
 
 
136
 (defun system:top-level nil (system::gcl-top-level))
 
137
 
 
138
 (setq compiler::*default-c-file* nil)
 
139
 (setq compiler::*default-h-file* nil)
 
140
 (setq compiler::*default-data-file* nil)
 
141
 (setq compiler::*default-system-p* nil)
 
142
 (setq compiler::*keep-gaz* nil)
 
143
 
 
144
 (setq clcs_shadow
 
145
       '(CONDITIONS::BREAK
 
146
         CONDITIONS::ERROR
 
147
         CONDITIONS::CERROR
 
148
         CONDITIONS::WARN
 
149
         CONDITIONS::CHECK-TYPE
 
150
         CONDITIONS::ASSERT
 
151
         CONDITIONS::ETYPECASE
 
152
         CONDITIONS::CTYPECASE
 
153
         CONDITIONS::ECASE
 
154
         CONDITIONS::CCASE ))
 
155
 
 
156
 (setq lisp_unexport
 
157
       '(LISP::LAMBDA-BLOCK-CLOSURE
 
158
         LISP::BYE
 
159
         LISP::QUIT
 
160
         LISP::EXIT
 
161
         LISP::IEEE-FLOATING-POINT
 
162
         LISP::DEFENTRY
 
163
         LISP::VOID
 
164
         LISP::ALLOCATE-CONTIGUOUS-PAGES
 
165
         LISP::UNSIGNED-SHORT
 
166
         LISP::DOUBLE
 
167
         LISP::BY
 
168
         LISP::GBC
 
169
         LISP::DEFCFUN
 
170
         LISP::SAVE
 
171
         LISP::MAXIMUM-CONTIGUOUS-PAGES
 
172
         LISP::SPICE
 
173
         LISP::DEFLA
 
174
         LISP::ALLOCATED-PAGES
 
175
         LISP::SUN
 
176
         LISP::INT
 
177
         LISP::USE-FAST-LINKS
 
178
         LISP::CFUN
 
179
         LISP::UNSIGNED-CHAR
 
180
         LISP::HELP
 
181
         LISP::HELP*
 
182
         LISP::MACRO
 
183
         LISP::*BREAK-ENABLE*
 
184
         LISP::CLINES
 
185
         LISP::LAMBDA-CLOSURE
 
186
         LISP::OBJECT
 
187
         LISP::FAT-STRING
 
188
         LISP::SIGNED-SHORT
 
189
         LISP::MC68020
 
190
         LISP::LAMBDA-BLOCK
 
191
         LISP::TAG
 
192
         LISP::PROCLAMATION
 
193
         LISP::ALLOCATED-CONTIGUOUS-PAGES
 
194
         LISP::*EVAL-WHEN-COMPILE*
 
195
         LISP::SIGNED-CHAR
 
196
         LISP::*IGNORE-MAXIMUM-PAGES*
 
197
         LISP::*LINK-ARRAY*
 
198
         LISP::KCL
 
199
         LISP::BSD
 
200
         LISP::ALLOCATE-RELOCATABLE-PAGES
 
201
         LISP::ALLOCATE
 
202
         LISP::UNIX
 
203
         LISP::MAXIMUM-ALLOCATABLE-PAGES
 
204
         LISP::ALLOCATED-RELOCATABLE-PAGES
 
205
         LISP::SYSTEM
 
206
         LISP::KYOTO
 
207
         LISP::CCLOSURE))
 
208
 
 
209
;anything in "SYSTEM" which should go in "COMMON-LISP"
 
210
;can be added to shadow-system
 
211
 (setf shadow-system '(system::copy-structure))
 
212
 
 
213
 (do-external-symbols (s "SYSTEM")
 
214
                      (when (member s shadow-system)
 
215
                        (shadowing-import (list s) "COMMON-LISP")
 
216
                        (shadowing-import (list s) "USER")))
 
217
 
 
218
 
 
219
 (do-external-symbols (s "LISP")
 
220
                      (if (not(member s lisp_unexport))
 
221
                          (progn 
 
222
                            (import (list s) "COMMON-LISP")
 
223
                            (import (list s) "USER")) ))
 
224
 
 
225
 (do-external-symbols (s "PCL")
 
226
                      (import (list s) "COMMON-LISP")
 
227
                      (import (list s) "USER"))
 
228
 
 
229
;(shadowing-import (list 'pcl::classp) "SYSTEM")
 
230
 (setf (symbol-function 'si::classp) (symbol-function 'pcl::classp))
 
231
 (setf (symbol-function 'si::class-of) (symbol-function 'pcl::class-of))
 
232
 (setf (symbol-function 'si::class-precedence-list) 
 
233
       (symbol-function 'pcl::class-precedence-list))
 
234
 (setf (symbol-function 'si::find-class) 
 
235
       (symbol-function 'pcl::find-class))
 
236
; (setf (symbol-function 'si::find-class-no-error) 
 
237
;       (symbol-function 'conditions::find-class-no-error))
 
238
 
 
239
 (do-external-symbols (s "CONDITIONS")
 
240
                      (if (member s clcs_shadow)
 
241
                          (progn 
 
242
                            (shadowing-import (list s) "COMMON-LISP")
 
243
                            (shadowing-import (list s) "USER"))
 
244
                        (progn
 
245
                          (import (list s) "COMMON-LISP")
 
246
                          (import (list s) "USER"))))
 
247
 
 
248
 t)
 
249
 
 
250
(progn
 
251
 
 
252
  (dolist (s '(*compile-file-pathname* *compile-file-truename*
 
253
                                       *compile-print* *compile-verbose* *load-pathname* *load-print*
 
254
                                       *load-truename* *print-lines* *print-miser-width*
 
255
                                       *print-pprint-dispatch* *print-right-margin* *read-eval*
 
256
                                       lisp::arithmetic-error broadcast-stream-streams cell-error
 
257
                                       cell-error-name compile compile-file compiler-macro
 
258
                                       compiler-macro-function complement concatenated-stream-streams
 
259
                                       condition control-error copy-pprint-dispatch copy-structure count
 
260
                                       debug define-compiler-macro define-setf-expander define-symbol-macro
 
261
                                       defpackage describe describe-object division-by-zero dynamic-extent
 
262
                                       echo-stream-input-stream echo-stream-output-stream
 
263
                                       ensure-directories-exist fdefinition file-string-length formatter
 
264
                                       function-lambda-expression get-setf-expansion hash-table-rehash-size
 
265
                                       hash-table-rehash-threshold interactive-stream-p
 
266
                                       load-logical-pathname-translations load-time-value
 
267
                                       logical-pathname-translations make-load-form
 
268
                                       make-load-form-saving-slots make-method open-stream-p pathname-match-p
 
269
                                       pprint-dispatch pprint-exit-if-list-exhausted pprint-fill
 
270
                                       pprint-indent pprint-linear pprint-logical-block pprint-newline
 
271
                                       pprint-pop pprint-tab pprint-tabular print-not-readable-object
 
272
                                       print-unreadable-object read-sequence readtable-case row-major-aref
 
273
                                       set-pprint-dispatch simple-condition-format-control
 
274
                                       stream-external-format synonym-stream-symbol
 
275
                                       translate-logical-pathname translate-pathname
 
276
                                       two-way-stream-input-stream two-way-stream-output-stream
 
277
                                       unbound-slot-instance 
 
278
                                       upgraded-complex-part-type wild-pathname-p with-compilation-unit
 
279
                                       with-condition-restarts with-package-iterator with-standard-io-syntax
 
280
                                       write-sequence ))
 
281
    (shadowing-import (list s) "COMMON-LISP"))
 
282
  
 
283
  (use-package "ANSI-LOOP" "COMMON-LISP")
 
284
  (use-package "ANSI-LOOP" "USER")
 
285
  
 
286
  (do-symbols (s "COMMON-LISP")
 
287
              (export (list s) "COMMON-LISP"))
 
288
  
 
289
  (rename-package 'common-lisp 'common-lisp '(cl))
 
290
  
 
291
  (unintern 'system)
 
292
  (unintern 'lisp)
 
293
  (unintern 'compiler)
 
294
  (unintern 'user)
 
295
  (fmakunbound 'si::init-cmp-anon)
 
296
  
 
297
  (makunbound 'clcs_shadow)
 
298
  (makunbound 'lisp_unexport)
 
299
  (makunbound 'shadow-system)
 
300
  (unintern 'clcs_shadow)
 
301
  (unintern 'lisp_unexport)
 
302
  (unintern 'int)
 
303
  (unintern 'shadow-system)
 
304
  
 
305
  (push :common-lisp *features*)
 
306
  (push :ansi-cl *features*)
 
307
  
 
308
  (eval-when (load)
 
309
             (if (fboundp 'get-system-time-zone)
 
310
                 (setf system:*default-time-zone* (get-system-time-zone))
 
311
               (setf system:*default-time-zone* 6)))
 
312
  
 
313
  (if (fboundp 'si::user-init) (si::user-init))
 
314
  (si::set-up-top-level)
 
315
  
 
316
  (setq si::*gcl-extra-version* @LI-EXTVERS@
 
317
        si::*gcl-minor-version* @LI-MINVERS@ 
 
318
        si::*gcl-major-version* @LI-MAJVERS@)
 
319
  (setq compiler::*cc* @LI-CC@)
 
320
  (setq compiler::*ld* @LI-LD@)
 
321
  (setq compiler::*ld-libs* @LI-LD-LIBS@)
 
322
  (setq compiler::*opt-three* @LI-OPT-THREE@)
 
323
  (setq compiler::*opt-two* @LI-OPT-TWO@)
 
324
  (setq compiler::*init-lsp* @LI-INIT-LSP@)
 
325
 
 
326
  (defvar si::*system-banner* (si::default-system-banner))
 
327
 
 
328
  (in-package 'user)
 
329
  (import 'si::info)
 
330
 
 
331
  t)