1 (defparameter *pkg-config* "/usr/bin/pkg-config")
3 (defun split-string (string &key (start 0) end)
4 (let ((position (position #\sp string :start start :end end)))
7 (subseq string start position)
8 (split-string string :start (1+ position) :end end))
9 (list (subseq string start end)))))
11 (defun run-pkg-config (package &rest options)
14 *pkg-config* (cons package options) :wait t :output :stream)))
16 (error "Unable to run ~A" *pkg-config*))
17 (unless (zerop (process-exit-code process))
18 (error "~A: ~A" *pkg-config* (read-line (process-output process))))
20 (delete-if #'(lambda (str) (string= str "")) (split-string (read-line (process-output process))))
21 (process-close process))))
24 (defun pkg-cflags (package)
25 (run-pkg-config package "--cflags"))