racket/rktboot/main.rkt
Matthew Flatt aa9bba9328 add Racket-based bootstrap support
Move "racket/src/cs/bootstrap" from the Racket source repository to
this one, because the bootstrapping implementation needs to track the
Chez Scheme source much more closely than the Racket implementation.
Currently, any Racket v7.1 or later works.

Also update "README.md" and "BUILDING" to get all the information
consistent and in sync with revised build options.

original commit: a9e6e99ea414b4625fe9705e4f3cfd62bbf38ae2
2020-07-25 14:10:25 -06:00

30 lines
889 B
Racket

#lang racket/base
(require racket/cmdline
racket/runtime-path)
;; Wrapper around "make-boot.rkt" to make it work in a more normal way
;; with command-line arguments, instead of environment variables.
(define scheme-src #f)
(define mach #f)
(command-line
#:once-each
[("--scheme-src") dir "Select the directory (defaults to current directory)"
(set! scheme-src dir)]
[("--machine") machine "Select the machine type (defaults to inferred)"
(set! mach machine)])
(unless scheme-src
(printf "Assuming current directory has Chez Scheme sources\n")
(flush-output))
(void (putenv "SCHEME_SRC" (or scheme-src ".")))
(when mach
(void (putenv "MACH" mach)))
;; Dynamic, so that environment variables are visible to
;; compile-time instantiation of `make-boot`:
(define-runtime-path make-boot "make-boot.rkt")
(dynamic-require make-boot #f)