7001056: JDK 7 fails on to build on Solaris 10 update 9 - updated Xrender header files
authorprr
Thu, 13 Jan 2011 10:36:51 -0800
changeset 7933 afae9398b405
parent 7932 f4ec6ef455c3
child 7934 ee92dd256de6
7001056: JDK 7 fails on to build on Solaris 10 update 9 - updated Xrender header files Reviewed-by: igor, jgodinez
jdk/make/sun/xawt/Makefile
jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c
--- a/jdk/make/sun/xawt/Makefile	Wed Jan 12 15:58:15 2011 -0800
+++ b/jdk/make/sun/xawt/Makefile	Thu Jan 13 10:36:51 2011 -0800
@@ -136,8 +136,25 @@
               -I$(OPENWIN_HOME)/include 
 endif
 
+# We have some odd logic here because some Solaris 10 updates
+# have a render.h file that suggests gradients are supported, but
+# the Xrender.h doesn't have the corresponding type definitions.
+# Earlier updates have neither. We'd like to know if there's a mismatch.
+# Whilst in the C preprocessor we can tell if the render.h define's are set
+# we can't tell anything about C declarations.
+# A grep of Xrender.h is the only way to know this. If they are absent
+# we will set a flag indicating this mismatch and the JDK source file
+# will interpret it to resolve the problem.
 ifeq ($(PLATFORM), solaris)
   CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions
+  OS_VERSION := $(shell uname -r)
+  XRENDER_H := $(OPENWIN_HOME)/share/include/X11/extensions/Xrender.h
+  ifeq ($(OS_VERSION),5.10) 
+     LINEARGRADIENT_CNT := $(shell $(EGREP) -c XLinearGradient $(XRENDER_H))
+     ifeq ($(LINEARGRADIENT_CNT),0) 
+       CFLAGS+= -DSOLARIS10_NO_XRENDER_STRUCTS
+     endif
+ endif
 endif
 
 ifeq ($(MILESTONE), internal)
--- a/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c	Wed Jan 12 15:58:15 2011 -0800
+++ b/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c	Thu Jan 13 10:36:51 2011 -0800
@@ -31,6 +31,21 @@
 
 #include <X11/extensions/Xrender.h>
 
+/* On Solaris 10 updates 8, 9, the render.h file defines these
+ * protocol values but does not define the structs in Xrender.h.
+ * Thus in order to get these always defined on Solaris 10
+ * we will undefine the symbols if we have determined via the
+ * makefiles that Xrender.h is lacking the structs. This will
+ * trigger providing our own definitions as on earlier updates.
+ * We could assume that *all* Solaris 10 update versions will lack the updated
+ * Xrender.h and do this based solely on O/S being any 5.10 version, but this
+ * could still change and we'd be broken again as we'd be re-defining them.
+ */
+#ifdef SOLARIS10_NO_XRENDER_STRUCTS
+#undef X_RenderCreateLinearGradient
+#undef X_RenderCreateRadialGradient
+#endif
+
 #ifndef X_RenderCreateLinearGradient
 typedef struct _XLinearGradient {
     XPointFixed p1;