8163102: Fix headless only configuration option

Reviewed-by: tbell
This commit is contained in:
Erik Joelsson 2016-09-26 14:56:35 +02:00
parent c7cf1788ed
commit d427383905
4 changed files with 77 additions and 74 deletions

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -28,7 +28,7 @@ include LauncherCommon.gmk
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, jdk, launcher/Launcher-java.desktop.gmk))
ifndef BUILD_HEADLESS_ONLY
ifeq ($(ENABLE_HEADLESS_ONLY), false)
$(eval $(call SetupBuildLauncher, appletviewer, \
MAIN_CLASS := sun.applet.Main, \
JAVA_ARGS := --add-modules ALL-DEFAULT, \

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -25,7 +25,7 @@
include LauncherCommon.gmk
ifndef BUILD_HEADLESS_ONLY
ifeq ($(ENABLE_HEADLESS_ONLY), false)
$(eval $(call SetupBuildLauncher, policytool, \
MAIN_CLASS := sun.security.tools.policytool.PolicyTool, \
LIBS_unix := $(X_LIBS), \

View File

@ -280,7 +280,7 @@ TARGETS += $(BUILD_LIBAWT)
################################################################################
ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),)
ifndef BUILD_HEADLESS_ONLY
ifeq ($(ENABLE_HEADLESS_ONLY), false)
LIBAWT_XAWT_DIRS := \
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt_xawt \
@ -511,7 +511,6 @@ TARGETS += $(BUILD_LIBJAVAJPEG)
################################################################################
ifeq ($(BUILD_HEADLESS), true)
# Mac and Windows only use the native AWT lib, do not build libawt_headless
ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx),)
@ -582,7 +581,6 @@ ifeq ($(BUILD_HEADLESS), true)
TARGETS += $(BUILD_LIBAWT_HEADLESS)
endif
endif
################################################################################
@ -780,7 +778,7 @@ else # OPENJDK_TARGET_OS not windows
ifneq ($(OPENJDK_TARGET_OS), solaris)
JAWT_LIBS += -lawt
endif
ifndef BUILD_HEADLESS_ONLY
ifeq ($(ENABLE_HEADLESS_ONLY), false)
JAWT_LIBS += -lawt_xawt
else
JAWT_LIBS += -lawt_headless
@ -809,7 +807,7 @@ else # OPENJDK_TARGET_OS not windows
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjawt, \
))
ifndef BUILD_HEADLESS_ONLY
ifeq ($(ENABLE_HEADLESS_ONLY), false)
$(BUILD_LIBJAWT): $(BUILD_LIBAWT_XAWT)
else
$(BUILD_LIBJAWT): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_headless$(SHARED_LIBRARY_SUFFIX)
@ -825,7 +823,7 @@ TARGETS += $(BUILD_LIBJAWT)
################################################################################
ifndef BUILD_HEADLESS_ONLY
ifeq ($(ENABLE_HEADLESS_ONLY), false)
LIBSPLASHSCREEN_DIRS := \
$(JDK_TOPDIR)/src/java.desktop/share/native/libjavajpeg \

View File

@ -39,6 +39,10 @@ DEF_STATIC_JNI_OnLoad
*/
JNIEXPORT jboolean JNICALL JAWT_GetAWT(JNIEnv* env, JAWT* awt)
{
#if defined(HEADLESS)
/* there are no AWT libs available at all */
return JNI_FALSE;
#else
if (awt == NULL) {
return JNI_FALSE;
}
@ -64,4 +68,5 @@ JNIEXPORT jboolean JNICALL JAWT_GetAWT(JNIEnv* env, JAWT* awt)
}
return JNI_TRUE;
#endif
}