Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Oct 2005 11:07:10 -0400 (EDT)
From:      "Mikhail T." <mi@aldan.algebra.com>
To:        phantom@FreeBSD.org
Cc:        java@FreeBSD.org
Subject:   JDK should use system's zlib
Message-ID:  <200510161507.j9GF7ACB003843@blue.virtual-estates.net>

next in thread | raw e-mail | index | archive | help

--ELM1129475230-3772-0_
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII

Hello!

The system's zlib is much newer and better tested on our various
platforms.

JDKs should use it instead of building their own. Attached is the
patch for ready to be dropped into jdk15/files.

Just to be sure, a wrong header file is not picked up somewhere
else in the tree, the little diff below prevents the bundled zlib-1.1.3
from even being extracted:

Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/java/jdk15/Makefile,v
retrieving revision 1.94
diff -U2 -r1.94 Makefile
--- Makefile	13 Oct 2005 15:19:18 -0000	1.94
+++ Makefile	16 Oct 2005 15:04:57 -0000
@@ -307,2 +307,4 @@
 
 .include <bsd.port.post.mk>
+
+EXTRACT_AFTER_ARGS+=	-x '*/zlib-*/*'


Please, test... Something like this should also be done to use the
already installed libjpeg. Yours,

	-mi

--ELM1129475230-3772-0_
Content-Transfer-Encoding: 7bit
Content-Type: text/plain
Content-Disposition: attachment; filename=patch-syszlib
Content-Description: 

--- ../../j2se/make/java/instrument/Makefile	Sat Oct 15 12:08:55 2005
+++ ../../j2se/make/java/instrument/Makefile	Sat Oct 15 12:37:43 2005
@@ -39,5 +39,4 @@
 # into the instrument library.
 #
-ZIP_SRC = $(SHARE_SRC)/native/java/util/zip/zlib-1.1.3
 IO_PLATFORM_SRC = $(PLATFORM_SRC)/native/java/io
 LAUNCHER_SHARE_SRC = $(SHARE_SRC)/bin
@@ -45,12 +44,4 @@
 
 FILES_c += \
-	inflate.c \
-	infblock.c \
-	infcodes.c \
-	inffast.c \
-	inftrees.c \
-	zadler32.c \
-	infutil.c \
-	zutil.c \
 	canonicalize_md.c \
 	parse_manifest.c 
@@ -61,5 +60,4 @@
 OTHER_INCLUDES = -I$(SHARE_SRC)/instrument
 OTHER_INCLUDES += -I$(PLATFORM_SRC)/instrument
-OTHER_INCLUDES += -I$(ZIP_SRC)
 OTHER_INCLUDES += -I$(IO_PLATFORM_SRC)
 OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC) -I$(LAUNCHER_PLATFORM_SRC)
@@ -71,4 +61,5 @@
   COMPILER_WARNING_LEVEL=0
 else
+OTHER_LDLIBS += -lz
 ifeq ($(PLATFORM), bsd)
   ifneq ($(TRUE_PLATFORM), NetBSD)
@@ -123,5 +121,4 @@
 #
 vpath %.c $(SHARE_SRC)/instrument $(PLATFORM_SRC)/instrument
-vpath %.c $(ZIP_SRC)
 vpath %.c $(IO_PLATFORM_SRC)
 vpath %.c $(LAUNCHER_SHARE_SRC) $(LAUNCHER_PLATFORM_SRC)
--- ../../j2se/make/common/Program.gmk	Tue Oct 19 14:44:50 2004
+++ ../../j2se/make/common/Program.gmk	Sat Oct 15 12:37:38 2005
@@ -17,5 +17,4 @@
 LAUNCHER_SHARE_SRC = $(SHARE_SRC)
 endif
-ZIP_SRC = $(SHARE_SRC)/native/java/util/zip/zlib-1.1.3
 
 .PHONY: all optimized debug classes clean clobber
@@ -47,5 +46,6 @@
 	$(OBJDIR)/zutil.$(OBJECT_SUFFIX)
 
-FILES_o = $(LAUNCHER_o) $(ZLIB_o)
+FILES_o = $(LAUNCHER_o)
+LDFLAGS += -lz
 
 ifeq ($(PLATFORM), windows)
--- ../../j2se/make/java/zip/Makefile	Tue Oct 19 14:44:55 2004
+++ ../../j2se/make/java/zip/Makefile	Sat Oct 15 14:02:40 2005
@@ -59,11 +59,4 @@
 endif
 
