diff options
Diffstat (limited to 'recipes-core/openjdk/patches-openjdk-8/0004-jdk-Allow-using-a-system-installed-libpng.patch')
-rw-r--r-- | recipes-core/openjdk/patches-openjdk-8/0004-jdk-Allow-using-a-system-installed-libpng.patch | 148 |
1 files changed, 0 insertions, 148 deletions
diff --git a/recipes-core/openjdk/patches-openjdk-8/0004-jdk-Allow-using-a-system-installed-libpng.patch b/recipes-core/openjdk/patches-openjdk-8/0004-jdk-Allow-using-a-system-installed-libpng.patch deleted file mode 100644 index 658ba32..0000000 --- a/recipes-core/openjdk/patches-openjdk-8/0004-jdk-Allow-using-a-system-installed-libpng.patch +++ /dev/null | |||
@@ -1,148 +0,0 @@ | |||
1 | From 549100e3e687d2c844eeebe22a7dcbf7ed50406e Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <andre.draszik@jci.com> | ||
3 | Date: Tue, 27 Feb 2018 13:43:04 +0000 | ||
4 | Subject: [PATCH 4/9] jdk: Allow using a system-installed libpng | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | Patch stolen (and some typos corrected) from debian patch, | ||
10 | which itself was a backport from: | ||
11 | http://hg.openjdk.java.net/jdk9/jdk9/rev/bfc1c131e540 | ||
12 | http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/5e503831b142 | ||
13 | |||
14 | Issues fixed on top of debian patch: | ||
15 | * the default when --with-libpng= is not given works | ||
16 | * using the bundled libpng works | ||
17 | |||
18 | Upstream-Status: Backport | ||
19 | Signed-off-by: André Draszik <andre.draszik@jci.com> | ||
20 | --- | ||
21 | common/autoconf/libraries.m4 | 41 ++++++++++++++++++++++ | ||
22 | common/autoconf/spec.gmk.in | 1 + | ||
23 | jdk/make/lib/Awt2dLibraries.gmk | 12 +++++-- | ||
24 | .../native/sun/awt/splashscreen/splashscreen_png.c | 3 +- | ||
25 | 4 files changed, 52 insertions(+), 5 deletions(-) | ||
26 | |||
27 | diff --git a/common/autoconf/libraries.m4 b/common/autoconf/libraries.m4 | ||
28 | index 3f5f69b1..e419a050 100644 | ||
29 | --- a/common/autoconf/libraries.m4 | ||
30 | +++ b/common/autoconf/libraries.m4 | ||
31 | @@ -664,6 +664,47 @@ AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS], | ||
32 | fi | ||
33 | AC_SUBST(USE_EXTERNAL_LIBGIF) | ||
34 | |||
35 | + ############################################################################### | ||
36 | + # | ||
37 | + # Check for the png library | ||
38 | + # | ||
39 | + | ||
40 | + AC_ARG_WITH(libpng, [AS_HELP_STRING([--with-libpng], | ||
41 | + [use libpng from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])]) | ||
42 | + | ||
43 | + AC_CHECK_LIB(png, png_sig_cmp, | ||
44 | + [ LIBPNG_FOUND=yes ], | ||
45 | + [ LIBPNG_FOUND=no ]) | ||
46 | + | ||
47 | + AC_MSG_CHECKING([for which libpng to use]) | ||
48 | + | ||
49 | + # default is bundled | ||
50 | + DEFAULT_LIBPNG=bundled | ||
51 | + | ||
52 | + # | ||
53 | + # if user didn't specify, use DEFAULT_LIBPNG | ||
54 | + # | ||
55 | + if test "x${with_libpng}" = "x"; then | ||
56 | + with_libpng=${DEFAULT_LIBPNG} | ||
57 | + fi | ||
58 | + | ||
59 | + | ||
60 | + if test "x${with_libpng}" = "xbundled"; then | ||
61 | + USE_EXTERNAL_LIBPNG=false | ||
62 | + AC_MSG_RESULT([bundled]) | ||
63 | + elif test "x${with_libpng}" = "xsystem"; then | ||
64 | + if test "x${LIBPNG_FOUND}" = "xyes"; then | ||
65 | + USE_EXTERNAL_LIBPNG=true | ||
66 | + AC_MSG_RESULT([system]) | ||
67 | + else | ||
68 | + AC_MSG_RESULT([system not found]) | ||
69 | + AC_MSG_ERROR([--with-libpng=system specified, but no libpng found!]) | ||
70 | + fi | ||
71 | + else | ||
72 | + AC_MSG_ERROR([Invalid value of --with-libpng: ${with_libpng}, use 'system' or 'bundled']) | ||
73 | + fi | ||
74 | + AC_SUBST(USE_EXTERNAL_LIBPNG) | ||
75 | + | ||
76 | ############################################################################### | ||
77 | # | ||
78 | # Check for the zlib library | ||
79 | diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in | ||
80 | index 1c418f29..2c802c0a 100644 | ||
81 | --- a/common/autoconf/spec.gmk.in | ||
82 | +++ b/common/autoconf/spec.gmk.in | ||
83 | @@ -567,6 +567,7 @@ endif | ||
84 | ENABLE_JFR=@ENABLE_JFR@ | ||
85 | ENABLE_INTREE_EC=@ENABLE_INTREE_EC@ | ||
86 | USE_EXTERNAL_LIBJPEG:=@USE_EXTERNAL_LIBJPEG@ | ||
87 | +USE_EXTERNAL_LIBPNG:=@USE_EXTERNAL_LIBPNG@ | ||
88 | USE_EXTERNAL_LIBGIF:=@USE_EXTERNAL_LIBGIF@ | ||
89 | USE_EXTERNAL_LIBZ:=@USE_EXTERNAL_LIBZ@ | ||
90 | LIBZIP_CAN_USE_MMAP:=@LIBZIP_CAN_USE_MMAP@ | ||
91 | diff --git a/jdk/make/lib/Awt2dLibraries.gmk b/jdk/make/lib/Awt2dLibraries.gmk | ||
92 | index 8872a8e8..c577951a 100644 | ||
93 | --- a/jdk/make/lib/Awt2dLibraries.gmk | ||
94 | +++ b/jdk/make/lib/Awt2dLibraries.gmk | ||
95 | @@ -1219,7 +1219,6 @@ endif | ||
96 | ifndef BUILD_HEADLESS_ONLY | ||
97 | LIBSPLASHSCREEN_DIRS := \ | ||
98 | $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg \ | ||
99 | - $(JDK_TOPDIR)/src/share/native/sun/awt/libpng \ | ||
100 | $(JDK_TOPDIR)/src/share/native/sun/awt/splashscreen | ||
101 | |||
102 | ifeq ($(USE_EXTERNAL_LIBGIF), true) | ||
103 | @@ -1236,6 +1235,13 @@ ifndef BUILD_HEADLESS_ONLY | ||
104 | LIBJPEG_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg | ||
105 | endif | ||
106 | |||
107 | + ifeq ($(USE_EXTERNAL_LIBPNG), true) | ||
108 | + LIBPNG_LDFLAGS := -lpng | ||
109 | + else | ||
110 | + LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/sun/awt/libpng | ||
111 | + LIBPNG_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/awt/libpng | ||
112 | + endif | ||
113 | + | ||
114 | ifneq ($(OPENJDK_TARGET_OS), macosx) | ||
115 | LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt/splashscreen | ||
116 | else | ||
117 | @@ -1297,12 +1303,12 @@ ifndef BUILD_HEADLESS_ONLY | ||
118 | LANG := C, \ | ||
119 | OPTIMIZATION := LOW, \ | ||
120 | CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) \ | ||
121 | - $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS), \ | ||
122 | + $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(LIBPNG_CFLAGS), \ | ||
123 | MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libsplashscreen/mapfile-vers, \ | ||
124 | LDFLAGS := $(LDFLAGS_JDKLIB) \ | ||
125 | $(call SET_SHARED_LIBRARY_ORIGIN), \ | ||
126 | LDFLAGS_SUFFIX := $(LIBSPLASHSCREEN_LDFLAGS_SUFFIX) $(LIBZ) \ | ||
127 | - $(GIFLIB_LDFLAGS) $(LIBJPEG_LDFLAGS), \ | ||
128 | + $(GIFLIB_LDFLAGS) $(LIBJPEG_LDFLAGS) $(LIBPNG_LDFLAGS), \ | ||
129 | LDFLAGS_SUFFIX_solaris := -lc, \ | ||
130 | VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ | ||
131 | RC_FLAGS := $(RC_FLAGS) \ | ||
132 | diff --git a/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c b/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c | ||
133 | index 3599433e..5bf002ea 100644 | ||
134 | --- a/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c | ||
135 | +++ b/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c | ||
136 | @@ -25,8 +25,7 @@ | ||
137 | |||
138 | #include "splashscreen_impl.h" | ||
139 | |||
140 | -#include "../libpng/png.h" | ||
141 | - | ||
142 | +#include <png.h> | ||
143 | #include <setjmp.h> | ||
144 | |||
145 | #define SIG_BYTES 8 | ||
146 | -- | ||
147 | 2.16.2 | ||
148 | |||