mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-24 04:25:06 +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)
|
(define-library (scheme cyclone libraries)
|
||||||
(import (scheme base)
|
(import (scheme base)
|
||||||
(scheme read)
|
(scheme read)
|
||||||
|
(scheme process-context)
|
||||||
(scheme cyclone util)
|
(scheme cyclone util)
|
||||||
)
|
)
|
||||||
(export
|
(export
|
||||||
|
@ -42,6 +43,7 @@
|
||||||
lib:import->filename
|
lib:import->filename
|
||||||
lib:import->metalist
|
lib:import->metalist
|
||||||
lib:import->path
|
lib:import->path
|
||||||
|
lib:check-system-path
|
||||||
lib:read-imports
|
lib:read-imports
|
||||||
lib:import->export-list
|
lib:import->export-list
|
||||||
lib:import-set/exports->imports
|
lib:import-set/exports->imports
|
||||||
|
@ -322,6 +324,21 @@
|
||||||
; path)
|
; 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
|
;; 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
|
;; 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.
|
;; libs requires. will probably need to prune duplicates from completed list.
|
||||||
|
|
Loading…
Add table
Reference in a new issue