support to set framework path in os x

svn: r251
This commit is contained in:
Matthew Flatt 2005-06-28 12:51:18 +00:00
parent fd00d79aff
commit a69440a111
2 changed files with 33 additions and 1 deletions

View File

@ -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

View File

@ -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 ()