write exe-relative paths to main exe for Mac OS X

svn: r2796
This commit is contained in:
Matthew Flatt 2006-04-26 12:56:54 +00:00
parent df5cecb6b7
commit 39b09735a2
2 changed files with 17 additions and 7 deletions

View File

@ -248,7 +248,7 @@
resource-files)) resource-files))
(build-path dest "Contents" "MacOS" name))) (build-path dest "Contents" "MacOS" name)))
(define (finish-osx-mred dest flags exec-name keep-exe?) (define (finish-osx-mred dest flags exec-name keep-exe? relative?)
(call-with-output-file (build-path dest (call-with-output-file (build-path dest
"Contents" "Contents"
"Resources" "Resources"
@ -257,7 +257,16 @@
(write-plist (write-plist
`(dict ,@(if keep-exe? `(dict ,@(if keep-exe?
`((assoc-pair "executable name" `((assoc-pair "executable name"
,(path->string exec-name))) ,(path->string
(if relative?
(let ([p (find-relative-path
(let-values ([(dir name dir?) (split-path (normalize-path dest))])
dir)
(normalize-path exec-name))])
(if (relative-path? p)
(build-path 'up 'up 'up p)
p))
exec-name))))
null) null)
(assoc-pair "stored arguments" (assoc-pair "stored arguments"
(array ,@flags))) (array ,@flags)))
@ -607,7 +616,9 @@
(list "-k" start-s end-s)) (list "-k" start-s end-s))
cmdline)]) cmdline)])
(if osx? (if osx?
(finish-osx-mred dest full-cmdline exe keep-exe?) (finish-osx-mred dest full-cmdline exe keep-exe?
(let ([m (assq 'relative? aux)])
(and m (cdr m))))
(let ([cmdpos (with-input-from-file dest-exe (let ([cmdpos (with-input-from-file dest-exe
(lambda () (find-cmdline (lambda () (find-cmdline
"cmdline" "cmdline"

View File

@ -37,10 +37,9 @@ executables.
script will call (ignoring `args'); if this name is not script will call (ignoring `args'); if this name is not
provided, the script will go through the MrEd executable provided, the script will go through the MrEd executable
_'relative?_ (Unix, Mac OS X Mzscheme or 'script[-3m] variant, _'relative?_ (all) - a boolean, where #t means that the generate
or Windows in 'independent? mode) - a boolean, where #t shell script should launch the executable through a
means that the generate shell script should launch the relative path
executable through a relative path
See also `build-aux-from-path' below. The default `aux' is `null'. See also `build-aux-from-path' below. The default `aux' is `null'.