diff -u cairo/cairo.setup cairo-fix/cairo.setup
old
|
new
|
|
1 | 1 | ;;;; -*- Scheme -*- |
| 2 | (use srfi-1) |
| 3 | (use srfi-13) |
2 | 4 | |
3 | | (let ((pkg-cflags (with-input-from-pipe "pkg-config --cflags cairo" read-line)) |
| 5 | ;;; on some systems cairo is compiled with pthread support using the |
| 6 | ;;; option '-pthread'. We need to parse the pkgconfig output to prefix |
| 7 | ;;; any non-include directives with '-C' so that csc passes them through |
| 8 | ;;; to the c-compiler. |
| 9 | (define mark-compiler-options |
| 10 | (lambda (s) |
| 11 | (reduce (lambda (s1 s2) (string-append s1 " " s2)) |
| 12 | "" |
| 13 | (map (lambda (option) |
| 14 | (if (string-prefix? "-I" option) |
| 15 | option |
| 16 | (string-append "-C " option))) |
| 17 | (string-tokenize s))))) |
| 18 | |
| 19 | (let ((pkg-cflags (mark-compiler-options (with-input-from-pipe "pkg-config --cflags cairo" read-line))) |
4 | 20 | (pkg-lflags (with-input-from-pipe "pkg-config --libs cairo" read-line))) |
5 | 21 | (compile -s -O2 cairo.scm -j cairo -lcairo ,pkg-cflags ,pkg-lflags) |
6 | 22 | (compile -c -O2 cairo.scm -unit cairo ,pkg-cflags ,pkg-lflags) |