diff --git a/collects/compiler/doc.txt b/collects/compiler/doc.txt index f8ef3ae233..cfaed0f112 100644 --- a/collects/compiler/doc.txt +++ b/collects/compiler/doc.txt @@ -482,10 +482,19 @@ _embedr-sig.ss_ library provides the signature, _compiler:embed^_. -'resource-files_ (Mac OS X) - extra files to copy into the "Resources" directory of the generated executable + _'framework-root_ (Mac OS X) - a string to prefix the + executable's path to the MzScheme and MrEd frameworks + (including a separating slash); note that when the + prefix start "@executable_path/" works for a + MzScheme-based application, the corresponding prefix + start for a MrEd-based application is + "@executable_path/../../../" + _'subsystem_ (Windows) - a symbol, either 'console for a console application or 'windows for a consoleless application; the default is 'console for a MzScheme-based application - and 'windows for a MrEd-based application + and 'windows for a MrEd-based application; see also + 'single-instance?, below _'single-instance?_ (Windows) - a boolean for MrEd-based apps; the default is #t, which means that the app looks for instances diff --git a/collects/compiler/embed-unit.ss b/collects/compiler/embed-unit.ss index 3b5e3ab3c2..0b1ae63d6b 100644 --- a/collects/compiler/embed-unit.ss +++ b/collects/compiler/embed-unit.ss @@ -7,6 +7,7 @@ (lib "port.ss") (lib "moddep.ss" "syntax") (lib "plist.ss" "xml") + (lib "process.ss") "embed-sig.ss" "private/winicon.ss" "private/winsubsys.ss") @@ -506,6 +507,28 @@ (when (file-exists? dest) (delete-file dest))) (raise x))]) + (let ([m (and (eq? 'macosx (system-type)) + (assq 'framework-root aux))]) + (when m + (for-each (lambda (p) + (system* "/usr/bin/install_name_tool" + "-change" + (format "~a.framework/Versions/~a/~a" p (version) p) + (format "~a~a.framework/Versions/~a/~a" + (cdr m) + p (version) p) + (let ([dest (if mred? + (let-values ([(base name dir?) (split-path dest)]) + (build-path dest + "Contents" "MacOS" + (path-replace-suffix name #""))) + dest)]) + (if (path? dest) + (path->string dest) + dest)))) + (if mred? + '("PLT_MzScheme" "PLT_MrEd") + '("PLT_MzScheme"))))) (let ([start (file-size dest-exe)]) (with-output-to-file dest-exe (lambda ()