8329178: Clean up jdk.accessibility native compilation

Reviewed-by: erikj, prr
This commit is contained in:
Magnus Ihse Bursie 2024-03-28 06:23:35 +00:00
parent 4fa77a2ad4
commit d580bcf956
2 changed files with 81 additions and 82 deletions

View File

@ -26,29 +26,21 @@
include LauncherCommon.gmk include LauncherCommon.gmk
ifeq ($(call isTargetOs, windows), true) ifeq ($(call isTargetOs, windows), true)
ACCESSIBILITY_SRCDIR := $(TOPDIR)/src/jdk.accessibility/windows/native ACCESSIBILITY_SRCDIR := $(TOPDIR)/src/jdk.accessibility/windows/native
TOOLS_CFLAGS := $(addprefix -I, \
$(ACCESSIBILITY_SRCDIR)/include/bridge \
$(ACCESSIBILITY_SRCDIR)/common \
$(ACCESSIBILITY_SRCDIR)/toolscommon)
############################################################################## ##############################################################################
# jabswitch # Build jabswitch
##############################################################################
$(eval $(call SetupJdkExecutable, BUILD_JABSWITCH, \ $(eval $(call SetupJdkExecutable, BUILD_JABSWITCH, \
NAME := jabswitch, \ NAME := jabswitch, \
SRC := $(ACCESSIBILITY_SRCDIR)/jabswitch, \
INCLUDE_FILES := jabswitch.cpp, \
CFLAGS_FILTER_OUT := -Zc:wchar_t-, \
CXXFLAGS_FILTER_OUT := -Zc:wchar_t-, \ CXXFLAGS_FILTER_OUT := -Zc:wchar_t-, \
CFLAGS := -Zc:wchar_t -analyze- -Od -Gd -D_WINDOWS -D_UNICODE \
-DUNICODE -RTC1 -EHsc, \
CXXFLAGS := -Zc:wchar_t -analyze- -Od -Gd -D_WINDOWS -D_UNICODE \ CXXFLAGS := -Zc:wchar_t -analyze- -Od -Gd -D_WINDOWS -D_UNICODE \
-DUNICODE -RTC1 -EHsc, \ -DUNICODE -RTC1 -EHsc, \
DISABLED_WARNINGS_microsoft_jabswitch.cpp := 4267 4996, \ DISABLED_WARNINGS_microsoft_jabswitch.cpp := 4267 4996, \
LIBS := advapi32.lib version.lib user32.lib, \ LIBS_windows := advapi32.lib user32.lib version.lib, \
VERSIONINFO_RESOURCE := $(ACCESSIBILITY_SRCDIR)/common/AccessBridgeStatusWindow.rc, \ VERSIONINFO_RESOURCE := \
$(ACCESSIBILITY_SRCDIR)/common/AccessBridgeStatusWindow.rc, \
MANIFEST := $(ACCESSIBILITY_SRCDIR)/jabswitch/jabswitch.manifest, \ MANIFEST := $(ACCESSIBILITY_SRCDIR)/jabswitch/jabswitch.manifest, \
MANIFEST_VERSION := $(VERSION_NUMBER_FOUR_POSITIONS), \ MANIFEST_VERSION := $(VERSION_NUMBER_FOUR_POSITIONS), \
)) ))
@ -56,47 +48,54 @@ ifeq ($(call isTargetOs, windows), true)
TARGETS += $(BUILD_JABSWITCH) TARGETS += $(BUILD_JABSWITCH)
############################################################################## ##############################################################################
# jaccessinspector # Setup rules to create 32/64 bit version of jaccessinspector
#
define SetupInspector
# Parameter 1 File name suffix # Parameter 1 File name suffix
# Parameter 2 ACCESSBRIDGE_ARCH_ -D suffix # Parameter 2 ACCESSBRIDGE_ARCH_ -D suffix
##############################################################################
define SetupInspector
$$(eval $$(call SetupJdkExecutable, BUILD_JACCESSINSPECTOR$1, \ $$(eval $$(call SetupJdkExecutable, BUILD_JACCESSINSPECTOR$1, \
NAME := jaccessinspector$1, \ NAME := jaccessinspector$1, \
SRC := $(ACCESSIBILITY_SRCDIR)/jaccessinspector $(ACCESSIBILITY_SRCDIR)/common \ SRC := jaccessinspector, \
$(ACCESSIBILITY_SRCDIR)/toolscommon $(ACCESSIBILITY_SRCDIR)/bridge, \ EXTRA_SRC := \
CFLAGS := $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 -EHsc, \ bridge \
CXXFLAGS := $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 -EHsc, \ common \
LDFLAGS := -stack:655360, \ toolscommon, \
LIBS := advapi32.lib user32.lib, \ EXTRA_HEADER_DIRS := include/bridge, \
VERSIONINFO_RESOURCE := $(ACCESSIBILITY_SRCDIR)/jaccessinspector/jaccessinspectorWindow.rc, \ CFLAGS := -DACCESSBRIDGE_ARCH_$2 -EHsc, \
CXXFLAGS := -DACCESSBRIDGE_ARCH_$2 -EHsc, \
LDFLAGS_windows := -stack:655360, \
LIBS_windows := advapi32.lib user32.lib, \
VERSIONINFO_RESOURCE := \
$(ACCESSIBILITY_SRCDIR)/jaccessinspector/jaccessinspectorWindow.rc, \
)) ))
TARGETS += $$(BUILD_JACCESSINSPECTOR$1) TARGETS += $$(BUILD_JACCESSINSPECTOR$1)
endef endef
############################################################################## ##############################################################################
# jaccesswalker # Setup rules to create 32/64 bit version of jaccesswalker
define SetupWalker
# Parameter 1 File name suffix # Parameter 1 File name suffix
# Parameter 2 ACCESSBRIDGE_ARCH_ -D suffix # Parameter 2 ACCESSBRIDGE_ARCH_ -D suffix
##############################################################################
define SetupWalker
$$(eval $$(call SetupJdkExecutable, BUILD_JACCESSWALKER$1, \ $$(eval $$(call SetupJdkExecutable, BUILD_JACCESSWALKER$1, \
NAME := jaccesswalker$1, \ NAME := jaccesswalker$1, \
SRC := $(ACCESSIBILITY_SRCDIR)/jaccesswalker $(ACCESSIBILITY_SRCDIR)/common \ SRC := jaccesswalker, \
$(ACCESSIBILITY_SRCDIR)/toolscommon $(ACCESSIBILITY_SRCDIR)/bridge, \ EXTRA_SRC := \
CFLAGS := $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 -EHsc, \ bridge \
CXXFLAGS := $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 -EHsc, \ common \
LDFLAGS := -stack:655360, \ toolscommon, \
LIBS := advapi32.lib comctl32.lib gdi32.lib user32.lib, \ EXTRA_HEADER_DIRS := include/bridge, \
VERSIONINFO_RESOURCE := $(ACCESSIBILITY_SRCDIR)/jaccesswalker/jaccesswalkerWindow.rc, \ CFLAGS := -DACCESSBRIDGE_ARCH_$2 -EHsc, \
CXXFLAGS := -DACCESSBRIDGE_ARCH_$2 -EHsc, \
LDFLAGS_windows := -stack:655360, \
LIBS_windows := advapi32.lib comctl32.lib gdi32.lib user32.lib, \
VERSIONINFO_RESOURCE := \
$(ACCESSIBILITY_SRCDIR)/jaccesswalker/jaccesswalkerWindow.rc, \
)) ))
TARGETS += $$(BUILD_JACCESSWALKER$1) TARGETS += $$(BUILD_JACCESSWALKER$1)
endef endef
ifeq ($(call isTargetCpuBits, 32), true) ifeq ($(call isTargetCpuBits, 32), true)
@ -108,7 +107,4 @@ ifeq ($(call isTargetOs, windows), true)
$(eval $(call SetupInspector,,64)) $(eval $(call SetupInspector,,64))
$(eval $(call SetupWalker,,64)) $(eval $(call SetupWalker,,64))
endif endif
endif endif
################################################################################

