chiark
/
gitweb
/
~mdw
/
clg
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reintroduced tests of idle, timeouts and tooltips
[clg]
/
tools
/
config.lisp
diff --git
a/tools/config.lisp
b/tools/config.lisp
index 1623a575163fe63b05d37fdf3ef459991ad1cb0f..0ec9a70b8c6e086310bd29ab9885dc87a319d530 100644
(file)
--- a/
tools/config.lisp
+++ b/
tools/config.lisp
@@
-1,3
+1,10
@@
+(defpackage #:pkg-config
+ (:use #:common-lisp)
+ (:export #:pkg-cflags #:pkg-libs #:pkg-exists-p #:pkg-version
+ #:pkg-variable))
+
+(in-package #:pkg-config)
+
(defparameter *pkg-config* "pkg-config")
(defun split-string (string &key (start 0) (end (length string)))
(defparameter *pkg-config* "pkg-config")
(defun split-string (string &key (start 0) (end (length string)))
@@
-37,25
+44,28
@@
(defun read-string (&optional (stream *standard-input*)
(defun run-pkg-config (package error &rest options)
(let ((process
(defun run-pkg-config (package error &rest options)
(let ((process
- (run-program
+ (
ext:
run-program
*pkg-config* (cons package options) :wait t :output :stream)))
(unless process
(error "Unable to run ~A" *pkg-config*))
*pkg-config* (cons package options) :wait t :output :stream)))
(unless process
(error "Unable to run ~A" *pkg-config*))
- (let ((exit-code (process-exit-code process)))
+ (let ((exit-code (
ext:
process-exit-code process)))
(unless (or (not error) (zerop exit-code))
(error
(or
(unless (or (not error) (zerop exit-code))
(error
(or
- (read-string (process-error process) nil)
+ (read-string (
ext:
process-error process) nil)
(format nil "~A terminated with exit code ~A"
*pkg-config* exit-code))))
(format nil "~A terminated with exit code ~A"
*pkg-config* exit-code))))
- (let ((output (read-lines (
process-output process))))
- (process-close process)
+ (let ((output (read-lines (
ext:process-output process))))
+ (
ext:
process-close process)
(values output exit-code)))))
(defun pkg-cflags (package)
(split-string (first (run-pkg-config package t "--cflags"))))
(values output exit-code)))))
(defun pkg-cflags (package)
(split-string (first (run-pkg-config package t "--cflags"))))
+(defun pkg-libs (package)
+ (split-string (first (run-pkg-config package t "--libs"))))
+
(defun pkg-exists-p (package &key version atleast-version max-version
( error t))
(defun pkg-exists-p (package &key version atleast-version max-version
( error t))