# HG changeset patch # User prr # Date 1294943811 28800 # Node ID afae9398b405786de95e889ce9d7a825c234418f # Parent f4ec6ef455c375751a11bce0db1214637f5486dd 7001056: JDK 7 fails on to build on Solaris 10 update 9 - updated Xrender header files Reviewed-by: igor, jgodinez diff -r f4ec6ef455c3 -r afae9398b405 jdk/make/sun/xawt/Makefile --- 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) diff -r f4ec6ef455c3 -r afae9398b405 jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c --- 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 +/* 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;