[kaffe] Cairo Java binding runs on Kaffe

Jim Huang jimchyun at ccns.ncku.edu.tw
Wed Apr 21 02:01:01 PDT 2004

Hi all,

  I'd like to inform that the Java binding for Cario[1] graphics library
runs on Kaffe. The Java binding can be used to draw on SWT images and 
widgets, and I hope SwingWT might even integrate Cario for advanced
high quality graphics.

  The instructions how I got Cario Java binding running are:

* Fetch the source
  cvs -d :pserver:anoncvs at cvs.cairographics.org:/cvs/cairo co CairoJava

* build Java part
  modify build.xml according to your SWT path, and run "ant"

* build JNI part
  modify Makefile for indicating Kaffe's path. If you use Debian, you
  could use the patch attached in this mail.

  That's all. Now, go to test directory. Here are my screenshots:


Jim Huang

[1] http://cairographics.org/
-------------- next part --------------
--- Makefile	2004-04-21 15:29:58.000000000 +0800
+++ Makefile.kaffe	2004-04-21 14:57:59.000000000 +0800
@@ -1,17 +1,23 @@
-CXXFLAGS=-O3 -g -ffloat-store -fPIC -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -I ./ `pkg-config --cflags cairo` `pkg-config --cflags gtk+-2.0`
+CXXFLAGS=-O3 -g -ffloat-store -fPIC -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -I ./ `pkg-config --cflags cairo` `pkg-config --cflags gtk+-2.0`  -I$(JAVA_HOME)/include
 LDFLAGS=`pkg-config --libs cairo` `pkg-config --libs gtk+-2.0`
 all:	$(LIBDIR)/libcairoJni.so
 libcairoJni.h:	../bin/org/cairographics/cairo/internal/CairoAPI.class
-	$(JAVA_HOME)/bin/javah -o libcairoJni.h -classpath ../bin org.cairographics.cairo.internal.CairoAPI
+	$(JAVA_HOME)/bin/javah \
+		-o libcairoJni.h \
+		-classpath ../bin::$(JAVA_HOME)/jre/lib/rt.jar \
+		org.cairographics.cairo.internal.CairoAPI
 libcairoJni.o:	libcairoJni.h
 $(LIBDIR)/libcairoJni.so:	libcairoJni.o
 	mkdir -p $(LIBDIR)
-	gcc -shared -O3 -g -ffloat-store -o $@ libcairoJni.o $(LDFLAGS) -lstdc++
+	gcc -shared -O3 -ffloat-store -o $@ libcairoJni.o $(LDFLAGS) -lstdc++
 	rm -f libcairoJni.h libcairoJni.o

More information about the kaffe mailing list