View File

@ -28,77 +28,83 @@ include LibCommon.gmk
################################################################################ ################################################################################
ifeq ($(call isTargetOs, windows), true) ifeq ($(call isTargetOs, windows), true)
ACCESSIBILITY_SRCDIR := $(TOPDIR)/src/jdk.accessibility/windows/native ACCESSIBILITY_SRCDIR := $(TOPDIR)/src/jdk.accessibility/windows/native
##############################################################################
# Setup rules to create 32/64 bit version of javaaccessbridge
#
# Parameter 1 Suffix
# Parameter 2 ACCESSBRIDGE_ARCH_ suffix
##############################################################################
define SetupJavaDLL define SetupJavaDLL
# Parameter 1 Suffix $(call SetupJdkLibrary, BUILD_LIBJAVAACCESSBRIDGE$1, \
# Parameter 2 ACCESSBRIDGE_ARCH_ suffix
$(call SetupJdkLibrary, BUILD_JAVAACCESSBRIDGE$1, \
NAME := javaaccessbridge$1, \ NAME := javaaccessbridge$1, \
SRC := libjavaaccessbridge, \ SRC := libjavaaccessbridge, \
EXTRA_SRC := common, \ EXTRA_SRC := common, \
OPTIMIZATION := LOW, \ OPTIMIZATION := LOW, \
DISABLED_WARNINGS_microsoft := 4311 4302 4312, \ DISABLED_WARNINGS_microsoft := 4311 4302 4312, \
CFLAGS_FILTER_OUT := -MD, \
CXXFLAGS_FILTER_OUT := -MD, \ CXXFLAGS_FILTER_OUT := -MD, \
CFLAGS := -MT -DACCESSBRIDGE_ARCH_$2, \
CXXFLAGS := -MT -DACCESSBRIDGE_ARCH_$2, \ CXXFLAGS := -MT -DACCESSBRIDGE_ARCH_$2, \
EXTRA_HEADER_DIRS := \ EXTRA_HEADER_DIRS := \
include/bridge \ include/bridge \
java.desktop:include, \ java.desktop:include, \
LIBS := kernel32.lib user32.lib gdi32.lib \ JDK_LIBS_windows := $(SUPPORT_OUTPUTDIR)/native/java.desktop/libjawt/jawt.lib, \
winspool.lib comdlg32.lib advapi32.lib shell32.lib \ LIBS_windows := advapi32.lib comdlg32.lib gdi32.lib kernel32.lib \
$(SUPPORT_OUTPUTDIR)/native/java.desktop/libjawt/jawt.lib \ odbc32.lib odbccp32.lib ole32.lib oleaut32.lib shell32.lib \
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib, \ user32.lib uuid.lib winspool.lib, \
VERSIONINFO_RESOURCE := $(ACCESSIBILITY_SRCDIR)/common/AccessBridgeStatusWindow.rc, \ VERSIONINFO_RESOURCE := \
$(ACCESSIBILITY_SRCDIR)/common/AccessBridgeStatusWindow.rc, \
) )
$$(BUILD_JAVAACCESSBRIDGE$1): $(call FindStaticLib, java.desktop, jawt, /libjawt) $$(BUILD_LIBJAVAACCESSBRIDGE$1): $(call FindStaticLib, java.desktop, jawt, /libjawt)
TARGETS += $$(BUILD_JAVAACCESSBRIDGE$1) TARGETS += $$(BUILD_LIBJAVAACCESSBRIDGE$1)
endef endef
##############################################################################
# Setup rules to create 32/64 bit version of windowsaccessbridge
#
# Parameter 1 Suffix
# Parameter 2 ACCESSBRIDGE_ARCH_ suffix
##############################################################################
define SetupWinDLL define SetupWinDLL
# Parameter 1 Suffix $(call SetupJdkLibrary, BUILD_LIBWINDOWSACCESSBRIDGE$1, \
# Parameter 2 ACCESSBRIDGE_ARCH_ suffix
$(call SetupJdkLibrary, BUILD_WINDOWSACCESSBRIDGE$1, \
NAME := windowsaccessbridge$1, \ NAME := windowsaccessbridge$1, \
SRC := libwindowsaccessbridge, \ SRC := libwindowsaccessbridge, \
EXTRA_SRC := common, \ EXTRA_SRC := common, \
OPTIMIZATION := LOW, \ OPTIMIZATION := LOW, \
DISABLED_WARNINGS_microsoft_WinAccessBridge.cpp := 4302 4311, \ DISABLED_WARNINGS_microsoft_WinAccessBridge.cpp := 4302 4311, \
CFLAGS := -DACCESSBRIDGE_ARCH_$2, \
CXXFLAGS := -DACCESSBRIDGE_ARCH_$2, \ CXXFLAGS := -DACCESSBRIDGE_ARCH_$2, \
EXTRA_HEADER_DIRS := \ EXTRA_HEADER_DIRS := \
include/bridge, \ include/bridge, \
LDFLAGS := \ LDFLAGS := \
-def:$(ACCESSIBILITY_SRCDIR)/libwindowsaccessbridge/WinAccessBridge.DEF, \ -def:$(ACCESSIBILITY_SRCDIR)/libwindowsaccessbridge/WinAccessBridge.DEF, \
LIBS := kernel32.lib user32.lib gdi32.lib \ LIBS_windows := advapi32.lib comdlg32.lib gdi32.lib kernel32.lib \
winspool.lib comdlg32.lib advapi32.lib shell32.lib \ odbc32.lib odbccp32.lib ole32.lib oleaut32.lib shell32.lib \
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib, \ user32.lib uuid.lib winspool.lib, \
VERSIONINFO_RESOURCE := $(ACCESSIBILITY_SRCDIR)/common/AccessBridgeStatusWindow.rc, \ VERSIONINFO_RESOURCE := \
$(ACCESSIBILITY_SRCDIR)/common/AccessBridgeStatusWindow.rc, \
) )
TARGETS += $$(BUILD_WINDOWSACCESSBRIDGE$1) TARGETS += $$(BUILD_LIBWINDOWSACCESSBRIDGE$1)
endef
define SetupAccessBridgeSysInfo
$(call SetupJdkLibrary, BUILD_ACCESSBRIDGESYSINFO, \
NAME := jabsysinfo, \
OPTIMIZATION := LOW, \
VERSIONINFO_RESOURCE := $(ACCESSIBILITY_SRCDIR)/common/AccessBridgeStatusWindow.rc, \
)
TARGETS += $$(BUILD_ACCESSBRIDGESYSINFO)
endef endef
ifeq ($(call isTargetCpuBits, 32), true) ifeq ($(call isTargetCpuBits, 32), true)
$(eval $(call SetupAccessBridgeSysInfo)) ############################################################################
# Build libjabsysinfo
############################################################################
$(eval $(call SetupJdkLibrary, BUILD_LIBJABSYSINFO, \
NAME := jabsysinfo, \
OPTIMIZATION := LOW, \
VERSIONINFO_RESOURCE := \
$(ACCESSIBILITY_SRCDIR)/common/AccessBridgeStatusWindow.rc, \
)
TARGETS += $(BUILD_LIBJABSYSINFO)
endif
ifeq ($(call isTargetCpuBits, 32), true)
$(eval $(call SetupJavaDLL,-32,32)) $(eval $(call SetupJavaDLL,-32,32))
$(eval $(call SetupJavaDLL,,LEGACY)) $(eval $(call SetupJavaDLL,,LEGACY))
$(eval $(call SetupWinDLL,-32,32)) $(eval $(call SetupWinDLL,-32,32))
@ -107,7 +113,4 @@ ifeq ($(call isTargetOs, windows), true)
$(eval $(call SetupJavaDLL,,64)) $(eval $(call SetupJavaDLL,,64))
$(eval $(call SetupWinDLL,-64,64)) $(eval $(call SetupWinDLL,-64,64))
endif endif
endif endif
################################################################################