~ubuntu-branches/ubuntu/karmic/maxima/karmic

« back to all changes in this revision

Viewing changes to lisp-utils/defsystem.lisp

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2004-11-13 18:39:14 UTC
  • mto: (2.1.2 hoary) (3.2.1 sid) (1.1.5 upstream)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20041113183914-ttig0evwuatnqosl
Tags: upstream-5.9.1
ImportĀ upstreamĀ versionĀ 5.9.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
;;; works based upon this Software are permitted, as long as the
41
41
;;; following conditions are met:
42
42
 
43
 
;;;      o this copyright notice is included intact and is prominently
44
 
;;;        visible in the Software
45
 
;;;      o distribution of a modification to the Software have been
46
 
;;;        previously submitted to the maintainers; if the maintainers
47
 
;;;        decide not to include the submitted changes, the "full
48
 
;;;        name" of the re-distributed Software ("MK:DEFSYSTEM", or
49
 
;;;        "MAKE:DEFSYSTEM", or "MK-DEFSYSTEM") must be changed.
 
43
;;;    o this copyright notice is included intact and is prominently
 
44
;;;      visible in the Software
 
45
;;;    o if modifications have been made to the source code of the
 
46
;;;      this package that have not been adopted for inclusion in the
 
47
;;;      official version of the Software as maintained by the Copyright
 
48
;;;      holders, then the modified package MUST CLEARLY identify that
 
49
;;;      such package is a non-standard and non-official version of
 
50
;;;      the Software.  Furthermore, it is strongly encouraged that any
 
51
;;;      modifications made to the Software be sent via e-mail to the
 
52
;;;      MK-DEFSYSTEM maintainers for consideration of inclusion in the
 
53
;;;      official MK-DEFSYSTEM package.
50
54
 
51
55
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
52
56
;;; EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
608
612
;;;       Harlequin LispWorks
609
613
;;;       CLISP (CLISP3 [SPARC])
610
614
;;;       Symbolics XL12000 (Genera 8.3)
 
615
;;;       Scieneer Common Lisp (SCL) 1.1
 
616
;;;       Macintosh Common Lisp
 
617
;;;       ECL
611
618
;;;
612
619
;;;    DEFSYSTEM needs to be tested in the following lisps:
613
 
;;;       Macintosh Common Lisp
 
620
;;;       OpenMCL
614
621
;;;       Symbolics Common Lisp (8.0)
615
622
;;;       KCL (June 3, 1987 or later)
616
623
;;;       AKCL (1.86, June 30, 1987 or later)
854
861
;;; Now that ANSI CL includes PROVIDE and REQUIRE again, is this code
855
862
;;; necessary?
856
863
 
857
 
#-(or (and :CMU (not :new-compiler))
 
864
#-(or :CMU
858
865
      :vms
859
866
      :mcl
860
867
      :lispworks
861
868
      :clisp
 
869
      :gcl
862
870
      :sbcl
863
871
      :cormanlisp
 
872
      :scl
864
873
      (and allegro-version>= (version>= 4 1)))
865
 
(eval-when #-(or :lucid :cmu17 :cmu18 :gcl)
 
874
(eval-when #-(or :lucid :gcl)
866
875
           (:compile-toplevel :load-toplevel :execute)
867
 
           #+(or :lucid :cmu17 :cmu18 :gcl)
 
876
           #+(or :lucid :gcl)
868
877
           (compile load eval)
869
878
 
870
879
  (unless (or (fboundp 'lisp::require)
967
976
                  (setf pathname nil))))
968
977
          ;; Now that we've got the list of pathnames, let's load them.
969
978
          (dolist (pname pathname t)
970
 
            (load pname :verbose nil)))))))
 
979
            (load pname :verbose nil))))))
 
980
  ) ; eval-when
971
981
 
972
982
;;; ********************************
973
983
;;; Set up Package *****************
980
990
;;; MAKE package. A nice side-effect is that the short nickname
981
991
;;; MK is my initials.
982
992
 
983
 
