From 26a7f50a04e911ec05fd3e0a441e6aa97225e520 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Mon, 7 Jan 2019 00:25:26 +0000 Subject: [PATCH] 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. --- src/compiler/machines/C/compiler.sf | 7 ++++++- src/compiler/machines/i386/compiler.sf | 7 ++++++- src/compiler/machines/svm/compiler.sf | 7 ++++++- src/compiler/machines/x86-64/compiler.sf | 7 ++++++- src/runtime/host-adapter.scm | 10 ++++++++++ 5 files changed, 34 insertions(+), 4 deletions(-) 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 -- 2.25.1