changeset 2472:0af3b9f0e92e

Integrate updated system library provisioning for zlib, libpng, libjpeg and giflib. PR770: Zero 7033954 regression: missing mapfile 2011-09-06 Andrew John Hughes <ahughes@redhat.com> * patches/hotspot-gcc-pr36917.patch: Redundant, was removed from IcedTea6. * patches/libraries.patch, * patches/linker-libs-order.patch, * patches/pr261.patch: Updated and recreated in the IcedTea7 forest. * Makefile.am: (JDK_CHANGESET): Updated. (JDK_SHA256SUM): Likewise. (ICEDTEA_PATCHES): Remove above. (ICEDTEA_ENV): Set ZLIB_LIBS, ZLIB_CFLAGS, USE_SYSTEM_ZLIB, JPEG_LIBS, JPEG_CFLAGS, USE_SYSTEM_JPEG, PNG_LIBS, PNG_CFLAGS, USE_SYSTEM_PNG, GIF_LIBS, GIF_CFLAGS, USE_SYSTEM_GIF. * NEWS: Mention new system library provision and cleanup ordering. Mention fix for PR770. * acinclude.m4: (IT_CHECK_FOR_ZLIB): New macro to check for zlib. (IT_CHECK_FOR_JPEG): Likewise for libjpeg. (IT_CHECK_FOR_PNG): Likewise for libpng. (IT_CHECK_FOR_GIF): Likewise for giflib. * configure.ac: Remove old AC_CHECK_LIB calls for jpeg, gif and zlib and PKG_CHECK_MODULES call for libpng. Add calls to new macros above. * remove-intree-libraries.sh.in: Make removal of zlib, libpng, giflib and libjpeg files dependent on whether or not the system versions are used (the default).
author Andrew John Hughes <ahughes@redhat.com>
date Tue, 06 Sep 2011 16:06:22 +0100
parents 8e4f97b246e8
children 9f7e31696ac5
files ChangeLog Makefile.am NEWS acinclude.m4 configure.ac patches/hotspot-gcc-pr36917.patch patches/libraries.patch patches/linker-libs-order.patch patches/pr261.patch remove-intree-libraries.sh.in
diffstat 10 files changed, 195 insertions(+), 1460 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Sep 05 12:59:28 2011 +0200
+++ b/ChangeLog	Tue Sep 06 16:06:22 2011 +0100
@@ -1,3 +1,36 @@
+2011-09-06  Andrew John Hughes  <ahughes@redhat.com>
+
+	* patches/hotspot-gcc-pr36917.patch:
+	Redundant, was removed from IcedTea6.
+	* patches/libraries.patch,
+	* patches/linker-libs-order.patch,
+	* patches/pr261.patch:
+	Updated and recreated in the IcedTea7 forest.
+	* Makefile.am:
+	(JDK_CHANGESET): Updated.
+	(JDK_SHA256SUM): Likewise.
+	(ICEDTEA_PATCHES): Remove above.
+	(ICEDTEA_ENV): Set ZLIB_LIBS, ZLIB_CFLAGS,
+	USE_SYSTEM_ZLIB, JPEG_LIBS, JPEG_CFLAGS,
+	USE_SYSTEM_JPEG, PNG_LIBS, PNG_CFLAGS,
+	USE_SYSTEM_PNG, GIF_LIBS, GIF_CFLAGS,
+	USE_SYSTEM_GIF.
+	* NEWS: Mention new system library provision
+	and cleanup ordering.  Mention fix for PR770.
+	* acinclude.m4:
+	(IT_CHECK_FOR_ZLIB): New macro to check for zlib.
+	(IT_CHECK_FOR_JPEG): Likewise for libjpeg.
+	(IT_CHECK_FOR_PNG): Likewise for libpng.
+	(IT_CHECK_FOR_GIF): Likewise for giflib.
+	* configure.ac:
+	Remove old AC_CHECK_LIB calls for jpeg, gif
+	and zlib and PKG_CHECK_MODULES call for libpng.
+	Add calls to new macros above.
+	* remove-intree-libraries.sh.in:
+	Make removal of zlib, libpng, giflib and libjpeg
+	files dependent on whether or not the system versions
+	are used (the default).
+
 2011-09-05  Xerxes RĂ„nby  <xerxes@zafena.se>
 
 	JamVM
--- a/Makefile.am	Mon Sep 05 12:59:28 2011 +0200
+++ b/Makefile.am	Tue Sep 06 16:06:22 2011 +0100
@@ -6,7 +6,7 @@
 HOTSPOT_CHANGESET = 1dd9b3d73b22
 JAXP_CHANGESET = c40983d6ae70
 JAXWS_CHANGESET = 83db5e316798
-JDK_CHANGESET = e46d527097f1
+JDK_CHANGESET = db7a2639858b
 LANGTOOLS_CHANGESET = fb7fb3071b64
 OPENJDK_CHANGESET = 3defd24c2671
 
@@ -14,7 +14,7 @@
 HOTSPOT_SHA256SUM = ffb1831a63e950bb7ade46a5382cb71d2603e0f40b3f758eb346833e18fca150
 JAXP_SHA256SUM = 6ab0cab1965edb28e4093b55436abd04fbffe0b0251016043c75246c4ee9dc2d
 JAXWS_SHA256SUM = 5567c90ce2857016365b2e346783a3b16ec0e76b80586a0371f601b4fed01f21
-JDK_SHA256SUM = 0cd074fb2400c95d013373847b5c52bb13997acbb6530507e384856583e1abd4
+JDK_SHA256SUM = 81b510c80f3af0a1cd19704c616a68ff131362b517996ae65cb91c9a5849fcdc
 LANGTOOLS_SHA256SUM = 9ddc00ec50fd2f5e331dc2bc10da4e23b69bf644eb92d50b39a2003c18fb5aa1
 OPENJDK_SHA256SUM = 4043a75c2c4385dd735f8dbbf2369311ce1b951217c9dbe9bba9609e24eb291e
 
@@ -246,13 +246,11 @@
 # Patch list
 
 ICEDTEA_PATCHES = \
-	patches/libraries.patch \
 	patches/debian/uname.patch \
 	patches/sparc-ptracefix.patch \
 	patches/sparc-trapsfix.patch \
 	patches/override-redirect-metacity.patch \
 	patches/security-updates.patch \
-	patches/hotspot-gcc-pr36917.patch \
 	patches/alpha-fixes.patch \
 	patches/alt-jar.patch \
 	patches/use-idx_t.patch \
@@ -262,9 +260,7 @@
 	patches/signed-types.patch \
 	patches/lc_ctype.patch \
 	patches/tests-jdk.patch \
-	patches/linker-libs-order.patch \
 	patches/samejvm-safe.patch \
-	patches/pr261.patch \
 	patches/parisc-opt.patch \
         patches/security/6592792.patch \
         patches/security/6733959.patch \
@@ -515,6 +511,13 @@
 	RHINO_JAR="$(abs_top_builddir)/rhino/rhino.jar"
 endif
 
+if USE_SYSTEM_ZLIB
+ICEDTEA_ENV += \
+	USE_SYSTEM_ZLIB="true" \
+	ZLIB_LIBS="${ZLIB_LIBS}" \
+	ZLIB_CFLAGS="${ZLIB_CFLAGS}"
+endif
+
 if USE_SYSTEM_LCMS
 ICEDTEA_ENV += \
 	USE_SYSTEM_LCMS="true" \
@@ -522,6 +525,27 @@
 	LCMS_CFLAGS="${LCMS2_CFLAGS}"
 endif
 
+if USE_SYSTEM_JPEG
+ICEDTEA_ENV += \
+	USE_SYSTEM_JPEG="true" \
+	JPEG_LIBS="${JPEG_LIBS}" \
+	JPEG_CFLAGS="${JPEG_CFLAGS}"
+endif
+
+if USE_SYSTEM_PNG
+ICEDTEA_ENV += \
+	USE_SYSTEM_PNG="true" \
+	PNG_LIBS="${PNG_LIBS}" \
+	PNG_CFLAGS="${PNG_CFLAGS}"
+endif
+
+if USE_SYSTEM_GIF
+ICEDTEA_ENV += \
+	USE_SYSTEM_GIF="true" \
+	GIF_LIBS="${GIF_LIBS}" \
+	GIF_CFLAGS="${GIF_CFLAGS}"
+endif
+
 # OpenJDK boot build environment.
 ICEDTEA_ENV_BOOT = $(ICEDTEA_ENV) \
 	BOOTCLASSPATH_CLS_RT="-bootclasspath $(CLS_DIR_BOOT):$(RUNTIME)" \
--- a/NEWS	Mon Sep 05 12:59:28 2011 +0200
+++ b/NEWS	Tue Sep 06 16:06:22 2011 +0100
@@ -13,10 +13,11 @@
 New in release 2.0 (2011-XX-XX):
 
 * Bug fixes
-  - PR767: Annotation Processing Filer.getResource() always throws FileNotFoundException
   - Allow the compiler used to be overridden by setting BUILD_GCC/BUILD_CPP.
   - Fixed regression test runtime/7020373.
+  - Convert to optional system library usage via USE_SYSTEM_ZLIB/JPEG/PNG/GIF.
   - PR586: Add missing sources to src.zip.
+  - PR767: Annotation Processing Filer.getResource() always throws FileNotFoundException
   - G356743: Support building against libpng 1.5.
   - S7070134: Hotspot crashes with sigsegv from PorterStemmer
   - S7044738: Loop unroll optimization causes incorrect result
@@ -25,6 +26,7 @@
 * Zero/Shark
   - PR757, 7066143: 7009309 regression: x86 stubRoutines
   - PR753, 7066143: 7009923 regression
+  - PR770: Zero 7033954 regression: missing mapfile
   - methodHandles_zero missing.
   - sharkContext typo in assert
   - sharedRuntime needs rework after indy reorg
--- a/acinclude.m4	Mon Sep 05 12:59:28 2011 +0200
+++ b/acinclude.m4	Tue Sep 06 16:06:22 2011 +0100
@@ -1956,6 +1956,108 @@
   AC_SUBST(ENABLE_SYSTEM_LCMS)
 ])
 
