From 825902f8e6d853b60842a640a795659c6ab71b3a Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 12 Nov 2015 19:01:18 -0700 Subject: [PATCH] Windows: adjust `raco ctool --c-mods ... --runtime ...` to copy libs When gathering runtime files, include the "longdouble.dll" and "libiconv-2.dll" libraries that are referenced by the runtime system. --- racket/collects/compiler/distribute.rkt | 96 +++++++++++++------------ 1 file changed, 49 insertions(+), 47 deletions(-) diff --git a/racket/collects/compiler/distribute.rkt b/racket/collects/compiler/distribute.rkt index c235a144d4..9f854ec4ec 100644 --- a/racket/collects/compiler/distribute.rkt +++ b/racket/collects/compiler/distribute.rkt @@ -105,8 +105,7 @@ (make-directory* collects-dir) (make-directory* exts-dir) ;; Copy libs into place - (when executables? - (install-libs lib-dir types)) + (install-libs lib-dir types (not executables?)) ;; Copy collections into place (for-each (lambda (dir) (for-each (lambda (f) @@ -154,7 +153,7 @@ ;; Done! (void)))))) - (define (install-libs lib-dir types) + (define (install-libs lib-dir types extras-only?) (case (cross-system-type) [(windows) (let ([copy-dll (lambda (name) @@ -169,52 +168,55 @@ (map copy-dll (list "libiconv-2.dll" "longdouble.dll")) - (when (or (memq 'racketcgc types) - (memq 'gracketcgc types)) - (map copy-dll - (list - (versionize "libracket~a.dll") - (versionize "libmzgc~a.dll")))) - (when (or (memq 'racket3m types) - (memq 'gracket3m types)) - (map copy-dll - (list - (versionize "libracket3m~a.dll")))))] + (unless extras-only? + (when (or (memq 'racketcgc types) + (memq 'gracketcgc types)) + (map copy-dll + (list + (versionize "libracket~a.dll") + (versionize "libmzgc~a.dll")))) + (when (or (memq 'racket3m types) + (memq 'gracket3m types)) + (map copy-dll + (list + (versionize "libracket3m~a.dll"))))))] [(macosx) - (when (or (memq 'racketcgc types) - (memq 'gracketcgc types)) - (copy-framework "Racket" #f lib-dir)) - (when (or (memq 'racket3m types) - (memq 'gracket3m types)) - (copy-framework "Racket" #t lib-dir))] + (unless extras-only? + (when (or (memq 'racketcgc types) + (memq 'gracketcgc types)) + (copy-framework "Racket" #f lib-dir)) + (when (or (memq 'racket3m types) + (memq 'gracket3m types)) + (copy-framework "Racket" #t lib-dir)))] [(unix) - (let ([lib-plt-dir (build-path lib-dir "plt")]) - (unless (directory-exists? lib-plt-dir) - (make-directory lib-plt-dir)) - (let ([copy-bin - (lambda (name variant gr?) - (copy-file* (build-path (if gr? - (find-lib-dir) - (find-console-bin-dir)) - (format "~a~a" name (variant-suffix variant #f))) - (build-path lib-plt-dir - (format "~a~a-~a" name variant (version)))))]) - (when (memq 'racketcgc types) - (copy-bin "racket" 'cgc #f)) - (when (memq 'racket3m types) - (copy-bin "racket" '3m #f)) - (when (memq 'gracketcgc types) - (copy-bin "gracket" 'cgc #t)) - (when (memq 'gracket3m types) - (copy-bin "gracket" '3m #t))) - (when (shared-libraries?) - (when (or (memq 'racketcgc types) - (memq 'gracketcgc types)) - (copy-shared-lib "racket" lib-dir) - (copy-shared-lib "mzgc" lib-dir)) - (when (or (memq 'racket3m types) - (memq 'gracket3m types)) - (copy-shared-lib "racket3m" lib-dir))))])) + (unless extras-only? + (let ([lib-plt-dir (build-path lib-dir "plt")]) + (unless (directory-exists? lib-plt-dir) + (make-directory lib-plt-dir)) + (let ([copy-bin + (lambda (name variant gr?) + (copy-file* (build-path (if gr? + (find-lib-dir) + (find-console-bin-dir)) + (format "~a~a" name (variant-suffix variant #f))) + (build-path lib-plt-dir + (format "~a~a-~a" name variant (version)))))]) + (when (memq 'racketcgc types) + (copy-bin "racket" 'cgc #f)) + (when (memq 'racket3m types) + (copy-bin "racket" '3m #f)) + (when (memq 'gracketcgc types) + (copy-bin "gracket" 'cgc #t)) + (when (memq 'gracket3m types) + (copy-bin "gracket" '3m #t))) + (when (shared-libraries?) + (when (or (memq 'racketcgc types) + (memq 'gracketcgc types)) + (copy-shared-lib "racket" lib-dir) + (copy-shared-lib "mzgc" lib-dir)) + (when (or (memq 'racket3m types) + (memq 'gracket3m types)) + (copy-shared-lib "racket3m" lib-dir)))))])) (define (search-dll dll-dir dll) (if dll-dir