diff --git a/collects/setup/unixstyle-install.ss b/collects/setup/unixstyle-install.ss index f99411eb39..b93bacdad5 100644 --- a/collects/setup/unixstyle-install.ss +++ b/collects/setup/unixstyle-install.ss @@ -272,14 +272,15 @@ (define (ftime file) (and (file-exists? file) (file-or-directory-modify-seconds file))) (let* ([src (cpath "config.ss")] - [zo (cpath "compiled" "config.zo")] - [dep (cpath "compiled" "config.dep")] + [zo (cpath "compiled" "config_ss.zo")] + ;; [dep (cpath "compiled" "config_ss.dep")] ; not needed [src-time (ftime src)] [zo-time (ftime zo)]) (printf "Rewriting configuration file at: ~a...\n" src) - (parameterize ([current-library-collection-paths ; for configtab.ss + (parameterize ([current-namespace (make-base-namespace)] ; to compile + [current-library-collection-paths ; for configtab.ss (list collectsdir)]) - (with-output-to-file (cpath "config.ss") #:exists 'truncate/replace + (with-output-to-file src #:exists 'truncate/replace (lambda () (printf ";; automatically generated by unixstyle-install\n") (printf "(module config (lib \"configtab.ss\" \"setup\")\n") @@ -293,14 +294,17 @@ ;; recompile & set times as if nothing happened (don't remove .dep) ;; this requires the file to look the same on all compilations, and ;; configtab.ss generates bindings unhygienically for that reason. - (unless (and (pair? compile?) (not (car compile?))) + (when compile? (when src-time (file-or-directory-modify-seconds src src-time)) - (when zo-time - (with-input-from-file src - (lambda () - (with-output-to-file zo #:exists 'truncate/replace - (lambda () (write (compile (read-syntax))))))) - (file-or-directory-modify-seconds zo zo-time)))))])) + (if (not zo-time) + (printf "WARNING: skipping recompilation, no zo file at ~a\n" zo) + (begin + (printf "Recompiling to ~a...\n" zo) + (with-input-from-file src + (lambda () + (with-output-to-file zo #:exists 'truncate/replace + (lambda () (write (compile (read-syntax))))))) + (file-or-directory-modify-seconds zo zo-time))))))])) ;; creates a directory including its ancestors when needed (define (make-dir* dir)