Permalink
Browse files

Initial commit.

  • Loading branch information...
Brian J. Burg
Brian J. Burg committed Oct 25, 2012
0 parents commit 84214a4b9e4e29403a8a744d4463ad9239294937
Showing with 1,137 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +49 −0 Makefile.in
  3. +18 −0 cairo.rc
  4. +881 −0 cairo.rs
  5. +27 −0 cairo_ft.rs
  6. +114 −0 cairo_hl.rs
  7. +10 −0 cairo_quartz.rs
  8. +32 −0 cairo_xlib.rs
  9. +5 −0 configure
@@ -0,0 +1 @@
+*~
@@ -0,0 +1,49 @@
+VPATH=%VPATH%
+
+CC ?= gcc
+CXX ?= g++
+CXXFLAGS ?=
+AR ?= ar
+RUSTC ?= rustc
+RUSTFLAGS ?=
+
+UNAME=$(shell uname)
+
+ifeq ($(UNAME),Darwin)
+ OSTYPE=darwin
+endif
+ifeq ($(UNAME),Linux)
+ OSTYPE=linux
+endif
+
+ifeq ($(OSTYPE),darwin)
+# Cairo is not on the default library path for Darwin.
+# FIXME: This is not the right way to set up the lib location
+RUSTFLAGS += -L/opt/local/lib \
+ -L /usr/local/Cellar/cairo/1.10.2/lib \
+ $(NULL)
+endif
+
+RUST_SRC=$(shell find $(VPATH)/. -type f -name '*.rs')
+
+.PHONE: all
+all: librustcairo.dummy
+
+%.o: %.c
+ $(CC) $< -o $@ -c $(CFLAGS)
+
+librustcairo.dummy: cairo.rc $(RUST_SRC)
+ $(RUSTC) $(RUSTFLAGS) $< -o $@
+ touch $@
+
+cairo-test: cairo.rc $(RUST_SRC)
+ $(RUSTC) $(RUSTFLAGS) $< -o $@ --test
+
+.PHONY: check
+check: cairo-test
+ ./cairo-test
+
+.PHONY: clean
+clean:
+ rm -f *.o *.a *.so *.dylib *.dll *.dummy
+
@@ -0,0 +1,18 @@
+#[link(name = "cairo",
+ vers = "0.1")];
+#[crate_type = "lib"];
+
+extern mod std;
+
+pub mod cairo;
+pub mod cairo_hl;
+
+#[cfg(target_os = "linux")]
+pub mod cairo_xlib;
+
+#[cfg(target_os = "linux")]
+pub mod cairo_ft;
+
+#[cfg(target_os = "macos")]
+pub mod cairo_quartz;
+
Oops, something went wrong.

0 comments on commit 84214a4

Please sign in to comment.