[cp-patches] [rfc] add check for Xrender for recent and future functionality.

Andreas Tobler toa at pop.agri.ch
Tue May 30 19:03:30 UTC 2006


Hi Tom,

Thomas Fitzsimmons wrote:

> would you please try this patch on your platform and commit it if it works?

Thanks for the patch, I had something similar in mind.

Unfortunately your version doesn't help me, I need to add -lXrender to 
the X_EXTRA_LIBS then your patch works.

Attached the diff.


Andreas

-------------- next part --------------
Index: configure.ac
===================================================================
RCS file: /cvsroot/classpath/classpath/configure.ac,v
retrieving revision 1.153
diff -u -r1.153 configure.ac
--- configure.ac	27 May 2006 21:10:46 -0000	1.153
+++ configure.ac	30 May 2006 19:03:20 -0000
@@ -406,6 +406,12 @@
     PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8 gthread-2.0 >= 2.2 gdk-pixbuf-2.0)
     PKG_CHECK_MODULES(FREETYPE2, freetype2)
     PKG_CHECK_MODULES(PANGOFT2, pangoft2)
+    dnl Check if we can link against the XRender library and set
+    dnl HAVE_XRENDER accordingly.
+    AC_CHECK_LIB([Xrender], [XRenderQueryExtension],
+		 [AC_DEFINE(HAVE_XRENDER, 1, [Define to 1 if you have libXrender.])[X_EXTRA_LIBS="$X_EXTRA_LIBS -lXrender"]],
+		 [true],
+		 [${X_LIBS}])
 
     AC_SUBST(GTK_CFLAGS)
     AC_SUBST(GTK_LIBS)
Index: native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphics.c
===================================================================
RCS file: /cvsroot/classpath/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphics.c,v
retrieving revision 1.4
diff -u -r1.4 gnu_java_awt_peer_gtk_ComponentGraphics.c
--- native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphics.c	30 May 2006 11:30:02 -0000	1.4
+++ native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphics.c	30 May 2006 19:03:20 -0000
@@ -55,7 +55,7 @@
 #include "gnu_java_awt_peer_gtk_ComponentGraphics.h"
 
 
-static void 
+void 
 cp_java_awt_peer_gtk_ComponentGraphics_grab_current_drawable(GtkWidget *widget,
 	GdkDrawable **draw, GdkWindow **win)
 {  
@@ -78,9 +78,11 @@
 Java_gnu_java_awt_peer_gtk_ComponentGraphics_hasXRender
   (JNIEnv *env __attribute__ ((unused)), jclass cls __attribute__ ((unused)))
 { 
+#if HAVE_XRENDER
   int ev = 0, err = 0; 
   if( XRenderQueryExtension (GDK_DISPLAY (), &ev, &err) )
     return JNI_TRUE;
+#endif
   return JNI_FALSE;
 }
 


More information about the Classpath-patches mailing list