a patch to fix building OpenJDK with jhalfs

"Zhang Wen" ([email protected] via alfs-discuss Mailing List) <[email protected]> Mon, 27 Jan 2025 07:35:31 +0800
Newsgroups gmane.linux.lfs.automated
Message-ID <[email protected]>
The OpenJDK package requires JOBS=N instead of -jN as makeflags to build 
parallel, so it can't be built with jhalfs now. Attached is the patch 
I'm using and it works well for me, hope someone can review this patch.

diff --git a/BLFS/xsl/scripts.xsl b/BLFS/xsl/scripts.xsl
index b5a6fa5..104da13 100644
--- a/BLFS/xsl/scripts.xsl
+++ b/BLFS/xsl/scripts.xsl
@@ -193,7 +193,15 @@ export JH_KEEP_FILES="</xsl:text>
       parallel jobs. This supposes that ninja has been build with
       support for NINJAJOBS in lfs. We'll have to change that code
       if lfs changes its policy for ninja. -->
-      <xsl:text>export MAKEFLAGS="-j</xsl:text>
+      <xsl:text>export MAKEFLAGS="</xsl:text>
+      <xsl:choose>
+        <xsl:when test="@id='openjdk'">
+          <xsl:text>JOBS=</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+                <xsl:text>-j</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
        <xsl:choose>
          <xsl:when test="$jobs = 0">
            <xsl:text>$(nproc)"

-- 
http://lists.linuxfromscratch.org/sympa/info/alfs-discuss
Unsubscribe: See the above information page
0001-fix-openjdk-parallel-build.patch (text/x-patch, 1.1 KB)
From f0ffa7eed29750acdfc7bbda3967794f48ee64d0 Mon Sep 17 00:00:00 2001
From: Zhang Wen <[email protected]>
Date: Fri, 6 Dec 2024 18:55:33 +0800
Subject: [PATCH] fix openjdk parallel build

---
 BLFS/xsl/scripts.xsl | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/BLFS/xsl/scripts.xsl b/BLFS/xsl/scripts.xsl
index b5a6fa5..104da13 100644
--- a/BLFS/xsl/scripts.xsl
+++ b/BLFS/xsl/scripts.xsl
@@ -193,7 +193,15 @@ export JH_KEEP_FILES="</xsl:text>
      parallel jobs. This supposes that ninja has been build with
      support for NINJAJOBS in lfs. We'll have to change that code
      if lfs changes its policy for ninja. -->
-      <xsl:text>export MAKEFLAGS="-j</xsl:text>
+      <xsl:text>export MAKEFLAGS="</xsl:text>
+      <xsl:choose>
+        <xsl:when test="@id='openjdk'">
+          <xsl:text>JOBS=</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+                <xsl:text>-j</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
       <xsl:choose>
         <xsl:when test="$jobs = 0">
           <xsl:text>$(nproc)"
-- 
2.48.1