AUXDIR = @AUXDIR@
@IF_CROSS@COMPILER_SETTINGS_CROSS = (set! compiler:cross-compiling? true)
+@IF_CROSS@SF_SETTINGS_CROSS = \
+@IF_CROSS@ (set! sf/cross-compiling? true) \
+@IF_CROSS@ (set! package/cross-compiling? true)
@IF_LIARC@COMPILER_SETTINGS_LIARC = (set! compiler:invoke-c-compiler? false)
HOST_COMPILER_HEAP = @HOST_COMPILER_HEAP@
HOST_COMPILER_SETTINGS = \
+ $(SF_SETTINGS_CROSS) \
$(COMPILER_SETTINGS_CROSS) \
$(COMPILER_SETTINGS_LIARC)
syntax-compiler: compile-sf
@IF_SVM_COMPILER@syntax-compiler: compiler/machines/svm/svm1-defns.h
(echo '(with-working-directory-pathname "compiler"' && \
- echo ' (lambda () (load "compiler.sf")))') \
- | $(HOST_RUNTIME_ONLY)
+ echo ' (lambda ()' && \
+ echo ' $(SF_SETTINGS_CROSS)' && \
+ echo ' (load "compiler.sf")))') \
+ | $(HOST_RUNTIME_ONLY) --eval '(load-option (quote SF))'
.PHONY: compile-compiler
compile-compiler: syntax-compiler
(define compiler:compile-data-files-as-expressions? #t)
(define compile-file)
(let ((scm-pathname (lambda (path) (pathname-new-type path "scm")))
- (bin-pathname (lambda (path) (pathname-new-type path "bin")))
+ (bin-pathname
+ (lambda (path)
+ (pathname-new-type path (if sf/cross-compiling? "nib" "bin"))))
(ext-pathname (lambda (path) (pathname-default-type path "ext")))
(ext-pathname? (lambda (path) (equal? (pathname-type path) "ext")))
(com-pathname
(compiler-pathnames
input-string
(and (not (default-object? output-string)) output-string)
- (make-pathname #f #f #f #f "bin" 'NEWEST)
+ (make-pathname #f #f #f #f (if sf/cross-compiling? "nib" "bin") 'NEWEST)
(lambda (input-pathname output-pathname)
(fluid-let ((*compiler-input-pathname*
(merge-pathnames input-pathname))
\f
;;;; Alternate Entry Points
-(define compile-directory
- (directory-processor
- "bin"
- (lambda ()
- (compiler:compiled-code-pathname-type))
- (lambda (pathname output-directory)
- (compile-bin-file pathname output-directory))))
+(define (compile-directory input-directory #!optional output-directory force?)
+ ((directory-processor
+ (if sf/cross-compiling? "nib" "bin")
+ (lambda ()
+ (compiler:compiled-code-pathname-type))
+ (lambda (pathname output-directory)
+ (compile-bin-file pathname output-directory)))
+ input-directory output-directory force?))
(define (compile-scode scode #!optional keep-debugging-info?)
(compiler-output->compiled-expression
(fluid-let ((sf/default-syntax-table (->environment package)))
(sf-conditionally files))
(for-each (lambda (file)
- (load (string-append file ".bin") package))
+ (receive (scm bin spec)
+ (sf/pathname-defaulting file #f #f)
+ scm spec
+ (load bin package)))
files))))
(load-option 'hash-table)
(fresh-line)
(for-each
(lambda (node)
(let ((modification-time
- (let ((source (modification-time node "scm"))
- (binary (modification-time node "bin")))
- (if (not source)
- (error "Missing source file" (source-node/filename node)))
- (and binary (< source binary) binary))))
+ (receive (scm bin spec)
+ (sf/pathname-defaulting (source-node/pathname node) #f #f)
+ spec
+ (let ((source (file-modification-time scm))
+ (binary (file-modification-time bin)))
+ (if (not source)
+ (error "Missing source file" (source-node/filename node)))
+ (and binary (< source binary) binary)))))
(set-source-node/modification-time! node modification-time)
(if (not modification-time)
(write-notification-line
(lambda (declarations)
(remove integration-declaration? declarations)))
(source-node/declarations node)))))
-
-(define (modification-time node type)
- (file-modification-time
- (pathname-new-type (source-node/pathname node) type)))
\f
;;;; Syntax dependencies
(for-each
(lambda (node)
(let ((modification-time
- (let ((source (modification-time node "scm"))
- (binary (modification-time node "bin")))
- (if (not source)
- (error "Missing source file" (source-node/filename node)))
- (and binary (< source binary) binary))))
+ (receive (scm bin spec)
+ (sf/pathname-defaulting (source-node/pathname node) #f #f)
+ spec
+ (let ((source (file-modification-time scm))
+ (binary (file-modification-time bin)))
+ (if (not source)
+ (error "Missing source file" (source-node/filename node)))
+ (and binary (< source binary) binary)))))
(set-source-node/modification-time! node modification-time)
(if (not modification-time)
(write-notification-line
(lambda (declarations)
(remove integration-declaration? declarations)))
(source-node/declarations node)))))
-
-(define (modification-time node type)
- (file-modification-time
- (pathname-new-type (source-node/pathname node) type)))
\f
;;;; Syntax dependencies
(sf-conditionally file)))
files)
(for-each (lambda (file)
- (load (pathname-new-type file "bin") (env file)))
+ (receive (scm bin spec)
+ (sf/pathname-defaulting file #f #f)
+ scm spec
+ (load bin (env file))))
files))))
(fresh-line)
(for-each
(lambda (node)
(let ((modification-time
- (let ((source (modification-time node "scm"))
- (binary (modification-time node "bin")))
- (if (not source)
- (error "Missing source file" (source-node/filename node)))
- (and binary (< source binary) binary))))
+ (receive (scm bin spec)
+ (sf/pathname-defaulting (source-node/pathname node) #f #f)
+ spec
+ (let ((source (file-modification-time scm))
+ (binary (file-modification-time bin)))
+ (if (not source)
+ (error "Missing source file" (source-node/filename node)))
+ (and binary (< source binary) binary)))))
(set-source-node/modification-time! node modification-time)
(if (not modification-time)
(write-notification-line
(lambda (declarations)
(remove integration-declaration? declarations)))
(source-node/declarations node)))))
-
-(define (modification-time node type)
- (file-modification-time
- (pathname-new-type (source-node/pathname node) type)))
\f
;;;; Integration Dependencies
(for-each
(lambda (node)
(let ((modification-time
- (let ((source (modification-time node "scm"))
- (binary (modification-time node "bin")))
- (if (not source)
- (error "Missing source file" (source-node/filename node)))
- (and binary (< source binary) binary))))
+ (receive (scm bin spec)
+ (sf/pathname-defaulting (source-node/pathname node) #f #f)
+ spec
+ (let ((source (file-modification-time scm))
+ (binary (file-modification-time bin)))
+ (if (not source)
+ (error "Missing source file" (source-node/filename node)))
+ (and binary (< source binary) binary)))))
(set-source-node/modification-time! node modification-time)
(if (not modification-time)
(write-notification-line
(lambda (declarations)
(remove integration-declaration? declarations)))
(source-node/declarations node)))))
-
-(define (modification-time node type)
- (file-modification-time
- (pathname-new-type (source-node/pathname node) type)))
\f
;;;; Syntax dependencies
(define (cache-file-analysis! pmodel caches pathname changes?)
(let ((cache (analysis-cache/lookup caches pathname))
(full-pathname
- (merge-pathnames (pathname-new-type pathname "bin")
- (pmodel/pathname pmodel))))
+ (merge-pathnames
+ (pathname-new-type pathname (if sf/cross-compiling? "nib" "bin"))
+ (pmodel/pathname pmodel))))
(let ((time (file-modification-time full-pathname)))
(if (not time)
(error "unable to open file" full-pathname))
(or (try-fasl-file pathname)
(try-fasl-file (pathname-new-type pathname "com"))
(try-object-file (pathname-new-type pathname "so"))
- (try-fasl-file (pathname-new-type pathname "bin"))))))
+ (let ((bin-type (if package/cross-compiling? "nib" "bin")))
+ (try-fasl-file (pathname-new-type pathname bin-type)))))))
(if thunk
(receive (pathname loader notifier) (thunk)
(values pathname
(export 'package-set-pathname)
(export 'package/add-child!)
(export 'package/children)
+ (export 'package/cross-compiling?)
(export 'package/environment)
(export 'package/name)
(export 'package/parent)
(else #f)))
(define (load-entry entry)
- (for-each (lambda (thunk) (thunk)) (cdr entry))
+ (fluid-let ((package/cross-compiling? #f))
+ (for-each (lambda (thunk) (thunk)) (cdr entry)))
(set! loaded-options (cons name loaded-options))
name)
;; Obsolete and ignored:
(define system-loader/enable-query? #f)
+(define package/cross-compiling?
+ #f)
+
(define (package-set-pathname pathname #!optional os-type)
(let ((p (->pathname pathname)))
(pathname-new-type
"")))
"-"
(microcode-id/operating-system-suffix os-type)))
- "pkd")))
+ (if package/cross-compiling?
+ "dkp"
+ "pkd"))))
\f
(define-integrable (make-package-file tag version descriptions loads)
(vector tag version descriptions loads))
package/add-child!
package/create
package/children
+ package/cross-compiling?
package/environment
package/name
package/parent
(define sf-directory
(directory-processor
"scm"
- (lambda () "bin")
+ (lambda () (if sf/cross-compiling? "nib" "bin"))
(lambda (pathname output-directory)
(sf pathname output-directory))))
(parent (scode-optimizer))
(export ()
sf
+ sf/cross-compiling?
sf/default-declarations
sf/default-syntax-table
sf/pathname-defaulting
\f
;;;; User Interface
-(define bin-pathname-type "bin")
+(define (bin-pathname-type)
+ (if sf/cross-compiling? "nib" "bin"))
(define (integrate/procedure procedure)
(procedure-components procedure
(define sf/usual-integrations-default-deletions
'())
+
+(define sf/cross-compiling?
+ #f)
\f
;;;; File Syntaxer
(if (> (string-length input-type) 2)
(string-head input-type 2)
input-type))
- bin-pathname-type)))))
+ (bin-pathname-type))))))
(if bin-string
(merge-pathnames bin-string bin-path)
bin-path))
(define (sf/file->scode input-pathname output-pathname
environment declarations)
(fluid-let ((sf/default-externs-pathname
- (make-pathname (pathname-host input-pathname)
- (pathname-device input-pathname)
- (pathname-directory input-pathname)
- #f
- externs-pathname-type
- 'newest)))
+ (lambda ()
+ (make-pathname (pathname-host input-pathname)
+ (pathname-device input-pathname)
+ (pathname-directory input-pathname)
+ #f
+ (externs-pathname-type)
+ 'newest))))
(receive (expression externs-block externs)
(integrate/file input-pathname environment declarations)
(if output-pathname
(write-externs-file (pathname-new-type output-pathname
- externs-pathname-type)
+ (externs-pathname-type))
externs-block
externs))
expression)))
-(define externs-pathname-type
- "ext")
+(define (externs-pathname-type)
+ (if sf/cross-compiling? "txe" "ext"))
-(define sf/default-externs-pathname
- (make-pathname #f #f #f #f externs-pathname-type 'newest))
+(define (sf/default-externs-pathname)
+ (make-pathname #f #f #f #f (externs-pathname-type) 'newest))
\f
(define (read-externs-file pathname)
- (let ((pathname (merge-pathnames pathname sf/default-externs-pathname)))
+ (let ((pathname (merge-pathnames pathname (sf/default-externs-pathname))))
(let ((namestring (->namestring pathname)))
(if (file-exists? pathname)
(let ((object (fasload pathname #t))
(fluid-let ((sf/default-syntax-table (->environment '(win32))))
(sf-conditionally "ffimacro")
- (load "ffimacro.bin" '(win32 ffi-macro))
+ (receive (scm bin spec) (sf/pathname-defaulting "ffimacro" #f #f)
+ scm spec
+ (load bin '(win32 ffi-macro)))
(sf-conditionally "winuser")
(sf-conditionally "wingdi")