mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-18 21:29:19 +02:00
Added c-flags-from-script to chibi-ffi
This commit is contained in:
parent
212231dca6
commit
90e2cb1aa6
1 changed files with 17 additions and 0 deletions
|
@ -415,6 +415,23 @@
|
|||
(define (c-link lib)
|
||||
(set! *clibs* (cons lib *clibs*)))
|
||||
|
||||
(define (c-flags-from-script cmd)
|
||||
(eval '(import (chibi process)
|
||||
; lest I clobber the existing string-split:
|
||||
(prefix (chibi string) imported:)
|
||||
(chibi char-set full)) ; for char-set:whitespace
|
||||
(current-environment))
|
||||
(let ((string-null? (eval 'imported:string-null? (current-environment)))
|
||||
(string-split (eval 'imported:string-split (current-environment)))
|
||||
(process->string (eval 'process->string (current-environment)))
|
||||
(char-set:whitespace
|
||||
(eval 'char-set:whitespace (current-environment))))
|
||||
(set! *cflags*
|
||||
(append *cflags*
|
||||
(filter
|
||||
(lambda (x) (not (string-null? x)))
|
||||
(string-split (process->string cmd) char-set:whitespace))))))
|
||||
|
||||
(define (c-declare . args)
|
||||
(apply cat args)
|
||||
(newline))
|
||||
|
|
Loading…
Add table
Reference in a new issue