From 02001567f0d8ba83d28b014b9e8564f1e594ff74 Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Thu, 19 Mar 2026 08:19:41 +0000 Subject: [PATCH] 8379425: Windows and macOS should not allow unsupported headless-only build Reviewed-by: erikj, aivanov, clanger --- make/autoconf/jdk-options.m4 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/make/autoconf/jdk-options.m4 b/make/autoconf/jdk-options.m4 index dafac618c59..89fcbc88521 100644 --- a/make/autoconf/jdk-options.m4 +++ b/make/autoconf/jdk-options.m4 @@ -102,6 +102,13 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS], CHECKING_MSG: [if we should build headless-only (no GUI)]) AC_SUBST(ENABLE_HEADLESS_ONLY) + # Avoid headless-only on macOS and Windows, it is not supported there + if test "x$ENABLE_HEADLESS_ONLY" = xtrue; then + if test "x$OPENJDK_TARGET_OS" = xwindows || test "x$OPENJDK_TARGET_OS" = xmacosx; then + AC_MSG_ERROR([headless-only is not supported on macOS and Windows]) + fi + fi + # should we linktime gc unused code sections in the JDK build ? if test "x$OPENJDK_TARGET_OS" = "xlinux"; then if test "x$OPENJDK_TARGET_CPU" = "xs390x" || test "x$OPENJDK_TARGET_CPU" = "xppc64le"; then