Re: a patch to fix building OpenJDK with jhalfs

"Pierre Labastie" ([email protected] via alfs-discuss Mailing List) <[email protected]> Sat, 01 Feb 2025 12:20:56 +0100
Newsgroups gmane.linux.lfs.automated
Message-ID <[email protected]>
Le lundi 27 janvier 2025 à 07:35 +0800, Zhang Wen a écrit :
> 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)"

This should work, but actually it is better to change the blfs book
itself by adding "unset MAKEFLAGS" and passing --jobs=$(nproc) to
configure. Note that jhalfs has recently learned how to treat $(nproc)
(in a <replaceable> tag), that is replace it with the number of jobs
set by the user (or $(nproc) if the user sets $jobs to 0.)

Regards
Pierre

-- 
http://lists.linuxfromscratch.org/sympa/info/alfs-discuss
Unsubscribe: See the above information page