mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
Added lib:check-system-path
This commit is contained in:
parent
5c1048bfe0
commit
27caeb3fbf
1 changed files with 17 additions and 0 deletions
|
@ -16,6 +16,7 @@
|
|||
(define-library (scheme cyclone libraries)
|
||||
(import (scheme base)
|
||||
(scheme read)
|
||||
(scheme process-context)
|
||||
(scheme cyclone util)
|
||||
)
|
||||
(export
|
||||
|
@ -42,6 +43,7 @@
|
|||
lib:import->filename
|
||||
lib:import->metalist
|
||||
lib:import->path
|
||||
lib:check-system-path
|
||||
lib:read-imports
|
||||
lib:import->export-list
|
||||
lib:import-set/exports->imports
|
||||
|
@ -322,6 +324,21 @@
|
|||
; path)
|
||||
))
|
||||
|
||||
;; string :: string
|
||||
;;
|
||||
;; Check the system path to see if the given library is present.
|
||||
;; If so return the full path, otherwise give up and return filename.
|
||||
;;
|
||||
(define (lib:check-system-path filename)
|
||||
(let* ((env-dir (get-environment-variable "CYCLONE_LIBRARY_PATH"))
|
||||
(dir (if env-dir
|
||||
env-dir
|
||||
(Cyc-installation-dir 'sld)))
|
||||
(path (string-append dir "/" filename)))
|
||||
(if (file-exists? path)
|
||||
path
|
||||
filename)))
|
||||
|
||||
;; Given a program's import set, resolve each import to its .o file, then
|
||||
;; process each import recursively to get the .o files that each one of those
|
||||
;; libs requires. will probably need to prune duplicates from completed list.
|
||||
|
|
Loading…
Add table
Reference in a new issue