From: Taylor R Campbell Date: Mon, 7 Jan 2019 00:25:26 +0000 (+0000) Subject: Generate the trivial constructor in the objdir, not srcdir. X-Git-Tag: mit-scheme-pucked-10.1.9~3^2~9 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=26a7f50a04e911ec05fd3e0a441e6aa97225e520;p=mit-scheme.git Generate the trivial constructor in the objdir, not srcdir. Define cref/source-root and cref/object-root in host-adapter.scm so we can still load compiler.sf into old Schemes, which will never have this distinction. --- diff --git a/src/compiler/machines/C/compiler.sf b/src/compiler/machines/C/compiler.sf index 62e0db5d8..819d6ac76 100644 --- a/src/compiler/machines/C/compiler.sf +++ b/src/compiler/machines/C/compiler.sf @@ -31,7 +31,12 @@ USA. ;; Guarantee that the compiler's package structure exists. (if (not (name->package '(compiler))) - (let ((package-set (package-set-pathname "compiler"))) + (let ((package-set + (merge-pathnames + (enough-pathname + (merge-pathnames (package-set-pathname "compiler")) + cref/source-root) + cref/object-root))) (if (not (file-exists? package-set)) (cref/generate-trivial-constructor "compiler")) (construct-packages-from-file (fasload package-set)))) diff --git a/src/compiler/machines/i386/compiler.sf b/src/compiler/machines/i386/compiler.sf index f134bc3b7..8679c8cee 100644 --- a/src/compiler/machines/i386/compiler.sf +++ b/src/compiler/machines/i386/compiler.sf @@ -31,7 +31,12 @@ USA. ;; Guarantee that the compiler's package structure exists. (if (not (name->package '(compiler))) - (let ((package-set (package-set-pathname "compiler"))) + (let ((package-set + (merge-pathnames + (enough-pathname + (merge-pathnames (package-set-pathname "compiler")) + cref/source-root) + cref/object-root))) (if (not (file-exists? package-set)) (cref/generate-trivial-constructor "compiler")) (construct-packages-from-file (fasload package-set)))) diff --git a/src/compiler/machines/svm/compiler.sf b/src/compiler/machines/svm/compiler.sf index 20ed4deb4..c18784556 100644 --- a/src/compiler/machines/svm/compiler.sf +++ b/src/compiler/machines/svm/compiler.sf @@ -31,7 +31,12 @@ USA. ;; Guarantee that the compiler's package structure exists. (if (not (name->package '(compiler))) - (let ((package-set (package-set-pathname "compiler"))) + (let ((package-set + (merge-pathnames + (enough-pathname + (merge-pathnames (package-set-pathname "compiler")) + cref/source-root) + cref/object-root))) (if (not (file-exists? package-set)) (cref/generate-trivial-constructor "compiler")) (construct-packages-from-file (fasload package-set)))) diff --git a/src/compiler/machines/x86-64/compiler.sf b/src/compiler/machines/x86-64/compiler.sf index 68ee38b5b..25ec92658 100644 --- a/src/compiler/machines/x86-64/compiler.sf +++ b/src/compiler/machines/x86-64/compiler.sf @@ -31,7 +31,12 @@ USA. ;; Guarantee that the compiler's package structure exists. (if (not (name->package '(compiler))) - (let ((package-set (package-set-pathname "compiler"))) + (let ((package-set + (merge-pathnames + (enough-pathname + (merge-pathnames (package-set-pathname "compiler")) + cref/source-root) + cref/object-root))) (if (not (file-exists? package-set)) (cref/generate-trivial-constructor "compiler")) (construct-packages-from-file (fasload package-set)))) diff --git a/src/runtime/host-adapter.scm b/src/runtime/host-adapter.scm index 240ab0c4c..524f126d8 100644 --- a/src/runtime/host-adapter.scm +++ b/src/runtime/host-adapter.scm @@ -40,4 +40,14 @@ USA. 'target-bytes-per-object bytes-per-object)) +(if (lexical-unreferenceable? (->environment '()) 'cref/source-root) + (environment-define (->environment '()) + 'cref/source-root + #!default)) + +(if (lexical-unreferenceable? (->environment '()) 'cref/object-root) + (environment-define (->environment '()) + 'cref/object-root + #!default)) + unspecific \ No newline at end of file