#+clisp
984
 
(defpackage "MAKE" (:use "COMMON-LISP") (:nicknames "MK"))
985
 
 
986
 
#+cormanlisp
 
993
#+(or clisp cormanlisp ecl (and gcl defpackage) sbcl)
987
994
(defpackage "MAKE" (:use "COMMON-LISP") (:nicknames "MK"))
988
995
 
989
996
#+gcl
990
 
(defpackage "MAKE" (:use "LISP") (:nicknames "MK"))
 
997
(defpackage "MAKE" (:use "LISP" "SYSTEM") (:nicknames "MK")
 
998
             (:import-from conditions ignore-errors))
991
999
 
992
 
#-(or :sbcl :cltl2 :lispworks)
 
1000
#-(or :sbcl :cltl2 :lispworks :ecl :scl)
993
1001
(in-package "MAKE" :nicknames '("MK"))
994
1002
 
995
1003
;;; For CLtL2 compatible lisps...
1037
1045
(defpackage "MAKE" (:use "COMMON-LISP")
1038
1046
  (:nicknames "MK"))
1039
1047
 
1040
 
#+(or :cltl2 :lispworks)
 
1048
#+:scl
 
1049
(defpackage :make (:use :common-lisp)
 
1050
  (:nicknames :mk))
 
1051
 
 
1052
#+(or :cltl2 :lispworks :scl)
1041
1053
(eval-when (compile load eval)
1042
1054
  (in-package "MAKE"))
1043
1055
 
 
1056
#+ecl
 
1057
(in-package "MAKE")
 
1058
 
1044
1059
;;; *** Marco Antoniotti <marcoxa@icsi.berkeley.edu> 19970105
1045
1060
;;; 'provide' is not esternal in 'CLTL1' in Allegro v 4.1
1046
1061
#+(and :excl :allegro-v4.0 :cltl2)
1048
1063
#+(and :excl :allegro-v4.0 :cltl2)
1049
1064
(provide 'make)
1050
1065
 
1051
 
#+:mcl
 
1066
#+:openmcl
 
1067
(cl:provide 'make)
 
1068
 
 
1069
#+(and :mcl (not :openmcl))
1052
1070
(ccl:provide 'make)
1053
1071
 
1054
1072
#+(and :cltl2 (not (or (and :excl (or :allegro-v4.0 :allegro-v4.1)) :mcl)))
1155
1173
                    #+(or :cltl2 :lispworks) "COMMON-LISP-USER"))
1156
1174
|#
1157
1175
 
1158
 
#-(or :PCL :CLOS)
 
1176
#-(or :PCL :CLOS :scl)
1159
1177
(when (find-package "PCL")
1160
1178
  (pushnew :pcl *modules*)
1161
1179
  (pushnew :pcl *features*))
1192
1210
#-cormanlisp
1193
1211
(defun home-subdirectory (directory)
1194
1212
  (concatenate 'string
1195
 
        #+(or :sbcl :cmu) "home:"
1196
 
        #-(or :sbcl :cmu) (let ((homedir (user-homedir-pathname)))
1197
 
                 (or (when homedir (namestring homedir))
1198
 
                     "~/"))
 
1213
        #+(or :sbcl :cmu :scl)
 
1214
        "home:"
 
1215
        #-(or :sbcl :cmu :scl)
 
1216
        (let ((homedir (user-homedir-pathname)))
 
1217
          (or (and homedir (namestring homedir))
 
1218
              "~/"))
1199
1219
        directory))
1200
1220
 
1201
1221
#+cormanlisp
1230
1250
    #+ACLPC      (current-directory)
1231
1251
    #+:allegro   (excl:current-directory)
1232
1252
    #+:sbcl      (progn *default-pathname-defaults*)
1233
 
    #+:CMU       (ext:default-directory)
 
1253
    #+(or :cmu :scl)       (ext:default-directory)
1234
1254
    ;; *** Marco Antoniotti <marcoxa@icsi.berkeley.edu>
1235
1255
    ;; Somehow it is better to qualify default-directory in CMU with
1236
1256
    ;; the appropriate package (i.e. "EXTENSIONS".)
1266
1286
 
1267
1287
(defun add-registry-location (pathname)
1268
1288
  "Adds a path to the central registry."
1269
 
  (push pathname *central-registry*))
 
1289
  (pushnew pathname *central-registry* :test #'equal))
1270
1290
 
1271
1291
(defvar *bin-subdir* ".bin/"
1272
1292
  "The subdirectory of an AFS directory where the binaries are really kept.")
1330
1350
    (pushnew :ibm-rt-pc *features*))
1331
1351
  )
1332
1352
 
1333
 
#+:gcl(defun compile-file-pathname (x) x)
1334
1353
;;; *filename-extensions* is a cons of the source and binary extensions.
1335
1354
(defvar *filename-extensions*
1336
1355
  (car `(#+(and Symbolics Lispm)              ("lisp" . "bin")
1339
1358
         #+ACLPC                              ("lsp"  . "fsl")
1340
1359
         #+CLISP                              ("lsp"  . "fas")
1341
1360
         #+KCL                                ("lsp"  . "o")
 
1361
         #+ECL                                ("lsp"  . "so")
1342
1362
         #+IBCL                               ("lsp"  . "o")
1343
1363
         #+Xerox                              ("lisp" . "dfasl")
1344
1364
         ;; Lucid on Silicon Graphics
1357
1377
         ;; PA is Precision Architecture, HP's 9000/800 RISC cpu
1358
1378
         #+(and Lucid PA)                     ("lisp" . "hbin")
1359
1379
         #+excl ("cl"   . ,(pathname-type (compile-file-pathname "foo.cl")))
1360
 
         #+CMU  ("lisp" . ,(or (c:backend-fasl-file-type c:*backend*) "fasl"))
 
1380
         #+(or :cmu :scl)  ("lisp" . ,(or (c:backend-fasl-file-type c:*backend*) "fasl"))
1361
1381
;        #+(and :CMU (not (or :sgi :sparc)))  ("lisp" . "fasl")
1362
1382
;        #+(and :CMU :sgi)                    ("lisp" . "sgif")
1363
1383
;        #+(and :CMU :sparc)                  ("lisp" . "sparcf")
1366
1386
         #+TI ("lisp" . #.(string (si::local-binary-file-type)))
1367
1387
         #+:gclisp                            ("LSP"  . "F2S")
1368
1388
         #+pyramid                            ("clisp" . "o")
1369
 
         #+:coral                             ("lisp" . "pfsl")
 
1389
 
1370
1390
         ;; Harlequin LispWorks
1371
1391
         #+:lispworks         ("lisp" . ,COMPILER:*FASL-EXTENSION-STRING*)
1372
1392
;        #+(and :sun4 :lispworks)             ("lisp" . "wfasl")
1373
1393
;        #+(and :mips :lispworks)             ("lisp" . "mfasl")
1374
 
         #+:mcl                               ("lisp" . "pfsl")
1375
 
         #+:gcl                                ("lsp" . "o")
 
1394
         #+:mcl                               ("lisp" . ,(pathname-type (compile-file-pathname "foo.lisp")))
 
1395
         #+:coral                             ("lisp" . "fasl")
1376
1396
 
1377
1397
         ;; Otherwise,
1378
1398
         ("lisp" . ,(pathname-type (compile-file-pathname "foo.lisp")))))
1412
1432
;;; ********************************
1413
1433
;;; Component Operation Definition *
1414
1434
;;; ********************************
1415
 
;jfa (eval-when (:compile-toplevel :load-toplevel :execute)
1416
 
(eval-when #-(or :lucid :cmu17 :cmu18 :gcl)
1417
 
           (:compile-toplevel :load-toplevel :execute)
1418
 
           #+(or :lucid :cmu17 :cmu18 :gcl)
1419
 
           (compile load eval)
 
1435
(eval-when #-(or :lucid :gcl)
 
1436
           (:compile-toplevel :load-toplevel :execute)
 
1437
           #+(or :lucid :gcl)
 
1438
           (compile load eval)
1420
1439
(defvar *version-dir* nil
1421
1440
  "The version subdir. bound in operate-on-system.")
1422
1441
(defvar *version-replace* nil
1504
1523
                           "sbcl" " " (lisp-implementation-version))
1505
1524
  #+cmu       (concatenate 'string
1506
1525
                "cmu" " " (lisp-implementation-version))
 
1526
  #+scl       (concatenate 'string
 
1527
                "scl" " " (lisp-implementation-version))
 
1528
 
1507
1529
  #+kcl       "kcl"
 
1530
  #+IBCL      "ibcl"
1508
1531
  #+akcl      "akcl"
1509
1532
  #+gcl       "gcl"
 
1533
  #+ecl       "ecl"
1510
1534
  #+lucid     "lucid"
1511
1535
  #+ACLPC     "aclpc"
1512
1536
  #+CLISP     "clisp"
1513
 
  #+KCL       "kcl"
1514
 
  #+IBCL      "ibcl"
1515
1537
  #+Xerox     "xerox"
1516
1538
  #+symbolics "symbolics"
1517
1539
  #+mcl       "mcl"
1530
1552
                  #+(and :sgi :allegro-version>= (version>= 4 2))
1531
1553
                  (machine-version)))
1532
1554
        (software (software-type-translation
1533
 
                   #-(and :sgi (or :cmu :sbcl
 
1555
                   #-(and :sgi (or :cmu :sbcl :scl
1534
1556
                                   (and :allegro-version>= (version>= 4 2))))
1535
1557
                   (software-type)
1536
 
                   #+(and :sgi (or :cmu :sbcl
 
1558
                   #+(and :sgi (or :cmu :sbcl :scl
1537
1559
                                   (and :allegro-version>= (version>= 4 2))))
1538
1560
                   (operating-system-version)))
1539
1561
        (lisp (compiler-type-translation (compiler-version))))
1857
1879
     (make-pathname :host host
1858
1880
                    :device device
1859
1881
                    :directory
1860
 
                    #-(and :cmu (not (or :cmu17 :cmu18)))
1861
1882
                    directory
1862
 
                    #+(and :cmu (not (or :cmu17 :cmu18)))
1863
 
                    (coerce directory 'simple-vector)
1864
1883
                    :name
1865
1884
                    #-(or :sbcl :MCL :clisp) rel-file
1866
1885
                    #+(or :sbcl :MCL :clisp) rel-name
2001
2020
  (etypecase relative-dir
2002
2021
    (string (setq relative-dir (parse-namestring relative-dir)))
2003
2022
    (pathname #| do nothing |#))
2004
 
  
 
2023
 
2005
2024
  (translate-logical-pathname
2006
2025
   (merge-pathnames relative-dir absolute-dir)))
2007
2026
 
2014
2033
  (setq absolute-dir (logical-pathname absolute-dir))
2015
2034
  (etypecase relative-dir
2016
2035
    (string (setq relative-dir (parse-namestring relative-dir)))
2017
 
    (pathname #| do nothing |#))
 
2036
    (pathname ))
2018
2037
 
2019
2038
  (translate-logical-pathname
2020
2039
   (make-pathname
2158
2177
 
2159
2178
||#
2160
2179
 
2161
 
 
2162
 
 
2163
 
 
 
2180
;;; The following is a change proposed by DTC for SCL.
 
2181
;;; Maybe it could be used all the time.
 
2182
 
 
2183
#-scl
2164
2184
(defun new-file-type (pathname type)
2165
2185
  ;; why not (make-pathname :type type :defaults pathname)?
2166
2186
  (make-pathname
2172
2192
   :version (pathname-version pathname)))
2173
2193
 
2174
2194
 
 
2195
#+scl
 
2196
(defun new-file-type (pathname type)
 
2197
  ;; why not (make-pathname :type type :defaults pathname)?
 
2198
  (make-pathname
 
2199
   :host (pathname-host pathname :case :common)
 
2200
   :device (pathname-device pathname :case :common)
 
2201
   :directory (pathname-directory pathname :case :common)
 
2202
   :name (pathname-name pathname :case :common)
 
2203
   :type (string-upcase type)
 
2204
   :version (pathname-version pathname :case :common)))
 
2205
 
 
2206
 
2175
2207
 
2176
2208
;;; ********************************
2177
2209
;;; Component Defstruct ************
2303
2335
            (when path
2304
2336
              (gethash path *file-load-time-table*)))))))))
2305
2337
 
2306
 
#-(or :cmu17 :cmu18)
 
2338
#-(or :cmu)
2307
2339
(defsetf component-load-time (component) (value)
2308
2340
  `(when ,component
2309
2341
    (etypecase ,component
2328
2360
                    ,value)))))))
