jdk: complete SYSTEM_ZLIB build hooks and enable

Kurt Miller kurt at intricatesoftware.com
Wed Jan 7 16:04:38 PST 2009


The SYSTEM_ZLIB build flag is not complete. The following
diff completes the build hooks and enables it for OpenBSD
and FreeBSD. Tested on FreeBSD and OpenBSD and should have
no effect on OS X.

# HG changeset patch
# User kurtmiller
# Date 1231360831 18000
# Node ID 54448649b27edaaf0891ebb66897508168cb05d2
# Parent  2a26505c13046d93870a31f5a881bb47703f4438
[mq]: libz.diff

diff -r 2a26505c1304 -r 54448649b27e make/common/Defs-bsd.gmk
--- a/make/common/Defs-bsd.gmk	Sun Dec 28 10:34:23 2008 -0800
+++ b/make/common/Defs-bsd.gmk	Wed Jan 07 15:40:31 2009 -0500
@@ -286,6 +286,14 @@
 # DPS (Displayable PostScript) is available on Solaris machines
 HAVE_DPS = no
 
+ifeq ($(OS_VENDOR), FreeBSD)
+  SYSTEM_ZLIB = true
+endif
+
+ifeq ($(OS_VENDOR), OpenBSD)
+  SYSTEM_ZLIB = true
+endif
+
 #
 # Japanese manpages
 #
diff -r 2a26505c1304 -r 54448649b27e make/common/Program.gmk
--- a/make/common/Program.gmk	Sun Dec 28 10:34:23 2008 -0800
+++ b/make/common/Program.gmk	Wed Jan 07 15:40:31 2009 -0500
@@ -83,6 +83,9 @@
     LDFLAGS += -Wl,--no-whole-archive
 # Work-around an dlsym(RTLD_DEFAULT) bug in at least FreeBSD & OpenBSD
     LDFLAGS += -Wl,--export-dynamic
+  endif
+  ifeq ($(SYSTEM_ZLIB),true)
+      OTHER_LDLIBS += -lz
   endif
 endif
 ifneq (,$(findstring $(PLATFORM), linux solaris))	# UNIX systems
@@ -269,7 +272,9 @@
 endif
 
 OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)/bin -I$(LAUNCHER_PLATFORM_SRC)/bin
+ifneq ($(SYSTEM_ZLIB),true)
 OTHER_INCLUDES += -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3
+endif
 
 # this may not be necessary...
 ifeq ($(PLATFORM), windows)
diff -r 2a26505c1304 -r 54448649b27e make/java/jli/Makefile
--- a/make/java/jli/Makefile	Sun Dec 28 10:34:23 2008 -0800
+++ b/make/java/jli/Makefile	Wed Jan 07 15:40:31 2009 -0500
@@ -44,8 +44,10 @@
 
 include $(BUILDDIR)/common/Defs.gmk
 
+ifneq ($(SYSTEM_ZLIB),true)
 ZLIB_VERSION = 1.1.3
 ZIP_SRC = $(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
+endif
 LAUNCHER_SHARE_SRC = $(SHARE_SRC)/bin
 LAUNCHER_PLATFORM_SRC = $(PLATFORM_SRC)/bin
 
@@ -66,7 +68,10 @@
 	parse_manifest.c \
 	version_comp.c \
 	wildcard.c \
-	jli_util.c \
+	jli_util.c
+
+ifneq ($(SYSTEM_ZLIB),true)
+FILES_c += \
 	inflate.c \
 	infblock.c \
 	inftrees.c \
@@ -75,6 +80,7 @@
 	infutil.c \
 	zadler32.c \
 	zutil.c
+endif
 
 ifneq ($(PLATFORM), windows)
 
@@ -125,7 +131,11 @@
 
 OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)
 OTHER_INCLUDES += -I$(LAUNCHER_PLATFORM_SRC)
-OTHER_INCLUDES += -I$(ZIP_SRC)
+ifneq ($(SYSTEM_ZLIB),true)
+  OTHER_INCLUDES += -I$(ZIP_SRC)
+else
+  LDLIBS += -lz
+endif
 
 #
 # Library to compile.
@@ -184,4 +194,8 @@
 #
 # 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)
+ifneq ($(SYSTEM_ZLIB),true)
+  vpath %.c $(ZIP_SRC)
+endif
+
diff -r 2a26505c1304 -r 54448649b27e make/sun/splashscreen/FILES_c.gmk
--- a/make/sun/splashscreen/FILES_c.gmk	Sun Dec 28 10:34:23 2008 -0800
+++ b/make/sun/splashscreen/FILES_c.gmk	Wed Jan 07 15:40:31 2009 -0500
@@ -49,20 +49,6 @@
 	dgif_lib.c \
 	gif_err.c \
 	gifalloc.c \
-	compress.c \
-	deflate.c \
-	gzio.c \
-	infblock.c \
-	infcodes.c \
-	inffast.c \
-	inflate.c \
-	inftrees.c \
-	infutil.c \
-	trees.c \
-	uncompr.c \
-	zadler32.c \
-	zcrc32.c \
-	zutil.c \
 	jcomapi.c \
 	jdapimin.c \
 	jdapistd.c \
@@ -108,3 +94,20 @@
 	jfdctfst.c \
 	jfdctint.c
 
+ifneq ($(SYSTEM_ZLIB),true)
+  FILES_c += \
+	compress.c \
+	deflate.c \
+	gzio.c \
+	infblock.c \
+	infcodes.c \
+	inffast.c \
+	inflate.c \
+	inftrees.c \
+	infutil.c \
+	trees.c \
+	uncompr.c \
+	zadler32.c \
+	zcrc32.c \
+	zutil.c
+endif
diff -r 2a26505c1304 -r 54448649b27e make/sun/splashscreen/Makefile
--- a/make/sun/splashscreen/Makefile	Sun Dec 28 10:34:23 2008 -0800
+++ b/make/sun/splashscreen/Makefile	Wed Jan 07 15:40:31 2009 -0500
@@ -62,7 +62,11 @@
 CFLAGS += -DSPLASHSCREEN
 
 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-1.1.3
+CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR)/image/jpeg
+ifneq ($(SYSTEM_ZLIB),true)
+  CPPFLAGS += -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3
+endif
+
 
 ifneq ($(PLATFORM), windows)
   CFLAGS += -DWITH_X11
@@ -89,7 +93,9 @@
 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-1.1.3
+ifneq ($(SYSTEM_ZLIB),true)
+  vpath %.c   $(SHARE_SRC)/native/java/util/zip/zlib-1.1.3
+endif
 vpath %.c   $(SHARE_SRC)/native/$(PKGDIR)/libpng
 vpath %.c   $(SHARE_SRC)/native/$(PKGDIR)/image/jpeg
 vpath %.c   $(PLATFORM_SRC)/native/$(PKGDIR)/splashscreen



More information about the bsd-port-dev mailing list