301.13 (the beginning of the end for PLTHOME)

svn: r2740
This commit is contained in:
Matthew Flatt 2006-04-23 02:36:55 +00:00
parent 4edd6f5b4f
commit 1d77707ef1
25 changed files with 2066 additions and 1765 deletions

View File

@ -394,7 +394,16 @@ The _embedr-unit.ss_ library provides a signed unit, _compiler:embed@_
that imports nothing and exports the functions below. The that imports nothing and exports the functions below. The
_embedr-sig.ss_ library provides the signature, _compiler:embed^_. _embedr-sig.ss_ library provides the signature, _compiler:embed^_.
> (make-embedding-executable dest mred? verbose? mod-list literal-file-list literal-sexpr cmdline-list [aux launcher? variant]) > (create-embedding-executable dest
[#:modules mod-list]
[#:literal-files literal-file-list]
[#:literal-expression literal-sexp]
[#:cmdline cmdline-list]
[#:mred? mred?]
[#:variant variant]
[#:aux aux]
[#:launcher? launcher?]
[#:verbose? verbose?])
- Copies the MzScheme (if `mred?' is #f) or MrEd (otherwise) binary, - Copies the MzScheme (if `mred?' is #f) or MrEd (otherwise) binary,
embedding code into the copied executable to be loaded on startup. embedding code into the copied executable to be loaded on startup.
The source executable is located relative to the "mzlib" collection. The source executable is located relative to the "mzlib" collection.
@ -526,6 +535,9 @@ _embedr-sig.ss_ library provides the signature, _compiler:embed^_.
the only other possibility is '3m. See `current-launcher-variant' the only other possibility is '3m. See `current-launcher-variant'
in the "launcher" collection for more information. in the "launcher" collection for more information.
> (make-embedding-executable dest mred? verbose? mod-list literal-file-list literal-sexpr cmdline-list [aux launcher? variant])
Old (keywordless) interface to `create-embedding-executable'.
> (write-module-bundle verbose? mod-list literal-file-list literal-sexpr) > (write-module-bundle verbose? mod-list literal-file-list literal-sexpr)
- Like `make-embedding-executable', but the module bundle is written - Like `make-embedding-executable', but the module bundle is written

View File

@ -4,7 +4,8 @@
(provide compiler:embed^) (provide compiler:embed^)
(define-signature compiler:embed^ (define-signature compiler:embed^
(make-embedding-executable (create-embedding-executable
make-embedding-executable
write-module-bundle write-module-bundle
embedding-executable-is-directory? embedding-executable-is-directory?
embedding-executable-is-actually-directory? embedding-executable-is-actually-directory?

View File

@ -8,6 +8,7 @@
(lib "moddep.ss" "syntax") (lib "moddep.ss" "syntax")
(lib "plist.ss" "xml") (lib "plist.ss" "xml")
(lib "plthome.ss" "setup") (lib "plthome.ss" "setup")
(lib "kw.ss")
"embed-sig.ss" "embed-sig.ss"
"private/winicon.ss" "private/winicon.ss"
"private/winsubsys.ss" "private/winsubsys.ss"
@ -63,7 +64,7 @@
[base (build-path c-path 'up 'up)] [base (build-path c-path 'up 'up)]
[fail [fail
(lambda () (lambda ()
(error 'make-embedding-executable (error 'create-embedding-executable
"can't find ~a executable" "can't find ~a executable"
(if mred? "MrEd" "MzScheme")))] (if mred? "MrEd" "MzScheme")))]
[variant-suffix (case variant [variant-suffix (case variant
@ -111,7 +112,7 @@
(if m (if m
(caar m) (caar m)
(error (error
'make-embedding-executable 'create-embedding-executable
(format (format
"can't find ~a position in executable" "can't find ~a position in executable"
what))))) what)))))
@ -477,7 +478,7 @@
(when literal-expression (when literal-expression
(write literal-expression)))) (write literal-expression))))
;; Use `write-module-bundle', but figure out how to put it into an executable ;; The old interface:
(define make-embedding-executable (define make-embedding-executable
(opt-lambda (dest mred? verbose? (opt-lambda (dest mred? verbose?
modules modules
@ -486,17 +487,52 @@
[aux null] [aux null]
[launcher? #f] [launcher? #f]
[variant 'normal]) [variant 'normal])
(create-embedding-executable dest
#:mred? mred?
#:verbose? verbose?
#:modules modules
#:literal-files literal-files
#:literal-expression literal-expression
#:cmdline cmdline
#:aux aux
#:launcher? launcher?
#:variant variant)))
;; Use `write-module-bundle', but figure out how to put it into an executable
(define/kw (create-embedding-executable dest
#:key
[mred? #f]
[verbose? #f]
[modules null]
[literal-files null]
[literal-expression #f]
[cmdline null]
[aux null]
[launcher? #f]
[variant 'normal]
[lib-path #f])
(define keep-exe? (and launcher? (define keep-exe? (and launcher?
(let ([m (assq 'forget-exe? aux)]) (let ([m (assq 'forget-exe? aux)])
(or (not m) (or (not m)
(not (cdr m)))))) (not (cdr m))))))
(define long-cmdline? (or (eq? (system-type) 'windows) (define long-cmdline? (or (eq? (system-type) 'windows)
(and mred? (eq? 'macosx (system-type))))) (and mred? (eq? 'macosx (system-type)))))
(define lib-path-bytes (and lib-path
(if (path? lib-path)
(path->bytes lib-path)
(if (string? lib-path)
(string->bytes/locale lib-path)
#f))))
(unless (or long-cmdline? (unless (or long-cmdline?
((apply + (length cmdline) (map (lambda (s) ((apply + (length cmdline) (map (lambda (s)
(bytes-length (string->bytes/utf-8 s))) (bytes-length (string->bytes/utf-8 s)))
cmdline)) . < . 50)) cmdline)) . < . 50))
(error 'make-embedding-executable "command line too long")) (error 'create-embedding-executable "command line too long"))
(when lib-path
(unless (path-string? lib-path)
(raise-type-error 'create-embedding-executable "path, string, or #f" lib-path))
(unless ((bytes-length lib-path-bytes) . <= . 512)
(error 'create-embedding-executable "'collects-path value is too long")))
(let ([exe (find-exe mred? variant)]) (let ([exe (find-exe mred? variant)])
(when verbose? (when verbose?
(fprintf (current-error-port) "Copying to ~s~n" dest)) (fprintf (current-error-port) "Copying to ~s~n" dest))
@ -564,6 +600,13 @@
(lambda () (find-cmdline (lambda () (find-cmdline
"cmdline" "cmdline"
#"\\[Replace me for EXE hack")))] #"\\[Replace me for EXE hack")))]
[libpos (and lib-path
(let ([tag #"coLLECTs dIRECTORy:"])
(+ (with-input-from-file dest-exe
(lambda () (find-cmdline
"collects path"
tag)))
(bytes-length tag))))]
[anotherpos (and mred? [anotherpos (and mred?
(eq? 'windows (system-type)) (eq? 'windows (system-type))
(let ([m (assq 'single-instance? aux)]) (let ([m (assq 'single-instance? aux)])
@ -579,6 +622,10 @@
(when anotherpos (when anotherpos
(file-position out anotherpos) (file-position out anotherpos)
(write-bytes #"no," out)) (write-bytes #"no," out))
(when libpos
(file-position out libpos)
(write-bytes lib-path-bytes out)
(write-byte 0 out))
(if long-cmdline? (if long-cmdline?
;; write cmdline at end: ;; write cmdline at end:
(file-position out end) (file-position out end)
@ -614,4 +661,4 @@
(let ([m (and (eq? 'windows (system-type)) (let ([m (and (eq? 'windows (system-type))
(assq 'subsystem aux))]) (assq 'subsystem aux))])
(when m (when m
(set-subsystem dest-exe (cdr m)))))))))))))))))) (set-subsystem dest-exe (cdr m)))))))))))))))))

View File

@ -25,6 +25,7 @@
symbol?) symbol?)
void?)]) void?)])
(provide write-module-bundle (provide write-module-bundle
create-embedding-executable
embedding-executable-is-directory? embedding-executable-is-directory?
embedding-executable-put-file-extension+style+filters embedding-executable-put-file-extension+style+filters
embedding-executable-add-suffix)) embedding-executable-add-suffix))

View File

@ -1,7 +1,7 @@
(module embed mzscheme (module embed mzscheme
(require (lib "embed.ss" "compiler")) (require (lib "embed.ss" "compiler"))
(define mzc:make-embedding-executable make-embedding-executable) (define mzc:create-embedding-executable create-embedding-executable)
(define mzc:embedding-executable-add-suffix embedding-executable-add-suffix) (define mzc:embedding-executable-add-suffix embedding-executable-add-suffix)
(provide mzc:make-embedding-executable (provide mzc:create-embedding-executable
mzc:embedding-executable-add-suffix)) mzc:embedding-executable-add-suffix))

View File

@ -3,21 +3,32 @@
(require (lib "process.ss")) (require (lib "process.ss"))
(provide update-framework-path (provide update-framework-path
get-current-framework-path) get-current-framework-path
update-framework-path/cmdline)
(define (update-framework-path/cmdline)
(let ([v (current-command-line-arguments)])
(update-framework-path (vector-ref v 0)
(vector-ref v 1)
(equal? (vector-ref v 2) "mred"))))
(define (update-framework-path fw-path dest mred?) (define (update-framework-path fw-path dest mred?)
(let ([dest (if (path? dest) (let ([dest (if (path? dest)
(path->string dest) (path->string dest)
dest)]) dest)])
(for-each (lambda (p) (for-each (lambda (p)
(let* ([orig (get-current-framework-path dest p)]
[3m (if (and orig (regexp-match #rx"_3m" orig))
"_3m"
"")])
(system* "/usr/bin/install_name_tool" (system* "/usr/bin/install_name_tool"
"-change" "-change"
(or (get-current-framework-path dest p) (or orig
(format "~a.framework/Versions/~a/~a" p (version) p)) (format "~a.framework/Versions/~a~a/~a" p (version) 3m p))
(format "~a~a.framework/Versions/~a/~a" (format "~a~a.framework/Versions/~a~a/~a"
fw-path fw-path
p (version) p) p (version) 3m p)
dest)) dest)))
(if mred? (if mred?
'("PLT_MrEd") '("PLT_MrEd")
'("PLT_MzScheme"))))) '("PLT_MzScheme")))))

View File

@ -43,6 +43,7 @@
(define exe-embedded-flags (make-parameter '("-mvq-"))) (define exe-embedded-flags (make-parameter '("-mvq-")))
(define exe-embedded-libraries (make-parameter null)) (define exe-embedded-libraries (make-parameter null))
(define exe-aux (make-parameter null)) (define exe-aux (make-parameter null))
(define exe-embedded-lib-path (make-parameter #f))
(define module-mode (make-parameter #f)) (define module-mode (make-parameter #f))
@ -256,6 +257,10 @@
[help-labels [help-labels
"--------------------- executable configuration flags ------------------------"] "--------------------- executable configuration flags ------------------------"]
[once-each [once-each
[("--collects")
,(lambda (f i)
(exe-embedded-lib-path i))
("Path to libraries relative to --[gui-]exe executable" "path")]
[("--ico") [("--ico")
,(lambda (f i) (exe-aux ,(lambda (f i) (exe-aux
(cons (cons 'ico i) (cons (cons 'ico i)
@ -496,26 +501,26 @@
(exe-output) (exe-output)
(eq? mode 'gui-exe))]) (eq? mode 'gui-exe))])
((dynamic-require '(lib "embed.ss" "compiler" "private") ((dynamic-require '(lib "embed.ss" "compiler" "private")
'mzc:make-embedding-executable) 'mzc:create-embedding-executable)
dest dest
(eq? mode 'gui-exe) #:mred? (eq? mode 'gui-exe)
(compiler:option:verbose) #:verbose? (compiler:option:verbose)
(cons #:modules (cons
`(#%mzc: (file ,(car source-files))) `(#%mzc: (file ,(car source-files)))
(map (lambda (l) (map (lambda (l)
`(#t (lib ,@l))) `(#t (lib ,@l)))
(exe-embedded-libraries))) (exe-embedded-libraries)))
null #:literal-expression `(require ,(string->symbol
`(require ,(string->symbol
(format (format
"#%mzc:~a" "#%mzc:~a"
(let-values ([(base name dir?) (split-path (car source-files))]) (let-values ([(base name dir?) (split-path (car source-files))])
(path->bytes (path-replace-suffix name #"")))))) (path->bytes (path-replace-suffix name #""))))))
(let ([flags (exe-embedded-flags)]) #:cmdline (let ([flags (exe-embedded-flags)])
(if (eq? mode 'gui-exe) (if (eq? mode 'gui-exe)
(cons "-Z" flags) (cons "-Z" flags)
flags)) flags))
(exe-aux)) #:lib-path (exe-embedded-lib-path)
#:aux (exe-aux))
(printf " [output to \"~a\"]~n" dest))] (printf " [output to \"~a\"]~n" dest))]
[(plt) [(plt)
(for-each (lambda (fd) (for-each (lambda (fd)

View File

@ -37,6 +37,11 @@ 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,
or Windows in 'independent? mode) - a boolean, where #t
means that the generate shell script should launch the
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'.
For Unix/X, the script created by `make-mred-launcher' detects and For Unix/X, the script created by `make-mred-launcher' detects and

View File

@ -234,6 +234,73 @@
no-arg-x-flags))) no-arg-x-flags)))
args)))))) args))))))
(define (protect-shell-string s)
(regexp-replace* #rx"\"" s "\\\\\""))
(define (make-relative-path-header dest bindir)
(let ([dirname (find-executable-path "dirname")]
[basename (find-executable-path "basename")]
[readlink (find-executable-path "readlink")]
[dest-explode (explode-path (normalize-path dest))]
[bindir-explode (explode-path (normalize-path bindir))]
[newline "\n"])
(if (and dirname basename readlink
(equal? (car dest-explode) (car bindir-explode)))
(format
(string-append
"# Programs we need (avoid depending on user's PATH):" newline
"dirname=\"~a\"" newline
"basename=\"~a\"" newline
"readlink=\"~a\"" newline
newline
"# Remember current directory" newline
"saveD=`pwd`" newline
newline
"# Find absolute path to this script," newline
"# resolving symbolic references to the end" newline
"# (changes the current directory):" newline
"D=`$dirname \"$0\"`" newline
"F=`$basename \"$0\"`" newline
"cd \"$D\"" newline
"while [ -L \"$F\" ]; do" newline
" P=`$readlink \"$F\"`" newline
" D=`$dirname \"$P\"`" newline
" F=`$basename \"$P\"`" newline
" cd \"$D\"" newline
"done" newline
"D=`pwd`" newline
newline
"# Restore current directory" newline
"cd \"$saveD\"" newline
newline
"bindir=\"$D/~a\"" newline
newline)
(protect-shell-string (path->string dirname))
(protect-shell-string (path->string basename))
(protect-shell-string (path->string readlink))
(protect-shell-string (path->string
(apply
build-path
(let loop ([b bindir-explode]
[d dest-explode])
(cond
[(and (pair? b)
(equal? (car b) (car d)))
(loop (cdr b) (cdr d))]
[else
(append (map (lambda (x)
'up)
(cdr d))
b
(list 'same))]))))))
(make-absolute-path-header bindir))))
(define (make-absolute-path-header bindir)
(format
"bindir=\"~a\"\n\n"
(protect-shell-string
(path->string bindir))))
(define (make-unix-launcher kind variant flags dest aux) (define (make-unix-launcher kind variant flags dest aux)
(install-template dest kind "sh" "sh") ; just for something that's executable (install-template dest kind "sh" "sh") ; just for something that's executable
(let* ([newline (string #\newline)] (let* ([newline (string #\newline)]
@ -244,13 +311,15 @@
(format "~a~a.app/Contents/MacOS/~a~a" (format "~a~a.app/Contents/MacOS/~a~a"
(cdr m) (variant-suffix variant) (cdr m) (variant-suffix variant)
(cdr m) (variant-suffix variant))))] (cdr m) (variant-suffix variant))))]
[post-flags (if (and (eq? kind 'mred) [x-flags? (and (eq? kind 'mred)
(not (memq variant '(script script-3m)))) (eq? (system-type) 'unix)
(skip-x-flags flags) (not (memq variant '(script script-3m))))]
null)] [post-flags (cond
[pre-flags (cond [x-flags? (skip-x-flags flags)]
[alt-exe null] [alt-exe null]
[(null? post-flags) flags] [else flags])]
[pre-flags (cond
[(not x-flags?) null]
[else [else
(let loop ([f flags]) (let loop ([f flags])
(if (eq? f post-flags) (if (eq? f post-flags)
@ -262,22 +331,24 @@
(string-append (string-append
"#!/bin/sh" newline "#!/bin/sh" newline
"# This script was created by make-~a-launcher" newline "# This script was created by make-~a-launcher" newline
newline
"if [ \"$PLTHOME\" = '' ] ; then" newline
" PLTHOME=\"~a\"" newline
" export PLTHOME" newline
"fi" newline
newline) newline)
kind (regexp-replace* "\"" kind )]
(path->string plthome) [dir-finder
"\\\\\""))] (let ([bindir (if alt-exe
plthome
(build-path plthome "bin"))])
(if (let ([a (assq 'relative? aux)])
(and a (cdr a)))
(make-relative-path-header dest bindir)
(make-absolute-path-header bindir)))]
[exec (format [exec (format
"exec \"${PLTHOME}/~a~a~a\" ~a" "exec \"${bindir}/~a~a\" ~a"
(if alt-exe "" "bin/")
(or alt-exe kind) (or alt-exe kind)
(if alt-exe "" (variant-suffix variant)) pre-str)] (if alt-exe "" (variant-suffix variant))
pre-str)]
[args (format [args (format
" ~a ${1+\"$@\"}~n" "~a ~a ${1+\"$@\"}~n"
(if alt-exe "" " -N \"$0\"")
post-str)] post-str)]
[assemble-exec (if (and (eq? kind 'mred) [assemble-exec (if (and (eq? kind 'mred)
(not (memq variant '(script scrip-3m))) (not (memq variant '(script scrip-3m)))
@ -287,8 +358,9 @@
(unless plthome (unless plthome
(error 'make-unix-launcher "unable to locate PLTHOME")) (error 'make-unix-launcher "unable to locate PLTHOME"))
(let ([p (open-output-file dest 'truncate)]) (let ([p (open-output-file dest 'truncate)])
(fprintf p "~a~a" (fprintf p "~a~a~a"
header header
dir-finder
(assemble-exec exec args)) (assemble-exec exec args))
(close-output-port p)))) (close-output-port p))))

View File

@ -743,6 +743,7 @@
(let ([p (program-launcher-path mzln)] (let ([p (program-launcher-path mzln)]
[aux (list* `(exe-name . ,mzln) [aux (list* `(exe-name . ,mzln)
'(framework-root . #f) '(framework-root . #f)
'(relative? . #t)
(build-aux-from-path (build-aux-from-path
(build-path (cc-path cc) (build-path (cc-path cc)
(path-replace-suffix (or mzll mzln) #""))))]) (path-replace-suffix (or mzll mzln) #""))))])

View File

@ -8,9 +8,14 @@
(or n (or n
(let ([s (syntax-source stx)]) (let ([s (syntax-source stx)])
(and s (and s
(let ([s (cond (let ([s (let ([s (format
"~a"
(cond
[(path? s) (path->string s)] [(path? s) (path->string s)]
[else s])] [else s]))])
(if ((string-length s) . > . 20)
(string-append "..." (substring s (- (string-length s) 20)))
s))]
[l (syntax-line stx)] [l (syntax-line stx)]
[c (syntax-column stx)]) [c (syntax-column stx)])
(if l (if l

View File

@ -42,17 +42,13 @@ First, install the Mac OS X Developer Tools from Apple. Then, follow
the Unix instructions below, but note the following: the Unix instructions below, but note the following:
* The MzScheme build creates a framework, PLT_MzScheme.framework, * The MzScheme build creates a framework, PLT_MzScheme.framework,
which is installed into ~/Library/Frameworks. This framework is which is installed into plt/lib. This framework is used by the
used by the executable `mzscheme' that goes into plt/bin. executable `mzscheme' that goes into plt/bin.
* The MrEd build creates a framework, PLT_MrEd.framework, which is * The MrEd build creates a framework, PLT_MrEd.framework, which is
installed into ~/Library/Frameworks. This framework is used by the installed into plt/lib. This framework is used by the executable
executable bundle MrEd.app that goes into the `plt' directory. bundle MrEd.app that goes into the `plt' directory. Installation
Installation creates a script, plt/bin/mred, that runs the bundle. creates a script, plt/bin/mred, that runs the bundle.
* If you build frequently from the Subversion-based sources, beware
that you may accumlate many old, unused versions of the framework
in ~/Library/Frameworks.
* The --enable-shared flag for `configure' is redundant (i.e., builds * The --enable-shared flag for `configure' is redundant (i.e., builds
create and use frameworks by default), and --disable-shared is not create and use frameworks by default), and --disable-shared is not

View File

@ -494,13 +494,15 @@ void GetStarterInfo()
CFStringRef execName; CFStringRef execName;
CFArrayRef storedArgsArray; CFArrayRef storedArgsArray;
CFIndex count; CFIndex count;
char **storedArgs, *tmps; char **storedArgs, *tmps, *orig_argv0 = NULL;
int name_offset;
if (CFDictionaryContainsKey((CFDictionaryRef)propertyList, if (CFDictionaryContainsKey((CFDictionaryRef)propertyList,
(const void *)(CFSTR("executable name")))) { (const void *)(CFSTR("executable name")))) {
execName = (CFStringRef)CFDictionaryGetValue((CFDictionaryRef)propertyList, execName = (CFStringRef)CFDictionaryGetValue((CFDictionaryRef)propertyList,
(CFSTR("executable name"))); (CFSTR("executable name")));
tmps = ConvertCFStringRef(execName); tmps = ConvertCFStringRef(execName);
orig_argv0 = scheme_mac_argv[0];
scheme_mac_argv[0] = tmps; scheme_mac_argv[0] = tmps;
} }
@ -514,22 +516,30 @@ void GetStarterInfo()
count = CFArrayGetCount(storedArgsArray); count = CFArrayGetCount(storedArgsArray);
storedArgs = (char **)malloc(sizeof(char *) * (scheme_mac_argc + count)); name_offset = (orig_argv0 ? 2 : 0);
storedArgs = (char **)malloc(sizeof(char *) * (scheme_mac_argc + count + name_offset));
storedArgs[0] = scheme_mac_argv[0]; storedArgs[0] = scheme_mac_argv[0];
if (orig_argv0) {
/* Preserve the "run" name for a launcher: */
storedArgs[1] = "-N";
storedArgs[2] = orig_argv0;
}
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
CFStringRef arg; CFStringRef arg;
char *tmps; char *tmps;
arg = (CFStringRef)CFArrayGetValueAtIndex(storedArgsArray,i); arg = (CFStringRef)CFArrayGetValueAtIndex(storedArgsArray,i);
tmps = ConvertCFStringRef(arg); tmps = ConvertCFStringRef(arg);
storedArgs[i + 1] = tmps; storedArgs[i + 1 + name_offset] = tmps;
} }
for (i = 1; i < scheme_mac_argc; i++) { for (i = 1; i < scheme_mac_argc; i++) {
storedArgs[count + i] = scheme_mac_argv[i]; storedArgs[count + i + name_offset] = scheme_mac_argv[i];
} }
scheme_mac_argv = storedArgs; scheme_mac_argv = storedArgs;
scheme_mac_argc += count; scheme_mac_argc += count + name_offset;
} }
} }

View File

@ -69,7 +69,7 @@ LOCALFLAGS = $(LOCALFLAGS_@WXVARIANT@)
MREDOBJECTS = mrmain.@LTO@ MREDOBJECTS = mrmain.@LTO@
MZSCHEME = ../mzscheme/libmzscheme.@LIBSFX@ ../mzscheme/libmzgc.@LIBSFX@ MZSCHEMEDEPS = ../mzscheme/libmzscheme.@LIBSFX@ ../mzscheme/libmzgc.@LIBSFX@
WXSCHEME = wxs/libwxscheme.@LIBSFX@ WXSCHEME = wxs/libwxscheme.@LIBSFX@
WXME = wxme/libwxme.@LIBSFX@ WXME = wxme/libwxme.@LIBSFX@
@ -98,7 +98,7 @@ all:
bin: bin:
$(MAKE) $(LINKRESULT) $(MAKE) $(LINKRESULT)
mred : $(MZSCHEME) mrmain.@LTO@ $(MREDOBJECTS) $(@WXLIBS@) $(MRSTATIC_STUB) mred : $(MZSCHEMEDEPS) mrmain.@LTO@ $(MREDOBJECTS) $(@WXLIBS@) $(MRSTATIC_STUB)
$(MREDLINKER) $(MREDLDFLAGS) $(MRSTATIC) -o mred $(MREDOBJECTS) $(MREDLDLIBS) $(MRSTATIC_STUB) $(MREDLINKER) $(MREDLDFLAGS) $(MRSTATIC) -o mred $(MREDOBJECTS) $(MREDLDLIBS) $(MRSTATIC_STUB)
libmred.@LIBSFX@: $(WXLIBSNORM) libmred.@LIBSFX@: $(WXLIBSNORM)
@ -107,11 +107,12 @@ libmred.@LIBSFX@: $(WXLIBSNORM)
MRFW = PLT_MrEd.framework/Versions/$(FWVERSION)/PLT_MrEd MRFW = PLT_MrEd.framework/Versions/$(FWVERSION)/PLT_MrEd
MRFWRES = PLT_MrEd.framework/Versions/$(FWVERSION)/Resources/PLT_MrEd.rsrc MRFWRES = PLT_MrEd.framework/Versions/$(FWVERSION)/Resources/PLT_MrEd.rsrc
$(MRFW) : $(MZSCHEME) $(MREDOBJECTS) $(@WXLIBS@) $(MRSTATIC_STUB) $(MRFW) : $(MZSCHEMEDEPS) $(MREDOBJECTS) $(@WXLIBS@) $(MRSTATIC_STUB)
$(MREDLINKER) $(MREDLDFLAGS) -dynamiclib -o $(MRFW) -Wl,-headerpad_max_install_names ../mzscheme/libmzscheme.@LIBSFX@ ../mzscheme/libmzgc.@LIBSFX@ $(@WXLIBS@) $(GUILIBS_@WXVARIANT@) @X_EXTRA_LIBS@ $(MREDLINKER) $(MREDLDFLAGS) -dynamiclib -o $(MRFW) -Wl,-headerpad_max_install_names ../mzscheme/libmzscheme.@LIBSFX@ ../mzscheme/libmzgc.@LIBSFX@ $(@WXLIBS@) $(GUILIBS_@WXVARIANT@) @X_EXTRA_LIBS@
MrEd.app/Contents/MacOS/MrEd: $(MRFWRES) $(MRFW) mrmain.@LTO@ MrEd.app/Contents/MacOS/MrEd: $(MRFWRES) $(MRFW) mrmain.@LTO@
$(MREDLINKER) -o MrEd.app/Contents/MacOS/MrEd mrmain.@LTO@ -Wl,-headerpad_max_install_names -F. -framework PLT_MrEd -framework Carbon @PROFFLAGS@ $(MREDLINKER) -o MrEd.app/Contents/MacOS/MrEd mrmain.@LTO@ -Wl,-headerpad_max_install_names -F. -framework PLT_MrEd -framework Carbon @PROFFLAGS@
/usr/bin/install_name_tool -change "PLT_MrEd.framework/Versions/$(FWVERSION)/PLT_MrEd" "@executable_path/../../../PLT_MrEd.framework/Versions/$(FWVERSION)/PLT_MrEd" MrEd.app/Contents/MacOS/MrEd
$(MRFWRES): $(srcdir)/../mac/osx_appl.ss $(srcdir)/../mac/cw/MrEd.r $(MRFWRES): $(srcdir)/../mac/osx_appl.ss $(srcdir)/../mac/cw/MrEd.r
rm -rf PLT_MrEd.framework/Resources PLT_MrEd.framework/PLT_MrEd rm -rf PLT_MrEd.framework/Resources PLT_MrEd.framework/PLT_MrEd
@ -119,6 +120,8 @@ $(MRFWRES): $(srcdir)/../mac/osx_appl.ss $(srcdir)/../mac/cw/MrEd.r
ln -s Versions/$(FWVERSION)/PLT_MrEd PLT_MrEd.framework/PLT_MrEd ln -s Versions/$(FWVERSION)/PLT_MrEd PLT_MrEd.framework/PLT_MrEd
ln -s Versions/$(FWVERSION)/Resources PLT_MrEd.framework/Resources ln -s Versions/$(FWVERSION)/Resources PLT_MrEd.framework/Resources
MZSCHEME = ../mzscheme/mzscheme
ee-app: mred mrmain_ee.@LTO@ ee-app: mred mrmain_ee.@LTO@
if [ "$(EEAPP)" = '' ] ; then echo "ERROR: You must specify EEAPP" ; else $(MREDLINKER) $(MREDLDFLAGS) $(MRSTATIC) -o $(EEAPP) mrmain_ee.@LTO@ $(EEOBJECTS) $(MREDLDLIBS) $(MRSTATIC_STUB) ; fi if [ "$(EEAPP)" = '' ] ; then echo "ERROR: You must specify EEAPP" ; else $(MREDLINKER) $(MREDLDFLAGS) $(MRSTATIC) -o $(EEAPP) mrmain_ee.@LTO@ $(EEOBJECTS) $(MREDLDLIBS) $(MRSTATIC_STUB) ; fi
@ -144,13 +147,15 @@ mred.@LTO@ : $(srcdir)/mred.cxx $(srcdir)/wxme/wx_media.h $(srcdir)/wxme/wx_med
$(srcdir)/../wxcommon/wx_list.h $(srcdir)/../wxcommon/wx_list.h
$(CXX) $(CXXFLAGS) $(LOCALFLAGS) -c $(srcdir)/mred.cxx -o mred.@LTO@ $(CXX) $(CXXFLAGS) $(LOCALFLAGS) -c $(srcdir)/mred.cxx -o mred.@LTO@
DEF_COLLECTS_DIR = -DINITIAL_COLLECTS_DIRECTORY='"'"`cd $(srcdir)/../../collects; pwd`"'"'
mrmain.@LTO@ : $(srcdir)/mrmain.cxx $(srcdir)/mred.h $(srcdir)/wxs/wxsmred.h \ mrmain.@LTO@ : $(srcdir)/mrmain.cxx $(srcdir)/mred.h $(srcdir)/wxs/wxsmred.h \
$(srcdir)/../mzscheme/cmdline.inc $(srcdir)/../mzscheme/src/stypes.h \ $(srcdir)/../mzscheme/cmdline.inc $(srcdir)/../mzscheme/src/stypes.h \
$(srcdir)/../mzscheme/include/scheme.h $(srcdir)/../mzscheme/src/schvers.h $(srcdir)/../mzscheme/include/scheme.h $(srcdir)/../mzscheme/src/schvers.h
$(CXX) $(CXXFLAGS) $(LOCALFLAGS) -c $(srcdir)/mrmain.cxx -o mrmain.@LTO@ $(CXX) $(CXXFLAGS) $(LOCALFLAGS) $(DEF_COLLECTS_DIR) -c $(srcdir)/mrmain.cxx -o mrmain.@LTO@
mrmain_ee.@LTO@ : mred.@LTO@ mrmain_ee.@LTO@ : mred.@LTO@
$(CXX) $(CXXFLAGS) $(LOCALFLAGS) -DSTANDALONE_WITH_EMBEDDED_EXTENSION -c $(srcdir)/mrmain.cxx -o mrmain_ee.@LTO@ $(CXX) $(CXXFLAGS) $(LOCALFLAGS) -DSTANDALONE_WITH_EMBEDDED_EXTENSION $(DEF_COLLECTS_DIR) -c $(srcdir)/mrmain.cxx -o mrmain_ee.@LTO@
ee-main: ee-main:
$(MAKE) mrmain_ee.@LTO@ $(MAKE) mrmain_ee.@LTO@
@ -233,6 +238,7 @@ install_wx_xt:
cd ..; rm -f $(prefix)/bin/mred cd ..; rm -f $(prefix)/bin/mred
$(MAKE) @MRLIBINSTALL@ $(MAKE) @MRLIBINSTALL@
cd ..; $(ICP) mred/mred `(cd $(prefix); pwd)`/bin/ cd ..; $(ICP) mred/mred `(cd $(prefix); pwd)`/bin/
$(MZSCHEME) -e '(use-compiled-file-paths null)' -mvqL private/collects-path.ss compiler -e '(set-collects-path)' "$(prefix)/bin/mred" ../collects
LIBIDIR=$(prefix)/lib LIBIDIR=$(prefix)/lib
BUILDINFO=$(LIBIDIR)/buildinfo BUILDINFO=$(LIBIDIR)/buildinfo
@ -244,7 +250,7 @@ install_wx_mac:
rm -rf $(MRFWDIR)/Versions/$(FWVERSION)/Resources rm -rf $(MRFWDIR)/Versions/$(FWVERSION)/Resources
rm -f $(MRFWDIR)/PLT_MrEd rm -f $(MRFWDIR)/PLT_MrEd
rm -rf $(MRFWDIR)/Resources rm -rf $(MRFWDIR)/Resources
if [ @FRAMEWORK_REL_INSTALL@ = yes ] ; then rm -rf $(MZFWDIR) ; fi if [ @FRAMEWORK_REL_INSTALL@ = yes ] ; then rm -rf $(MRFWDIR) ; fi
if [ ! -d @FRAMEWORK_INSTALL_DIR@ ] ; then mkdir @FRAMEWORK_INSTALL_DIR@ ; fi if [ ! -d @FRAMEWORK_INSTALL_DIR@ ] ; then mkdir @FRAMEWORK_INSTALL_DIR@ ; fi
if [ ! -d $(MRFWDIR) ] ; then mkdir $(MRFWDIR) ; fi if [ ! -d $(MRFWDIR) ] ; then mkdir $(MRFWDIR) ; fi
if [ ! -d $(MRFWDIR)/Versions ] ; then mkdir $(MRFWDIR)/Versions ; fi if [ ! -d $(MRFWDIR)/Versions ] ; then mkdir $(MRFWDIR)/Versions ; fi
@ -259,7 +265,8 @@ install_wx_mac:
if [ ! -d $(prefix)/collects ] ; then mkdir $(prefix)/collects ; fi if [ ! -d $(prefix)/collects ] ; then mkdir $(prefix)/collects ; fi
if [ ! -d $(prefix)/collects/launcher ] ; then mkdir $(prefix)/collects/launcher ; fi if [ ! -d $(prefix)/collects/launcher ] ; then mkdir $(prefix)/collects/launcher ; fi
cd ..; $(ICP) -r mred/Starter.app $(prefix)/collects/launcher/. cd ..; $(ICP) -r mred/Starter.app $(prefix)/collects/launcher/.
if [ @FRAMEWORK_REL_INSTALL@ = yes ] ; then /usr/bin/install_name_tool -change "PLT_MrEd.framework/Versions/$(FWVERSION)/PLT_MrEd" "@executable_path/../../../lib/PLT_MrEd.framework/Versions/$(FWVERSION)/PLT_MrEd" "$(prefix)/MrEd.app/Contents/MacOS/MrEd" ; fi if [ @FRAMEWORK_REL_INSTALL@ = yes ] ; then /usr/bin/install_name_tool -change "@executable_path/../../../PLT_MrEd.framework/Versions/$(FWVERSION)/PLT_MrEd" "@executable_path/../../../lib/PLT_MrEd.framework/Versions/$(FWVERSION)/PLT_MrEd" "$(prefix)/MrEd.app/Contents/MacOS/MrEd" ; fi
$(MZSCHEME) -e '(use-compiled-file-paths null)' -mvqL private/collects-path.ss compiler -e '(set-collects-path)' "$(prefix)/MrEd.app/Contents/MacOS/MrEd" ../../../collects
install: install:
$(MAKE) install_@WXVARIANT@ $(MAKE) install_@WXVARIANT@
@ -283,6 +290,7 @@ install-lib3m:
install-3m_wx_xt: install-3m_wx_xt:
cd ..; $(ICP) mred/mred3m $(prefix)/bin/ cd ..; $(ICP) mred/mred3m $(prefix)/bin/
$(MZSCHEME) -e '(use-compiled-file-paths null)' -mvqL private/collects-path.ss compiler -e '(set-collects-path)' "$(prefix)/bin/mred" ../collects
$(MAKE) @MRLIBINSTALL@3m $(MAKE) @MRLIBINSTALL@3m
install-3m_wx_mac: install-3m_wx_mac:
@ -297,7 +305,8 @@ install-3m_wx_mac:
if [ ! -d $(prefix)/collects ] ; then mkdir $(prefix)/collects ; fi if [ ! -d $(prefix)/collects ] ; then mkdir $(prefix)/collects ; fi
if [ ! -d $(prefix)/collects/launcher ] ; then mkdir $(prefix)/collects/launcher ; fi if [ ! -d $(prefix)/collects/launcher ] ; then mkdir $(prefix)/collects/launcher ; fi
cd ..; $(ICP) -r mred/Starter3m.app $(prefix)/collects/launcher/. cd ..; $(ICP) -r mred/Starter3m.app $(prefix)/collects/launcher/.
if [ @FRAMEWORK_REL_INSTALL@ = yes ] ; then /usr/bin/install_name_tool -change "PLT_MrEd.framework/Versions/$(FWVERSION)_3m/PLT_MrEd" "@executable_path/../../../lib/PLT_MrEd.framework/Versions/$(FWVERSION)_3m/PLT_MrEd" "$(prefix)/MrEd3m.app/Contents/MacOS/MrEd3m" ; fi if [ @FRAMEWORK_REL_INSTALL@ = yes ] ; then /usr/bin/install_name_tool -change "@executable_path/../../../PLT_MrEd.framework/Versions/$(FWVERSION)_3m/PLT_MrEd" "@executable_path/../../../lib/PLT_MrEd.framework/Versions/$(FWVERSION)_3m/PLT_MrEd" "$(prefix)/MrEd3m.app/Contents/MacOS/MrEd3m" ; fi
$(MZSCHEME) -e '(use-compiled-file-paths null)' -mvqL private/collects-path.ss compiler -e '(set-collects-path)' "$(prefix)/MrEd3m.app/Contents/MacOS/MrEd3m" ../../../collects
install-3m: install-3m:
$(MAKE) install-3m_@WXVARIANT@ $(MAKE) install-3m_@WXVARIANT@

View File

@ -54,7 +54,7 @@ XFORM_INC_wx_xt = -Dwx_xt -I$(WXDIR)/src/XWidgets -I$(WXDIR)/src
XFORM_INC_wx_mac = -Dwx_mac -DOS_X -MMD -DWX_CARBON -I$(WXMACDIR)/../utils/image/src -I$(WXMACDIR)/../contrib/wxxpm/libxpm.34b/lib -I$(WXMACDIR)/../../mac/mzscheme XFORM_INC_wx_mac = -Dwx_mac -DOS_X -MMD -DWX_CARBON -I$(WXMACDIR)/../utils/image/src -I$(WXMACDIR)/../contrib/wxxpm/libxpm.34b/lib -I$(WXMACDIR)/../../mac/mzscheme
MZMMM_wx_xt = ../../mzscheme/mzscheme3m MZMMM_wx_xt = ../../mzscheme/mzscheme3m
MZMMM_wx_mac = env DYLD_FRAMEWORK_PATH="`pwd`/../../mzscheme" ../../mzscheme/mzscheme3m MZMMM_wx_mac = ../../mzscheme/mzscheme3m
MZMMM = $(MZMMM_@WXVARIANT@) MZMMM = $(MZMMM_@WXVARIANT@)
XFORM_CMD = $(MZMMM) -rq $(srcdir)/../../mzscheme/gc2/xform.ss --setup XFORM_CMD = $(MZMMM) -rq $(srcdir)/../../mzscheme/gc2/xform.ss --setup
@ -69,6 +69,8 @@ WXMACBDIR=../../wxmac/src
MREDLDFLAGS = -L$(WXBDIR)/utils/image/src -L$(WXBDIR)/contrib/xpm/lib $(LDFLAGS) -L../../mzscheme -L../wxs -L../wxme -L$(WXBDIR)/src MREDLDFLAGS = -L$(WXBDIR)/utils/image/src -L$(WXBDIR)/contrib/xpm/lib $(LDFLAGS) -L../../mzscheme -L../wxs -L../wxme -L$(WXBDIR)/src
DEF_COLLECTS_DIR = +D INITIAL_COLLECTS_DIRECTORY='"'"`cd $(srcdir)/../../../collects; pwd`"'"'
xsrc/Window.cc: $(WXDIR)/src/Windows/Window.cc $(WXBDIR)/src/Windows/Window.@LTO@ $(XFORMDEP) xsrc/Window.cc: $(WXDIR)/src/Windows/Window.cc $(WXBDIR)/src/Windows/Window.@LTO@ $(XFORMDEP)
$(XFORM) xsrc/Window.cc $(WXDIR)/src/Windows/Window.cc $(XFORM) xsrc/Window.cc $(WXDIR)/src/Windows/Window.cc
xsrc/Button.cc: $(WXDIR)/src/Windows/Button.cc $(WXBDIR)/src/Windows/Button.@LTO@ $(XFORMDEP) xsrc/Button.cc: $(WXDIR)/src/Windows/Button.cc $(WXBDIR)/src/Windows/Button.@LTO@ $(XFORMDEP)
@ -408,7 +410,7 @@ xsrc/mred.cc: $(srcdir)/../mred.cxx ../mred.@LTO@ $(XFORMDEP) $(XPRECOMP)
$(XFORMWP) xsrc/mred.cc $(srcdir)/../mred.cxx $(XFORMWP) xsrc/mred.cc $(srcdir)/../mred.cxx
xsrc/mrmain.cc: $(srcdir)/../mrmain.cxx ../mrmain.@LTO@ $(XFORMDEP) $(XPRECOMP) xsrc/mrmain.cc: $(srcdir)/../mrmain.cxx ../mrmain.@LTO@ $(XFORMDEP) $(XPRECOMP)
$(XFORMWP) xsrc/mrmain.cc $(srcdir)/../mrmain.cxx $(XFORMWP) xsrc/mrmain.cc $(DEF_COLLECTS_DIR) $(srcdir)/../mrmain.cxx
xsrc/mredx.cc: $(srcdir)/../mredx.cxx ../mredx.@LTO@ $(XFORMDEP) $(XPRECOMP) xsrc/mredx.cc: $(srcdir)/../mredx.cxx ../mredx.@LTO@ $(XFORMDEP) $(XPRECOMP)
$(XFORMWP) xsrc/mredx.cc $(srcdir)/../mredx.cxx $(XFORMWP) xsrc/mredx.cc $(srcdir)/../mredx.cxx
@ -1370,6 +1372,7 @@ MRFWRES = PLT_MrEd.framework/Versions/$(FWVERSION)_3m/Resources/PLT_MrEd.rsrc
if [ ! -d ../PLT_MrEd.framework/Versions/$(FWVERSION)_3m ] ; then mkdir ../PLT_MrEd.framework/Versions/$(FWVERSION)_3m ; fi if [ ! -d ../PLT_MrEd.framework/Versions/$(FWVERSION)_3m ] ; then mkdir ../PLT_MrEd.framework/Versions/$(FWVERSION)_3m ; fi
cp $(MRFW) ../$(MRFW) cp $(MRFW) ../$(MRFW)
cp -r PLT_MrEd.framework/Versions/$(FWVERSION)_3m/Resources ../PLT_MrEd.framework/Versions/$(FWVERSION)_3m/Resources cp -r PLT_MrEd.framework/Versions/$(FWVERSION)_3m/Resources ../PLT_MrEd.framework/Versions/$(FWVERSION)_3m/Resources
/usr/bin/install_name_tool -change "PLT_MrEd.framework/Versions/$(FWVERSION)_3m/PLT_MrEd" "@executable_path/../../../PLT_MrEd.framework/Versions/$(FWVERSION)_3m/PLT_MrEd" ../MrEd3m.app/Contents/MacOS/MrEd3m
$(MRFW) : $(XOBJS) $(@WXVARIANT@_PLAIN_OBJS) ../../mzscheme/libmzscheme3m.@LIBSFX@ $(MRFW) : $(XOBJS) $(@WXVARIANT@_PLAIN_OBJS) ../../mzscheme/libmzscheme3m.@LIBSFX@
$(MREDLINKER) -dynamiclib -o $(MRFW) -Wl,-headerpad_max_install_names $(XOBJS) $(@WXVARIANT@_PLAIN_OBJS) ../../mzscheme/libmzscheme3m.@LIBSFX@ $(@WXVARIANT@_LIBS) $(MREDLINKER) -dynamiclib -o $(MRFW) -Wl,-headerpad_max_install_names $(XOBJS) $(@WXVARIANT@_PLAIN_OBJS) ../../mzscheme/libmzscheme3m.@LIBSFX@ $(@WXVARIANT@_LIBS)

View File

@ -150,6 +150,7 @@ $(MZFW): libmzscheme.@LIBSFX@ libmzgc.@LIBSFX@ $(SPECIALIZINGOBJECTS)
mzscheme@OSX@: $(MZFW) main.@LTO@ mzscheme@OSX@: $(MZFW) main.@LTO@
$(CC) -o mzscheme @PROFFLAGS@ main.@LTO@ -Wl,-headerpad_max_install_names -F. -framework PLT_MzScheme $(CC) -o mzscheme @PROFFLAGS@ main.@LTO@ -Wl,-headerpad_max_install_names -F. -framework PLT_MzScheme
/usr/bin/install_name_tool -change "PLT_MzScheme.framework/Versions/$(FWVERSION)/PLT_MzScheme" "@executable_path/PLT_MzScheme.framework/Versions/$(FWVERSION)/PLT_MzScheme" mzscheme
# OSKit ---------------------------------------- # OSKit ----------------------------------------
@ -165,11 +166,13 @@ mzscheme.multiboot : libmzscheme.@LIBSFX@ libmzgc.@LIBSFX@ main.@LTO@
# ---------------------------------------- # ----------------------------------------
DEF_COLLECTS_DIR = -DINITIAL_COLLECTS_DIRECTORY='"'"`cd $(srcdir)/../../collects; pwd`"'"'
main.@LTO@: $(srcdir)/main.c $(srcdir)/include/scheme.h $(srcdir)/sconfig.h $(srcdir)/src/stypes.h $(srcdir)/cmdline.inc $(srcdir)/oskglue.inc main.@LTO@: $(srcdir)/main.c $(srcdir)/include/scheme.h $(srcdir)/sconfig.h $(srcdir)/src/stypes.h $(srcdir)/cmdline.inc $(srcdir)/oskglue.inc
$(CC) @CFLAGS@ @COMPFLAGS@ @PREFLAGS@ @PROFFLAGS@ @OPTIONS@ @MZOPTIONS@ -I$(builddir) -I$(srcdir)/include -c $(srcdir)/main.c -o main.@LTO@ $(CC) @CFLAGS@ @COMPFLAGS@ @PREFLAGS@ @PROFFLAGS@ @OPTIONS@ @MZOPTIONS@ $(DEF_COLLECTS_DIR) -I$(builddir) -I$(srcdir)/include -c $(srcdir)/main.c -o main.@LTO@
main_ee.@LTO@: main.@LTO@ main_ee.@LTO@: main.@LTO@
$(CC) @CFLAGS@ @COMPFLAGS@ @PREFLAGS@ @PROFFLAGS@ @OPTIONS@ @MZOPTIONS@ -I$(builddir) -I$(srcdir)/include -DSTANDALONE_WITH_EMBEDDED_EXTENSION -c $(srcdir)/main.c -o main_ee.@LTO@ $(CC) @CFLAGS@ @COMPFLAGS@ @PREFLAGS@ @PROFFLAGS@ @OPTIONS@ @MZOPTIONS@ $(DEF_COLLECTS_DIR) -I$(builddir) -I$(srcdir)/include -DSTANDALONE_WITH_EMBEDDED_EXTENSION -c $(srcdir)/main.c -o main_ee.@LTO@
ee-main: ee-main:
$(MAKE) main_ee.@LTO@ $(MAKE) main_ee.@LTO@
@ -263,6 +266,7 @@ install:
install-3m-basic: install-3m-basic:
cd ..; $(ICP) mzscheme/mzscheme3m $(prefix)/bin/mzscheme3m cd ..; $(ICP) mzscheme/mzscheme3m $(prefix)/bin/mzscheme3m
cd ..; $(ICP) mzscheme/mzdyn3m.o $(prefix)/lib/mzdyn3m.o cd ..; $(ICP) mzscheme/mzdyn3m.o $(prefix)/lib/mzdyn3m.o
./mzscheme -e '(use-compiled-file-paths null)' -mvqL private/collects-path.ss compiler -e '(set-collects-path)' "$(prefix)/bin/mzscheme3m" ../collects
install-3m@NOT_OSX@: install-3m@NOT_OSX@:
$(MAKE) install-3m-basic $(MAKE) install-3m-basic
@ -278,6 +282,7 @@ unix-install:
cd ..; $(ICP) mzscheme/libmzgc.@LIBSFX@ $(LIBIDIR)/libmzgc.@LIBSFX@ cd ..; $(ICP) mzscheme/libmzgc.@LIBSFX@ $(LIBIDIR)/libmzgc.@LIBSFX@
cd ..; $(ICP) mzscheme/libmzscheme.@LIBSFX@ $(LIBIDIR)/libmzscheme.@LIBSFX@ cd ..; $(ICP) mzscheme/libmzscheme.@LIBSFX@ $(LIBIDIR)/libmzscheme.@LIBSFX@
cd ..; $(ICP) mzscheme/mzscheme "$(BINDIR)/mzscheme" cd ..; $(ICP) mzscheme/mzscheme "$(BINDIR)/mzscheme"
./mzscheme -e '(use-compiled-file-paths null)' -mvqL private/collects-path.ss compiler -e '(set-collects-path)' "$(BINDIR)/mzscheme" ../collects
cd ..; echo 'CC=@CC@' > $(BUILDINFO) cd ..; echo 'CC=@CC@' > $(BUILDINFO)
cd ..; echo 'CFLAGS=@CFLAGS@ @PREFLAGS@ @COMPFLAGS@' >> $(BUILDINFO) cd ..; echo 'CFLAGS=@CFLAGS@ @PREFLAGS@ @COMPFLAGS@' >> $(BUILDINFO)
cd ..; echo 'OPTIONS=@OPTIONS@' >> $(BUILDINFO) cd ..; echo 'OPTIONS=@OPTIONS@' >> $(BUILDINFO)
@ -302,7 +307,7 @@ osx-install:
if [ ! -d $(MZFWDIR)/Versions/$(FWVERSION) ] ; then mkdir $(MZFWDIR)/Versions/$(FWVERSION) ; fi if [ ! -d $(MZFWDIR)/Versions/$(FWVERSION) ] ; then mkdir $(MZFWDIR)/Versions/$(FWVERSION) ; fi
cp $(MZFW) $(MZFWDIR)/Versions/$(FWVERSION)/ cp $(MZFW) $(MZFWDIR)/Versions/$(FWVERSION)/
ln -s Versions/$(FWVERSION)/PLT_MzScheme $(MZFWDIR)/ ln -s Versions/$(FWVERSION)/PLT_MzScheme $(MZFWDIR)/
if [ @FRAMEWORK_REL_INSTALL@ = yes ] ; then /usr/bin/install_name_tool -change "PLT_MzScheme.framework/Versions/$(FWVERSION)/PLT_MzScheme" "@executable_path/../lib/PLT_MzScheme.framework/Versions/$(FWVERSION)/PLT_MzScheme" "$(BINDIR)/mzscheme" ; fi if [ @FRAMEWORK_REL_INSTALL@ = yes ] ; then /usr/bin/install_name_tool -change "@executable_path/PLT_MzScheme.framework/Versions/$(FWVERSION)/PLT_MzScheme" "@executable_path/../lib/PLT_MzScheme.framework/Versions/$(FWVERSION)/PLT_MzScheme" "$(BINDIR)/mzscheme" ; fi
MZFWMMM = PLT_MzScheme.framework/Versions/$(FWVERSION)_3m/PLT_MzScheme MZFWMMM = PLT_MzScheme.framework/Versions/$(FWVERSION)_3m/PLT_MzScheme
@ -311,7 +316,7 @@ install-3m@OSX@:
rm -f $(MZFWDIR)/Versions/$(FWVERSION)_3m/PLT_MzScheme rm -f $(MZFWDIR)/Versions/$(FWVERSION)_3m/PLT_MzScheme
if [ ! -d $(MZFWDIR)/Versions/$(FWVERSION)_3m ] ; then mkdir $(MZFWDIR)/Versions/$(FWVERSION)_3m ; fi if [ ! -d $(MZFWDIR)/Versions/$(FWVERSION)_3m ] ; then mkdir $(MZFWDIR)/Versions/$(FWVERSION)_3m ; fi
cp $(MZFWMMM) $(MZFWDIR)/Versions/$(FWVERSION)_3m/ cp $(MZFWMMM) $(MZFWDIR)/Versions/$(FWVERSION)_3m/
if [ @FRAMEWORK_REL_INSTALL@ = yes ] ; then /usr/bin/install_name_tool -change "PLT_MzScheme.framework/Versions/$(FWVERSION)_3m/PLT_MzScheme" "@executable_path/../lib/PLT_MzScheme.framework/Versions/$(FWVERSION)_3m/PLT_MzScheme" "$(BINDIR)/mzscheme3m" ; fi if [ @FRAMEWORK_REL_INSTALL@ = yes ] ; then /usr/bin/install_name_tool -change "@executable_path/PLT_MzScheme.framework/Versions/$(FWVERSION)_3m/PLT_MzScheme" "@executable_path/../lib/PLT_MzScheme.framework/Versions/$(FWVERSION)_3m/PLT_MzScheme" "$(BINDIR)/mzscheme3m" ; fi
WLIBIDIR=`(cd $(prefix); pwd)`/lib WLIBIDIR=`(cd $(prefix); pwd)`/lib
WBUILDINFO=$(WLIBIDIR)/buildinfo WBUILDINFO=$(WLIBIDIR)/buildinfo

View File

@ -8,6 +8,31 @@
char *cmdline_exe_hack = "[Replace me for EXE hack ]"; char *cmdline_exe_hack = "[Replace me for EXE hack ]";
char *binary_type_hack = "bINARy tYPe:" INITIAL_BIN_TYPE; char *binary_type_hack = "bINARy tYPe:" INITIAL_BIN_TYPE;
#ifndef INITIAL_COLLECTS_DIRECTORY
# ifdef DOS_FILE_SYSTEM
# define INITIAL_COLLECTS_DIRECTORY "collects"
# else
# define INITIAL_COLLECTS_DIRECTORY "../collects"
# endif
#endif
static char *_coldir = "coLLECTs dIRECTORy:" /* <- this tag stays, so we can find it again */
INITIAL_COLLECTS_DIRECTORY "\0"
/* Pad with at least 512 bytes: */
"****************************************************************"
"****************************************************************"
"****************************************************************"
"****************************************************************"
"****************************************************************"
"****************************************************************"
"****************************************************************"
"****************************************************************";
static int _coldir_offset = 19; /* Skip permanent tag */
#ifndef MZ_PRECISE_GC
# define XFORM_OK_PLUS +
#endif
#ifdef DOS_FILE_SYSTEM #ifdef DOS_FILE_SYSTEM
# include <Windows.h> # include <Windows.h>
# ifdef MZ_PRECISE_GC # ifdef MZ_PRECISE_GC
@ -502,8 +527,8 @@ static int run_from_cmd_line(int argc, char *_argv[],
{ {
GC_CAN_IGNORE char **argv = _argv; GC_CAN_IGNORE char **argv = _argv;
Scheme_Env *global_env; Scheme_Env *global_env;
char *prog; char *prog, *sprog = NULL;
Scheme_Object *sch_argv; Scheme_Object *sch_argv, *collects_path = NULL;
int i; int i;
#ifndef DONT_PARSE_COMMAND_LINE #ifndef DONT_PARSE_COMMAND_LINE
char **evals_and_loads, *real_switch = NULL, *runner; char **evals_and_loads, *real_switch = NULL, *runner;
@ -585,7 +610,7 @@ static int run_from_cmd_line(int argc, char *_argv[],
The cmdline is appended to the end of the binary. The cmdline is appended to the end of the binary.
The long integer at cmdline_exe_hack[4] says The long integer at cmdline_exe_hack[4] says
where the old end was, and cmdline_exe_hack[8] where the old end was, and cmdline_exe_hack[8]
says how long the cmdoine string is. */ says how long the cmdline string is. */
char *path; char *path;
HANDLE fd; HANDLE fd;
@ -612,6 +637,7 @@ static int run_from_cmd_line(int argc, char *_argv[],
p = (unsigned char *)"\0\0\0"; p = (unsigned char *)"\0\0\0";
else if (cmdline_exe_hack[0] == '*') { else if (cmdline_exe_hack[0] == '*') {
/* "*" means that the first item is argv[0] replacement: */ /* "*" means that the first item is argv[0] replacement: */
sprog = prog;
prog = (char *)p + 4; prog = (char *)p + 4;
p += (p[0] p += (p[0]
+ (((long)p[1]) << 8) + (((long)p[1]) << 8)
@ -727,6 +753,8 @@ static int run_from_cmd_line(int argc, char *_argv[],
argv[0] = "-u"; argv[0] = "-u";
else if (!strcmp("--main", argv[0])) else if (!strcmp("--main", argv[0]))
argv[0] = "-I"; argv[0] = "-I";
else if (!strcmp("--name", argv[0]))
argv[0] = "-N";
else if (!strcmp("--no-lib-path", argv[0])) else if (!strcmp("--no-lib-path", argv[0]))
argv[0] = "-x"; argv[0] = "-x";
else if (!strcmp("--version", argv[0])) else if (!strcmp("--version", argv[0]))
@ -743,6 +771,8 @@ static int run_from_cmd_line(int argc, char *_argv[],
argv[0] = "-w"; argv[0] = "-w";
else if (!strcmp("--binary", argv[0])) else if (!strcmp("--binary", argv[0]))
argv[0] = "-b"; argv[0] = "-b";
else if (!strcmp("--collects", argv[0]))
argv[0] = "-X";
# ifndef MZSCHEME_CMD_LINE # ifndef MZSCHEME_CMD_LINE
else if (!strcmp("--nogui", argv[0])) else if (!strcmp("--nogui", argv[0]))
argv[0] = "-Z"; argv[0] = "-Z";
@ -796,6 +826,16 @@ static int run_from_cmd_line(int argc, char *_argv[],
evals_and_loads[num_enl] = argv[0]; evals_and_loads[num_enl] = argv[0];
eval_kind[num_enl++] = mzcmd_EVAL; eval_kind[num_enl++] = mzcmd_EVAL;
break; break;
case 'X':
if (argc < 2) {
PRINTF("%s: missing path after %s switch\n",
prog, real_switch);
goto show_need_help;
}
argv++;
--argc;
collects_path = scheme_make_path(argv[0]);
break;
case 'x': case 'x':
no_lib_path = 1; no_lib_path = 1;
break; break;
@ -936,6 +976,17 @@ static int run_from_cmd_line(int argc, char *_argv[],
--argc; --argc;
eval_kind[num_enl++] = mzcmd_EVAL; eval_kind[num_enl++] = mzcmd_EVAL;
break; break;
case 'N':
if (argc < 2) {
PRINTF("%s: missing name after %s switch\n",
prog,
real_switch);
goto show_need_help;
}
argv++;
--argc;
sprog = argv[0];
break;
case 'A': case 'A':
no_argv = 1; no_argv = 1;
break; break;
@ -1046,7 +1097,10 @@ static int run_from_cmd_line(int argc, char *_argv[],
scheme_add_global("argv", sch_argv, global_env); scheme_add_global("argv", sch_argv, global_env);
{ {
Scheme_Object *ps; Scheme_Object *ps;
ps = scheme_set_exec_cmd(prog); scheme_set_exec_cmd(prog);
if (!sprog)
sprog = prog;
ps = scheme_set_run_cmd(sprog);
#ifndef DONT_PARSE_COMMAND_LINE #ifndef DONT_PARSE_COMMAND_LINE
if (!no_argv) if (!no_argv)
#endif #endif
@ -1055,8 +1109,12 @@ static int run_from_cmd_line(int argc, char *_argv[],
#ifndef NO_FILE_SYSTEM_UTILS #ifndef NO_FILE_SYSTEM_UTILS
/* Setup path for "collects" collection directory: */ /* Setup path for "collects" collection directory: */
if (!no_lib_path) if (!no_lib_path) {
if (!collects_path)
collects_path = scheme_make_path(_coldir XFORM_OK_PLUS _coldir_offset);
scheme_set_collects_path(collects_path);
init_collection_paths(global_env); init_collection_paths(global_env);
}
#endif /* NO_FILE_SYSTEM_UTILS */ #endif /* NO_FILE_SYSTEM_UTILS */
#ifndef MZSCHEME_CMD_LINE #ifndef MZSCHEME_CMD_LINE
@ -1114,7 +1172,6 @@ static int run_from_cmd_line(int argc, char *_argv[],
" -l <file>, --mzlib <file> : Same as -e '(require (lib \"<file>\"))'.\n" " -l <file>, --mzlib <file> : Same as -e '(require (lib \"<file>\"))'.\n"
" -L <file> <coll> : Same as -e '(require (lib \"<file>\" \"<coll>\"))'.\n" " -L <file> <coll> : Same as -e '(require (lib \"<file>\" \"<coll>\"))'.\n"
" -M <coll> : Same as -e '(require (lib \"<coll>.ss\" \"<coll>\"))'.\n" " -M <coll> : Same as -e '(require (lib \"<coll>.ss\" \"<coll>\"))'.\n"
" -M errortrace : Report locations in uncompiled source for run-time errors.\n"
" -r, --script : Script mode: use as last switch for scripts. Same as -fmv-.\n" " -r, --script : Script mode: use as last switch for scripts. Same as -fmv-.\n"
" -i, --script-cd : Like -r, but also sets the directory. Same as -dmv-.\n" " -i, --script-cd : Like -r, but also sets the directory. Same as -dmv-.\n"
" -u, --require-script : Like -r, but requires a module. Same as -tmv-.\n" " -u, --require-script : Like -r, but requires a module. Same as -tmv-.\n"
@ -1129,8 +1186,10 @@ static int run_from_cmd_line(int argc, char *_argv[],
" -k <n> <m> : Load executable-embedded code from file offset <n> to <m>.\n" " -k <n> <m> : Load executable-embedded code from file offset <n> to <m>.\n"
" -C, --main : Like -r, then call `main' w/argument list; car is file name.\n" " -C, --main : Like -r, then call `main' w/argument list; car is file name.\n"
" Initialization switches:\n" " Initialization switches:\n"
" -X <dir>, --collects <dir> : libraries at <dir> relative to executable.\n"
" -x, --no-lib-path : Skips trying to set current-library-collection-paths.\n" " -x, --no-lib-path : Skips trying to set current-library-collection-paths.\n"
" -q, --no-init-file : Skips trying to load " INIT_FILENAME ".\n" " -q, --no-init-file : Skips trying to load " INIT_FILENAME ".\n"
" -N <file>, --name <file> : Set `program' to <file>.\n"
" -A : Skips defining `argv' and `program'.\n" " -A : Skips defining `argv' and `program'.\n"
# ifdef MZ_USE_JIT # ifdef MZ_USE_JIT
" -j, --no-jit : Disables just-in-time compiler.\n" " -j, --no-jit : Disables just-in-time compiler.\n"

View File

@ -17,6 +17,8 @@ CPPFLAGS = @PREFLAGS@ @OPTIONS@ @GC2OPTIONS@ @MZOPTIONS@ -I$(builddir)/.. -I$(sr
CFLAGS = @CFLAGS@ $(CPPFLAGS) @COMPFLAGS@ @PROFFLAGS@ CFLAGS = @CFLAGS@ $(CPPFLAGS) @COMPFLAGS@ @PROFFLAGS@
LIBS = @LIBS@ LIBS = @LIBS@
DEF_COLLECTS_DIR = +D INITIAL_COLLECTS_DIRECTORY='"'"`cd $(srcdir)/../../../collects; pwd`"'"'
PRE_MZ@OSX@ = env DYLD_FRAMEWORK_PATH="`pwd`/.." PRE_MZ@OSX@ = env DYLD_FRAMEWORK_PATH="`pwd`/.."
PRE_MZ@NOT_OSX@ = PRE_MZ@NOT_OSX@ =
XFORM_SETUP = $(PRE_MZ) ../mzscheme -rq $(srcdir)/xform.ss --setup XFORM_SETUP = $(PRE_MZ) ../mzscheme -rq $(srcdir)/xform.ss --setup
@ -197,7 +199,7 @@ $(XSRCDIR)/vector.c: ../src/vector.@LTO@ $(XFORMDEP)
$(XSRCDIR)/foreign.c: ../../foreign/foreign.@LTO@ $(XFORMDEP) $(XSRCDIR)/foreign.c: ../../foreign/foreign.@LTO@ $(XFORMDEP)
$(XFORM_SETUP) --cpp "$(CPP) $(CPPFLAGS) -I../../foreign/gcc/libffi/include -I${SRCDIR}/../../mzscheme/src" -o $(XSRCDIR)/foreign.c $(SRCDIR)/../../foreign/foreign.c $(XFORM_SETUP) --cpp "$(CPP) $(CPPFLAGS) -I../../foreign/gcc/libffi/include -I${SRCDIR}/../../mzscheme/src" -o $(XSRCDIR)/foreign.c $(SRCDIR)/../../foreign/foreign.c
$(XSRCDIR)/main.c: ../main.@LTO@ $(XFORMDEP) $(XSRCDIR)/main.c: ../main.@LTO@ $(XFORMDEP)
$(XFORM) $(XSRCDIR)/main.c $(srcdir)/../main.c $(XFORM) $(XSRCDIR)/main.c $(DEF_COLLECTS_DIR) $(srcdir)/../main.c
salloc.@LTO@: $(XSRCDIR)/salloc.c salloc.@LTO@: $(XSRCDIR)/salloc.c
@ -314,6 +316,8 @@ $(MZFWMMM): ../libmzscheme3m.@LIBSFX@
$(CC) -o ../mzscheme3m @PROFFLAGS@ main.@LTO@ -Wl,-headerpad_max_install_names -F. -framework PLT_MzScheme $(CC) -o ../mzscheme3m @PROFFLAGS@ main.@LTO@ -Wl,-headerpad_max_install_names -F. -framework PLT_MzScheme
if [ ! -d ../PLT_MzScheme.framework/Versions/$(FWVERSION)_3m ] ; then mkdir ../PLT_MzScheme.framework/Versions/$(FWVERSION)_3m ; fi if [ ! -d ../PLT_MzScheme.framework/Versions/$(FWVERSION)_3m ] ; then mkdir ../PLT_MzScheme.framework/Versions/$(FWVERSION)_3m ; fi
cp PLT_MzScheme.framework/Versions/$(FWVERSION)_3m/PLT_MzScheme ../PLT_MzScheme.framework/Versions/$(FWVERSION)_3m/PLT_MzScheme cp PLT_MzScheme.framework/Versions/$(FWVERSION)_3m/PLT_MzScheme ../PLT_MzScheme.framework/Versions/$(FWVERSION)_3m/PLT_MzScheme
/usr/bin/install_name_tool -change "PLT_MzScheme.framework/Versions/$(FWVERSION)_3m/PLT_MzScheme" "@executable_path/PLT_MzScheme.framework/Versions/$(FWVERSION)_3m/PLT_MzScheme" ../mzscheme3m
clean: clean:
/bin/rm -f ../mzscheme3m *.@LTO@ $(XSRCDIR)/* /bin/rm -f ../mzscheme3m *.@LTO@ $(XSRCDIR)/*

View File

@ -40,7 +40,10 @@
[("--cpp") cmdline "set CPP command line" [("--cpp") cmdline "set CPP command line"
(set! cpp cmdline)] (set! cpp cmdline)]
[("-o") dest-file "name destination file" [("-o") dest-file "name destination file"
(set! file-out dest-file)]] (set! file-out dest-file)]
[("+D") def "add CPP -D flag"
(set! cpp (string-append cpp " -D"
(regexp-replace* "[ \"]" def "'\\0'")))]]
[args (file) [args (file)
(set! file-in file)]) (set! file-in file)])

View File

@ -1563,6 +1563,8 @@ MZ_EXTERN Scheme_Object *(*scheme_make_stderr)(void);
MZ_EXTERN void scheme_set_banner(char *s); MZ_EXTERN void scheme_set_banner(char *s);
MZ_EXTERN Scheme_Object *scheme_set_exec_cmd(char *s); MZ_EXTERN Scheme_Object *scheme_set_exec_cmd(char *s);
MZ_EXTERN Scheme_Object *scheme_set_run_cmd(char *s);
MZ_EXTERN void scheme_set_collects_path(Scheme_Object *p);
/* Initialization */ /* Initialization */
MZ_EXTERN Scheme_Env *scheme_basic_env(void); MZ_EXTERN Scheme_Env *scheme_basic_env(void);

File diff suppressed because it is too large Load Diff

View File

@ -184,9 +184,10 @@ static Scheme_Object *read_symbol, *write_symbol, *execute_symbol;
static Scheme_Object *temp_dir_symbol, *home_dir_symbol, *pref_dir_symbol; static Scheme_Object *temp_dir_symbol, *home_dir_symbol, *pref_dir_symbol;
static Scheme_Object *doc_dir_symbol, *desk_dir_symbol; static Scheme_Object *doc_dir_symbol, *desk_dir_symbol;
static Scheme_Object *init_dir_symbol, *init_file_symbol, *sys_dir_symbol; static Scheme_Object *init_dir_symbol, *init_file_symbol, *sys_dir_symbol;
static Scheme_Object *exec_file_symbol, *pref_file_symbol, *addon_dir_symbol; static Scheme_Object *exec_file_symbol, *run_file_symbol, *collects_dir_symbol;
static Scheme_Object *pref_file_symbol, *addon_dir_symbol;
static Scheme_Object *exec_cmd; static Scheme_Object *exec_cmd, *run_cmd, *collects_path;
#endif #endif
void scheme_init_file(Scheme_Env *env) void scheme_init_file(Scheme_Env *env)
@ -209,6 +210,8 @@ void scheme_init_file(Scheme_Env *env)
REGISTER_SO(sys_dir_symbol); REGISTER_SO(sys_dir_symbol);
REGISTER_SO(pref_file_symbol); REGISTER_SO(pref_file_symbol);
REGISTER_SO(exec_file_symbol); REGISTER_SO(exec_file_symbol);
REGISTER_SO(run_file_symbol);
REGISTER_SO(collects_dir_symbol);
REGISTER_SO(addon_dir_symbol); REGISTER_SO(addon_dir_symbol);
#endif #endif
@ -231,6 +234,8 @@ void scheme_init_file(Scheme_Env *env)
sys_dir_symbol = scheme_intern_symbol("sys-dir"); sys_dir_symbol = scheme_intern_symbol("sys-dir");
pref_file_symbol = scheme_intern_symbol("pref-file"); pref_file_symbol = scheme_intern_symbol("pref-file");
exec_file_symbol = scheme_intern_symbol("exec-file"); exec_file_symbol = scheme_intern_symbol("exec-file");
run_file_symbol = scheme_intern_symbol("run-file");
collects_dir_symbol = scheme_intern_symbol("collects-dir");
addon_dir_symbol = scheme_intern_symbol("addon-dir"); addon_dir_symbol = scheme_intern_symbol("addon-dir");
#endif #endif
@ -4472,6 +4477,18 @@ find_system_path(int argc, Scheme_Object **argv)
exec_cmd = scheme_make_path("mzscheme"); exec_cmd = scheme_make_path("mzscheme");
} }
return exec_cmd; return exec_cmd;
} else if (argv[0] == run_file_symbol) {
if (!run_cmd) {
REGISTER_SO(run_cmd);
run_cmd = scheme_make_path("mzscheme");
}
return run_cmd;
} else if (argv[0] == collects_dir_symbol) {
if (!collects_path) {
REGISTER_SO(collects_path);
collects_path = scheme_make_path("collects");
}
return collects_path;
} else if (argv[0] == addon_dir_symbol) { } else if (argv[0] == addon_dir_symbol) {
which = id_addon_dir; which = id_addon_dir;
} else { } else {
@ -4709,6 +4726,18 @@ Scheme_Object *scheme_set_exec_cmd(char *s)
#endif #endif
} }
Scheme_Object *scheme_set_run_cmd(char *s)
{
#ifndef NO_FILE_SYSTEM_UTILS
if (!run_cmd) {
REGISTER_SO(run_cmd);
run_cmd = scheme_make_path(s);
}
return run_cmd;
#endif
}
char *scheme_get_exec_path(void) char *scheme_get_exec_path(void)
{ {
if (exec_cmd) if (exec_cmd)
@ -4717,6 +4746,12 @@ char *scheme_get_exec_path(void)
return NULL; return NULL;
} }
void scheme_set_collects_path(Scheme_Object *p)
{
REGISTER_SO(collects_path);
collects_path = p;
}
/********************************************************************************/ /********************************************************************************/
#ifdef DOS_FILE_SYSTEM #ifdef DOS_FILE_SYSTEM

View File

@ -9,6 +9,6 @@
#define MZSCHEME_VERSION_MAJOR 301 #define MZSCHEME_VERSION_MAJOR 301
#define MZSCHEME_VERSION_MINOR 12 #define MZSCHEME_VERSION_MINOR 13
#define MZSCHEME_VERSION "301.12" _MZ_SPECIAL_TAG #define MZSCHEME_VERSION "301.13" _MZ_SPECIAL_TAG

View File

@ -2646,7 +2646,8 @@
"(cons-path default(cadr m)(loop(caddr m)))" "(cons-path default(cadr m)(loop(caddr m)))"
"(cons-path default s null)))))))" "(cons-path default s null)))))))"
"(define find-executable-path" "(define find-executable-path"
"(lambda(program libpath)" "(case-lambda "
"((program libpath reverse?)"
"(unless(path-string? program) " "(unless(path-string? program) "
" (raise-type-error 'find-executable-path \"path or string (sans nul)\" program))" " (raise-type-error 'find-executable-path \"path or string (sans nul)\" program))"
"(unless(or(not libpath)(and(path-string? libpath) " "(unless(or(not libpath)(and(path-string? libpath) "
@ -2656,18 +2657,22 @@
"(lambda(exec-name)" "(lambda(exec-name)"
"(if libpath" "(if libpath"
"(let-values(((base name isdir?)(split-path exec-name)))" "(let-values(((base name isdir?)(split-path exec-name)))"
"(if(path? base)" "(let((next"
"(let((lib(build-path base libpath)))" "(lambda()"
"(if(or(directory-exists? lib) "
"(file-exists? lib))"
" lib"
"(let((resolved(resolve-path exec-name)))" "(let((resolved(resolve-path exec-name)))"
"(cond" "(cond"
"((equal? resolved exec-name) #f)" "((equal? resolved exec-name) #f)"
"((relative-path? resolved)" "((relative-path? resolved)"
"(found-exec(build-path base resolved)))" "(found-exec(build-path base resolved)))"
"(else(found-exec resolved))))))" "(else(found-exec resolved)))))))"
" #f))" "(or(and reverse?(next))"
"(if(path? base)"
"(let((lib(build-path base libpath)))"
"(and(or(directory-exists? lib) "
"(file-exists? lib))"
" lib))"
" #f)"
"(and(not reverse?)(next)))))"
" exec-name))))" " exec-name))))"
"(if(and(relative-path? program)" "(if(and(relative-path? program)"
"(let-values(((base name dir?)(split-path program)))" "(let-values(((base name dir?)(split-path program)))"
@ -2687,7 +2692,9 @@
"(found-exec name)" "(found-exec name)"
"(loop(cdr paths)))))))" "(loop(cdr paths)))))))"
"(let((p(path->complete-path program)))" "(let((p(path->complete-path program)))"
"(and(file-exists? p)(found-exec p)))))))" "(and(file-exists? p)(found-exec p))))))"
"((program libpath)(find-executable-path program libpath #f))"
"((program)(find-executable-path program #f #f))))"
"(define-syntax memory-trace-lambda" "(define-syntax memory-trace-lambda"
"(lambda(x)" "(lambda(x)"
"(syntax-case x()" "(syntax-case x()"
@ -3048,16 +3055,18 @@
"(build-path(find-system-path 'addon-dir)" "(build-path(find-system-path 'addon-dir)"
"(version)" "(version)"
" \"collects\")" " \"collects\")"
"(or(ormap" "(let*((collects-path(find-system-path 'collects-dir))"
"(lambda(f)(let((p(f)))(and p(directory-exists? p)(list(simplify-path p)))))" "(v"
"(list" "(cond"
" (lambda () (let ((v (getenv \"PLTHOME\")))" "((complete-path? collects-path) collects-path)"
" (and v (build-path v \"collects\"))))" "((absolute-path? collects-path)"
" (lambda () (find-executable-path (find-system-path 'exec-file) \"collects\"))" "(path->complete-path collects-path"
" (lambda () (find-executable-path (find-system-path 'exec-file) (build-path 'up \"collects\")))" "(find-executable-path(find-system-path 'exec-file) #f #t)))"
" (lambda () (find-executable-path (find-system-path 'exec-file) (build-path 'up 'up \"collects\")))" "(else"
" (lambda () (find-executable-path (find-system-path 'exec-file) (build-path 'up 'up 'up \"collects\")))))" "(find-executable-path(find-system-path 'exec-file) collects-path #t)))))"
" null))))" "(if v"
"(list(simplify-path(path->complete-path v(current-directory))))"
" null)))))"
"(define(port? x)(or(input-port? x)(output-port? x)))" "(define(port? x)(or(input-port? x)(output-port? x)))"
"(define-values(struct:guard make-guard guard? guard-ref guard-set!)" "(define-values(struct:guard make-guard guard? guard-ref guard-set!)"
"(make-struct-type 'evt #f 1 0 #f(list(cons prop:evt 0))(current-inspector) #f '(0)))" "(make-struct-type 'evt #f 1 0 #f(list(cons prop:evt 0))(current-inspector) #f '(0)))"

View File

@ -3063,7 +3063,8 @@
(cons-path default s null))))))) (cons-path default s null)))))))
(define find-executable-path (define find-executable-path
(lambda (program libpath) (case-lambda
[(program libpath reverse?)
(unless (path-string? program) (unless (path-string? program)
(raise-type-error 'find-executable-path "path or string (sans nul)" program)) (raise-type-error 'find-executable-path "path or string (sans nul)" program))
(unless (or (not libpath) (and (path-string? libpath) (unless (or (not libpath) (and (path-string? libpath)
@ -3073,18 +3074,22 @@
(lambda (exec-name) (lambda (exec-name)
(if libpath (if libpath
(let-values ([(base name isdir?) (split-path exec-name)]) (let-values ([(base name isdir?) (split-path exec-name)])
(if (path? base) (let ([next
(let ([lib (build-path base libpath)]) (lambda ()
(if (or (directory-exists? lib)
(file-exists? lib))
lib
(let ([resolved (resolve-path exec-name)]) (let ([resolved (resolve-path exec-name)])
(cond (cond
[(equal? resolved exec-name) #f] [(equal? resolved exec-name) #f]
[(relative-path? resolved) [(relative-path? resolved)
(found-exec (build-path base resolved))] (found-exec (build-path base resolved))]
[else (found-exec resolved)])))) [else (found-exec resolved)])))])
#f)) (or (and reverse? (next))
(if (path? base)
(let ([lib (build-path base libpath)])
(and (or (directory-exists? lib)
(file-exists? lib))
lib))
#f)
(and (not reverse?) (next)))))
exec-name))]) exec-name))])
(if (and (relative-path? program) (if (and (relative-path? program)
(let-values ([(base name dir?) (split-path program)]) (let-values ([(base name dir?) (split-path program)])
@ -3104,7 +3109,9 @@
(found-exec name) (found-exec name)
(loop (cdr paths))))))) (loop (cdr paths)))))))
(let ([p (path->complete-path program)]) (let ([p (path->complete-path program)])
(and (file-exists? p) (found-exec p))))))) (and (file-exists? p) (found-exec p)))))]
[(program libpath) (find-executable-path program libpath #f)]
[(program) (find-executable-path program #f #f)]))
;; ------------------------------ Memtrace ------------------------------ ;; ------------------------------ Memtrace ------------------------------
@ -3497,19 +3504,18 @@
(build-path (find-system-path 'addon-dir) (build-path (find-system-path 'addon-dir)
(version) (version)
"collects") "collects")
(or (ormap (let* ([collects-path (find-system-path 'collects-dir)]
(lambda (f) (let ([p (f)]) (and p (directory-exists? p) (list (simplify-path p))))) [v
(list (cond
(lambda () (let ((v (getenv "PLTHOME"))) [(complete-path? collects-path) collects-path]
(and v (build-path v "collects")))) [(absolute-path? collects-path)
(lambda () (find-executable-path (find-system-path 'exec-file) "collects")) (path->complete-path collects-path
;; When binary is in bin/ subdir: (find-executable-path (find-system-path 'exec-file) #f #t))]
(lambda () (find-executable-path (find-system-path 'exec-file) (build-path 'up "collects"))) [else
;; When binary is in .bin/<platform> subdir: (find-executable-path (find-system-path 'exec-file) collects-path #t)])])
(lambda () (find-executable-path (find-system-path 'exec-file) (build-path 'up 'up "collects"))) (if v
;; When binary is in bin/<appname>.app/Contents/Macos subdir: (list (simplify-path (path->complete-path v (current-directory))))
(lambda () (find-executable-path (find-system-path 'exec-file) (build-path 'up 'up 'up "collects"))))) null)))))
null))))
;; ------------------------------------------------------------------------- ;; -------------------------------------------------------------------------