-CPPFLAGS += -I$(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
-
-#
-# Add to ambient vpath so we pick up the library files
-#
-vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/zlib-$(ZLIB_VERSION)
-
 #
 # Has been converted to the JNI: generate JNI-style header files
@@ -74,3 +67,3 @@
 # Link to JVM library for JVM_Zip* functions
 #
-OTHER_LDLIBS = $(JVMLIB)
+OTHER_LDLIBS = -lz
--- ../../j2se/make/java/zip/FILES_c.gmk	Tue Oct 19 14:44:55 2004
+++ ../../j2se/make/java/zip/FILES_c.gmk	Sat Oct 15 14:51:44 2005
@@ -9,14 +9,3 @@
 	$(CTARGDIR)ZipFile.c \
 	$(CTARGDIR)ZipEntry.c \
-	$(CTARGDIR)zadler32.c \
-	$(CTARGDIR)zcrc32.c \
-	$(CTARGDIR)deflate.c \
-	$(CTARGDIR)trees.c \
-	$(CTARGDIR)zutil.c \
-	$(CTARGDIR)inflate.c \
-	$(CTARGDIR)infblock.c \
-	$(CTARGDIR)inftrees.c \
-	$(CTARGDIR)infcodes.c \
-	$(CTARGDIR)infutil.c \
-	$(CTARGDIR)inffast.c \
 	$(CTARGDIR)zip_util.c
--- ../../j2se/src/share/native/com/sun/java/util/jar/pack/defines.h	Tue Oct 19 14:59:48 2004
+++ ../../j2se/src/share/native/com/sun/java/util/jar/pack/defines.h	Sun Oct 16 09:06:04 2005
@@ -15,4 +15,8 @@
 #endif
 
+#ifndef NO_ZLIB
+#	include <zconf.h>
+#endif
+
 #ifndef FULL
 #define FULL 1 /* Adds <500 bytes to the zipped final product. */
@@ -70,4 +74,5 @@
 
 typedef unsigned int uint;
+#ifdef NO_ZLIB
 #ifdef _LP64
 typedef unsigned int uLong; // Historical zlib, should be 32-bit.
@@ -75,4 +80,6 @@
 typedef unsigned long uLong;
 #endif
+#endif
+
 #ifdef _MSC_VER 
 typedef LONGLONG 	jlong;
--- ../../j2se/make/com/sun/java/pack/Makefile	Tue Oct 19 14:44:46 2004
+++ ../../j2se/make/com/sun/java/pack/Makefile	Sun Oct 16 09:07:12 2005
@@ -36,24 +36,6 @@
 
 
-
-
 ifeq ($(STANDALONE),true)
-  ZIPOBJDIR = $(OUTPUTDIR)/tmp/sun/java.util.zip/zip/$(OBJDIRNAME)
-
-  ZIPOBJS =  $(ZIPOBJDIR)/zcrc32.$(OBJECT_SUFFIX) \
-	     $(ZIPOBJDIR)/deflate.$(OBJECT_SUFFIX) \
-	     $(ZIPOBJDIR)/trees.$(OBJECT_SUFFIX) \
-	     $(ZIPOBJDIR)/zadler32.$(OBJECT_SUFFIX) \
-	     $(ZIPOBJDIR)/zutil.$(OBJECT_SUFFIX) \
-	     $(ZIPOBJDIR)/inflate.$(OBJECT_SUFFIX) \
-	     $(ZIPOBJDIR)/infblock.$(OBJECT_SUFFIX) \
-	     $(ZIPOBJDIR)/infcodes.$(OBJECT_SUFFIX) \
-	     $(ZIPOBJDIR)/inftrees.$(OBJECT_SUFFIX) \
-	     $(ZIPOBJDIR)/infutil.$(OBJECT_SUFFIX) \
-	     $(ZIPOBJDIR)/inffast.$(OBJECT_SUFFIX)
-
-  ZINCLUDE=-I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3
-  OTHER_CXXFLAGS += $(ZINCLUDE)
-  LDDFLAGS += $(ZIPOBJS)
+  LDDFLAGS += -lz
 else
   OTHER_CXXFLAGS += -DNO_ZLIB -DUNPACK_JNI

--ELM1129475230-3772-0_--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200510161507.j9GF7ACB003843>