diff --git a/racket/lib/collects/mzlib/restart.rkt b/pkgs/compatibility-pkgs/compatibility-lib/mzlib/restart.rkt similarity index 100% rename from racket/lib/collects/mzlib/restart.rkt rename to pkgs/compatibility-pkgs/compatibility-lib/mzlib/restart.rkt diff --git a/racket/src/worksp/gc2/make.rkt b/racket/src/worksp/gc2/make.rkt index d4fccdde79..468f416362 100644 --- a/racket/src/worksp/gc2/make.rkt +++ b/racket/src/worksp/gc2/make.rkt @@ -2,8 +2,7 @@ (use-compiled-file-paths null) -(require mzlib/restart - racket/system) +(require racket/system) (define (system- s) (eprintf "~a\n" s) @@ -106,37 +105,42 @@ (if (file-exists? deps) (with-input-from-file deps read) null)))))) - (unless (parameterize ([use-compiled-file-paths (list "compiled")]) - (restart-mzscheme #() (lambda (x) x) - (list->vector - (append - (list "-u" - "../../racket/gc2/xform.rkt" - "--setup" - ".") - (if objdest - (if use-precomp - (list "--precompiled" use-precomp) - null) - (list "--precompile")) - (if indirect? - '("--indirect") - null) - (list - "--depends" - "--cpp" - (format "~a /MT /E ~a ~a ~a" - cl.exe - common-cpp-defs - expand-extra-flags - includes) - "-o" - dest - src))) - void)) + (define success? #f) + (sync + (thread + (lambda () + (parameterize ([use-compiled-file-paths (list "compiled")] + [current-namespace (make-base-namespace)] + [current-command-line-arguments + (list->vector + (append + (list "--setup" + ".") + (if objdest + (if use-precomp + (list "--precompiled" use-precomp) + null) + (list "--precompile")) + (if indirect? + '("--indirect") + null) + (list + "--depends" + "--cpp" + (format "~a /MT /E ~a ~a ~a" + cl.exe + common-cpp-defs + expand-extra-flags + includes) + "-o" + dest + src)))]) + (dynamic-require "../../racket/gc2/xform.rkt" #f) + (set! success? #t))))) + (unless success? (when (file-exists? dest) - (delete-file dest)) - (error "error xforming"))) + (delete-file dest)) + (error "error xforming"))) (when objdest (c-compile dest objdest null (string-append extra-compile-flags diff --git a/racket/src/worksp/mzcom/xform.rkt b/racket/src/worksp/mzcom/xform.rkt index f80db86e23..410b586782 100644 --- a/racket/src/worksp/mzcom/xform.rkt +++ b/racket/src/worksp/mzcom/xform.rkt @@ -1,31 +1,25 @@ #lang scheme/base -(use-compiled-file-paths null) - -(require mzlib/restart) - (define cpp-flags "/D _CRT_SECURE_NO_DEPRECATE /D WIN32 /D _USE_DECLSPECS_FOR_SAL=0 /D _USE_ATTRIBUTES_FOR_SAL=0") (define includes "/I ../../racket/include /I . /I .. /I ../../mzcom") (define (xform src dest) - (parameterize ([use-compiled-file-paths (list "compiled")]) - (restart-mzscheme #() (lambda (x) x) - (list->vector - (append - (list "-u" - "../../racket/gc2/xform.rkt" - "--setup" - "../gc2" - "--indirect" - "--depends") - (list - "--cpp" - (format "cl.exe /MT /E ~a ~a" - cpp-flags - includes) - "-o" - dest - src))) - void))) + (parameterize ([use-compiled-file-paths (list "compiled")] + [current-command-line-arguments + (list->vector + (append + (list "--setup" + "../gc2" + "--indirect" + "--depends") + (list + "--cpp" + (format "cl.exe /MT /E ~a ~a" + cpp-flags + includes) + "-o" + dest + src)))]) + (dynamic-require "../../racket/gc2/xform.rkt" #f))) (xform "../../mzcom/mzobj.cxx" "../../mzcom/mzobj3m.cxx")