mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
Added functions to read C linker options
This commit is contained in:
parent
d9d78c226b
commit
4901bf4832
1 changed files with 29 additions and 0 deletions
|
@ -54,6 +54,9 @@
|
||||||
lib:get-all
|
lib:get-all
|
||||||
lib:get-all-import-deps
|
lib:get-all-import-deps
|
||||||
lib:get-dep-list
|
lib:get-dep-list
|
||||||
|
lib:c-linker-options
|
||||||
|
lib:read-c-linker-options
|
||||||
|
lib:get-all-c-linker-options
|
||||||
;; Import Database "idb" oriented functions
|
;; Import Database "idb" oriented functions
|
||||||
;;
|
;;
|
||||||
;; These functions perform operations for a "database" created from
|
;; These functions perform operations for a "database" created from
|
||||||
|
@ -188,6 +191,15 @@
|
||||||
(tagged-list? 'include code))
|
(tagged-list? 'include code))
|
||||||
(cddr ast))))
|
(cddr ast))))
|
||||||
|
|
||||||
|
(define (lib:c-linker-options ast)
|
||||||
|
(map
|
||||||
|
(lambda (inc-lst)
|
||||||
|
(cadr inc-lst))
|
||||||
|
(filter
|
||||||
|
(lambda (code)
|
||||||
|
(tagged-list? 'c-linker-options code))
|
||||||
|
(cddr ast))))
|
||||||
|
|
||||||
(define (lib:include-c-headers ast)
|
(define (lib:include-c-headers ast)
|
||||||
(map
|
(map
|
||||||
(lambda (inc-lst)
|
(lambda (inc-lst)
|
||||||
|
@ -380,6 +392,23 @@
|
||||||
(close-input-port fp)
|
(close-input-port fp)
|
||||||
includes))
|
includes))
|
||||||
|
|
||||||
|
(define (lib:read-c-linker-options import append-dirs prepend-dirs)
|
||||||
|
(let* ((lib-name (lib:import->library-name import))
|
||||||
|
(dir (lib:import->filename lib-name ".sld" append-dirs prepend-dirs))
|
||||||
|
(fp (open-input-file dir))
|
||||||
|
(lib (read-all fp))
|
||||||
|
(options (lib:c-linker-options (car lib))))
|
||||||
|
(close-input-port fp)
|
||||||
|
(string-join options " ")))
|
||||||
|
|
||||||
|
(define (lib:get-all-c-linker-options imports append-dirs prepend-dirs)
|
||||||
|
(string-join
|
||||||
|
(map
|
||||||
|
(lambda (import)
|
||||||
|
(lib:read-c-linker-options import append-dirs prepend-dirs))
|
||||||
|
imports)
|
||||||
|
" "))
|
||||||
|
|
||||||
;; Read export list for a given import
|
;; Read export list for a given import
|
||||||
(define (lib:import->export-list import append-dirs prepend-dirs)
|
(define (lib:import->export-list import append-dirs prepend-dirs)
|
||||||
(let* ((lib-name (lib:import->library-name import))
|
(let* ((lib-name (lib:import->library-name import))
|
||||||
|
|
Loading…
Add table
Reference in a new issue