Move "src/worksp/extradlls" to libs.

This commit is contained in:
Eli Barzilay 2010-11-08 11:22:54 -05:00
parent 689f2ac5c8
commit 614f100e8f
11 changed files with 66 additions and 80 deletions

View File

@ -373,8 +373,7 @@ mz-tests := (tests: "racket/" "info.rkt" "utils/" "match/" "eli-tester.rkt" "str
mz-src := (+ (- (src: "README" "Makefile.in" "configure" "lt/" "racket/" "utils/" mz-src := (+ (- (src: "README" "Makefile.in" "configure" "lt/" "racket/" "utils/"
(cond win => "worksp/{README|mzconfig.h}" (cond win => "worksp/{README|mzconfig.h}"
"worksp/{racket|libracket|libmzgc|gc2}/" "worksp/{racket|libracket|libmzgc|gc2}/"
"worksp/{mzstart|starters}/" "worksp/{mzstart|starters}/"))
"worksp/extradlls/"))
(cond (not mr) => (src: "worksp/starters/mrstart.ico"))) (cond (not mr) => (src: "worksp/starters/mrstart.ico")))
foreign-src) foreign-src)

1
src/.gitattributes vendored
View File

@ -11,7 +11,6 @@
/racket/gc/BCC_MAKEFILE -crlf /racket/gc/BCC_MAKEFILE -crlf
/racket/gc/digimars.mak -crlf /racket/gc/digimars.mak -crlf
/worksp/README -crlf /worksp/README -crlf
/worksp/extradlls/README.TXT -crlf
/worksp/gracket/gracket.manifest -crlf /worksp/gracket/gracket.manifest -crlf
/worksp/mzcom/mzcom.def -crlf /worksp/mzcom/mzcom.def -crlf
/worksp/mzcom/mzcom.rgs -crlf /worksp/mzcom/mzcom.rgs -crlf

View File

@ -14,8 +14,7 @@
[("--install") "install mode" (mode 'install)] [("--install") "install mode" (mode 'install)]
#:once-each #:once-each
[("--ready") n "touch `ready<n>' on download success" (touch-ready n)] [("--ready") n "touch `ready<n>' on download success" (touch-ready n)]
#:args #:args (src-dir dest-dir)
(src-dir dest-dir)
(values src-dir dest-dir))) (values src-dir dest-dir)))
(define url-host "download.racket-lang.org") (define url-host "download.racket-lang.org")
@ -72,7 +71,13 @@
["libpng14.14.dylib" 505920] ["libpng14.14.dylib" 505920]
["PSMTabBarControl.tgz" 95862])])] ["PSMTabBarControl.tgz" 95862])])]
[(windows) [(windows)
(let ([basic '(["libjpeg-7.dll" 233192] (let ([basic '(;; basic libraries
["UnicoWS.dll" 245408]
["iconv.dll" 892928]
["libeay32.dll" 1089536]
["ssleay32.dll" 237568]
;; gracket libraries
["libjpeg-7.dll" 233192]
["libcairo-2.dll" 921369] ["libcairo-2.dll" 921369]
["libpango-1.0-0.dll" 336626] ["libpango-1.0-0.dll" 336626]
["libexpat-1.dll" 143096] ["libexpat-1.dll" 143096]
@ -129,83 +134,73 @@
(path->string name)))) (path->string name))))
(define (download-if-needed dest-dir file size) (define (download-if-needed dest-dir file size)
(let ([dest (build-path dest-dir file)] (define dest (build-path dest-dir file))
[tmp (build-path dest-dir (format "~a.download" file))]) (if (and (file-exists? dest) (= (file-size dest) size))
(if (and (file-exists? dest) (printf " ~a is ready\n" file)
(= (file-size dest) size)) (let* ([sub (unixize (system-library-subpath #f))]
(printf " ~a is ready\n" file) [src (format "~a~a/~a" url-path sub file)])
(let* ([sub (unixize (system-library-subpath #f))] (unless explained?
[src (format "~a~a/~a" url-path sub file)]) (set! explained? #t)
(unless explained? (printf ">> Downloading files from\n>> ~a~a\n" url-base sub)
(set! explained? #t) (printf ">> If you don't want automatic download, download each file\n")
(printf ">> Downloading files from\n>> ~a~a\n" url-base sub) (printf ">> yourself from there to\n")
(printf ">> If you don't want automatic download, download each file\n") (printf ">> ~a\n" (path->complete-path dest-dir)))
(printf ">> yourself from there to\n") (printf " ~a downloading..." file)
(printf ">> ~a\n" (path->complete-path dest-dir))) (flush-output)
(printf " ~a downloading..." file) (define-values [i o] (tcp-connect url-host 80))
(flush-output) (fprintf o "GET ~a HTTP/1.0\r\n" (string-append src))
(let-values ([(i o) (tcp-connect url-host 80)]) (fprintf o "Host: ~a\r\n" url-host)
(fprintf o "GET ~a HTTP/1.0\r\n" (string-append src)) (fprintf o "\r\n")
(fprintf o "Host: ~a\r\n" url-host) (flush-output o)
(fprintf o "\r\n") (tcp-abandon-port o)
(flush-output o) (purify-port i)
(tcp-abandon-port o) (define tmp (build-path dest-dir (format "~a.download" file)))
(purify-port i) (call-with-output-file tmp #:exists 'truncate/replace
(call-with-output-file tmp (lambda (out) (copy-port i out)))
#:exists 'truncate/replace (rename-file-or-directory tmp dest #t)
(lambda (out) (let ([sz (file-size dest)])
(copy-port i out))) (unless (= size sz)
(rename-file-or-directory tmp dest #t) (raise-user-error
(let ([sz (file-size dest)]) 'get-libs "size of ~a is ~a; doesn't match expected size ~a"
(unless (= size sz) dest sz size)))
(raise-user-error (printf "done\n"))))
'get-libs
"size of ~a is ~a; doesn't match expected size ~a"
dest sz size)))
(printf "done\n"))))))
(define (same-content? f1 f2) (define (same-content? f1 f2)
;; approximate: ;; approximate:
(and (file-exists? f1) (and (file-exists? f1) (file-exists? f2) (= (file-size f1) (file-size f2))))
(file-exists? f2)
(= (file-size f1) (file-size f2))))
(define (install-file src dest) (define (install-file src dest)
(if (regexp-match? #rx"[.]tgz" (path->string src)) (if (regexp-match? #rx"[.]tgz" (path->string src))
;; Unpack tar file: ;; Unpack tar file:
(unpack-tgz src dest) (unpack-tgz src dest)
;; Plain copy: ;; Plain copy:
(unless (same-content? src dest) (unless (same-content? src dest)
(printf "Updating ~a\n" dest) (printf "Updating ~a\n" dest)
(when (file-exists? dest) (when (file-exists? dest) (delete-file dest))
(delete-file dest)) (copy-file src dest))))
(copy-file src dest))))
(define (unpack-tgz src dest) (define (unpack-tgz src* dest)
(let ([src (path->string (path->complete-path src))]) (define src (path->string (path->complete-path src*)))
(parameterize ([current-directory (parameterize ([current-directory
(let-values ([(base name dir?) (split-path dest)]) base)]) (let-values ([(base name dir?) (split-path dest)]) base)])
(define-values [p pout pin perr] (define-values [p pout pin perr]
(subprocess (subprocess
(current-output-port) (current-input-port) (current-error-port) (current-output-port) (current-input-port) (current-error-port)
(find-executable-path "tar") "zxf" src)) (find-executable-path "tar") "zxf" src))
(subprocess-wait p)))) (subprocess-wait p)))
(case (mode) (case (mode)
[(download) [(download)
(let ([libs dest-dir]) (let ([libs dest-dir])
(unless (directory-exists? libs) (unless (directory-exists? libs)
(make-directory libs)) (make-directory libs))
(for-each (lambda (file+size) (for ([file+size (in-list needed-files+sizes)])
(download-if-needed libs (car file+size) (cadr file+size))) (download-if-needed libs (car file+size) (cadr file+size)))
needed-files+sizes)
(when (touch-ready) (when (touch-ready)
(let ([ok (build-path libs (format "ready~a" (touch-ready)))]) (define ok (build-path libs (format "ready~a" (touch-ready))))
(unless (file-exists? ok) (unless (file-exists? ok) (with-output-to-file ok void))))]
(with-output-to-file ok void)))))]
[(install) [(install)
(for-each (lambda (file+size) (for ([file+size (in-list needed-files+sizes)])
(let ([file (car file+size)]) (define file (car file+size))
(install-file (build-path src-dir "libs" file) (install-file (build-path src-dir "libs" file)
(build-path dest-dir file)))) (build-path dest-dir file)))])
needed-files+sizes)])

View File

@ -4,4 +4,3 @@ mkdir ..\..\..\lib
mkdir ..\..\..\lib\msvc mkdir ..\..\..\lib\msvc
copy mzdyn.exp ..\..\..\lib\msvc copy mzdyn.exp ..\..\..\lib\msvc
copy mzdyn.obj ..\..\..\lib\msvc copy mzdyn.obj ..\..\..\lib\msvc
copy ..\..\worksp\extradlls\*.dll ..\..\..\lib

View File

@ -7,4 +7,3 @@ copy mzdyn.exp ..\..\..\lib\msvc
copy mzdyn.obj ..\..\..\lib\msvc copy mzdyn.obj ..\..\..\lib\msvc
copy ..\..\worksp\libmzsch\debug\libmzschxxxxxxx.lib ..\..\..\lib\msvc copy ..\..\worksp\libmzsch\debug\libmzschxxxxxxx.lib ..\..\..\lib\msvc
copy ..\..\worksp\libmzgc\debug\libmzgcxxxxxxx.lib ..\..\..\lib\msvc copy ..\..\worksp\libmzgc\debug\libmzgcxxxxxxx.lib ..\..\..\lib\msvc
copy ..\..\worksp\extradlls\*.dll ..\..\..\lib

View File

@ -87,8 +87,7 @@ builds
In addition, building RacketCGC executes In addition, building RacketCGC executes
racket\src\racket\dynsrc\mkmzdyn.bat racket\src\racket\dynsrc\mkmzdyn.bat
which copies .exp, .obj, and .lib files into racket\lib\, and also which copies .exp, .obj, and .lib files into racket\lib\.
copies DLLs from the "extradlls" directory to to racket\lib\.
Finally, you must install pre-build DLLs that GRacket needs to run. Finally, you must install pre-build DLLs that GRacket needs to run.
The DLLs are available from The DLLs are available from

View File

@ -1,4 +0,0 @@
This directory contains extra DLLs that are needed for running
Racket. The DLL files are moved into the Racket/lib folder by
plt/src/racket/dynsrc/mkmzdyn.bat
which is, in turn, called by the MSVC projects.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.