Ticket #497: compilation-fix.patch

File compilation-fix.patch, 1.1 KB (added by Bobby Powers, 13 years ago)


  • cairo.setup

    diff -u cairo/cairo.setup cairo-fix/cairo.setup
    old new  
    11;;;; -*- Scheme -*-
     2(use srfi-1)
     3(use srfi-13)
    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)))))
     19(let ((pkg-cflags (mark-compiler-options (with-input-from-pipe "pkg-config --cflags cairo" read-line)))
    420      (pkg-lflags (with-input-from-pipe "pkg-config --libs cairo" read-line)))
    521      (compile -s -O2 cairo.scm -j cairo -lcairo ,pkg-cflags ,pkg-lflags)
    622      (compile -c -O2 cairo.scm -unit cairo ,pkg-cflags ,pkg-lflags)