2329
2361
    ,value))
2330
2362
 
2331
 
#+(or :cmu17 :cmu18)
 
2363
#+(or :cmu)
2332
2364
(defun (setf component-load-time) (value component)
2333
2365
  (declare
2334
2366
   (type (or null string pathname component) component)
2622
2654
            (make-pathname :host (when (component-host component)
2623
2655
                                   ;; MCL2.0b1 and ACLPC cause an error on
2624
2656
                                   ;; (pathname-host nil)
2625
 
                                   (pathname-host (component-host component)))
2626
 
                           :directory (pathname-directory pathname)
 
2657
                                   (pathname-host (component-host component)
 
2658
                                                  #+scl :case #+scl :common
 
2659
                                                  ))
 
2660
                           :directory (pathname-directory pathname
 
2661
                                                  #+scl :case #+scl :common
 
2662
                                                  )
2627
2663
                           ;; Use :directory instead of :defaults
2628
 
                           :name (pathname-name pathname)
2629
 
                           :type (component-extension component type)
 
2664
                           :name (pathname-name pathname
 
2665
                                                  #+scl :case #+scl :common
 
2666
                                                  )
 
2667
                           :type #-scl (component-extension component type)
 
2668
                                 #+scl (string-upcase
 
2669
                                        (component-extension component type))
2630
2670
                           :device
2631
 
                           #+(and :CMU (not (or :cmu17 :cmu18)))
2632
 
                           :absolute
2633
2671
                           #+sbcl
2634
2672
                           :unspecific
2635
 
                           #-(or :sbcl (and :CMU (not (or :cmu17 :cmu18))))
 
2673
                           #-(or :sbcl)
2636
2674
                           (let ((dev (component-device component)))
2637
2675
                             (if dev
2638
 
                                 (pathname-device dev)
2639
 
                                 (pathname-device pathname)))
 
2676
                                 (pathname-device dev
 
2677
                                                  #+scl :case #+scl :common
 
2678
                                                  )
 
2679
                                 (pathname-device pathname
 
2680
                                                  #+scl :case #+scl :common
 
2681
                                                  )))
