make plot work right in 3m
svn: r2876
This commit is contained in:
parent
24f8896c8d
commit
d1b9071732
|
@ -4,7 +4,7 @@
|
|||
|
||||
(define libfit
|
||||
(ffi-lib (build-path (this-expression-source-directory)
|
||||
"compiled" "native" (system-library-subpath)
|
||||
"compiled" "native" (system-library-subpath #f)
|
||||
"libfit")))
|
||||
|
||||
(define do-fit-int
|
||||
|
|
|
@ -6,13 +6,26 @@
|
|||
(define libplplot
|
||||
(ffi-lib
|
||||
(build-path (this-expression-source-directory)
|
||||
"compiled" "native" (system-library-subpath) "libplplot")))
|
||||
"compiled" "native" (system-library-subpath #f) "libplplot")))
|
||||
|
||||
(define plplotlibdir (get-ffi-obj "plplotLibDir" libplplot _string))
|
||||
|
||||
;; set the lib dir to contain the fonts.
|
||||
(set-ffi-obj! "plplotLibDir" libplplot _string
|
||||
(path->string (this-expression-source-directory)))
|
||||
;; set the lib dir to contain the fonts:
|
||||
(let ([path (this-expression-source-directory)])
|
||||
;; free current pointer, if any:
|
||||
(let ([p (get-ffi-obj "plplotLibDir" libplplot _pointer)])
|
||||
(when p (free p)))
|
||||
;; install new value:
|
||||
(set-ffi-obj! "plplotLibDir" libplplot _bytes
|
||||
;; malloc the string, since the GC won't see the static variable:
|
||||
(let* ([gced-bytes (path->bytes path)]
|
||||
[len (bytes-length gced-bytes)]
|
||||
[p (malloc (add1 len) 'raw)]
|
||||
[malloced-bytes (make-sized-byte-string p len)])
|
||||
(bytes-copy! malloced-bytes 0 gced-bytes)
|
||||
;; set nul terminator:
|
||||
(ptr-set! p _byte len 0)
|
||||
malloced-bytes)))
|
||||
|
||||
(define _plflt _double*)
|
||||
(define _plint _int)
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
(define tmp-dir (build-path src-dir "tmp"))
|
||||
(define dir->libname '(["all" "libplplot"] ["fit" "libfit"]))
|
||||
(define native-dir
|
||||
(build-path top-dir "compiled" "native" (system-library-subpath)))
|
||||
(build-path top-dir "compiled" "native" (system-library-subpath #f)))
|
||||
|
||||
(define (build-library lib)
|
||||
(when (and (directory-exists? lib)
|
||||
|
|
Loading…
Reference in New Issue
Block a user