git: 5c22d5b7a120 - main - java/openjdk11: honour MAKE_JOBS_NUMBER

From: Ronald Klop <ronald_at_FreeBSD.org>
Date: Sat, 20 Sep 2025 13:19:53 UTC
The branch main has been updated by ronald:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5c22d5b7a120ba4aad20ebaf9a4d5492136f640c

commit 5c22d5b7a120ba4aad20ebaf9a4d5492136f640c
Author:     Ronald Klop <ronald@FreeBSD.org>
AuthorDate: 2025-09-19 14:19:31 +0000
Commit:     Ronald Klop <ronald@FreeBSD.org>
CommitDate: 2025-09-20 13:19:10 +0000

    java/openjdk11: honour MAKE_JOBS_NUMBER
    
    fixes flapping builds
    
    similar to fixes in the openjdk17 Makefile
---
 java/openjdk11/Makefile | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/java/openjdk11/Makefile b/java/openjdk11/Makefile
index a5d9e29dc2aa..8951bf84ea87 100644
--- a/java/openjdk11/Makefile
+++ b/java/openjdk11/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=	openjdk
 DISTVERSIONPREFIX=	jdk-
 DISTVERSION=	${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_PATCH_VERSION}+${JDK_BUILD_NUMBER}-${BSD_JDK_VERSION}
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	java devel
 PKGNAMESUFFIX?=	${JDK_MAJOR_VERSION}
 
@@ -40,6 +40,8 @@ GH_PROJECT=	jdk11u
 
 NO_CCACHE=	yes
 
+# Suppress passing -j to do-build target via Mk/bsd.port.mk
+# In the JDK build the number of parallel jobs is passed in via configure --with-num-cores=N
 _MAKE_JOBS=	#
 MAKE_ENV=	LANG="C" \
 		LC_ALL="C" \
@@ -49,6 +51,7 @@ MAKE_ENV=	LANG="C" \
 		CC=${CC} \
 		CXX=${CXX} \
 		CPP=${CPP} \
+		LOG=cmdlines \
 		MAKEFLAGS=""
 
 JDK_OSARCH=	bsd-${ARCH:S/amd64/x86_64/:C/armv.*/arm/:S/i386/x86/:S/powerpc/ppc/}
@@ -102,6 +105,7 @@ CONFIGURE_ARGS=	--with-boot-jdk=${BOOTSTRAPJDKDIR} \
 		--with-giflib-include=${LOCALBASE}/include \
 		--with-giflib-lib=${LOCALBASE}/lib \
 		--with-libpng=system \
+		--with-num-cores=${MAKE_JOBS_NUMBER} \
 		--with-zlib=system \
 		--with-lcms=system \
 		--x-includes=${LOCALBASE}/include \
@@ -125,6 +129,11 @@ JDK_BUILD_TYPE=		release
 
 .include <bsd.port.pre.mk>
 
+# portsfallout.com shows flapping builds on 13.5 and 14.2
+.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1403000
+MAKE_JOBS_UNSAFE=	yes
+.endif
+
 .if !${PORT_OPTIONS:MCUPS}
 MASTER_SITES+=	https://codeload.github.com/OpenPrinting/cups/tar.gz/v${CUPS_INC_VER}?dummy=/:cups
 .endif