diff --git a/racket/src/cs/main.sps b/racket/src/cs/main.sps index 779713031e..09b695a7c3 100644 --- a/racket/src/cs/main.sps +++ b/racket/src/cs/main.sps @@ -183,6 +183,7 @@ (define exit-value 0) (define host-collects-dir init-collects-dir) (define host-config-dir init-config-dir) + (define addon-dir #f) (define (no-init! saw) (unless (saw? saw 'top) @@ -330,6 +331,10 @@ (when init-library (set! init-library `(lib ,lib-name))) (loop rest-args))] + [("-A" "--addon") + (let-values ([(addon-path rest-args) (next-arg "addon directory" arg within-arg args)]) + (set! addon-dir addon-path) + (loop rest-args))] [("-X" "--collects") (let-values ([(collects-path rest-args) (next-arg "collects path" arg within-arg args)]) (cond @@ -545,6 +550,11 @@ (let ([f (dynamic-require mod sym)]) (f pch))))) + (let ([a (or addon-dir + (getenv "PLTADDONDIR"))]) + (when a + (set-addon-dir! (path->complete-path a)))) + (when (getenv "PLT_STATS_ON_BREAK") (keyboard-interrupt-handler (let ([orig (keyboard-interrupt-handler)]) diff --git a/racket/src/io/Makefile b/racket/src/io/Makefile index d894e3850f..8a27e93bbf 100644 --- a/racket/src/io/Makefile +++ b/racket/src/io/Makefile @@ -26,7 +26,8 @@ GLOBALS = --no-global \ ++global-ok exec-file \ ++global-ok run-file \ ++global-ok collects-dir \ - ++global-ok config-dir + ++global-ok config-dir \ + ++global-ok addon-dir io-src: $(RKTIO_DEP) $(RACO) make ../expander/bootstrap-run.rkt diff --git a/racket/src/io/path/main.rkt b/racket/src/io/path/main.rkt index 76ccdc0761..177fe195b2 100644 --- a/racket/src/io/path/main.rkt +++ b/racket/src/io/path/main.rkt @@ -60,6 +60,7 @@ set-run-file! set-collects-dir! set-config-dir! + set-addon-dir! _path) diff --git a/racket/src/io/path/system.rkt b/racket/src/io/path/system.rkt index cb619bd452..b87645aba2 100644 --- a/racket/src/io/path/system.rkt +++ b/racket/src/io/path/system.rkt @@ -10,7 +10,8 @@ set-exec-file! set-run-file! set-collects-dir! - set-config-dir!) + set-config-dir! + set-addon-dir!) (define/who (find-system-path key) (begin0 @@ -28,7 +29,8 @@ [(sys-dir) (rktio-system-path who RKTIO_PATH_SYS_DIR)] [(pref-dir) (rktio-system-path who RKTIO_PATH_PREF_DIR)] [(pref-file) (rktio-system-path who RKTIO_PATH_PREF_FILE)] - [(addon-dir) (rktio-system-path who RKTIO_PATH_ADDON_DIR)] + [(addon-dir) (or addon-dir + (rktio-system-path who RKTIO_PATH_ADDON_DIR))] [(home-dir) (rktio-system-path who RKTIO_PATH_HOME_DIR)] [(desk-dir) (rktio-system-path who RKTIO_PATH_DESK_DIR)] [(doc-dir) (rktio-system-path who RKTIO_PATH_DOC_DIR)] @@ -56,6 +58,9 @@ (define config-dir #f) (define (set-config-dir! p) (set! config-dir p)) +(define addon-dir #f) +(define (set-addon-dir! p) (set! addon-dir p)) + (define (rktio-system-path who key) (start-atomic) (define s (rktio_system_path rktio key))