From 512fab8291d977424a66186141f66cf5a553fa05 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 17 Dec 2001 17:40:59 +0000 Subject: [PATCH] Change package system to conditionalize everything according to the operating-system type. All output files are now OS-specific, e.g. "runtime.pkg" produces output files "runtime-unx.{pkd,fre,crf}". Package files can now use the conditionalization variable OS-TYPE. --- v7/src/6001/6001.pkg | 9 ++-- v7/src/compiler/machines/C/compiler.sf | 8 ++-- v7/src/compiler/machines/alpha/compiler.sf | 8 ++-- v7/src/compiler/machines/bobcat/compiler.sf | 8 ++-- v7/src/compiler/machines/i386/compiler.sf | 8 ++-- v7/src/compiler/machines/mips/compiler.sf-big | 8 ++-- .../compiler/machines/mips/compiler.sf-little | 8 ++-- v7/src/compiler/machines/spectrum/compiler.sf | 8 ++-- v7/src/compiler/machines/vax/compiler.sf | 8 ++-- v7/src/cref/Makefile.in | 4 +- v7/src/cref/cref.sf | 9 ++-- v7/src/cref/make.scm | 4 +- v7/src/cref/redpkg.scm | 11 ++--- v7/src/cref/toplev.scm | 37 +++++++++++----- v7/src/edwin/Clean.sh | 6 +-- v7/src/edwin/edwin.sf | 28 +++--------- v7/src/edwin/make.scm | 17 ++----- v7/src/imail/Makefile.in | 4 +- v7/src/imail/clean.sh | 3 +- v7/src/imail/imail.pkg | 4 +- v7/src/runtime-check/Clean.sh | 6 +-- v7/src/runtime-check/Setup.sh | 4 +- v7/src/runtime/make.scm | 13 ++++-- v7/src/runtime/packag.scm | 44 ++++++++++--------- v7/src/runtime/runtime.pkg | 3 +- v7/src/runtime/sfile.scm | 14 +++++- v7/src/runtime/version.scm | 4 +- v7/src/sf/butils.scm | 33 +++++--------- v7/src/sf/make.scm | 4 +- v7/src/sf/sf.pkg | 8 ++-- v7/src/sos/Makefile.in | 4 +- v7/src/star-parser/Makefile.in | 4 +- v7/src/xml/Makefile.in | 4 +- 33 files changed, 174 insertions(+), 171 deletions(-) diff --git a/v7/src/6001/6001.pkg b/v7/src/6001/6001.pkg index 2df99bc23..c2d231af1 100644 --- a/v7/src/6001/6001.pkg +++ b/v7/src/6001/6001.pkg @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: 6001.pkg,v 1.12 2001/08/18 04:50:08 cph Exp $ +$Id: 6001.pkg,v 1.13 2001/12/17 17:40:58 cph Exp $ -Copyright (c) 1991-1999 Massachusetts Institute of Technology +Copyright (c) 1991-1999, 2001 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,13 +16,14 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +USA. |# ;;;; 6.001 packaging (global-definitions "../runtime/runtime") -(global-definitions "../edwin/edwinunx") +(global-definitions "../edwin/edwin") (define-package (student) (parent ())) diff --git a/v7/src/compiler/machines/C/compiler.sf b/v7/src/compiler/machines/C/compiler.sf index 5876ff735..d7766e65b 100644 --- a/v7/src/compiler/machines/C/compiler.sf +++ b/v7/src/compiler/machines/C/compiler.sf @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: compiler.sf,v 1.7 2001/08/16 19:28:21 cph Exp $ +$Id: compiler.sf,v 1.8 2001/12/17 17:40:58 cph Exp $ Copyright (c) 1992-1999, 2001 Massachusetts Institute of Technology @@ -26,10 +26,10 @@ USA. ;; Guarantee that the compiler's package structure exists. (if (not (name->package '(COMPILER))) - (begin - (if (not (file-exists? "compiler.pkd")) + (let ((package-set (package-set-pathname "compiler"))) + (if (not (file-exists? package-set)) (cref/generate-trivial-constructor "compiler")) - (construct-packages-from-file (fasload "compiler.pkd")))) + (construct-packages-from-file (fasload package-set)))) ;; Guarantee that the necessary syntactic transforms and optimizers ;; are loaded. diff --git a/v7/src/compiler/machines/alpha/compiler.sf b/v7/src/compiler/machines/alpha/compiler.sf index a06f8809a..bd57de3c3 100644 --- a/v7/src/compiler/machines/alpha/compiler.sf +++ b/v7/src/compiler/machines/alpha/compiler.sf @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: compiler.sf,v 1.7 2001/08/16 19:28:21 cph Exp $ +$Id: compiler.sf,v 1.8 2001/12/17 17:40:58 cph Exp $ Copyright (c) 1992-1999, 2001 Massachusetts Institute of Technology @@ -26,10 +26,10 @@ USA. ;; Guarantee that the compiler's package structure exists. (if (not (name->package '(COMPILER))) - (begin - (if (not (file-exists? "compiler.pkd")) + (let ((package-set (package-set-pathname "compiler"))) + (if (not (file-exists? package-set)) (cref/generate-trivial-constructor "compiler")) - (construct-packages-from-file (fasload "compiler.pkd")))) + (construct-packages-from-file (fasload package-set)))) ;; Guarantee that the necessary syntactic transforms and optimizers ;; are loaded. diff --git a/v7/src/compiler/machines/bobcat/compiler.sf b/v7/src/compiler/machines/bobcat/compiler.sf index 19706f185..db637802a 100644 --- a/v7/src/compiler/machines/bobcat/compiler.sf +++ b/v7/src/compiler/machines/bobcat/compiler.sf @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: compiler.sf,v 1.19 2001/08/16 19:28:21 cph Exp $ +$Id: compiler.sf,v 1.20 2001/12/17 17:40:58 cph Exp $ Copyright (c) 1988-1999, 2001 Massachusetts Institute of Technology @@ -26,10 +26,10 @@ USA. ;; Guarantee that the compiler's package structure exists. (if (not (name->package '(COMPILER))) - (begin - (if (not (file-exists? "compiler.pkd")) + (let ((package-set (package-set-pathname "compiler"))) + (if (not (file-exists? package-set)) (cref/generate-trivial-constructor "compiler")) - (construct-packages-from-file (fasload "compiler.pkd")))) + (construct-packages-from-file (fasload package-set)))) ;; Guarantee that the necessary syntactic transforms and optimizers ;; are loaded. diff --git a/v7/src/compiler/machines/i386/compiler.sf b/v7/src/compiler/machines/i386/compiler.sf index 8316776a5..907a517dc 100644 --- a/v7/src/compiler/machines/i386/compiler.sf +++ b/v7/src/compiler/machines/i386/compiler.sf @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: compiler.sf,v 1.13 2001/08/16 19:28:21 cph Exp $ +$Id: compiler.sf,v 1.14 2001/12/17 17:40:58 cph Exp $ Copyright (c) 1992-2001 Massachusetts Institute of Technology @@ -26,10 +26,10 @@ USA. ;; Guarantee that the compiler's package structure exists. (if (not (name->package '(COMPILER))) - (begin - (if (not (file-exists? "compiler.pkd")) + (let ((package-set (package-set-pathname "compiler"))) + (if (not (file-exists? package-set)) (cref/generate-trivial-constructor "compiler")) - (construct-packages-from-file (fasload "compiler.pkd")))) + (construct-packages-from-file (fasload package-set)))) ;; Guarantee that the necessary syntactic transforms and optimizers ;; are loaded. diff --git a/v7/src/compiler/machines/mips/compiler.sf-big b/v7/src/compiler/machines/mips/compiler.sf-big index 77812e27f..7dce83ba1 100644 --- a/v7/src/compiler/machines/mips/compiler.sf-big +++ b/v7/src/compiler/machines/mips/compiler.sf-big @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: compiler.sf-big,v 1.9 2001/08/16 19:28:21 cph Exp $ +$Id: compiler.sf-big,v 1.10 2001/12/17 17:40:58 cph Exp $ Copyright (c) 1988-1999, 2001 Massachusetts Institute of Technology @@ -26,10 +26,10 @@ USA. ;; Guarantee that the compiler's package structure exists. (if (not (name->package '(COMPILER))) - (begin - (if (not (file-exists? "compiler.pkd")) + (let ((package-set (package-set-pathname "compiler"))) + (if (not (file-exists? package-set)) (cref/generate-trivial-constructor "compiler")) - (construct-packages-from-file (fasload "compiler.pkd")))) + (construct-packages-from-file (fasload package-set)))) ;; Guarantee that the necessary syntactic transforms and optimizers ;; are loaded. diff --git a/v7/src/compiler/machines/mips/compiler.sf-little b/v7/src/compiler/machines/mips/compiler.sf-little index 73145bd12..18da376f8 100644 --- a/v7/src/compiler/machines/mips/compiler.sf-little +++ b/v7/src/compiler/machines/mips/compiler.sf-little @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: compiler.sf-little,v 1.9 2001/08/16 19:28:22 cph Exp $ +$Id: compiler.sf-little,v 1.10 2001/12/17 17:40:58 cph Exp $ Copyright (c) 1988-1999, 2001 Massachusetts Institute of Technology @@ -26,10 +26,10 @@ USA. ;; Guarantee that the compiler's package structure exists. (if (not (name->package '(COMPILER))) - (begin - (if (not (file-exists? "compiler.pkd")) + (let ((package-set (package-set-pathname "compiler"))) + (if (not (file-exists? package-set)) (cref/generate-trivial-constructor "compiler")) - (construct-packages-from-file (fasload "compiler.pkd")))) + (construct-packages-from-file (fasload package-set)))) ;; Guarantee that the necessary syntactic transforms and optimizers ;; are loaded. diff --git a/v7/src/compiler/machines/spectrum/compiler.sf b/v7/src/compiler/machines/spectrum/compiler.sf index 700166c2b..02a1ec3f9 100644 --- a/v7/src/compiler/machines/spectrum/compiler.sf +++ b/v7/src/compiler/machines/spectrum/compiler.sf @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: compiler.sf,v 1.19 2001/08/16 19:28:22 cph Exp $ +$Id: compiler.sf,v 1.20 2001/12/17 17:40:58 cph Exp $ Copyright (c) 1988-1999, 2001 Massachusetts Institute of Technology @@ -26,10 +26,10 @@ USA. ;; Guarantee that the compiler's package structure exists. (if (not (name->package '(COMPILER))) - (begin - (if (not (file-exists? "compiler.pkd")) + (let ((package-set (package-set-pathname "compiler"))) + (if (not (file-exists? package-set)) (cref/generate-trivial-constructor "compiler")) - (construct-packages-from-file (fasload "compiler.pkd")))) + (construct-packages-from-file (fasload package-set)))) ;; Guarantee that the necessary syntactic transforms and optimizers ;; are loaded. diff --git a/v7/src/compiler/machines/vax/compiler.sf b/v7/src/compiler/machines/vax/compiler.sf index 614239705..0a0041041 100644 --- a/v7/src/compiler/machines/vax/compiler.sf +++ b/v7/src/compiler/machines/vax/compiler.sf @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: compiler.sf,v 1.10 2001/08/16 19:28:22 cph Exp $ +$Id: compiler.sf,v 1.11 2001/12/17 17:40:58 cph Exp $ Copyright (c) 1988-1999, 2001 Massachusetts Institute of Technology @@ -26,10 +26,10 @@ USA. ;; Guarantee that the compiler's package structure exists. (if (not (name->package '(COMPILER))) - (begin - (if (not (file-exists? "compiler.pkd")) + (let ((package-set (package-set-pathname "compiler"))) + (if (not (file-exists? package-set)) (cref/generate-trivial-constructor "compiler")) - (construct-packages-from-file (fasload "compiler.pkd")))) + (construct-packages-from-file (fasload package-set)))) ;; Guarantee that the necessary syntactic transforms and optimizers ;; are loaded. diff --git a/v7/src/cref/Makefile.in b/v7/src/cref/Makefile.in index bcec4c9bd..0b049c075 100644 --- a/v7/src/cref/Makefile.in +++ b/v7/src/cref/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.1 2001/09/25 18:24:08 cph Exp $ +# $Id: Makefile.in,v 1.2 2001/12/17 17:40:58 cph Exp $ # # Copyright (c) 2001 Massachusetts Institute of Technology # @@ -77,6 +77,6 @@ install: $(mkinstalldirs) $(DESTDIR)$(CREF_DIR) $(INSTALL_DATA) *.com $(DESTDIR)$(CREF_DIR)/. $(INSTALL_DATA) *.bci $(DESTDIR)$(CREF_DIR)/. - $(INSTALL_DATA) cref.pkd $(DESTDIR)$(CREF_DIR)/. + $(INSTALL_DATA) cref-unx.pkd $(DESTDIR)$(CREF_DIR)/. .PHONY: all mostlyclean clean distclean maintainer-clean tags TAGS install diff --git a/v7/src/cref/cref.sf b/v7/src/cref/cref.sf index 0a36f038a..31df50be3 100644 --- a/v7/src/cref/cref.sf +++ b/v7/src/cref/cref.sf @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: cref.sf,v 1.13 2001/08/15 02:59:46 cph Exp $ +$Id: cref.sf,v 1.14 2001/12/17 17:40:58 cph Exp $ Copyright (c) 1988-2001 Massachusetts Institute of Technology @@ -24,10 +24,11 @@ USA. (sf-conditionally "object") (sf-directory ".") -(if (not (file-exists? "cref.pkd")) - (fasdump (load "triv.pkg") "cref.pkd")) +(let ((package-set (package-set-pathname "cref"))) + (if (not (file-exists? package-set)) + (fasdump (load "triv.pkg") package-set))) -(if (file-exists? "../runtime/runtime.pkd") +(if (file-exists? (package-set-pathname "../runtime/runtime")) (begin (if (not (name->package '(CROSS-REFERENCE))) (load "make")) diff --git a/v7/src/cref/make.scm b/v7/src/cref/make.scm index 4be6c4f3d..a7e03a7e6 100644 --- a/v7/src/cref/make.scm +++ b/v7/src/cref/make.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: make.scm,v 1.23 2001/08/18 04:48:16 cph Exp $ +$Id: make.scm,v 1.24 2001/12/17 17:40:58 cph Exp $ Copyright (c) 1988-2001 Massachusetts Institute of Technology @@ -34,4 +34,4 @@ USA. (lambda () (load-option 'RB-TREE) (load-package-set "cref"))))) -(add-identification! "CREF" 2 1) \ No newline at end of file +(add-identification! "CREF" 2 2) \ No newline at end of file diff --git a/v7/src/cref/redpkg.scm b/v7/src/cref/redpkg.scm index a1d8b8524..207c2d4b1 100644 --- a/v7/src/cref/redpkg.scm +++ b/v7/src/cref/redpkg.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: redpkg.scm,v 1.22 2001/11/27 02:53:22 cph Exp $ +$Id: redpkg.scm,v 1.23 2001/12/17 17:40:58 cph Exp $ Copyright (c) 1988-2001 Massachusetts Institute of Technology @@ -39,9 +39,8 @@ USA. (cons (->namestring pathname) (let ((pathname - (pathname-new-type (merge-pathnames pathname - model-pathname) - "pkd"))) + (package-set-pathname + (merge-pathnames pathname model-pathname)))) (if (file-exists? pathname) (let ((contents (fasload pathname))) (if (package-file? contents) @@ -131,7 +130,9 @@ USA. (data #f)) (define (cache-file-analyses! pmodel) - (let ((pathname (pathname-new-type (pmodel/pathname pmodel) "fre")) + (let ((pathname + (pathname-new-type (package-set-pathname (pmodel/pathname pmodel)) + "fre")) (changes? (list #f))) (let ((result (let ((caches (if (file-exists? pathname) (fasload pathname) '()))) diff --git a/v7/src/cref/toplev.scm b/v7/src/cref/toplev.scm index c4500bd17..6542910dc 100644 --- a/v7/src/cref/toplev.scm +++ b/v7/src/cref/toplev.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: toplev.scm,v 1.15 2001/08/16 20:46:15 cph Exp $ +$Id: toplev.scm,v 1.16 2001/12/17 17:40:58 cph Exp $ Copyright (c) 1988-2001 Massachusetts Institute of Technology @@ -59,18 +59,31 @@ USA. (write-external-descriptions pathname pmodel changes?)))) (define (write-external-descriptions pathname pmodel changes?) - (if (or changes? (not (file-processed? pathname "pkg" "pkd"))) - (fasdump (construct-external-descriptions pmodel) - (pathname-new-type pathname "pkd")))) + (let ((package-set (package-set-pathname pathname))) + (if (or changes? + (not (file-modification-timepackage '(EDWIN))) - (begin - (if (not (file-exists? (pathname-new-type package-name "pkd"))) - (cref/generate-trivial-constructor package-name)) - (construct-packages-from-file - (fasload (pathname-new-type package-name "pkd"))))) + (let ((package-set (package-set-pathname "edwin"))) + (if (not (file-exists? package-set)) + (cref/generate-trivial-constructor "edwin")) + (construct-packages-from-file (fasload package-set)))) (if (lexical-unreferenceable? (->environment '(EDWIN CLASS-CONSTRUCTOR)) 'CLASS-DESCRIPTORS) @@ -78,7 +66,5 @@ (load "decls") -(cref/generate-constructors package-name) -(sf-conditionally "edwin.ldr") - -) \ No newline at end of file +(cref/generate-constructors "edwin") +(sf-conditionally "edwin.ldr") \ No newline at end of file diff --git a/v7/src/edwin/make.scm b/v7/src/edwin/make.scm index 69d55c805..e33a769f8 100644 --- a/v7/src/edwin/make.scm +++ b/v7/src/edwin/make.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: make.scm,v 3.112 2001/12/17 04:42:01 cph Exp $ +$Id: make.scm,v 3.113 2001/12/17 17:40:58 cph Exp $ Copyright (c) 1989-2001 Massachusetts Institute of Technology @@ -34,17 +34,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA (lambda () (declare-shared-library "edwin" (lambda () #t)) (load-package-set "edwin" - (let ((package-name - (case microcode-id/operating-system - ((DOS) "edwindos") - ((NT) "edwinw32") - ((OS/2) "edwinos2") - ((UNIX) "edwinunx") - (else "edwinunk")))) - `((os-type . ,microcode-id/operating-system) - (rewrite-package-file-name - . ,(lambda (pathname) - (pathname-new-name pathname package-name))) - (alternate-package-loader - . ,(load "edwin.bld" system-global-environment))))))))) + `((alternate-package-loader + . ,(load "edwin.bld" system-global-environment)))))))) (add-identification! "Edwin" 3 111) \ No newline at end of file diff --git a/v7/src/imail/Makefile.in b/v7/src/imail/Makefile.in index 01484532a..a5f847c3e 100644 --- a/v7/src/imail/Makefile.in +++ b/v7/src/imail/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.2 2001/08/15 03:27:11 cph Exp $ +# $Id: Makefile.in,v 1.3 2001/12/17 17:40:58 cph Exp $ # # Copyright (c) 2000, 2001 Massachusetts Institute of Technology # @@ -77,7 +77,7 @@ install: $(mkinstalldirs) $(DESTDIR)$(IMAIL_DIR) $(INSTALL_DATA) *.com $(DESTDIR)$(IMAIL_DIR)/. $(INSTALL_DATA) *.bci $(DESTDIR)$(IMAIL_DIR)/. - $(INSTALL_DATA) imail.pkd $(DESTDIR)$(IMAIL_DIR)/. + $(INSTALL_DATA) imail-unx.pkd $(DESTDIR)$(IMAIL_DIR)/. $(INSTALL_DATA) $(srcdir)/load.scm $(DESTDIR)$(IMAIL_DIR)/. .PHONY: all mostlyclean clean distclean maintainer-clean tags TAGS install diff --git a/v7/src/imail/clean.sh b/v7/src/imail/clean.sh index 563f41869..56057759a 100755 --- a/v7/src/imail/clean.sh +++ b/v7/src/imail/clean.sh @@ -1,3 +1,2 @@ #!/bin/bash -rm -f *.{bin,ext,com,bci} -rm -f imail.{crf,fre,glo,pkd} +rm -f *.{bin,ext,com,bci,pkd,crf,fre} diff --git a/v7/src/imail/imail.pkg b/v7/src/imail/imail.pkg index 957090f92..b7eb7ee5f 100644 --- a/v7/src/imail/imail.pkg +++ b/v7/src/imail/imail.pkg @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: imail.pkg,v 1.93 2001/11/06 04:45:45 cph Exp $ +;;; $Id: imail.pkg,v 1.94 2001/12/17 17:40:58 cph Exp $ ;;; ;;; Copyright (c) 2000-2001 Massachusetts Institute of Technology ;;; @@ -23,7 +23,7 @@ (global-definitions "../runtime/runtime") (global-definitions "../sos/sos") -(global-definitions "../edwin/edwinunx") +(global-definitions "../edwin/edwin") (global-definitions "../star-parser/parser") (define-package (runtime url) diff --git a/v7/src/runtime-check/Clean.sh b/v7/src/runtime-check/Clean.sh index 2a09cdd43..d7f332fb3 100755 --- a/v7/src/runtime-check/Clean.sh +++ b/v7/src/runtime-check/Clean.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: Clean.sh,v 1.2 2001/08/15 03:34:18 cph Exp $ +# $Id: Clean.sh,v 1.3 2001/12/17 17:40:59 cph Exp $ # # Copyright (c) 2000, 2001 Massachusetts Institute of Technology # @@ -30,8 +30,8 @@ fi ../etc/Clean.sh "${1}" rm-com if [ "${1}" = "maintainer-clean" ]; then - echo "rm -f *.bin runtime.pkd" - rm -f *.bin runtime.pkd + echo "rm -f *.bin *.pkd" + rm -f *.bin *.pkd fi exit 0 diff --git a/v7/src/runtime-check/Setup.sh b/v7/src/runtime-check/Setup.sh index 446bd440d..fb31e13b3 100755 --- a/v7/src/runtime-check/Setup.sh +++ b/v7/src/runtime-check/Setup.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: Setup.sh,v 1.4 2001/08/15 03:30:05 cph Exp $ +# $Id: Setup.sh,v 1.5 2001/12/17 17:40:59 cph Exp $ # # Copyright (c) 2000, 2001 Massachusetts Institute of Technology # @@ -36,6 +36,6 @@ for FNS in `cd ../runtime; ls *.scm`; do maybe_link ${FN} ../runtime/${FN} done -maybe_link runtime.pkd ../runtime/runtime.pkd +maybe_link runtime-unx.pkd ../runtime/runtime-unx.pkd exit 0 diff --git a/v7/src/runtime/make.scm b/v7/src/runtime/make.scm index 2f33f0318..07281eafb 100644 --- a/v7/src/runtime/make.scm +++ b/v7/src/runtime/make.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: make.scm,v 14.72 2001/08/17 12:51:00 cph Exp $ +$Id: make.scm,v 14.73 2001/12/17 17:40:58 cph Exp $ Copyright (c) 1988-2001 Massachusetts Institute of Technology @@ -298,6 +298,7 @@ USA. (export 'LOAD-PACKAGE-SET) (export 'LOAD-PACKAGES-FROM-FILE) (export 'NAME->PACKAGE) + (export 'PACKAGE-SET-PATHNAME) (export 'PACKAGE/ADD-CHILD!) (export 'PACKAGE/CHILD) (export 'PACKAGE/CHILDREN) @@ -316,9 +317,15 @@ USA. environment-for-package name)))) (import 'CONSTRUCT-PACKAGES-FROM-FILE) (import 'LOAD-PACKAGES-FROM-FILE)) -(define packages-file (fasload "runtime.pkd" #f)) +(define packages-file + (fasload (case os-name + ((NT) "runtime-w32.pkd") + ((OS/2) "runtime-os2.pkd") + ((UNIX) "runtime-unx.pkd") + (else "runtime-unk.pkd")) + #f)) (construct-packages-from-file packages-file) - + ;;; Global databases. Load, then initialize. (let ((files1 '(("gcdemn" . (RUNTIME GC-DAEMONS)) diff --git a/v7/src/runtime/packag.scm b/v7/src/runtime/packag.scm index 285fab0b0..d6bb9f716 100644 --- a/v7/src/runtime/packag.scm +++ b/v7/src/runtime/packag.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: packag.scm,v 14.35 2001/09/25 05:11:31 cph Exp $ +$Id: packag.scm,v 14.36 2001/12/17 17:40:59 cph Exp $ Copyright (c) 1988-1999, 2001 Massachusetts Institute of Technology @@ -158,17 +158,13 @@ USA. package-name-tag system-global-package)) -(define system-loader/enable-query? - #f) +(define system-loader/enable-query? #f) (define (load-package-set filename #!optional options load-interpreted?) - (let* ((options (if (default-object? options) '() options)) - (pathname - (let ((rewrite (lookup-option 'REWRITE-PACKAGE-FILE-NAME options)) - (pathname (pathname-new-type filename "pkd"))) - (if rewrite - (rewrite pathname) - pathname)))) + (let ((pathname (package-set-pathname filename)) + (options + (cons (cons 'OS-TYPE microcode-id/operating-system) + (if (default-object? options) '() options)))) (with-working-directory-pathname (directory-pathname pathname) (lambda () (let ((file (fasload pathname))) @@ -207,8 +203,19 @@ USA. ;; can end up being purified also. (flush-purification-queue!)) -(define package/system-loader - load-package-set) +(define (package-set-pathname pathname) + (make-pathname (pathname-host pathname) + (pathname-device pathname) + (pathname-directory pathname) + (string-append (pathname-name pathname) + "-" + (case microcode-id/operating-system + ((NT) "w32") + ((OS/2) "os2") + ((UNIX) "unx") + (else "unk"))) + "pkd" + (pathname-version pathname))) (define (filename->compiled-object system component) (let ((prim (ucode-primitive initialize-c-compiled-block 1))) @@ -217,22 +224,19 @@ USA. (let* ((p (->pathname component)) (d (pathname-directory p))) (string-append - (if (pair? d) - (car (last-pair d)) - system) + (if (pair? d) (car (last-pair d)) system) "_" - (string-replace (pathname-name p) ; kludge - #\- - #\_)))) + (string-replace (pathname-name p) #\- #\_)))) (value (prim name))) - (if (or (not value) - load/suppress-loading-message?) + (if (or (not value) load/suppress-loading-message?) value (let ((port (notification-output-port))) (fresh-line port) (write-string ";Initialized " port) (write name port) value)))))) + +(define package/system-loader load-package-set) (define-structure (package-file (type vector) (conc-name package-file/)) diff --git a/v7/src/runtime/runtime.pkg b/v7/src/runtime/runtime.pkg index f3719896b..f891a8452 100644 --- a/v7/src/runtime/runtime.pkg +++ b/v7/src/runtime/runtime.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: runtime.pkg,v 14.383 2001/11/11 05:58:56 cph Exp $ +$Id: runtime.pkg,v 14.384 2001/12/17 17:40:59 cph Exp $ Copyright (c) 1988-2001 Massachusetts Institute of Technology @@ -57,6 +57,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA load-package-set load-packages-from-file name->package + package-set-pathname package/add-child! package/child package/children diff --git a/v7/src/runtime/sfile.scm b/v7/src/runtime/sfile.scm index a297e499f..36722f814 100644 --- a/v7/src/runtime/sfile.scm +++ b/v7/src/runtime/sfile.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: sfile.scm,v 14.30 2001/07/17 02:08:50 cph Exp $ +$Id: sfile.scm,v 14.31 2001/12/17 17:40:59 cph Exp $ Copyright (c) 1988-2001 Massachusetts Institute of Technology @@ -163,6 +163,18 @@ USA. (begin (directory-channel-close channel) result)))))) + +(define (file-processed? filename input-type output-type) + (file-modification-time