JDK-6565114 : Allow using system copies of libjpeg, libpng and giflib for splashscreen
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Future Project
  • OS: linux
  • CPU: generic
  • Submitted: 2007-06-04
  • Updated: 2011-08-18
  • Resolved: 2009-10-20
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8-poolResolved
Related Reports
Relates :  
Description
Contributor notes (http://mail.openjdk.java.net/pipermail/awt-dev/2007-May/000000.html):

***********************************
Trying to make OpenJDK more friendly for those distributions (like Gentoo and Debian iirc) having in their policy the use, whenever possible, of the system's libraries rather than internal copies of them, I've prepared three patches to AWT's libsplashscreen that allows to use the external/system copy of the three libraries in the subject.

The default behaviour is unchanged, you need to pass EXTERNAL_JPEG
EXTERNAL_LIBPNG and EXTERNAL_GIFLIB with the value "true" to get them
used.
***********************************

See the patches in the Evaluation field.

Comments
EVALUATION The submitter of the patch is currently unavailable. The fix is deferred for the time being.
20-10-2009

EVALUATION Index: openjdk/j2se/make/sun/splashscreen/FILES_c.gmk =================================================================== --- openjdk.orig/j2se/make/sun/splashscreen/FILES_c.gmk +++ openjdk/j2se/make/sun/splashscreen/FILES_c.gmk @@ -48,10 +48,13 @@ FILES_c = \ $(CTARGDIR)pngwio.c \ $(CTARGDIR)pngwrite.c \ $(CTARGDIR)pngwtran.c \ - $(CTARGDIR)pngwutil.c \ - $(CTARGDIR)dgif_lib.c \ + $(CTARGDIR)pngwutil.c + +ifneq ($(EXTERNAL_GIFLIB), true) +FILES_c += $(CTARGDIR)dgif_lib.c \ $(CTARGDIR)gif_err.c \ $(CTARGDIR)gifalloc.c +endif ifneq ($(EXTERNAL_JPEG), true) FILES_c += $(CTARGDIR)jcomapi.c \ Index: openjdk/j2se/make/sun/splashscreen/Makefile =================================================================== --- openjdk.orig/j2se/make/sun/splashscreen/Makefile +++ openjdk/j2se/make/sun/splashscreen/Makefile @@ -89,6 +89,12 @@ CPPFLAGS += -I$(PLATFORM_SRC)/native/$(P # JAVAHFLAGS += -jni +ifeq ($(EXTERNAL_GIFLIB), true) + OTHER_LDLIBS += -lgif +else + CPPFLAGS += -I$(SHARE_SRC)/native/sun/awt/giflib +endif + ifeq ($(EXTERNAL_JPEG), true) OTHER_LDLIBS += -ljpeg else Index: openjdk/j2se/src/share/native/sun/awt/splashscreen/splashscreen_gif.c =================================================================== --- openjdk.orig/j2se/src/share/native/sun/awt/splashscreen/splashscreen_gif.c +++ openjdk/j2se/src/share/native/sun/awt/splashscreen/splashscreen_gif.c @@ -26,7 +26,7 @@ #include "splashscreen_impl.h" #include "splashscreen_gfx.h" -#include "../giflib/gif_lib.h" +#include "gif_lib.h" #define GIF_TRANSPARENT 0x01 #define GIF_USER_INPUT 0x02 Index: openjdk-b13/j2se/make/sun/splashscreen/FILES_c.gmk =================================================================== --- openjdk-b13.orig/j2se/make/sun/splashscreen/FILES_c.gmk +++ openjdk-b13/j2se/make/sun/splashscreen/FILES_c.gmk @@ -51,8 +51,10 @@ FILES_c = \ $(CTARGDIR)pngwutil.c \ $(CTARGDIR)dgif_lib.c \ $(CTARGDIR)gif_err.c \ - $(CTARGDIR)gifalloc.c \ - $(CTARGDIR)jcomapi.c \ + $(CTARGDIR)gifalloc.c + +ifneq ($(EXTERNAL_JPEG), true) +FILES_c += $(CTARGDIR)jcomapi.c \ $(CTARGDIR)jdapimin.c \ $(CTARGDIR)jdapistd.c \ $(CTARGDIR)jdcoefct.c \ @@ -96,6 +98,7 @@ FILES_c = \ $(CTARGDIR)jfdctflt.c \ $(CTARGDIR)jfdctfst.c \ $(CTARGDIR)jfdctint.c +endif ifneq ($(EXTERNAL_ZLIB),true) FILES_c += $(CTARGDIR)compress.c \ Index: openjdk-b13/j2se/make/sun/splashscreen/Makefile =================================================================== --- openjdk-b13.orig/j2se/make/sun/splashscreen/Makefile +++ openjdk-b13/j2se/make/sun/splashscreen/Makefile @@ -83,13 +83,18 @@ vpath %.c $(SHARE_SRC)/native/$(PKGDIR vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)/splashscreen CPPFLAGS += -I$(PLATFORM_SRC)/native/$(PKGDIR)/splashscreen -I$(SHARE_SRC)/native/$(PKGDIR)/splashscreen -CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR)/image/jpeg # # Has been converted to the JNI: generate JNI-style header files # JAVAHFLAGS += -jni +ifeq ($(EXTERNAL_JPEG), true) + OTHER_LDLIBS += -ljpeg +else + CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR)/image/jpeg +endif + ifeq ($(EXTERNAL_ZLIB), true) OTHER_LDLIBS += -lz else Index: openjdk-b13/j2se/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c =================================================================== --- openjdk-b13.orig/j2se/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c +++ openjdk-b13/j2se/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c @@ -25,7 +25,6 @@ #include "splashscreen_impl.h" -#include "jinclude.h" #include "jpeglib.h" #include "jerror.h" @@ -107,11 +106,11 @@ set_stream_src(j_decompress_ptr cinfo, S if (cinfo->src == NULL) { /* first time for this JPEG object? */ cinfo->src = (struct jpeg_source_mgr *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, - JPOOL_PERMANENT, SIZEOF(stream_source_mgr)); + JPOOL_PERMANENT, sizeof(stream_source_mgr)); src = (stream_src_ptr) cinfo->src; src->buffer = (JOCTET *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, - JPOOL_PERMANENT, INPUT_BUF_SIZE * SIZEOF(JOCTET)); + JPOOL_PERMANENT, INPUT_BUF_SIZE * sizeof(JOCTET)); } src = (stream_src_ptr) cinfo->src; Index: openjdk/j2se/make/sun/splashscreen/FILES_c.gmk =================================================================== --- openjdk.orig/j2se/make/sun/splashscreen/FILES_c.gmk +++ openjdk/j2se/make/sun/splashscreen/FILES_c.gmk @@ -33,8 +33,10 @@ FILES_c = \ $(CTARGDIR)splashscreen_impl.c \ $(CTARGDIR)splashscreen_jpeg.c \ $(CTARGDIR)splashscreen_png.c \ - $(CTARGDIR)splashscreen_sys.c \ - $(CTARGDIR)png.c \ + $(CTARGDIR)splashscreen_sys.c + +ifneq ($(EXTERNAL_LIBPNG), true) +FILES_c += $(CTARGDIR)png.c \ $(CTARGDIR)pngerror.c \ $(CTARGDIR)pngget.c \ $(CTARGDIR)pngmem.c \ @@ -49,6 +51,7 @@ FILES_c = \ $(CTARGDIR)pngwrite.c \ $(CTARGDIR)pngwtran.c \ $(CTARGDIR)pngwutil.c +endif ifneq ($(EXTERNAL_GIFLIB), true) FILES_c += $(CTARGDIR)dgif_lib.c \ Index: openjdk/j2se/make/sun/splashscreen/Makefile =================================================================== --- openjdk.orig/j2se/make/sun/splashscreen/Makefile +++ openjdk/j2se/make/sun/splashscreen/Makefile @@ -89,6 +89,12 @@ CPPFLAGS += -I$(PLATFORM_SRC)/native/$(P # JAVAHFLAGS += -jni +ifeq ($(EXTERNAL_LIBPNG), true) + OTHER_LDLIBS += -lpng +else + CPPFLAGS += -I$(SHARE_SRC)/native/sun/awt/libpng +endif + ifeq ($(EXTERNAL_GIFLIB), true) OTHER_LDLIBS += -lgif endif Index: openjdk/j2se/src/share/native/sun/awt/splashscreen/splashscreen_png.c =================================================================== --- openjdk.orig/j2se/src/share/native/sun/awt/splashscreen/splashscreen_png.c +++ openjdk/j2se/src/share/native/sun/awt/splashscreen/splashscreen_png.c @@ -25,7 +25,7 @@ #include "splashscreen_impl.h" -#include "../libpng/png.h" +#include "png.h" #include <setjmp.h>
04-06-2007