2640
2682
                           ;; :version :newest
2641
2683
                           ))))))
2642
2684
 
2748
2790
    ;; Return the component.
2749
2791
    component))
2750
2792
 
 
2793
 
 
2794
;;; defsystem --
 
2795
;;; The main macro.
 
2796
;;;
 
2797
;;; 2002-11-22 Marco Antoniotti
 
2798
;;; Added code to achieve a first cut "pathname less" operation,
 
2799
;;; following the ideas in ASDF.  If the DEFSYSTEM form is loaded from
 
2800
;;; a file, then the location of the file (intended as a directory) is
 
2801
;;; computed from *LOAD-PATHNAME* and stored as the :SOURCE-PATHNAME
 
2802
;;; of the system.
 
2803
 
2751
2804
(defmacro defsystem (name &rest definition-body)
 
2805
  (unless (find :source-pathname definition-body)
 
2806
    (setf definition-body
 
2807
          (list* :source-pathname
 
2808
                 '(when *load-pathname*
 
2809
                        (make-pathname :name nil
 
2810
                                       :type nil
 
2811
                                       :defaults *load-pathname*))
 
2812
                 definition-body)))
2752
2813
  `(create-component :defsystem ',name ',definition-body nil 0))
2753
2814
 
2754
2815
(defun create-component-pathnames (component parent)
3305
3366
  (declare #-(or :cltl2 :ansi-cl) (ignore override-compilation-unit))
3306
3367
  (unwind-protect
3307
3368
      ;; Protect the undribble.
3308
 
      (#+(and (not :gcl) (or :cltl2 :ansi-cl)) with-compilation-unit
3309
 
         #+(and (not :gcl) (or :cltl2 :ansi-cl)) (:override override-compilation-unit)
3310
 
         #-(and (not :gcl) (or :cltl2 :ansi-cl)) progn
 
3369
      (#+(and (or :cltl2 :ansi-cl) (not :gcl)) with-compilation-unit
 
3370
         #+(and (or :cltl2 :ansi-cl) (not :gcl)) 
 
3371
         (:override override-compilation-unit)
 
3372
         #-(and (or :cltl2 :ansi-cl) (not :gcl)) progn
3311
3373
        (when *reset-full-pathname-table* (clear-full-pathname-tables))
3312
3374
        (when dribble (dribble dribble))
3313
3375
        (when test (setq verbose t))
3323
3385
          ;; CL implementations may uniformly default this to nil
3324
3386
          (let ((*load-verbose* #-common-lisp-controller t
3325
3387
                                #+common-lisp-controller nil) ; nil
3326
 
                #-(or MCL CMU CLISP :sbcl lispworks)
 
3388
                #-(or MCL CMU CLISP ECL :sbcl lispworks scl)
3327
3389
                (*compile-file-verbose* t) ; nil
3328
3390
                #+common-lisp-controller
3329
3391
                (*compile-print* nil)
3345
3407
                (*load-source-instead-of-binary* load-source-instead-of-binary)
3346
3408
                (*minimal-load* minimal-load)
3347
3409
                (system (find-system name :load)))
3348
 
            #-(or CMU CLISP :sbcl :lispworks :cormanlisp)
 
3410
            #-(or CMU CLISP :sbcl :lispworks :cormanlisp scl)
3349
3411
            (declare (special *compile-verbose* #-MCL *compile-file-verbose*)
3350
 
                     (ignore *compile-verbose* #-MCL *compile-file-verbose*)
3351
 
                     (optimize (inhibit-warnings 3)))
 
3412
                     #-openmcl (ignore *compile-verbose*
 
3413
                                       #-MCL *compile-file-verbose*)
 
3414
                     #-openmcl (optimize (inhibit-warnings 3)))
3352
3415
            (unless (component-operation operation)
3353
3416
              (error "Operation ~A undefined." operation))
3354
3417
            (operate-on-component system operation force))))
3530
3593
                (eval (component-finally-do component))))
3531
3594
 
3532
3595
          ;; add the banner if needed
3533
 
          #+cmu
 
3596
          #+(or cmu scl)
3534
3597
          (when (component-banner component)
3535
3598
            (unless (stringp (component-banner component))
3536
3599
              (error "The banner should be a string, it is: ~S"
3659
3722
                                default-action (version *version*))
3660
3723
  ;; If the pathname is present, this behaves like the old require.
3661
3724
  (unless (and module-name
3662
 
               (find #-CMU (string module-name)
3663
 
                     #+CMU (string-downcase (string module-name))
 
3725
               (find (string module-name)
3664
3726
                     *modules* :test #'string=))
3665
3727
    (cond (pathname
3666
3728
           (funcall *old-require* module-name pathname))
3733
3795
;;; if anybody does a funcall on #'require.
3734
3796
 
3735
3797
;;; Redefine old require to call the new require.
3736
 
(eval-when #-(or :lucid :cmu17 :cmu18 :gcl) (:load-toplevel :execute)
3737
 
           #+(or :lucid :cmu17 :cmu18 :gcl) (load eval)
 
3798
(eval-when #-(or :lucid :gcl) (:load-toplevel :execute)
 
3799
           #+(or :lucid  :gcl) (load eval)
3738
3800
(unless *old-require*
3739
3801
  (setf *old-require*
3740
3802
        (symbol-function
3743
3805
         #+:sbcl 'cl:require
3744
3806
         #+:lispworks3.1 'common-lisp::require
3745
3807
         #+(and :lispworks (not :lispworks3.1)) 'system::require
3746
 
         #+:mcl 'ccl:require))
 
3808
         #+:openmcl 'cl:require
 
3809
         #+(and :mcl (not :openmcl)) 'ccl:require
 
3810
         ))
3747
3811
 
3748
3812
  (unless *dont-redefine-require*
3749
3813
    (let (#+(or :mcl (and :CCL (not :lispworks)))
3750
3814
          (ccl:*warn-if-redefine-kernel* nil))
3751
 
      #-(or (and allegro-version>= (version>= 4 1)) :lispworks)
 
3815
      #-(or (and allegro-version>= (version>= 4 1)) :lispworks :sbcl)
3752
3816
      (setf (symbol-function
3753
3817
             #-(or (and :excl :allegro-v4.0) :mcl :sbcl :lispworks) 'lisp:require
3754
3818
             #+(and :excl :allegro-v4.0) 'cltl1:require
3755
3819
             #+:lispworks3.1 'common-lisp::require
3756
 
             #+:sbcl 'cl:require
3757
3820
             #+(and :lispworks (not :lispworks3.1)) 'system::require
3758
 
             #+:mcl 'ccl:require)
 
3821
             #+:openmcl 'cl:require
 
3822
             #+(and :mcl (not :openmcl)) 'ccl:require
 
3823
             )
3759
3824
            (symbol-function 'new-require))
3760
3825
      #+:lispworks
3761
3826
      (let ((warn-packs system::*packages-for-warn-on-redefinition*))
3770
3835
      #+(and allegro-version>= (version>= 4 1))
3771
3836
      (excl:without-package-locks
3772
3837
       (setf (symbol-function 'lisp:require)
3773
 
         (symbol-function 'new-require))))))
3774
 
)
 
3838
         (symbol-function 'new-require)))
 
3839
      #+:sbcl
 
3840
      (sb-ext:without-package-locks
 
3841
       (setf (symbol-function 'cl:require)
 
3842
         (symbol-function 'new-require)))))))
3775
3843
 
3776
3844
;;; ********************************
3777
3845
;;; Language-Dependent Characteristics
3856
3924
 
3857
3925
;;; *** PseudoScheme Language Definition
3858
3926
(defun scheme-compile-file (filename &rest args)
3859
 
  (let ((scheme-package (find-package "SCHEME")))
3860
 
    (apply (symbol-function (find-symbol "COMPILE-FILE"
3861
 
                                               scheme-package))
 
3927
  (let ((scheme-package (find-package '#:scheme)))
 
3928
    (apply (symbol-function (find-symbol (symbol-name 'compile-file)
 
3929
                                         scheme-package))
3862
3930
           filename
3863
3931
           (funcall (symbol-function
3864
 
                     (find-symbol "INTERACTION-ENVIRONMENT"
3865
 
                                     scheme-package)))
 
3932
                     (find-symbol (symbol-name '#:interaction-environment)
 
3933
                                  scheme-package)))
3866
3934
           args)))
3867
3935
 
3868
3936
(define-language :scheme
3887
3955
  #+:allegro (excl:run-shell-command
3888
3956
              (format nil "~A~@[ ~{~A~^ ~}~]"
3889
3957
                      program arguments))
3890
 
  #+KCL (system (format nil "~A~@[ ~{~A~^ ~}~]" program arguments))
3891
 
  #+:cmu (extensions:run-program program arguments)
 
3958
  #+(or :kcl :ecl) (system (format nil "~A~@[ ~{~A~^ ~}~]" program arguments))
 
3959
  #+(or :cmu :scl) (extensions:run-program program arguments)
 
3960
  #+:openmcl (ccl:run-program program arguments)
3892
3961
  #+:sbcl (sb-ext:run-program program arguments)
3893
3962
  #+:lispworks (foreign:call-system-showing-output
3894
3963
                (format nil "~A~@[ ~{~A~^ ~}~]" program arguments))
3940
4009
                     error-file
3941
4010
                     error-output
3942
4011
                     verbose)
3943
 
  #-cmu (declare (ignore error-file error-output))
 
4012
  #-(or cmu scl) (declare (ignore error-file error-output))
3944
4013
 
3945
4014
  (flet ((make-useable-stream (&rest streams)
3946
4015
           (apply #'make-broadcast-stream (delete nil streams)))
3947
4016
         )
3948
 
    (let (#+cmu (error-file error-file)
3949
 
          #+cmu (error-file-stream nil)
 
4017
    (let (#+(or cmu scl) (error-file error-file)
 
4018
          #+(or cmu scl) (error-file-stream nil)
3950
4019
          (verbose-stream nil)
3951
4020
          (old-timestamp (file-write-date output-file))
3952
4021
          (fatal-error nil)
3954
4023
          )
3955
4024
      (unwind-protect
3956
4025
           (progn
3957
 
             #+cmu
 
4026
             #+(or cmu scl)
3958
4027
             (setf error-file
3959
4028
                   (when error-file
3960
4029
                     (default-output-pathname error-file
3977
4046
                     arguments)
3978
4047
 
3979
4048
             (setf fatal-error
3980
 
                   #-cmu
 
4049
                   #-(or cmu scl)
3981
4050
                   (and (run-unix-program program arguments) nil) ; Incomplete.
3982
 
                   #+cmu
 
4051
                   #+(or cmu scl)
3983
4052
                   (let* ((error-output
3984
4053
                           (make-useable-stream error-file-stream
3985
4054
                                                (if (eq error-output t)
4004
4073
                     fatal-error
4005
4074
                     fatal-error))
4006
4075
 
4007
 
        #+cmu
 
4076
        #+(or cmu scl)
4008
4077
        (when error-file
4009
4078
          (close error-file-stream)
4010
4079
          (unless (or fatal-error (not output-file-written))
4072
4141
  :compiler #'c-compile-file
4073
4142
  :loader #+:lucid #'load-foreign-files
4074
4143
          #+:allegro #'load
4075
 
          #+:cmu #'alien:load-foreign
 
4144
          #+(or :cmu :scl) #'alien:load-foreign
4076
4145
          #+:sbcl #'sb-alien:load-foreign
4077
4146
          #+(and :lispworks :unix (not :linux)) #'link-load:read-foreign-modules
4078
4147
          #+(and :lispworks (or (not :unix) :linux)) #'fli:register-module
4081
4150
                :allegro
4082
4151
                :cmu
4083
4152
                :sbcl
 
4153
                :scl
4084
4154
                :lispworks
4085
4155
                :ecl :gcl :kcl)
4086
4156
          (lambda (&rest args)
4186
4256
                          :output-file
4187
4257
                          output-file
4188
4258
                          #+gcl :system-p #+gcl t
4189
 
                          #+CMU :error-file
4190
 
                          #+CMU (and *cmu-errors-to-file*
4191
 
                                     (component-full-pathname component
4192
 
                                                              :error))
4193
 
                          #+(and CMU (not :new-compiler))
4194
 
                          :errors-to-terminal
4195
 
                          #+(and CMU (not :new-compiler))
 
4259
                          #+(or :cmu :scl) :error-file
 
4260
                          #+(or :cmu :scl) (and *cmu-errors-to-file*
 
4261
                                                (component-full-pathname component
 
4262
                                                                         :error))
 
4263
                          #+CMU
 
4264
                          :error-output
 
4265
                          #+CMU
4196
4266
                          *cmu-errors-to-terminal*
4197
4267
                          (component-compiler-options component)
4198
4268
                          ))))