Skip to content

Commit 9f70d86

Browse files
committed
add command line flags to include "cairo.h" and link against libcairo
1 parent 43cb55c commit 9f70d86

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

gum/fast/Makefile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
all: fast.c
1+
all: fast.so
22

3-
fast.c: fast.pyx
4-
$(CYTHON) fast.pyx
3+
fast.so: fast.c
54
gcc -shared -pthread -fPIC -fwrapv -O2 -Wall -fno-strict-aliasing \
65
-I/usr/include/python2.5 -I/usr/include/python2.6 \
76
-I/usr/include/python2.7 \
8-
-lcairo -o fast.so fast.c
7+
`pkg-config --cflags cairo` \
8+
-o fast.so fast.c \
9+
`pkg-config --libs cairo`
910
if [ ! -e ../fast.so ]; then ln -s fast/fast.so ../; fi
1011

12+
fast.c: fast.pyx
13+
$(CYTHON) fast.pyx
14+
15+
.PHONY: clean
1116
clean:
1217
rm -f fast.so fast.c

gum/fast/fast.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,3 @@ typedef struct {
55
void *ctx;
66
} PycairoContext;
77

8-
void cairo_move_to (void *cr, double x, double y);
9-
void cairo_line_to (void *cr, double x, double y);
10-
void cairo_rectangle(void *cr, double x, double ymin,
11-
double w, double h);
12-
void cairo_set_source_rgb (void *cr, double r, double g, double b);
13-
void cairo_stroke (void *cr);
14-
void cairo_fill (void *cr);
15-
void cairo_set_line_width(void *cr, double w);

gum/fast/fast.pyx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ cdef extern from "math.h":
66
cdef extern from "fast.h":
77
ctypedef struct PycairoContext:
88
void *ctx
9+
10+
cdef extern from "cairo.h":
911
void cairo_move_to (void *cr, double x, double y) nogil
1012
void cairo_line_to (void *cr, double x, double y) nogil
1113
void cairo_rectangle(void *cr, double x, double ymin,

0 commit comments

Comments
 (0)