+AC_DEFUN_ONCE([IT_CHECK_FOR_ZLIB],
+[
+  AC_MSG_CHECKING([whether to use the system zlib install])
+  AC_ARG_ENABLE([system-zlib],
+	      [AS_HELP_STRING(--enable-system-zlib,use the system ZLIB [[default=yes]])],
+  [
+    ENABLE_SYSTEM_ZLIB="${enableval}"
+  ],
+  [
+    ENABLE_SYSTEM_ZLIB="yes"
+  ])
+  AC_MSG_RESULT(${ENABLE_SYSTEM_ZLIB})
+  if test x"${ENABLE_SYSTEM_ZLIB}" = "xyes"; then
+    dnl Check for ZLIB headers and libraries.
+    PKG_CHECK_MODULES(ZLIB, zlib,[ZLIB_FOUND=yes],[ZLIB_FOUND=no])
+    if test "x${ZLIB_FOUND}" = xno
+    then
+      AC_MSG_ERROR([Could not find ZLIB; install ZLIB or build with --disable-system-zlib to use the in-tree copy.])
+    fi
+    AC_SUBST(ZLIB_CFLAGS)
+    AC_SUBST(ZLIB_LIBS)
+  fi
+  AM_CONDITIONAL(USE_SYSTEM_ZLIB, test x"${ENABLE_SYSTEM_ZLIB}" = "xyes")
+  AC_SUBST(ENABLE_SYSTEM_ZLIB)
+])
+
+AC_DEFUN_ONCE([IT_CHECK_FOR_JPEG],
+[
+  AC_MSG_CHECKING([whether to use the system jpeg install])
+  AC_ARG_ENABLE([system-jpeg],
+	      [AS_HELP_STRING(--enable-system-jpeg,use the system libjpeg [[default=yes]])],
+  [
+    ENABLE_SYSTEM_JPEG="${enableval}"
+  ],
+  [
+    ENABLE_SYSTEM_JPEG="yes"
+  ])
+  AC_MSG_RESULT(${ENABLE_SYSTEM_JPEG})
+  if test x"${ENABLE_SYSTEM_JPEG}" = "xyes"; then
+    dnl Check for JPEG headers and libraries.
+    AC_CHECK_LIB([jpeg], [main],
+        , [AC_MSG_ERROR("Could not find JPEG library; install JPEG or build with --disable-system-jpeg to use the in-tree copy.")])
+    AC_CHECK_HEADER([jpeglib.h],
+        , [AC_MSG_ERROR("Could not find JPEG header; install JPEG or build with --disable-system-jpeg to use the in-tree copy.")])
+    JPEG_LIBS="-ljpeg"
+    AC_SUBST(JPEG_LIBS)
+  fi
+  AM_CONDITIONAL(USE_SYSTEM_JPEG, test x"${ENABLE_SYSTEM_JPEG}" = "xyes")
+  AC_SUBST(ENABLE_SYSTEM_JPEG)
+])
+
+AC_DEFUN_ONCE([IT_CHECK_FOR_PNG],
+[
+  AC_MSG_CHECKING([whether to use the system libpng install])
+  AC_ARG_ENABLE([system-png],
+	      [AS_HELP_STRING(--enable-system-png,use the system PNG [[default=yes]])],
+  [
+    ENABLE_SYSTEM_PNG="${enableval}"
+  ],
+  [
+    ENABLE_SYSTEM_PNG="yes"
+  ])
+  AC_MSG_RESULT(${ENABLE_SYSTEM_PNG})
+  if test x"${ENABLE_SYSTEM_PNG}" = "xyes"; then
+    dnl Check for PNG headers and libraries.
+    PKG_CHECK_MODULES(PNG, libpng,[LIBPNG_FOUND=yes],[LIBPNG_FOUND=no])
+    if test "x${LIBPNG_FOUND}" = xno
+    then
+      AC_MSG_ERROR([Could not find libpng; install libpng or build with --disable-system-png to use the in-tree copy.])
+    fi
+    AC_SUBST(PNG_CFLAGS)
+    AC_SUBST(PNG_LIBS)
+  fi
+  AM_CONDITIONAL(USE_SYSTEM_PNG, test x"${ENABLE_SYSTEM_PNG}" = "xyes")
+  AC_SUBST(ENABLE_SYSTEM_PNG)
+])
+
+AC_DEFUN_ONCE([IT_CHECK_FOR_GIF],
+[
+  AC_MSG_CHECKING([whether to use the system giflib install])
+  AC_ARG_ENABLE([system-gif],
+	      [AS_HELP_STRING(--enable-system-gif,use the system giflib [[default=yes]])],
+  [
+    ENABLE_SYSTEM_GIF="${enableval}"
+  ],
+  [
+    ENABLE_SYSTEM_GIF="yes"
+  ])
+  AC_MSG_RESULT(${ENABLE_SYSTEM_GIF})
+  if test x"${ENABLE_SYSTEM_GIF}" = "xyes"; then
+    dnl Check for GIF headers and libraries.
+    AC_CHECK_LIB([gif], [main],
+        , [AC_MSG_ERROR("Could not find GIF library; install GIF or build with --disable-system-gif to use the in-tree copy.")])
+    AC_CHECK_HEADER([gif_lib.h],
+        , [AC_MSG_ERROR("Could not find GIF header; install GIF or build with --disable-system-gif to use the in-tree copy.")])
+    GIF_LIBS="-lgif"
+    AC_SUBST(GIF_LIBS)
+  fi
+  AM_CONDITIONAL(USE_SYSTEM_GIF, test x"${ENABLE_SYSTEM_GIF}" = "xyes")
+  AC_SUBST(ENABLE_SYSTEM_GIF)
+])
+
 AC_DEFUN([IT_ENABLE_JAMVM],
 [
   AC_MSG_CHECKING(whether to use JamVM as VM)
--- a/configure.ac	Mon Sep 05 12:59:28 2011 +0200
+++ b/configure.ac	Tue Sep 06 16:06:22 2011 +0100
@@ -167,12 +167,13 @@
 AC_CHECK_HEADERS([X11/X.h],[]
 	,[AC_MSG_ERROR("xorg headers were not found -
 	try installing xorg-x11-proto-devel.")])
-AC_CHECK_LIB(jpeg, main,
-        , [AC_MSG_ERROR("libjpeg not found - try installing libjpeg-devel")])
-AC_CHECK_LIB(gif, main,
-        , [AC_MSG_ERROR("giflib not found - try installing giflib-devel")])
-AC_CHECK_LIB(z, main,
-	, [AC_MSG_ERROR("zlib not found - try installing zlib-devel")])
+
+IT_CHECK_FOR_ZLIB
+IT_CHECK_FOR_JPEG
+IT_CHECK_FOR_PNG
+IT_CHECK_FOR_GIF
+IT_CHECK_FOR_LCMS
+AC_CONFIG_FILES([remove-intree-libraries.sh])
 
 dnl Check for Xproto headers and libraries.
 PKG_CHECK_MODULES(XPROTO, xproto,[XPROTO_FOUND=yes],[XPROTO_FOUND=no])
@@ -296,17 +297,6 @@
   AC_CONFIG_FILES([tapset/jstack.stp])
 fi
 
-dnl Check for libpng headers and libraries.
-PKG_CHECK_MODULES(LIBPNG, libpng,[LIBPNG_FOUND=yes]
-	,[LIBPNG_FOUND=no])
-if test "x${LIBPNG_FOUND}" = xno
-then
-  AC_MSG_ERROR([Could not find libpng - \
-  Try installing libpng-devel.])
-fi
-AC_SUBST(LIBPNG_CFLAGS)
-AC_SUBST(LIBPNG_LIBS)
-
 dnl Check for libXtst headers and libraries.
 PKG_CHECK_MODULES(XTST, xtst,[XTST_FOUND=yes],[XTST_FOUND=no])
 if test "x${XTST_FOUND}" = xno
@@ -440,9 +430,6 @@
 AC_SUBST(LLVM_LDFLAGS)
 AC_SUBST(LLVM_LIBS)
 
-IT_CHECK_FOR_LCMS
-AC_CONFIG_FILES([remove-intree-libraries.sh])
-
 # Arguments passed to configure.
 AC_SUBST(CONFIGURE_ARGS)
 CONFIGURE_ARGS="$ac_configure_args"
--- a/patches/hotspot-gcc-pr36917.patch	Mon Sep 05 12:59:28 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
---- openjdk/hotspot/make/linux/makefiles/i486.make~	2008-07-10 22:04:18.000000000 +0200
-+++ openjdk/hotspot/make/linux/makefiles/i486.make	2008-07-24 12:23:11.344839305 +0200
-@@ -34,3 +34,6 @@
- CFLAGS += -DVM_LITTLE_ENDIAN
- 
- OPT_CFLAGS/compactingPermGenGen.o = -O1
-+
-+# GCC PR tree-optimization/36917
-+OPT_CFLAGS/ciTypeFlow.o += $(OPT_CFLAGS) -fno-ivopts
--- a/patches/libraries.patch	Mon Sep 05 12:59:28 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1277 +0,0 @@
-diff -Nru openjdk.orig/jdk/make/com/sun/java/pack/Makefile openjdk/jdk/make/com/sun/java/pack/Makefile
---- openjdk.orig/jdk/make/com/sun/java/pack/Makefile	2011-06-11 00:38:06.000000000 +0100
-+++ openjdk/jdk/make/com/sun/java/pack/Makefile	2011-06-13 15:12:16.465040427 +0100
-@@ -70,12 +70,10 @@
- 	     $(ZIPOBJDIR)/inftrees.$(OBJECT_SUFFIX) \
- 	     $(ZIPOBJDIR)/inffast.$(OBJECT_SUFFIX)
- 
--  ZINCLUDE=-I$(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
--  OTHER_CXXFLAGS += $(ZINCLUDE)
--  LDDFLAGS += $(ZIPOBJS)
-+  OTHER_LDLIBS += -lz
- else
-   OTHER_CXXFLAGS += -DNO_ZLIB -DUNPACK_JNI
--  OTHER_LDLIBS += $(JVMLIB)
-+  OTHER_LDLIBS += -lz $(JVMLIB)
- endif
- 
- CXXFLAGS_DBG += -DFULL
-@@ -94,12 +92,12 @@
-   RES = $(OBJDIR)/$(PGRM).res
- else
-   LDOUTPUT = -o #Have a space 
--  LDDFLAGS += -lc
-+  LDDFLAGS += -lz -lc
-   OTHER_LDLIBS  += $(LIBCXX)
- # setup the list of libraries to link in...
- ifeq ($(PLATFORM), linux)
- ifeq ("$(CC_VER_MAJOR)", "3")
--  OTHER_LDLIBS  += -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
-+  OTHER_LDLIBS  += -lz -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
- endif
- endif #LINUX
- endif #PLATFORM
-diff -Nru openjdk.orig/jdk/make/common/Program.gmk openjdk/jdk/make/common/Program.gmk
---- openjdk.orig/jdk/make/common/Program.gmk	2011-06-11 00:38:06.000000000 +0100
-+++ openjdk/jdk/make/common/Program.gmk	2011-06-13 15:12:16.465040427 +0100
-@@ -91,6 +91,7 @@
- 	endif
-     endif
-     ifeq ($(PLATFORM), linux)
-+        LDFLAGS += -lz
- 	LDFLAGS += $(LDFLAG_Z_ORIGIN)
- 	LDFLAGS += -Wl,--allow-shlib-undefined
- 	LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../lib/$(LIBARCH)/jli
-@@ -247,7 +248,6 @@
- endif
- 
- OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)/bin -I$(LAUNCHER_PLATFORM_SRC)/bin
--OTHER_INCLUDES += -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3
- 
- OTHER_CPPFLAGS += -DPROGNAME='"$(PROGRAM)"'
- VERSION_DEFINES += -DFULL_VERSION='"$(FULL_VERSION)"'
-diff -Nru openjdk.orig/jdk/make/java/jli/Makefile openjdk/jdk/make/java/jli/Makefile
---- openjdk.orig/jdk/make/java/jli/Makefile	2011-06-11 00:38:06.000000000 +0100
-+++ openjdk/jdk/make/java/jli/Makefile	2011-06-13 15:12:16.465040427 +0100
-@@ -44,7 +44,6 @@
- 
- include $(BUILDDIR)/common/Defs.gmk
- 
--ZIP_SRC = $(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
- LAUNCHER_SHARE_SRC = $(SHARE_SRC)/bin
- LAUNCHER_PLATFORM_SRC = $(PLATFORM_SRC)/bin
- 
-@@ -69,13 +68,7 @@
- 	parse_manifest.c \
- 	version_comp.c \
- 	wildcard.c \
--	jli_util.c \
--	inflate.c \
--	inftrees.c \
--	inffast.c \
--	zadler32.c \
--	zcrc32.c \
--	zutil.c
-+	jli_util.c
- 
- ifneq ($(PLATFORM), windows)
-   FILES_c += ergo.c 
-@@ -105,7 +98,7 @@
- 	# Note: its important to keep this order meaning -lc is the
- 	# last library otherwise it could cause compatibility issues
- 	# by pulling in SUNW_private symbols from libc
--	LDLIBS = -ldl -lc
-+	LDLIBS = -ldl -lz -lc
- ifeq ($(USE_PTHREADS),true)
- 	LDLIBS += -lpthread
- endif # USE_PTHREADS 
-@@ -129,7 +122,6 @@
- 
- OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)
- OTHER_INCLUDES += -I$(LAUNCHER_PLATFORM_SRC)
--OTHER_INCLUDES += -I$(ZIP_SRC)
- 
- #
- # Library to compile.
-@@ -164,4 +156,4 @@
- #
- # Add to ambient vpath so we pick up the library files
- #
--vpath %.c $(LAUNCHER_SHARE_SRC) $(ZIP_SRC) $(LAUNCHER_PLATFORM_SRC)
-+vpath %.c $(LAUNCHER_SHARE_SRC) $(LAUNCHER_PLATFORM_SRC)
-diff -Nru openjdk.orig/jdk/make/java/zip/FILES_c.gmk openjdk/jdk/make/java/zip/FILES_c.gmk
---- openjdk.orig/jdk/make/java/zip/FILES_c.gmk	2010-07-29 21:55:27.000000000 +0100
-+++ openjdk/jdk/make/java/zip/FILES_c.gmk	2011-06-13 15:12:16.477040613 +0100
-@@ -29,16 +29,4 @@
- 	Deflater.c \
- 	Inflater.c \
- 	ZipFile.c \
--	zip_util.c \
--	compress.c \
--	deflate.c \
--	gzio.c \
--	infback.c \
--	inffast.c \
--	inflate.c \
--	inftrees.c \
--	trees.c \
--	uncompr.c \
--	zadler32.c \
--	zcrc32.c \
--	zutil.c 
-+	zip_util.c
-diff -Nru openjdk.orig/jdk/make/java/zip/Makefile openjdk/jdk/make/java/zip/Makefile
---- openjdk.orig/jdk/make/java/zip/Makefile	2011-06-11 00:38:06.000000000 +0100
-+++ openjdk/jdk/make/java/zip/Makefile	2011-06-13 15:12:16.477040613 +0100
-@@ -74,16 +74,10 @@
- CPPFLAGS += -UDEBUG 
- endif
- 
--CPPFLAGS += -I$(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
- CPPFLAGS += -I$(SHARE_SRC)/native/java/io
- CPPFLAGS += -I$(PLATFORM_SRC)/native/java/io
- 
- #
--# Add to ambient vpath so we pick up the library files
--#
--vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/zlib-$(ZLIB_VERSION)
--
--#
- # Link to JVM library for JVM_Zip* functions
- #
--OTHER_LDLIBS = $(JVMLIB)
-+OTHER_LDLIBS = $(JVMLIB) -lz
-diff -Nru openjdk.orig/jdk/make/sun/jpeg/FILES_c.gmk openjdk/jdk/make/sun/jpeg/FILES_c.gmk
---- openjdk.orig/jdk/make/sun/jpeg/FILES_c.gmk	2010-07-29 21:55:29.000000000 +0100
-+++ openjdk/jdk/make/sun/jpeg/FILES_c.gmk	2011-06-13 15:12:16.477040613 +0100
-@@ -25,51 +25,7 @@
- 
- FILES_c = \
- 	imageioJPEG.c \
--	jpegdecoder.c \
--	jcomapi.c \
--	jdapimin.c \
--	jdapistd.c \
--	jdcoefct.c \
--	jdcolor.c \
--	jddctmgr.c \
--	jdhuff.c \
--	jdinput.c \
--	jdmainct.c \
--	jdmarker.c \
--	jdmaster.c \
--	jdmerge.c \
--	jdphuff.c \
--	jdpostct.c \
--	jdsample.c \
--	jerror.c \
--	jidctflt.c \
--	jidctfst.c \
--	jidctint.c \
--	jidctred.c \
--	jmemmgr.c \
--	jmemnobs.c \
--	jquant1.c \
--	jquant2.c \
--	jutils.c \
--	jcapimin.c \
--	jcapistd.c \
--	jccoefct.c \
--	jccolor.c \
--	jcdctmgr.c \
--	jchuff.c \
--	jcinit.c \
--	jcmainct.c \
--	jcmarker.c \
--	jcmaster.c \
--	jcparam.c \
--	jcphuff.c \
--	jcprepct.c \
--	jcsample.c \
--	jctrans.c \
--	jdtrans.c \
--	jfdctflt.c \
--	jfdctfst.c \
--	jfdctint.c
-+	jpegdecoder.c
- 
- ifndef OPENJDK
- FILES_c += \
-diff -Nru openjdk.orig/jdk/make/sun/jpeg/Makefile openjdk/jdk/make/sun/jpeg/Makefile
---- openjdk.orig/jdk/make/sun/jpeg/Makefile	2011-06-11 00:38:07.000000000 +0100
-+++ openjdk/jdk/make/sun/jpeg/Makefile	2011-06-13 15:12:16.477040613 +0100
-@@ -86,6 +86,8 @@
- include $(BUILDDIR)/common/Mapfile-vers.gmk
- include $(BUILDDIR)/common/Library.gmk
- 
-+LDLIBS += -ldl 
-+
- #
- # Add to ambient vpath to get files in a subdirectory
- #
-diff -Nru openjdk.orig/jdk/make/sun/splashscreen/FILES_c.gmk openjdk/jdk/make/sun/splashscreen/FILES_c.gmk
---- openjdk.orig/jdk/make/sun/splashscreen/FILES_c.gmk	2010-07-29 21:55:29.000000000 +0100
-+++ openjdk/jdk/make/sun/splashscreen/FILES_c.gmk	2011-06-13 15:12:16.477040613 +0100
-@@ -30,79 +30,5 @@
- 	splashscreen_impl.c \
- 	splashscreen_jpeg.c \
- 	splashscreen_png.c \
--	splashscreen_sys.c \
--	png.c \
--	pngerror.c \
--	pngget.c \
--	pngmem.c  \
--	pngpread.c \
--	pngread.c \
--	pngrio.c \
--	pngrtran.c \
--	pngrutil.c \
--	pngset.c \
--	pngtrans.c \
--	pngwio.c \
--	pngwrite.c \
--	pngwtran.c \
--	pngwutil.c \
--	dgif_lib.c \
--	gif_err.c \
--	gifalloc.c \
--	compress.c \
--	deflate.c \
--	gzio.c \
--	infback.c \
--	inffast.c \
--	inflate.c \
--	inftrees.c \
--	trees.c \
--	uncompr.c \
--	zadler32.c \
--	zcrc32.c \
--	zutil.c \
--	jcomapi.c \
--	jdapimin.c \
--	jdapistd.c \
--	jdcoefct.c \
--	jdcolor.c \
--	jddctmgr.c \
--	jdhuff.c \
--	jdinput.c \
--	jdmainct.c \
--	jdmarker.c \
--	jdmaster.c \
--	jdmerge.c \
--	jdphuff.c \
--	jdpostct.c \
--	jdsample.c \
--	jerror.c \
--	jidctflt.c \
--	jidctfst.c \
--	jidctint.c \
--	jidctred.c \
--	jmemmgr.c \
--	jmemnobs.c \
--	jquant1.c \
--	jquant2.c \
--	jutils.c \
--	jcapimin.c \
--	jcapistd.c \
--	jccoefct.c \
--	jccolor.c \
--	jcdctmgr.c \
--	jchuff.c \
--	jcinit.c \
--	jcmainct.c \
--	jcmarker.c \
--	jcmaster.c \
--	jcparam.c \
--	jcphuff.c \
--	jcprepct.c \
--	jcsample.c \
--	jctrans.c \
--	jdtrans.c \
--	jfdctflt.c \
--	jfdctfst.c \
--	jfdctint.c
-+	splashscreen_sys.c
- 
-diff -Nru openjdk.orig/jdk/make/sun/splashscreen/Makefile openjdk/jdk/make/sun/splashscreen/Makefile
---- openjdk.orig/jdk/make/sun/splashscreen/Makefile	2011-06-11 00:38:07.000000000 +0100
-+++ openjdk/jdk/make/sun/splashscreen/Makefile	2011-06-13 15:12:16.477040613 +0100
-@@ -59,12 +59,12 @@
- # C Flags
- #
- 
--CFLAGS += -DSPLASHSCREEN
-+CFLAGS += -DSPLASHSCREEN -DPNG_NO_MMX_CODE
- 
- ifneq ($(PLATFORM), windows)
-   CFLAGS += -DWITH_X11
-   CPPFLAGS += -I$(OPENWIN_HOME)/include -I$(OPENWIN_HOME)/include/X11/extensions
--  OTHER_LDLIBS += -L$(OPENWIN_LIB) -lX11 -lXext $(LIBM) -lpthread
-+  OTHER_LDLIBS += -L$(OPENWIN_LIB) -lX11 -lXext $(LIBM) -lpng -ljpeg -lgif -lz -lpthread
- else # PLATFORM
-   CFLAGS += -DWITH_WIN32
-   OTHER_LDLIBS += kernel32.lib user32.lib gdi32.lib delayimp.lib /DELAYLOAD:user32.dll
-@@ -76,14 +76,10 @@
- #
- vpath %.c   $(SHARE_SRC)/native/$(PKGDIR)/splashscreen
- vpath %.c   $(SHARE_SRC)/native/$(PKGDIR)
--vpath %.c   $(SHARE_SRC)/native/$(PKGDIR)/giflib
--vpath %.c   $(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
--vpath %.c   $(SHARE_SRC)/native/$(PKGDIR)/libpng
- vpath %.c   $(SHARE_SRC)/native/$(PKGDIR)/image/jpeg
- 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 -I$(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
- 
- # Shun the less than portable MMX assembly code in pnggccrd.c,
- # and use alternative implementations in C.
-diff -Nru openjdk.orig/jdk/src/share/native/com/sun/java/util/jar/pack/defines.h openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/defines.h
---- openjdk.orig/jdk/src/share/native/com/sun/java/util/jar/pack/defines.h	2010-07-29 21:56:11.000000000 +0100
-+++ openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/defines.h	2011-06-13 15:12:16.477040613 +0100
-@@ -89,11 +89,7 @@
- // bytes and byte arrays
- 
- typedef unsigned int uint;
--#ifdef _LP64
--typedef unsigned int uLong; // Historical zlib, should be 32-bit.
--#else
- typedef unsigned long uLong;
--#endif
- #ifdef _MSC_VER
- typedef LONGLONG        jlong;
- typedef DWORDLONG       julong;
-diff -Nru openjdk.orig/jdk/src/share/native/java/util/zip/Adler32.c openjdk/jdk/src/share/native/java/util/zip/Adler32.c
---- openjdk.orig/jdk/src/share/native/java/util/zip/Adler32.c	2010-07-29 21:56:11.000000000 +0100
-+++ openjdk/jdk/src/share/native/java/util/zip/Adler32.c	2011-06-13 15:12:16.477040613 +0100
-@@ -29,7 +29,7 @@
- 
- #include "jni.h"
- #include "jni_util.h"
--#include "zlib.h"
-+#include <zlib.h>
- 
- #include "java_util_zip_Adler32.h"
- 
-diff -Nru openjdk.orig/jdk/src/share/native/java/util/zip/CRC32.c openjdk/jdk/src/share/native/java/util/zip/CRC32.c
---- openjdk.orig/jdk/src/share/native/java/util/zip/CRC32.c	2010-07-29 21:56:11.000000000 +0100
-+++ openjdk/jdk/src/share/native/java/util/zip/CRC32.c	2011-06-13 15:12:16.477040613 +0100
-@@ -29,7 +29,7 @@
- 
- #include "jni.h"
- #include "jni_util.h"
--#include "zlib.h"
-+#include <zlib.h>
- 
- #include "java_util_zip_CRC32.h"
- 
-diff -Nru openjdk.orig/jdk/src/share/native/java/util/zip/Deflater.c openjdk/jdk/src/share/native/java/util/zip/Deflater.c
---- openjdk.orig/jdk/src/share/native/java/util/zip/Deflater.c	2011-06-11 00:38:12.000000000 +0100
-+++ openjdk/jdk/src/share/native/java/util/zip/Deflater.c	2011-06-13 15:12:16.481040676 +0100
-@@ -32,7 +32,7 @@
- #include "jlong.h"
- #include "jni.h"
- #include "jni_util.h"
--#include "zlib.h"
-+#include <zlib.h>
- 
- #include "java_util_zip_Deflater.h"
- 
-diff -Nru openjdk.orig/jdk/src/share/native/java/util/zip/Inflater.c openjdk/jdk/src/share/native/java/util/zip/Inflater.c
---- openjdk.orig/jdk/src/share/native/java/util/zip/Inflater.c	2011-06-11 00:38:12.000000000 +0100
-+++ openjdk/jdk/src/share/native/java/util/zip/Inflater.c	2011-06-13 15:12:16.481040676 +0100
-@@ -35,7 +35,7 @@
- #include "jni.h"
- #include "jvm.h"
- #include "jni_util.h"
--#include "zlib.h"
-+#include <zlib.h>
- #include "java_util_zip_Inflater.h"
- 
- #define ThrowDataFormatException(env, msg) \
-diff -Nru openjdk.orig/jdk/src/share/native/java/util/zip/zip_util.c openjdk/jdk/src/share/native/java/util/zip/zip_util.c
---- openjdk.orig/jdk/src/share/native/java/util/zip/zip_util.c	2011-03-14 22:10:33.000000000 +0000
-+++ openjdk/jdk/src/share/native/java/util/zip/zip_util.c	2011-06-13 15:12:16.481040676 +0100
-@@ -44,7 +44,8 @@
- #include "io_util.h"
- #include "io_util_md.h"
- #include "zip_util.h"
--#include "zlib.h"
-+
-+#include <zlib.h>
- 
- /* USE_MMAP means mmap the CEN & ENDHDR part of the zip file. */
- #ifdef USE_MMAP
-diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c
---- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c	2011-06-11 00:38:12.000000000 +0100
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c	2011-06-13 15:12:16.481040676 +0100
-@@ -51,7 +51,9 @@
- 
- /* headers from the JPEG library */
- #include <jpeglib.h>
--#include "jerror.h"
-+#include <jerror.h>
-+
-+#include <dlfcn.h>
- 
- #undef MAX
- #define MAX(a,b)        ((a) > (b) ? (a) : (b))
-@@ -75,6 +77,62 @@
- static jfieldID JPEGHuffmanTable_lengthsID;
- static jfieldID JPEGHuffmanTable_valuesID;
- 
-+static void initIDs();
-+
-+typedef struct jpeg_error_mgr * (*fn_jpegstderror)(struct jpeg_error_mgr *);
-+typedef boolean (*fn_jpegresynctorestart)(j_decompress_ptr, int);
-+typedef JDIMENSION (*fn_jpegreadscanlines)(j_decompress_ptr, JSAMPARRAY, JDIMENSION);
-+typedef boolean (*fn_jpegfinishoutput)(j_decompress_ptr);
-+typedef int (*fn_jpegreadheader)(j_decompress_ptr, boolean);
-+typedef boolean (*fn_jpegstartdecompress)(j_decompress_ptr);
-+typedef boolean (*fn_jpeghasmultiplescans)(j_decompress_ptr);
-+typedef boolean (*fn_jpegfinishdecompress)(j_decompress_ptr);
-+typedef boolean (*fn_jpegstartoutput)(j_decompress_ptr, int);
-+typedef void (*fn_jpegabort)(j_common_ptr);
-+typedef void (*fn_jpegabortdecompress)(j_decompress_ptr);
-+typedef JHUFF_TBL * (*fn_jpegallochufftable)(j_common_ptr);
-+typedef JQUANT_TBL * (*fn_jpegallocquanttable)(j_common_ptr);
-+typedef void (*fn_jpegcreatecompress)(j_compress_ptr, int, size_t);
-+typedef void (*fn_jpegcreatedecompress)(j_decompress_ptr, int, size_t);
-+typedef void (*fn_jpegdestroy)(j_common_ptr);
-+typedef void (*fn_jpegfinishcompress)(j_compress_ptr);
-+typedef boolean (*fn_jpeginputcomplete)(j_decompress_ptr);
-+typedef void (*fn_jpegsavemarkers)(j_decompress_ptr, int, unsigned int);
-+typedef void (*fn_jpegsetcolorspace)(j_compress_ptr, J_COLOR_SPACE);
-+typedef void (*fn_jpegsetdefaults)(j_compress_ptr);
-+typedef void (*fn_jpegsimpleprogression)(j_compress_ptr);
-+typedef void (*fn_jpegstartcompress)(j_compress_ptr, boolean);
-+typedef void (*fn_jpegsuppresstables)(j_compress_ptr, boolean);
-+typedef JDIMENSION (*fn_jpegwritescanlines)(j_compress_ptr, JSAMPARRAY, JDIMENSION);
-+typedef void (*fn_jpegwritetables)(j_compress_ptr);
-+
-+fn_jpegabort jpegabort;
-+fn_jpegabortdecompress jpegabortdecompress;
-+fn_jpegallochufftable jpegallochufftable;
-+fn_jpegallocquanttable jpegallocquanttable;
-+fn_jpegcreatecompress jpegcreatecompress;
-+fn_jpegcreatedecompress jpegcreatedecompress;
-+fn_jpegdestroy jpegdestroy;
-+fn_jpegfinishcompress jpegfinishcompress;
-+fn_jpeginputcomplete jpeginputcomplete;
-+fn_jpegsavemarkers jpegsavemarkers;
-+fn_jpegsetcolorspace jpegsetcolorspace;
-+fn_jpegsetdefaults jpegsetdefaults;
-+fn_jpegsimpleprogression jpegsimpleprogression;
-+fn_jpegstartcompress jpegstartcompress;
-+fn_jpegsuppresstables jpegsuppresstables;
-+fn_jpegwritescanlines jpegwritescanlines;
-+fn_jpegwritetables jpegwritetables;
-+fn_jpegstderror jpegstderror;
-+fn_jpegstartoutput jpegstartoutput;
-+fn_jpegfinishdecompress jpegfinishdecompress;
-+fn_jpeghasmultiplescans jpeghasmultiplescans;
-+fn_jpegstartdecompress jpegstartdecompress;
-+fn_jpegreadheader jpegreadheader;
-+fn_jpegfinishoutput jpegfinishoutput;
-+fn_jpegreadscanlines jpegreadscanlines;
-+fn_jpegresynctorestart jpegresynctorestart;
-+
- /*
-  * Defined in jpegdecoder.c.  Copy code from there if and
-  * when that disappears. */
-@@ -608,7 +666,7 @@
-         return;
-     }
- 
--    jpeg_abort(cinfo);  // Frees any markers, but not tables
-+    jpegabort(cinfo);  // Frees any markers, but not tables
- 
- }
- 
-@@ -633,7 +691,7 @@
-         return;
-     }
- 
--    jpeg_abort(cinfo);  // Does not reset tables
-+    jpegabort(cinfo);  // Does not reset tables
- 
- }
- 
-@@ -651,7 +709,7 @@
-             free(cinfo->dest);
-             cinfo->dest = NULL;
-         }
--        jpeg_destroy(info);
-+        jpegdestroy(info);
-         free(info);
-     }
- }
-@@ -691,14 +749,14 @@
-             decomp = (j_decompress_ptr) cinfo;
-             if (decomp->quant_tbl_ptrs[i] == NULL) {
-                 decomp->quant_tbl_ptrs[i] =
--                    jpeg_alloc_quant_table(cinfo);
-+                    jpegallocquanttable(cinfo);
-             }
-             quant_ptr = decomp->quant_tbl_ptrs[i];
-         } else {
-             comp = (j_compress_ptr) cinfo;
-             if (comp->quant_tbl_ptrs[i] == NULL) {
-                 comp->quant_tbl_ptrs[i] =
--                    jpeg_alloc_quant_table(cinfo);
-+                    jpegallocquanttable(cinfo);
-             }
-             quant_ptr = comp->quant_tbl_ptrs[i];
-         }
-@@ -789,14 +847,14 @@
-             decomp = (j_decompress_ptr) cinfo;
-             if (decomp->dc_huff_tbl_ptrs[i] == NULL) {
-                 decomp->dc_huff_tbl_ptrs[i] =
--                    jpeg_alloc_huff_table(cinfo);
-+                    jpegallochufftable(cinfo);
-             }
-             huff_ptr = decomp->dc_huff_tbl_ptrs[i];
-         } else {
-             comp = (j_compress_ptr) cinfo;
-             if (comp->dc_huff_tbl_ptrs[i] == NULL) {
-                 comp->dc_huff_tbl_ptrs[i] =
--                    jpeg_alloc_huff_table(cinfo);
-+                    jpegallochufftable(cinfo);
-             }
-             huff_ptr = comp->dc_huff_tbl_ptrs[i];
-         }
-@@ -814,14 +872,14 @@
-             decomp = (j_decompress_ptr) cinfo;
-             if (decomp->ac_huff_tbl_ptrs[i] == NULL) {
-                 decomp->ac_huff_tbl_ptrs[i] =
--                    jpeg_alloc_huff_table(cinfo);
-+                    jpegallochufftable(cinfo);
-             }
-             huff_ptr = decomp->ac_huff_tbl_ptrs[i];
-         } else {
-             comp = (j_compress_ptr) cinfo;
-             if (comp->ac_huff_tbl_ptrs[i] == NULL) {
-                 comp->ac_huff_tbl_ptrs[i] =
--                    jpeg_alloc_huff_table(cinfo);
-+                    jpegallochufftable(cinfo);
-             }
-             huff_ptr = comp->ac_huff_tbl_ptrs[i];
-         }
-@@ -1381,6 +1439,8 @@
-      jclass ImageInputStreamClass,
-      jclass qTableClass,
-      jclass huffClass) {
-+   
-+    initIDs();
- 
-     ImageInputStream_readID = (*env)->GetMethodID(env,
-                                                   ImageInputStreamClass,
-@@ -1467,7 +1527,7 @@
-     }
- 
-     /* We set up the normal JPEG error routines, then override error_exit. */
--    cinfo->err = jpeg_std_error(&(jerr->pub));
-+    cinfo->err = jpegstderror(&(jerr->pub));
-     jerr->pub.error_exit = sun_jpeg_error_exit;
-     /* We need to setup our own print routines */
-     jerr->pub.output_message = sun_jpeg_output_message;
-@@ -1484,11 +1544,11 @@
-     }
- 
-     /* Perform library initialization */
--    jpeg_create_decompress(cinfo);
-+    jpegcreatedecompress(cinfo, JPEG_LIB_VERSION, (size_t) sizeof(struct jpeg_decompress_struct));
- 
-     // Set up to keep any APP2 markers, as these might contain ICC profile
-     // data
--    jpeg_save_markers(cinfo, ICC_MARKER, 0xFFFF);
-+    jpegsavemarkers(cinfo, ICC_MARKER, 0xFFFF);
- 
-     /*
-      * Now set up our source.
-@@ -1507,7 +1567,7 @@
-     cinfo->src->init_source = imageio_init_source;
-     cinfo->src->fill_input_buffer = imageio_fill_input_buffer;
-     cinfo->src->skip_input_data = imageio_skip_input_data;
--    cinfo->src->resync_to_restart = jpeg_resync_to_restart; // use default
-+    cinfo->src->resync_to_restart = jpegresynctorestart; // use default
-     cinfo->src->term_source = imageio_term_source;
- 
-     /* set up the association to persist for future calls */
-@@ -1627,7 +1687,7 @@
-         src->bytes_in_buffer = 0;
-     }
- 
--    ret = jpeg_read_header(cinfo, FALSE);
-+    ret = jpegreadheader(cinfo, FALSE);
- 
-     if (ret == JPEG_HEADER_TABLES_ONLY) {
-         retval = JNI_TRUE;
-@@ -1756,7 +1816,7 @@
-                                cinfo->num_components,
-                                profileData);
-         if (reset) {
--            jpeg_abort_decompress(cinfo);
-+            jpegabortdecompress(cinfo);
-         }
-     }
- 
-@@ -1951,7 +2011,7 @@
-                    TRUE);
-     }
- 
--    progressive = jpeg_has_multiple_scans(cinfo);
-+    progressive = jpeghasmultiplescans(cinfo);
-     if (progressive) {
-         cinfo->buffered_image = TRUE;
-         cinfo->input_scan_number = minProgressivePass+1; // Java count from 0
-@@ -1963,7 +2023,7 @@
- 
-     data->streamBuf.suspendable = FALSE;
- 
--    jpeg_start_decompress(cinfo);
-+    jpegstartdecompress(cinfo);
- 
-     if (numBands !=  cinfo->output_components) {
-         JNU_ThrowByName(env, "javax/imageio/IIOException",
-@@ -1988,7 +2048,7 @@
-         if (progressive) {
-             // initialize the next pass.  Note that this skips up to
-             // the first interesting pass.
--            jpeg_start_output(cinfo, cinfo->input_scan_number);
-+            jpegstartoutput(cinfo, cinfo->input_scan_number);
-             if (wantUpdates) {
-                 (*env)->CallVoidMethod(env, this,
-                                        JPEGImageReader_passStartedID,
-@@ -2004,7 +2064,7 @@
-         // Skip until the first interesting line
-         while ((data->abortFlag == JNI_FALSE)
-                && ((jint)cinfo->output_scanline < sourceYStart)) {
--            jpeg_read_scanlines(cinfo, &scanLinePtr, 1);
-+            jpegreadscanlines(cinfo, &scanLinePtr, 1);
-         }
- 
-         scanlineLimit = sourceYStart+sourceHeight;
-@@ -2017,7 +2077,7 @@
-         while ((data->abortFlag == JNI_FALSE)
-                && ((jint)cinfo->output_scanline < scanlineLimit)) {
- 
--            jpeg_read_scanlines(cinfo, &scanLinePtr, 1);
-+            jpegreadscanlines(cinfo, &scanLinePtr, 1);
- 
-             // Now mangle it into our buffer
-             out = data->pixelBuf.buf.bp;
-@@ -2072,13 +2132,13 @@
-                 skipLines = linesLeft;
-             }
-             for(i = 0; i < skipLines; i++) {
--                jpeg_read_scanlines(cinfo, &scanLinePtr, 1);
-+                jpegreadscanlines(cinfo, &scanLinePtr, 1);
-             }
-         }
-         if (progressive) {
--            jpeg_finish_output(cinfo); // Increments pass counter
-+            jpegfinishoutput(cinfo); // Increments pass counter
-             // Call Java to notify pass complete
--            if (jpeg_input_complete(cinfo)
-+            if (jpeginputcomplete(cinfo)
-                 || (cinfo->input_scan_number > maxProgressivePass)) {
-                 done = TRUE;
-             }
-@@ -2098,9 +2158,9 @@
-     if (cinfo->output_scanline == cinfo->output_height) {
-         //    if ((cinfo->output_scanline == cinfo->output_height) &&
-         //(jpeg_input_complete(cinfo))) {  // We read the whole file
--        jpeg_finish_decompress(cinfo);
-+        jpegfinishdecompress(cinfo);
-     } else {
--        jpeg_abort_decompress(cinfo);
-+        jpegabortdecompress(cinfo);
-     }
- 
-     free(scanLinePtr);
-@@ -2146,7 +2206,7 @@
- 
-     cinfo = (j_decompress_ptr) data->jpegObj;
- 
--    jpeg_abort_decompress(cinfo);
-+    jpegabortdecompress(cinfo);
- }
- 
- 
-@@ -2352,6 +2412,150 @@
- 
- /********************** end of destination manager ************/
- 
-+METHODDEF(void)
-+initIDs()
-+{
-+#if JPEG_LIB_VERSION >= 80
-+    void *handle = dlopen("libjpeg.so.8", RTLD_LAZY | RTLD_GLOBAL);
-+#else
-+#if JPEG_LIB_VERSION >= 70
-+    void *handle = dlopen("libjpeg.so.7", RTLD_LAZY | RTLD_GLOBAL);
-+#else
-+    void *handle = dlopen("libjpeg.so.62", RTLD_LAZY | RTLD_GLOBAL);
-+#endif
-+#endif
-+    
-+    jpegstderror = (fn_jpegstderror)dlsym(handle, "jpeg_std_error");
-+    if (jpegstderror == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegreadheader = (fn_jpegreadheader)dlsym(handle, "jpeg_read_header");
-+    if (jpegreadheader == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpeghasmultiplescans = (fn_jpeghasmultiplescans)dlsym(handle, "jpeg_has_multiple_scans");
-+    if (jpeghasmultiplescans == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegstartdecompress = (fn_jpegstartdecompress)dlsym(handle, "jpeg_start_decompress");
-+    if (jpegstartdecompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegstartoutput = (fn_jpegstartoutput)dlsym(handle, "jpeg_start_output");
-+    if (jpegstartoutput == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegfinishdecompress = (fn_jpegfinishdecompress)dlsym(handle, "jpeg_finish_decompress");
-+    if (jpegfinishdecompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegreadscanlines = (fn_jpegreadscanlines)dlsym(handle, "jpeg_read_scanlines");
-+    if (jpegreadscanlines == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegfinishoutput = (fn_jpegfinishoutput)dlsym(handle, "jpeg_finish_output");
-+    if (jpegfinishoutput == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegresynctorestart = (fn_jpegresynctorestart)dlsym(handle, "jpeg_resync_to_restart");
-+    if (jpegresynctorestart == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegabort = (fn_jpegabort)dlsym(handle, "jpeg_abort");
-+    if (jpegabort == NULL) {
-+       dlclose(handle);
-+    }
-+ 
-+    jpegabortdecompress = (fn_jpegabortdecompress)dlsym(handle, "jpeg_abort_decompress");
-+    if (jpegabortdecompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegallochufftable = (fn_jpegallochufftable)dlsym(handle, "jpeg_alloc_huff_table");
-+    if (jpegallochufftable == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegallocquanttable = (fn_jpegallocquanttable)dlsym(handle, "jpeg_alloc_quant_table");
-+    if (jpegallocquanttable == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegcreatecompress = (fn_jpegcreatecompress)dlsym(handle, "jpeg_CreateCompress");
-+    if (jpegcreatecompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegcreatedecompress = (fn_jpegcreatedecompress)dlsym(handle, "jpeg_CreateDecompress");
-+    if (jpegcreatedecompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegdestroy = (fn_jpegdestroy)dlsym(handle, "jpeg_destroy");
-+    if (jpegdestroy == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegfinishcompress = (fn_jpegfinishcompress)dlsym(handle, "jpeg_finish_compress");
-+    if (jpegfinishcompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpeginputcomplete = (fn_jpeginputcomplete)dlsym(handle, "jpeg_input_complete");
-+    if (jpeginputcomplete == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegsavemarkers = (fn_jpegsavemarkers)dlsym(handle, "jpeg_save_markers");
-+    if (jpegsavemarkers == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegsetcolorspace = (fn_jpegsetcolorspace)dlsym(handle, "jpeg_set_colorspace");
-+    if (jpegsetcolorspace == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegsetdefaults = (fn_jpegsetdefaults)dlsym(handle, "jpeg_set_defaults");
-+    if (jpegsetdefaults == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegsimpleprogression = (fn_jpegsimpleprogression)dlsym(handle, "jpeg_simple_progression");
-+    if (jpegsimpleprogression == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegstartcompress = (fn_jpegstartcompress)dlsym(handle, "jpeg_start_compress");
-+    if (jpegstartcompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegsuppresstables = (fn_jpegsuppresstables)dlsym(handle, "jpeg_suppress_tables");
-+    if (jpegsuppresstables == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegwritescanlines = (fn_jpegwritescanlines)dlsym(handle, "jpeg_write_scanlines");
-+    if (jpegwritescanlines == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegwritetables = (fn_jpegwritetables)dlsym(handle, "jpeg_write_tables");
-+    if (jpegwritetables == NULL) {
-+       dlclose(handle);
-+    }
-+}
-+
- /********************** Writer JNI calls **********************/
- 
- 
-@@ -2363,6 +2567,8 @@
-      jclass qTableClass,
-      jclass huffClass) {
- 
-+    initIDs();
-+
-     ImageOutputStream_writeID = (*env)->GetMethodID(env,
-                                                     IOSClass,
-                                                     "write",
-@@ -2436,7 +2642,7 @@
-     }
- 
-     /* We set up the normal JPEG error routines, then override error_exit. */
--    cinfo->err = jpeg_std_error(&(jerr->pub));
-+    cinfo->err = jpegstderror(&(jerr->pub));
-     jerr->pub.error_exit = sun_jpeg_error_exit;
-     /* We need to setup our own print routines */
-     jerr->pub.output_message = sun_jpeg_output_message;
-@@ -2453,7 +2659,7 @@
-     }
- 
-     /* Perform library initialization */
--    jpeg_create_compress(cinfo);
-+    jpegcreatecompress(cinfo, JPEG_LIB_VERSION, (size_t) sizeof(struct jpeg_compress_struct));
- 
-     /* Now set up the destination  */
-     dest = malloc(sizeof(struct jpeg_destination_mgr));
-@@ -2560,7 +2766,7 @@
-         return;
-     }
- 
--    jpeg_suppress_tables(cinfo, TRUE);  // Suppress writing of any current
-+    jpegsuppresstables(cinfo, TRUE);  // Suppress writing of any current
- 
-     data->streamBuf.suspendable = FALSE;
-     if (qtables != NULL) {
-@@ -2575,7 +2781,7 @@
-                    DCHuffmanTables, ACHuffmanTables, TRUE);
-     }
- 
--    jpeg_write_tables(cinfo); // Flushes the buffer for you
-+    jpegwritetables(cinfo); // Flushes the buffer for you
-     RELEASE_ARRAYS(env, data, NULL);
- }
- 
-@@ -2758,9 +2964,9 @@
-     cinfo->input_components = numBands;
-     cinfo->in_color_space = inCs;
- 
--    jpeg_set_defaults(cinfo);
-+    jpegsetdefaults(cinfo);
- 
--    jpeg_set_colorspace(cinfo, outCs);
-+    jpegsetcolorspace(cinfo, outCs);
- 
-     cinfo->optimize_coding = optimize;
- 
-@@ -2797,7 +3003,7 @@
-     (*env)->ReleaseIntArrayElements(env, QtableSelectors,
-                                     qsels, JNI_ABORT);
- 
--    jpeg_suppress_tables(cinfo, TRUE);  // Disable writing any current
-+    jpegsuppresstables(cinfo, TRUE);  // Disable writing any current
- 
-     qlen = setQTables(env, (j_common_ptr) cinfo, qtables, writeDQT);
- 
-@@ -2822,7 +3028,7 @@
- 
-     if (progressive) {
-         if (numScans == 0) { // then use default scans
--            jpeg_simple_progression(cinfo);
-+            jpegsimpleprogression(cinfo);
-         } else {
-             cinfo->num_scans = numScans;
-             // Copy the scanInfo to a local array
-@@ -2864,7 +3070,7 @@
- #endif
- 
-     // start the compressor; tables must already be set
--    jpeg_start_compress(cinfo, FALSE); // Leaves sent_table alone
-+    jpegstartcompress(cinfo, FALSE); // Leaves sent_table alone
- 
-     if (haveMetadata) {
-         // Flush the buffer
-@@ -2927,7 +3133,7 @@
-             }
-         }
-         // write it out
--        jpeg_write_scanlines(cinfo, (JSAMPARRAY)&scanLinePtr, 1);
-+        jpegwritescanlines(cinfo, (JSAMPARRAY)&scanLinePtr, 1);
-         targetLine += stepY;
-     }
- 
-@@ -2936,9 +3142,9 @@
-      * so use jpeg_abort instead of jpeg_finish_compress.
-      */
-     if (cinfo->next_scanline == cinfo->image_height) {
--        jpeg_finish_compress(cinfo);  // Flushes buffer with term_dest
-+        jpegfinishcompress(cinfo);  // Flushes buffer with term_dest
-     } else {
--        jpeg_abort((j_common_ptr)cinfo);
-+        jpegabort((j_common_ptr)cinfo);
-     }
- 
-     if (scale != NULL) {
-diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c openjdk/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c
---- openjdk.orig/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c	2011-06-11 00:38:12.000000000 +0100
-+++ openjdk/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c	2011-06-13 15:12:16.481040676 +0100
-@@ -45,7 +45,9 @@
- #undef boolean
- #undef FAR
- #include <jpeglib.h>
--#include "jerror.h"
-+#include <jerror.h>
-+#include <dlfcn.h>
-+
- 
- /* The method IDs we cache. Note that the last two belongs to the
-  * java.io.InputStream class.
-@@ -56,6 +58,32 @@
- static jmethodID InputStream_readID;
- static jmethodID InputStream_availableID;
- 
-+typedef struct jpeg_error_mgr * (*fn_jpegstderror)(struct jpeg_error_mgr *);
-+typedef void (*fn_jpegcreatedecompress)(j_decompress_ptr, int, size_t);
-+typedef boolean (*fn_jpegresynctorestart)(j_decompress_ptr, int);
-+typedef JDIMENSION (*fn_jpegreadscanlines)(j_decompress_ptr, JSAMPARRAY, JDIMENSION);
-+typedef boolean (*fn_jpegfinishoutput)(j_decompress_ptr);
-+typedef int (*fn_jpegreadheader)(j_decompress_ptr, boolean);
-+typedef boolean (*fn_jpegstartdecompress)(j_decompress_ptr);
-+typedef boolean (*fn_jpeghasmultiplescans)(j_decompress_ptr);
-+typedef void (*fn_jpegdestroydecompress)(j_decompress_ptr);
-+typedef int (*fn_jpegconsumeinput)(j_decompress_ptr);
-+typedef boolean (*fn_jpegfinishdecompress)(j_decompress_ptr);
-+typedef boolean (*fn_jpegstartoutput)(j_decompress_ptr, int);
-+
-+fn_jpegstderror jpegstderror;
-+fn_jpegstartoutput jpegstartoutput;
-+fn_jpegfinishdecompress jpegfinishdecompress;
-+fn_jpegconsumeinput jpegconsumeinput;
-+fn_jpegdestroydecompress jpegdestroydecompress; 
-+fn_jpeghasmultiplescans jpeghasmultiplescans;
-+fn_jpegstartdecompress jpegstartdecompress;
-+fn_jpegreadheader jpegreadheader;
-+fn_jpegfinishoutput jpegfinishoutput;
-+fn_jpegreadscanlines jpegreadscanlines;
-+fn_jpegresynctorestart jpegresynctorestart;
-+fn_jpegcreatedecompress jpegcreatedecompress;
-+
- /* Initialize the Java VM instance variable when the library is
-    first loaded */
- JavaVM *jvm;
-@@ -462,6 +490,76 @@
- Java_sun_awt_image_JPEGImageDecoder_initIDs(JNIEnv *env, jclass cls,
-                                             jclass InputStreamClass)
- {
-+#if JPEG_LIB_VERSION >= 80
-+    void *handle = dlopen("libjpeg.so.8", RTLD_LAZY | RTLD_GLOBAL);
-+#else
-+#if JPEG_LIB_VERSION >= 70
-+    void *handle = dlopen("libjpeg.so.7", RTLD_LAZY | RTLD_GLOBAL);
-+#else
-+    void *handle = dlopen("libjpeg.so.62", RTLD_LAZY | RTLD_GLOBAL);
-+#endif
-+#endif
-+ 
-+    jpegstderror = (fn_jpegstderror)dlsym(handle, "jpeg_std_error");
-+    if (jpegstderror == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegdestroydecompress = (fn_jpegdestroydecompress)dlsym(handle, "jpeg_destroy_decompress");
-+    if (jpegdestroydecompress == NULL) {
-+       dlclose(handle);
-+    }  
-+
-+    jpegcreatedecompress = (fn_jpegcreatedecompress)dlsym(handle, "jpeg_CreateDecompress");
-+    if (jpegcreatedecompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegreadheader = (fn_jpegreadheader)dlsym(handle, "jpeg_read_header");
-+    if (jpegreadheader == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpeghasmultiplescans = (fn_jpeghasmultiplescans)dlsym(handle, "jpeg_has_multiple_scans");
-+    if (jpeghasmultiplescans == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegstartdecompress = (fn_jpegstartdecompress)dlsym(handle, "jpeg_start_decompress");
-+    if (jpegstartdecompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegconsumeinput = (fn_jpegconsumeinput)dlsym(handle, "jpeg_consume_input");
-+    if (jpegconsumeinput == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegstartoutput = (fn_jpegstartoutput)dlsym(handle, "jpeg_start_output");
-+    if (jpegstartoutput == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegfinishdecompress = (fn_jpegfinishdecompress)dlsym(handle, "jpeg_finish_decompress");
-+    if (jpegfinishdecompress == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegreadscanlines = (fn_jpegreadscanlines)dlsym(handle, "jpeg_read_scanlines");
-+    if (jpegreadscanlines == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegfinishoutput = (fn_jpegfinishoutput)dlsym(handle, "jpeg_finish_output");
-+    if (jpegfinishoutput == NULL) {
-+       dlclose(handle);
-+    }
-+
-+    jpegresynctorestart = (fn_jpegresynctorestart)dlsym(handle, "jpeg_resync_to_restart");
-+    if (jpegresynctorestart == NULL) {
-+       dlclose(handle);
-+    }
-+
-     sendHeaderInfoID = (*env)->GetMethodID(env, cls, "sendHeaderInfo",
-                                            "(IIZZZ)Z");
-     sendPixelsByteID = (*env)->GetMethodID(env, cls, "sendPixels", "([BI)Z");
-@@ -519,7 +617,7 @@
-   /* Step 1: allocate and initialize JPEG decompression object */
- 
-   /* We set up the normal JPEG error routines, then override error_exit. */
--  cinfo.err = jpeg_std_error(&jerr.pub);
-+  cinfo.err = jpegstderror(&jerr.pub);
-   jerr.pub.error_exit = sun_jpeg_error_exit;
- 
-   /* We need to setup our own print routines */
-@@ -530,7 +628,7 @@
-     /* If we get here, the JPEG code has signaled an error.
-      * We need to clean up the JPEG object, close the input file, and return.
-      */
--    jpeg_destroy_decompress(&cinfo);
-+    jpegdestroydecompress(&cinfo);
-     RELEASE_ARRAYS(env, &jsrc);
-     if (!(*env)->ExceptionOccurred(env)) {
-         char buffer[JMSG_LENGTH_MAX];
-@@ -541,7 +639,7 @@
-     return;
-   }
-   /* Now we can initialize the JPEG decompression object. */
--  jpeg_create_decompress(&cinfo);
-+  jpegcreatedecompress(&cinfo, JPEG_LIB_VERSION, (size_t) sizeof(struct jpeg_decompress_struct));
- 
-   /* Step 2: specify data source (eg, a file) */
- 
-@@ -555,17 +653,17 @@
-   jsrc.pub.init_source = sun_jpeg_init_source;
-   jsrc.pub.fill_input_buffer = sun_jpeg_fill_input_buffer;
-   jsrc.pub.skip_input_data = sun_jpeg_skip_input_data;
--  jsrc.pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */
-+  jsrc.pub.resync_to_restart = jpegresynctorestart; /* use default method */
-   jsrc.pub.term_source = sun_jpeg_term_source;
-   if (!GET_ARRAYS(env, &jsrc)) {
--    jpeg_destroy_decompress(&cinfo);
-+    jpegdestroydecompress(&cinfo);
-     return;
-   }
-   /* Step 3: read file parameters with jpeg_read_header() */
- 
--  (void) jpeg_read_header(&cinfo, TRUE);
-+  (void) jpegreadheader(&cinfo, TRUE);
-   /* select buffered-image mode if it is a progressive JPEG only */
--  buffered_mode = cinfo.buffered_image = jpeg_has_multiple_scans(&cinfo);
-+  buffered_mode = cinfo.buffered_image = jpeghasmultiplescans(&cinfo);
-   grayscale = (cinfo.out_color_space == JCS_GRAYSCALE);
- #ifdef YCCALPHA
-   hasalpha = (cinfo.out_color_space == JCS_RGBA);
-@@ -584,7 +682,7 @@
-                                   grayscale, hasalpha, buffered_mode);
-   if ((*env)->ExceptionOccurred(env) || !ret) {
-     /* No more interest in this image... */
--    jpeg_destroy_decompress(&cinfo);
-+    jpegdestroydecompress(&cinfo);
-     return;
-   }
-   /* Make a one-row-high sample array with enough room to expand to ints */
-@@ -595,7 +693,7 @@
-   }
- 
-   if (jsrc.hOutputBuffer == 0 || !GET_ARRAYS(env, &jsrc)) {
--    jpeg_destroy_decompress(&cinfo);
-+    jpegdestroydecompress(&cinfo);
-     return;
-   }
- 
-@@ -613,7 +711,7 @@
- 
-   /* Step 5: Start decompressor */
- 
--  jpeg_start_decompress(&cinfo);
-+  jpegstartdecompress(&cinfo);
- 
-   /* We may need to do some setup of our own at this point before reading
-    * the data.  After jpeg_start_decompress() we have the correct scaled
-@@ -638,28 +736,28 @@
-           do {
-               sun_jpeg_fill_suspended_buffer(&cinfo);
-               jsrc.suspendable = TRUE;
--              ret = jpeg_consume_input(&cinfo);
-+	      ret = jpegconsumeinput(&cinfo);
-               jsrc.suspendable = FALSE;
-           } while (ret != JPEG_SUSPENDED && ret != JPEG_REACHED_EOI);
-           if (ret == JPEG_REACHED_EOI) {
-               final_pass = TRUE;
-               cinfo.dct_method = JDCT_ISLOW;
-           }
--          jpeg_start_output(&cinfo, cinfo.input_scan_number);
-+	  jpegstartoutput(&cinfo, cinfo.input_scan_number);
-       }
-       while (cinfo.output_scanline < cinfo.output_height) {
-           if (! final_pass) {
-               do {
-                   sun_jpeg_fill_suspended_buffer(&cinfo);
-                   jsrc.suspendable = TRUE;
--                  ret = jpeg_consume_input(&cinfo);
-+		  ret = jpegconsumeinput(&cinfo);
-                   jsrc.suspendable = FALSE;
-               } while (ret != JPEG_SUSPENDED && ret != JPEG_REACHED_EOI);
-               if (ret == JPEG_REACHED_EOI) {
-                   break;
-               }
-           }
--          (void) jpeg_read_scanlines(&cinfo, (JSAMPARRAY) &(jsrc.outbuf), 1);
-+	  (void) jpegreadscanlines(&cinfo, (JSAMPARRAY) &(jsrc.outbuf), 1);
- 
-           if (grayscale) {
-               RELEASE_ARRAYS(env, &jsrc);
-@@ -695,18 +793,18 @@
-           if ((*env)->ExceptionOccurred(env) || !ret ||
-               !GET_ARRAYS(env, &jsrc)) {
-               /* No more interest in this image... */
--              jpeg_destroy_decompress(&cinfo);
-+	      jpegdestroydecompress(&cinfo);
-               return;
-           }
-       }
-       if (buffered_mode) {
--          jpeg_finish_output(&cinfo);
-+	  jpegfinishoutput(&cinfo);
-       }
-   } while (! final_pass);
- 
-   /* Step 7: Finish decompression */
- 
--  (void) jpeg_finish_decompress(&cinfo);
-+  (void) jpegfinishdecompress(&cinfo);
-   /* We can ignore the return value since suspension is not possible
-    * with the stdio data source.
-    * (nor with the Java data source)
-@@ -715,7 +813,7 @@
-   /* Step 8: Release JPEG decompression object */
- 
-   /* This is an important step since it will release a good deal of memory. */
--  jpeg_destroy_decompress(&cinfo);
-+  jpegdestroydecompress(&cinfo);
- 
-   /* After finish_decompress, we can close the input file.
-    * Here we postpone it until after no more JPEG errors are possible,
-diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c
---- openjdk.orig/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c	2011-03-14 22:10:33.000000000 +0000
-+++ openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c	2011-06-13 15:12:16.481040676 +0100
-@@ -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
-diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c
---- openjdk.orig/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c	2010-07-29 21:56:12.000000000 +0100
-+++ openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c	2011-06-13 15:12:16.481040676 +0100
-@@ -25,9 +25,8 @@
- 
- #include "splashscreen_impl.h"
- 
--#include "jinclude.h"
--#include "jpeglib.h"
--#include "jerror.h"
-+#include <jpeglib.h>
-+#include <jerror.h>
- 
- #include <setjmp.h>
- 
-@@ -105,13 +104,9 @@
-     stream_src_ptr src;
- 
-     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));
--        src = (stream_src_ptr) cinfo->src;
--        src->buffer = (JOCTET *)
--            (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo,
--            JPOOL_PERMANENT, INPUT_BUF_SIZE * SIZEOF(JOCTET));
-+        cinfo->src = (struct jpeg_source_mgr *)(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, 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));
-     }
- 
-     src = (stream_src_ptr) cinfo->src;
-diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c
---- openjdk.orig/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c	2011-03-14 22:10:33.000000000 +0000
-+++ openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c	2011-06-13 15:12:16.481040676 +0100
-@@ -25,7 +25,7 @@
- 
- #include "splashscreen_impl.h"
- 
--#include "../libpng/png.h"
-+#include <png.h>
- 
- #include <setjmp.h>
- 
--- a/patches/linker-libs-order.patch	Mon Sep 05 12:59:28 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-diff -Nru openjdk.orig/jdk/make/com/sun/java/pack/Makefile openjdk/jdk/make/com/sun/java/pack/Makefile
---- openjdk.orig/jdk/make/com/sun/java/pack/Makefile	2011-06-13 15:19:20.000000000 +0100
-+++ openjdk/jdk/make/com/sun/java/pack/Makefile	2011-06-13 15:21:25.281602536 +0100
-@@ -70,12 +70,12 @@
- 	     $(ZIPOBJDIR)/inftrees.$(OBJECT_SUFFIX) \
- 	     $(ZIPOBJDIR)/inffast.$(OBJECT_SUFFIX)
- 
--  OTHER_LDLIBS += -lz
- else
-   OTHER_CXXFLAGS += -DNO_ZLIB -DUNPACK_JNI
--  OTHER_LDLIBS += -lz $(JVMLIB)
-+  OTHER_LDLIBS += $(JVMLIB)
- endif
- 
-+OTHER_LDLIBS += -lz
- CXXFLAGS_DBG += -DFULL
- CXXFLAGS_OPT += -DPRODUCT
- CXXFLAGS_COMMON += -DFULL
-@@ -92,12 +92,11 @@
-   RES = $(OBJDIR)/$(PGRM).res
- else
-   LDOUTPUT = -o #Have a space 
--  LDDFLAGS += -lz -lc
--  OTHER_LDLIBS  += $(LIBCXX)
-+  OTHER_LDLIBS += $(LIBCXX) -lc
- # setup the list of libraries to link in...
- ifeq ($(PLATFORM), linux)
- ifeq ("$(CC_VER_MAJOR)", "3")
--  OTHER_LDLIBS  += -lz -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
-+  OTHER_LDLIBS  += -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
- endif
- endif #LINUX
- endif #PLATFORM
-@@ -150,7 +149,7 @@
- 	$(prep-target)
- 	$(RM) $(TEMPDIR)/mapfile-vers
- 	$(CP) mapfile-vers-unpack200 $(TEMPDIR)/mapfile-vers
--	$(LINKER)  $(LDDFLAGS) $(UNPACK_EXE_FILES_o) $(RES) $(LIBCXX) $(LDOUTPUT)$(TEMPDIR)/unpack200$(EXE_SUFFIX)
-+	$(LINKER)  $(LDDFLAGS) $(UNPACK_EXE_FILES_o) $(RES) $(OTHER_LDLIBS) $(LIBCXX) $(LDOUTPUT)$(TEMPDIR)/unpack200$(EXE_SUFFIX)
- ifdef MT
- 	$(MT) /manifest $(OBJDIR)/unpack200$(EXE_SUFFIX).manifest /outputresource:$(TEMPDIR)/unpack200$(EXE_SUFFIX);#1
- endif
-diff -Nru openjdk.orig/jdk/make/javax/sound/jsoundalsa/Makefile openjdk/jdk/make/javax/sound/jsoundalsa/Makefile
---- openjdk.orig/jdk/make/javax/sound/jsoundalsa/Makefile	2011-06-11 00:38:06.000000000 +0100
-+++ openjdk/jdk/make/javax/sound/jsoundalsa/Makefile	2011-06-13 15:20:50.441058241 +0100
-@@ -65,7 +65,7 @@
- 	$(MIDIFILES_export) \
- 	$(PORTFILES_export)
- 
--LDFLAGS += -lasound
-+OTHER_LDLIBS += -lasound
- 
- CPPFLAGS += \
- 	-DUSE_DAUDIO=TRUE \
--- a/patches/pr261.patch	Mon Sep 05 12:59:28 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-diff -Nru openjdk.orig/jdk/make/java/nio/FILES_java.gmk openjdk/jdk/make/java/nio/FILES_java.gmk
---- openjdk.orig/jdk/make/java/nio/FILES_java.gmk	2009-03-05 08:28:24.000000000 +0000
-+++ openjdk/jdk/make/java/nio/FILES_java.gmk	2009-03-06 17:57:56.000000000 +0000
-@@ -39,6 +39,7 @@
- 	java/nio/channels/AsynchronousServerSocketChannel.java \
- 	java/nio/channels/AsynchronousSocketChannel.java \
- 	java/nio/channels/ByteChannel.java \
-+	java/nio/channels/CancelledKeyException.java \
- 	java/nio/channels/Channel.java \
- 	java/nio/channels/Channels.java \
- 	java/nio/channels/CompletionHandler.java \
-@@ -51,6 +52,7 @@
- 	java/nio/channels/MembershipKey.java \
- 	java/nio/channels/MulticastChannel.java \
- 	java/nio/channels/NetworkChannel.java \
-+	java/nio/channels/Pipe.java \
- 	java/nio/channels/ReadableByteChannel.java \
- 	java/nio/channels/ScatteringByteChannel.java \
- 	java/nio/channels/SeekableByteChannel.java \
-diff -Nru openjdk.orig/jdk/make/java/nio/Makefile openjdk/jdk/make/java/nio/Makefile
---- openjdk.orig/jdk/make/java/nio/Makefile	2009-03-05 08:28:24.000000000 +0000
-+++ openjdk/jdk/make/java/nio/Makefile	2009-03-06 18:00:27.000000000 +0000
-@@ -183,6 +183,9 @@
- ifeq ($(PLATFORM), linux)
- FILES_java += \
-         sun/nio/ch/AbstractPollSelectorImpl.java \
-+	sun/nio/ch/DevPollArrayWrapper.java \
-+	sun/nio/ch/DevPollSelectorImpl.java \
-+	sun/nio/ch/DevPollSelectorProvider.java \
- 	sun/nio/ch/EPoll.java \
- 	sun/nio/ch/EPollArrayWrapper.java \
- 	sun/nio/ch/EPollPort.java \
-@@ -242,6 +245,7 @@
- 	UnixNativeDispatcher.c
- 
- FILES_export += \
-+ 	sun/nio/ch/DevPollArrayWrapper.java \
- 	sun/nio/ch/EPoll.java \
-         sun/nio/ch/EPollArrayWrapper.java \
- 	sun/nio/ch/EPollPort.java \
--- a/remove-intree-libraries.sh.in	Mon Sep 05 12:59:28 2011 +0200
+++ b/remove-intree-libraries.sh.in	Tue Sep 06 16:06:22 2011 +0100
@@ -2,63 +2,30 @@
 
 ZLIB_VERSION=1.2.3
 ZIP_SRC=openjdk/jdk/src/share/native/java/util/zip/zlib-${ZLIB_VERSION}
-JPEG_SRC=openjdk/jdk/src/share/native/sun/awt/image/jpeg
+JPEG_SRC=openjdk/jdk/src/share/native/sun/awt/image/jpeg/jpeg-6b
 GIF_SRC=openjdk/jdk/src/share/native/sun/awt/giflib
 PNG_SRC=openjdk/jdk/src/share/native/sun/awt/libpng
 LCMS_SRC=openjdk/jdk/src/share/native/sun/java2d/cmm/lcms
 
-echo "Removing zlib"
-rm -rvf ${ZIP_SRC}
-echo "Removing libjpeg"
-rm -vf ${JPEG_SRC}/jcomapi.c
-rm -vf ${JPEG_SRC}/jdapimin.c
-rm -vf ${JPEG_SRC}/jdapistd.c
-rm -vf ${JPEG_SRC}/jdcoefct.c
-rm -vf ${JPEG_SRC}/jdcolor.c
-rm -vf ${JPEG_SRC}/jddctmgr.c
-rm -vf ${JPEG_SRC}/jdhuff.c
-rm -vf ${JPEG_SRC}/jdinput.c
-rm -vf ${JPEG_SRC}/jdmainct.
-rm -vf ${JPEG_SRC}/jdmarker.c
-rm -vf ${JPEG_SRC}/jdmaster.c
-rm -vf ${JPEG_SRC}/jdmerge.c
-rm -vf ${JPEG_SRC}/jdphuff.c
-rm -vf ${JPEG_SRC}/jdpostct.c
-rm -vf ${JPEG_SRC}/jdsample.c
-rm -vf ${JPEG_SRC}/jerror.c
-rm -vf ${JPEG_SRC}/jidctflt.c
-rm -vf ${JPEG_SRC}/jidctfst.c
-rm -vf ${JPEG_SRC}/jidctint.c
-rm -vf ${JPEG_SRC}/jidctred.c
-rm -vf ${JPEG_SRC}/jmemmgr.c
-rm -vf ${JPEG_SRC}/jmemnobs.c
-rm -vf ${JPEG_SRC}/jquant1.c
-rm -vf ${JPEG_SRC}/jquant2.c
-rm -vf ${JPEG_SRC}/jutils.c
-rm -vf ${JPEG_SRC}/jcapimin.c
-rm -vf ${JPEG_SRC}/jcapistd.c
-rm -vf ${JPEG_SRC}/jccoefct.c
-rm -vf ${JPEG_SRC}/jccolor.c
-rm -vf ${JPEG_SRC}/jcdctmgr.c
-rm -vf ${JPEG_SRC}/jchuff.c
-rm -vf ${JPEG_SRC}/jcinit.c
-rm -vf ${JPEG_SRC}/jcmainct.c
-rm -vf ${JPEG_SRC}/jcmarker.c
-rm -vf ${JPEG_SRC}/jcmaster.c
-rm -vf ${JPEG_SRC}/jcparam.c
-rm -vf ${JPEG_SRC}/jcphuff.c
-rm -vf ${JPEG_SRC}/jcprepct.c
-rm -vf ${JPEG_SRC}/jcsample.c
-rm -vf ${JPEG_SRC}/jctrans.c
-rm -vf ${JPEG_SRC}/jdtrans.c
-rm -vf ${JPEG_SRC}/jfdctflt.c
-rm -vf ${JPEG_SRC}/jfdctfst.c
-rm -vf ${JPEG_SRC}/jfdctint.c
-rm -vf ${JPEG_SRC}/README
-echo "Removing giflib"
-rm -rvf ${GIF_SRC}
-echo "Removing libpng"
-rm -rvf ${PNG_SRC}
+if test "x@ENABLE_SYSTEM_ZLIB@" = "xyes"; then
+  echo "Removing zlib"
+  rm -rvf ${ZIP_SRC}
+fi
+
+if test "x@ENABLE_SYSTEM_JPEG@" = "xyes"; then
+  echo "Removing libjpeg"
+  rm -rvf ${JPEG_SRC}
+fi
+
+if test "x@ENABLE_SYSTEM_GIF@" = "xyes"; then
+  echo "Removing giflib"
+  rm -rvf ${GIF_SRC}
+fi
+
+if test "x@ENABLE_SYSTEM_PNG@" = "xyes"; then
+  echo "Removing libpng"
+  rm -rvf ${PNG_SRC}
+fi
 
 if test "x@ENABLE_SYSTEM_LCMS@" = "xyes"; then
   echo "Removing lcms"