Skip to contentSkip to conversation

icedtea7-native: compiling without x11

PATCH In review Jens Rehsack 1 participant 1 message Oct 15, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 2/6 icedtea7-native: compiling without x11

Allow building icedtea7 without any X11 dependency.

This affects the native part only which is required to bootstrap openjdk-8-native for cross-compiling openjdk-8, but should be adoptable for cross-compiled recipe as well as for openjdk-6.

---
 recipes-core/icedtea/icedtea7-native.inc           | 14 ++++-
 .../openjdk-7-03b147/allow-headless-build.patch    | 72 ++++++++++++++++++++++
 ...-disable-sun.applet-for-tools-in-headless.patch | 10 +++
 .../icedtea-disable-x11-in-headless.patch          | 15 +++++
 recipes-core/icedtea/openjdk-7-release-03b147.inc  | 10 +++
 5 files changed, 119 insertions(+), 2 deletions(-)
 create mode 100644 recipes-core/icedtea/openjdk-7-03b147/allow-headless-build.patch
 create mode 100644 recipes-core/icedtea/openjdk-7-03b147/icedtea-disable-sun.applet-for-tools-in-headless.patch
 create mode 100644 recipes-core/icedtea/openjdk-7-03b147/icedtea-disable-x11-in-headless.patch
recipes-core/icedtea/icedtea7-native.inc +12 -2
index b29fd34..69dd0ae 100644
@@ -5,13 +5,18 @@ INC_PR = "r1"
 
 DEPENDS = "virtual/javac-native virtual/java-native classpath-native \
            rhino-native ant-native libxslt-native attr-native \
-           libx11-native xproto-native libxt-native libxext-native libxrender-native \
            giflib-native jpeg-native libpng-native \
            glib-2.0-native freetype-native zlib-native \
-           fontconfig-native zip-native alsa-lib-native \
+           fontconfig-native zip-native \
 	   unzip-native \
           "
 
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[x11] = ",--disable-headful,libx11-native xproto-native libxt-native libxext-native libxrender-native"
+
+OEMAKE_BUILD_HEADLESS_ONLY = "${@base_contains('PACKAGECONFIG', 'x11', '', 'BUILD_HEADLESS_ONLY=1', d)}"
+CFLAGS_append = "${@base_contains('PACKAGECONFIG', 'x11', '', ' -DHEADLESS=true', d)}"
+
 inherit native java autotools
 
 JAVA_HOME[unexport] = "1"
@@ -27,6 +32,7 @@ SRC_URI = " \
   ${LANGTOOLS_URI} \
   ${ICEDTEA_PATCHES} \
   ${OPENJDK_PATCHES} \
+  file://allow-headless-build.patch;striplevel=0 \
   "
 
 S = "${WORKDIR}/${ICEDTEA}"
@@ -124,6 +130,8 @@ do_configure_prepend() {
 	done
 }
 
+POST_CONFIGURE_CLEAN_X11 = "${@base_contains('PACKAGECONFIG', 'x11', '', 'rm openjdk*/jdk/src/solaris/classes/sun/awt/X11/*.java', d)}"
+
 do_configure_append() {
 	oe_runmake patch-fsg
 
@@ -143,6 +151,7 @@ do_configure_append() {
 			-e"s|g++\$(GCC_SUFFIX)|${CXX}|" \
 			$F
 	done
+	${POST_CONFIGURE_CLEAN_X11}
 	oe_runmake patch-boot
 }
 
@@ -152,6 +161,7 @@ EXTRA_OEMAKE = ' \
                 OE_CXXFLAGS="${CXXFLAGS}" \
                 OE_LDFLAGS="${LDFLAGS}" \
                 ZIPEXE="${STAGING_BINDIR_NATIVE}/zip" \
+		${OEMAKE_BUILD_HEADLESS_ONLY} \
                '
 
 do_compile() {
recipes-core/icedtea/openjdk-7-03b147/allow-headless-build.patch new file +72 -0

72 lines not on this page · raw message

recipes-core/icedtea/openjdk-7-03b147/icedtea-disable-sun.applet-for-tools-in-headless.patch new file +10 -0
new file mode 100644
index 0000000..336043f
@@ -0,0 +1,10 @@
+--- openjdk/jdk/make/common/Release.gmk.orig	2015-08-20 10:08:34.631526528 +0200
++++ openjdk/jdk/make/common/Release.gmk	2015-08-20 10:10:13.823526901 +0200
+@@ -340,7 +340,6 @@
+ 	sun/security/tools/SignatureFile.class \
+ 	sun/security/tools/TimestampedSigner.class \
+ 	sun/rmi/rmic		\
+-	sun/applet		\
+ 	sun/jvmstat		\
+ 	com/sun/javadoc		\
+ 	com/sun/jdi		\
recipes-core/icedtea/openjdk-7-03b147/icedtea-disable-x11-in-headless.patch new file +15 -0
new file mode 100644
index 0000000..b7cf7a3
@@ -0,0 +1,15 @@
+--- openjdk/jdk/make/sun/awt/FILES_c_unix.gmk.orig	2015-08-19 11:53:47.209867982 +0200
++++ openjdk/jdk/make/sun/awt/FILES_c_unix.gmk	2015-08-19 11:57:48.677868529 +0200
+@@ -207,12 +207,6 @@
+ 	awt_MToolkit.c \
+ 	fontpath.c \
+ 	VDrawingArea.c \
+-	X11Color.c \
+-	X11Renderer.c \
+-	X11PMBlitLoops.c \
+-	X11SurfaceData.c \
+-	X11FontScaler_md.c \
+-	X11TextRenderer_md.c \
+         OGLBlitLoops.c \
+         OGLBufImgOps.c \
+         OGLContext.c \
recipes-core/icedtea/openjdk-7-release-03b147.inc +10 -0
index 01e7a3d..98266f7 100644
@@ -82,8 +82,17 @@ OPENJDK_PATCHES = " \
 	file://icedtea-flags.patch;apply=no \
 	file://icedtea-openjdk-remove-currency-data-generation-expi.patch;apply=no \
 	file://icedtea-change-to-gdb-debug-format.patch;apply=no \
+	file://icedtea-disable-x11-in-headless.patch;apply=no \
+	file://icedtea-disable-sun.applet-for-tools-in-headless.patch;apply=no \
         "
 
+OPENJDK_HEADLESS_PATCHES = " \
+	patches/icedtea-disable-x11-in-headless.patch \
+	patches/icedtea-disable-sun.applet-for-tools-in-headless.patch \
+	"
+
+CLEAN_X11_DISTRIBUTION_PATCH = "${@base_contains('PACKAGECONFIG', 'x11', '', '${OPENJDK_HEADLESS_PATCHES}', d)}"
+
 export DISTRIBUTION_PATCHES = " \
         patches/icedtea-ecj-disable-compilation.patch \
 	patches/icedtea-unbreak-float.patch \
@@ -93,4 +102,5 @@ export DISTRIBUTION_PATCHES = " \
 	patches/icedtea-flags.patch \
 	patches/icedtea-openjdk-remove-currency-data-generation-expi.patch \
 	patches/icedtea-change-to-gdb-debug-format.patch \
+	${CLEAN_X11_DISTRIBUTION_PATCH} \
         "
Signature · 5 lines
2.3.8 (Apple Git-58)


-- 
Jens Rehsack - [email protected]