fix raco ctool --c-mods' for racket'

Merge to 5.2.1
(cherry picked from commit 6c4cd0e9c2)
This commit is contained in:
Matthew Flatt 2012-01-19 07:53:45 -07:00 committed by Ryan Culpepper
parent 87254941f5
commit fd8230152d
2 changed files with 26 additions and 4 deletions

View File

@ -800,7 +800,10 @@
(define (do-write-module-bundle outp verbose? modules config? literal-files literal-expressions collects-dest
on-extension program-name compiler expand-namespace
src-filter get-extra-imports on-decls-done)
(let* ([module-paths (map cadr modules)]
(let* ([program-name-bytes (if program-name
(path->bytes program-name)
#"?")]
[module-paths (map cadr modules)]
[resolve-one-path (lambda (mp)
(let ([f (resolve-module-path mp #f)])
(unless f
@ -882,7 +885,7 @@
;; The program name isn't used. It just helps ensures that
;; there's plenty of room in the executable for patching
;; the path later when making a distribution.
(path->bytes program-name))))
program-name-bytes)))
extensions))])
(for-each (lambda (pr)
(current-module-declare-name (make-resolved-module-path (cadr pr)))
@ -970,7 +973,7 @@
(build-path (path-only (mod-file nc)) p))))))
;; As for the extension table, a placeholder to save
;; room likely needed by the distribution-mangler
(bytes-append #"................." (path->bytes program-name))))
(bytes-append #"................." program-name-bytes)))
(mod-runtime-paths nc)
(mod-runtime-module-syms nc)))
runtimes))])
@ -1031,7 +1034,7 @@
(do-write-module-bundle (current-output-port) verbose? modules config? literal-files literal-expressions
#f ; collects-dest
on-extension
"?" ; program-name
#f ; program-name
compiler expand-namespace
src-filter get-extra-imports
void))

View File

@ -0,0 +1,19 @@
#lang racket
(require setup/dirs)
(define raco (build-path (find-console-bin-dir)
(if (eq? (system-type) 'windows)
"raco.exe"
"raco")))
(define tmp (make-temporary-file))
(system* raco
"ctool"
"--3m"
"--c-mods"
tmp
"++lib"
"racket")
(delete-file tmp)