aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-core/openjdk/patches-openjdk-14/0001-make-autoconf-remove-hard-dependency-on-cups.patch
blob: 51999b6227eda341e47ea1a06be0105cc5410b2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
From 3f77089a24c5073c59321d0ac5fdfe5057d8c06b Mon Sep 17 00:00:00 2001
From: Richard Leitner <richard.leitner@skidata.com>
Date: Wed, 13 May 2020 13:34:33 +0200
Subject: [PATCH 1/2] make: autoconf: remove hard dependency on cups

In our native build we don't want to have a dependency on cups,
therefore enable --without-cups for all platforms.

Upstream-Status: Inappropriate [disable feature]
Signed-off-by: Richard Leitner <richard.leitner@skidata.com>
---
 make/autoconf/lib-cups.m4   | 30 ++++++++++++------------------
 make/autoconf/libraries.m4  |  8 --------
 make/autoconf/spec.gmk.in   |  1 +
 make/lib/Awt2dLibraries.gmk | 13 ++++++++++++-
 4 files changed, 25 insertions(+), 27 deletions(-)

diff --git a/make/autoconf/lib-cups.m4 b/make/autoconf/lib-cups.m4
index 0a7df8b381..e8b6a683a3 100644
--- a/make/autoconf/lib-cups.m4
+++ b/make/autoconf/lib-cups.m4
@@ -34,25 +34,18 @@ AC_DEFUN_ONCE([LIB_SETUP_CUPS],
   AC_ARG_WITH(cups-include, [AS_HELP_STRING([--with-cups-include],
       [specify directory for the cups include files])])
 
-  if test "x$NEEDS_LIB_CUPS" = xfalse; then
-    if (test "x${with_cups}" != x && test "x${with_cups}" != xno) || \
-        (test "x${with_cups_include}" != x && test "x${with_cups_include}" != xno); then
-      AC_MSG_WARN([[cups not used, so --with-cups[-*] is ignored]])
-    fi
+
+  WITH_CUPS="false"
+  if test "x${with_cups}" = xno || test "x${with_cups_include}" = xno; then
+    AC_MSG_WARN([Disable the use of cups.])
     CUPS_CFLAGS=
   else
-    CUPS_FOUND=no
-
-    if test "x${with_cups}" = xno || test "x${with_cups_include}" = xno; then
-      AC_MSG_ERROR([It is not possible to disable the use of cups. Remove the --without-cups option.])
-    fi
-
     if test "x${with_cups}" != x; then
       AC_MSG_CHECKING([for cups headers])
       if test -s "${with_cups}/include/cups/cups.h"; then
         CUPS_CFLAGS="-I${with_cups}/include"
-        CUPS_FOUND=yes
-        AC_MSG_RESULT([$CUPS_FOUND])
+        WITH_CUPS="true"
+        AC_MSG_RESULT([$WITH_CUPS])
       else
         AC_MSG_ERROR([Can't find 'include/cups/cups.h' under ${with_cups} given with the --with-cups option.])
       fi
@@ -61,25 +54,26 @@ AC_DEFUN_ONCE([LIB_SETUP_CUPS],
       AC_MSG_CHECKING([for cups headers])
       if test -s "${with_cups_include}/cups/cups.h"; then
         CUPS_CFLAGS="-I${with_cups_include}"
-        CUPS_FOUND=yes
-        AC_MSG_RESULT([$CUPS_FOUND])
+        WITH_CUPS="true"
+        AC_MSG_RESULT([$WITH_CUPS])
       else
         AC_MSG_ERROR([Can't find 'cups/cups.h' under ${with_cups_include} given with the --with-cups-include option.])
       fi
     fi
-    if test "x$CUPS_FOUND" = xno; then
+    if test "x$WITH_CUPS" = "xfalse"; then
       # Are the cups headers installed in the default /usr/include location?
       AC_CHECK_HEADERS([cups/cups.h cups/ppd.h], [
-          CUPS_FOUND=yes
+          WITH_CUPS="true"
           CUPS_CFLAGS=
           DEFAULT_CUPS=yes
       ])
     fi
-    if test "x$CUPS_FOUND" = xno; then
+    if test "x$WITH_CUPS" = "xfalse"; then
       HELP_MSG_MISSING_DEPENDENCY([cups])
       AC_MSG_ERROR([Could not find cups! $HELP_MSG ])
     fi
   fi
 
   AC_SUBST(CUPS_CFLAGS)
+  AC_SUBST(WITH_CUPS)
 ])
diff --git a/make/autoconf/libraries.m4 b/make/autoconf/libraries.m4
index 5f16f08b20..8d64c6e8b7 100644
--- a/make/autoconf/libraries.m4
+++ b/make/autoconf/libraries.m4
@@ -59,14 +59,6 @@ AC_DEFUN_ONCE([LIB_DETERMINE_DEPENDENCIES],
     NEEDS_LIB_FONTCONFIG=true
   fi
 
-  # Check if cups is needed
-  if test "x$OPENJDK_TARGET_OS" = xwindows; then
-    # Windows have a separate print system
-    NEEDS_LIB_CUPS=false
-  else
-    NEEDS_LIB_CUPS=true
-  fi
-
   # A custom hook may have set this already
   if test "x$NEEDS_LIB_FREETYPE" = "x"; then
     NEEDS_LIB_FREETYPE=true
diff --git a/make/autoconf/spec.gmk.in b/make/autoconf/spec.gmk.in
index 3a85303e80..b1253daa5d 100644
--- a/make/autoconf/spec.gmk.in
+++ b/make/autoconf/spec.gmk.in
@@ -370,6 +370,7 @@ FREETYPE_LIBS:=@FREETYPE_LIBS@
 FREETYPE_CFLAGS:=@FREETYPE_CFLAGS@
 FONTCONFIG_CFLAGS:=@FONTCONFIG_CFLAGS@
 CUPS_CFLAGS:=@CUPS_CFLAGS@
+WITH_CUPS := @WITH_CUPS@
 ALSA_LIBS:=@ALSA_LIBS@
 ALSA_CFLAGS:=@ALSA_CFLAGS@
 LIBFFI_LIBS:=@LIBFFI_LIBS@
diff --git a/make/lib/Awt2dLibraries.gmk b/make/lib/Awt2dLibraries.gmk
index a38d416673..d0eeab35c6 100644
--- a/make/lib/Awt2dLibraries.gmk
+++ b/make/lib/Awt2dLibraries.gmk
@@ -141,7 +141,11 @@ ifeq ($(call isTargetOs, windows), true)
 endif
 
 ifeq ($(call isTargetOs, solaris linux macosx aix), true)
-  LIBAWT_EXFILES += awt_Font.c CUPSfuncs.c fontpath.c X11Color.c
+  LIBAWT_EXFILES += awt_Font.c fontpath.c X11Color.c
+endif
+
+ifeq ($(WITH_CUPS), false)
+  LIBAWT_EXFILES += CUPSfuncs.c
 endif
 
 ifeq ($(call isTargetOs, macosx), true)
@@ -461,10 +465,17 @@ ifeq ($(call isTargetOs, windows macosx), false)
   LIBAWT_HEADLESS_CFLAGS := $(CUPS_CFLAGS) $(FONTCONFIG_CFLAGS) $(X_CFLAGS) \
       -DHEADLESS=true
 
+
+  LIBAWT_HEADLESS_EXFILES :=
+  ifeq ($(WITH_CUPS), false)
+    LIBAWT_HEADLESS_EXFILES += CUPSfuncs.c
+  endif
+
   $(eval $(call SetupJdkLibrary, BUILD_LIBAWT_HEADLESS, \
       NAME := awt_headless, \
       EXTRA_SRC := $(LIBAWT_HEADLESS_EXTRA_SRC), \
       EXCLUDES := $(LIBAWT_HEADLESS_EXCLUDES), \
+      EXCLUDE_FILES := $(LIBAWT_HEADLESS_EXFILES), \
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) \
           $(LIBAWT_HEADLESS_CFLAGS), \
-- 
2.26.2