undefect. CWE-407 — 63 sites patched across 27 ecosystems
Authors: russell@unturf.com · brackishbert@gmail.com · foxhop.net · TimeHexOn.com Patches, unit tests, benchmarks, whitepaper, and outreach briefs. Public domain — no copyright claimed. Use freely.
This commit is contained in:
commit
0a580b313d
70422 changed files with 17213626 additions and 0 deletions
84
make/modules/java.desktop/Copy.gmk
Normal file
84
make/modules/java.desktop/Copy.gmk
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
#
|
||||
# Copyright (c) 2014, 2025, 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
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
|
||||
include CopyCommon.gmk
|
||||
include Modules.gmk
|
||||
|
||||
$(CONF_DST_DIR)/sound.properties: $(TOPDIR)/src/java.desktop/share/conf/sound.properties
|
||||
$(call install-file)
|
||||
|
||||
TARGETS += $(CONF_DST_DIR)/sound.properties
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Copy property files from sun/print to LIB_DST_DIR
|
||||
#
|
||||
PSFONTPROPFILE_SRC_DIR := $(TOPDIR)/src/java.desktop/share/conf
|
||||
PSFONTPROPFILE_SRCS := $(wildcard $(PSFONTPROPFILE_SRC_DIR)/psfont*.properties*)
|
||||
PSFONTPROPFILE_TARGET_FILES := $(subst $(PSFONTPROPFILE_SRC_DIR),$(LIB_DST_DIR),$(PSFONTPROPFILE_SRCS))
|
||||
|
||||
$(LIB_DST_DIR)/%: $(PSFONTPROPFILE_SRC_DIR)/%
|
||||
$(call install-file)
|
||||
|
||||
TARGETS += $(PSFONTPROPFILE_TARGET_FILES)
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Copy and filter the legal files depending on what 3rd party components are
|
||||
# bundled or linked from the OS.
|
||||
#
|
||||
ifeq ($(USE_EXTERNAL_LIBJPEG), true)
|
||||
LEGAL_EXCLUDES += jpeg.md
|
||||
endif
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LIBGIF), true)
|
||||
LEGAL_EXCLUDES += giflib.md
|
||||
endif
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LIBPNG), true)
|
||||
LEGAL_EXCLUDES += libpng.md
|
||||
endif
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LCMS), true)
|
||||
LEGAL_EXCLUDES += lcms.md
|
||||
endif
|
||||
|
||||
ifeq ($(FREETYPE_TO_USE), system)
|
||||
LEGAL_EXCLUDES += freetype.md
|
||||
endif
|
||||
|
||||
ifeq ($(USE_EXTERNAL_HARFBUZZ), true)
|
||||
LEGAL_EXCLUDES += harfbuzz.md
|
||||
endif
|
||||
|
||||
$(eval $(call SetupCopyLegalFiles, COPY_LEGAL, \
|
||||
EXCLUDES := $(LEGAL_EXCLUDES), \
|
||||
))
|
||||
|
||||
TARGETS += $(COPY_LEGAL)
|
||||
|
||||
################################################################################
|
||||
32
make/modules/java.desktop/Gendata.gmk
Normal file
32
make/modules/java.desktop/Gendata.gmk
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#
|
||||
# Copyright (c) 2011, 2025, 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
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
|
||||
include GendataCommon.gmk
|
||||
include gendata/GendataFontConfig.gmk
|
||||
include gendata/GendataHtml32dtd.gmk
|
||||
|
||||
################################################################################
|
||||
80
make/modules/java.desktop/Gensrc.gmk
Normal file
80
make/modules/java.desktop/Gensrc.gmk
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
#
|
||||
# Copyright (c) 2011, 2025, 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
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
|
||||
include GensrcCommon.gmk
|
||||
|
||||
ifeq ($(call isTargetOs, windows), false)
|
||||
include gensrc/GensrcIcons.gmk
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, linux aix), true)
|
||||
include gensrc/GensrcX11Wrappers.gmk
|
||||
endif
|
||||
|
||||
include gensrc/GensrcSwing.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
include GensrcProperties.gmk
|
||||
|
||||
PROP_SRC_DIRS := \
|
||||
$(TOPDIR)/src/java.desktop/share/classes/sun/awt/resources \
|
||||
$(TOPDIR)/src/java.desktop/share/classes/com/sun/accessibility/internal/resources \
|
||||
$(TOPDIR)/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/resources \
|
||||
$(TOPDIR)/src/java.desktop/share/classes/com/sun/swing/internal/plaf/basic/resources \
|
||||
$(TOPDIR)/src/java.desktop/share/classes/com/sun/swing/internal/plaf/metal/resources \
|
||||
$(TOPDIR)/src/java.desktop/share/classes/com/sun/swing/internal/plaf/synth/resources \
|
||||
$(TOPDIR)/src/java.desktop/share/classes/sun/print/resources \
|
||||
#
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
PROP_SRC_DIRS += \
|
||||
$(TOPDIR)/src/java.desktop/macosx/classes/com/apple/laf/resources \
|
||||
$(TOPDIR)/src/java.desktop/macosx/classes/sun/awt/resources \
|
||||
#
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
PROP_SRC_DIRS += \
|
||||
$(TOPDIR)/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/resources \
|
||||
$(TOPDIR)/src/java.desktop/windows/classes/sun/awt/windows \
|
||||
#
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, windows macosx), false)
|
||||
PROP_SRC_DIRS += $(TOPDIR)/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/resources
|
||||
endif
|
||||
|
||||
$(eval $(call SetupCompileProperties, COMPILE_PROPERTIES, \
|
||||
SRC_DIRS := $(PROP_SRC_DIRS), \
|
||||
EXCLUDE := %cursors.properties, \
|
||||
CLASS := ListResourceBundle, \
|
||||
))
|
||||
|
||||
TARGETS += $(COMPILE_PROPERTIES)
|
||||
|
||||
################################################################################
|
||||
136
make/modules/java.desktop/Java.gmk
Normal file
136
make/modules/java.desktop/Java.gmk
Normal file
|
|
@ -0,0 +1,136 @@
|
|||
#
|
||||
# Copyright (c) 2020, 2025, 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
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
|
||||
DISABLED_WARNINGS_java += dangling-doc-comments lossy-conversions this-escape
|
||||
DOCLINT += -Xdoclint:all/protected \
|
||||
'-Xdoclint/package:java.*,javax.*'
|
||||
COPY += .gif .png .wav .txt .xml .css .pf
|
||||
CLEAN += iio-plugin.properties cursors.properties
|
||||
|
||||
EXCLUDE_FILES += \
|
||||
javax/swing/plaf/nimbus/InternalFrameTitlePanePainter.java \
|
||||
javax/swing/plaf/nimbus/OptionPaneMessageAreaPainter.java \
|
||||
javax/swing/plaf/nimbus/ScrollBarPainter.java \
|
||||
javax/swing/plaf/nimbus/SliderPainter.java \
|
||||
javax/swing/plaf/nimbus/SpinnerPainter.java \
|
||||
javax/swing/plaf/nimbus/SplitPanePainter.java \
|
||||
javax/swing/plaf/nimbus/TabbedPanePainter.java \
|
||||
sun/awt/X11/java-icon16.png \
|
||||
sun/awt/X11/java-icon24.png \
|
||||
sun/awt/X11/java-icon32.png \
|
||||
sun/awt/X11/java-icon48.png \
|
||||
.template \
|
||||
#
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
# exclude all X11 on Mac.
|
||||
EXCLUDES += \
|
||||
sun/awt/screencast \
|
||||
sun/awt/X11 \
|
||||
sun/java2d/x11 \
|
||||
sun/java2d/jules \
|
||||
sun/java2d/xr \
|
||||
com/sun/java/swing/plaf/gtk \
|
||||
#
|
||||
EXCLUDE_FILES += \
|
||||
$(wildcard $(TOPDIR)/src/java.desktop/unix/classes/sun/java2d/*.java) \
|
||||
$(wildcard $(TOPDIR)/src/java.desktop/unix/classes/sun/java2d/opengl/*.java) \
|
||||
$(wildcard $(TOPDIR)/src/java.desktop/unix/classes/sun/awt/*.java) \
|
||||
$(wildcard $(TOPDIR)/src/java.desktop/unix/classes/sun/font/*.java) \
|
||||
#
|
||||
else
|
||||
# TBD: figure out how to eliminate this long list
|
||||
EXCLUDE_FILES += \
|
||||
sun/awt/X11/ScreenFormat.java \
|
||||
sun/awt/X11/XArc.java \
|
||||
sun/awt/X11/XChar2b.java \
|
||||
sun/awt/X11/XCharStruct.java \
|
||||
sun/awt/X11/XClassHint.java \
|
||||
sun/awt/X11/XComposeStatus.java \
|
||||
sun/awt/X11/XExtCodes.java \
|
||||
sun/awt/X11/XFontProp.java \
|
||||
sun/awt/X11/XFontSetExtents.java \
|
||||
sun/awt/X11/XFontStruct.java \
|
||||
sun/awt/X11/XGCValues.java \
|
||||
sun/awt/X11/XHostAddress.java \
|
||||
sun/awt/X11/XIMCallback.java \
|
||||
sun/awt/X11/XIMHotKeyTrigger.java \
|
||||
sun/awt/X11/XIMHotKeyTriggers.java \
|
||||
sun/awt/X11/XIMPreeditCaretCallbackStruct.java \
|
||||
sun/awt/X11/XIMPreeditDrawCallbackStruct.java \
|
||||
sun/awt/X11/XIMPreeditStateNotifyCallbackStruct.java \
|
||||
sun/awt/X11/XIMStatusDrawCallbackStruct.java \
|
||||
sun/awt/X11/XIMStringConversionCallbackStruct.java \
|
||||
sun/awt/X11/XIMStringConversionText.java \
|
||||
sun/awt/X11/XIMStyles.java \
|
||||
sun/awt/X11/XIMText.java \
|
||||
sun/awt/X11/XIMValuesList.java \
|
||||
sun/awt/X11/XImage.java \
|
||||
sun/awt/X11/XKeyboardControl.java \
|
||||
sun/awt/X11/XKeyboardState.java \
|
||||
sun/awt/X11/XOMCharSetList.java \
|
||||
sun/awt/X11/XOMFontInfo.java \
|
||||
sun/awt/X11/XOMOrientation.java \
|
||||
sun/awt/X11/XPoint.java \
|
||||
sun/awt/X11/XRectangle.java \
|
||||
sun/awt/X11/XSegment.java \
|
||||
sun/awt/X11/XStandardColormap.java \
|
||||
sun/awt/X11/XTextItem.java \
|
||||
sun/awt/X11/XTextItem16.java \
|
||||
sun/awt/X11/XTextProperty.java \
|
||||
sun/awt/X11/XTimeCoord.java \
|
||||
sun/awt/X11/XWindowChanges.java \
|
||||
sun/awt/X11/XdbeSwapInfo.java \
|
||||
sun/awt/X11/XmbTextItem.java \
|
||||
sun/awt/X11/XwcTextItem.java
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
EXCLUDES += com/sun/java/swing/plaf/gtk
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, windows macosx), false)
|
||||
EXCLUDE_FILES += sun/awt/AWTCharset.java
|
||||
endif
|
||||
|
||||
# These files do not appear in the build result of the old build. This
|
||||
# is because they are generated sources, but the AUTO_JAVA_FILES won't
|
||||
# pick them up since they aren't generated when the source dirs are
|
||||
# searched and they aren't referenced by any other classes so they won't
|
||||
# be picked up by implicit compilation. On a rebuild, they are picked up
|
||||
# and compiled.
|
||||
EXCLUDE_FILES += \
|
||||
javax/swing/plaf/nimbus/InternalFrameTitlePanePainter.java \
|
||||
javax/swing/plaf/nimbus/OptionPaneMessageAreaPainter.java \
|
||||
javax/swing/plaf/nimbus/ScrollBarPainter.java \
|
||||
javax/swing/plaf/nimbus/SliderPainter.java \
|
||||
javax/swing/plaf/nimbus/SpinnerPainter.java \
|
||||
javax/swing/plaf/nimbus/SplitPanePainter.java \
|
||||
javax/swing/plaf/nimbus/TabbedPanePainter.java \
|
||||
#
|
||||
|
||||
################################################################################
|
||||
134
make/modules/java.desktop/Lib.gmk
Normal file
134
make/modules/java.desktop/Lib.gmk
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
#
|
||||
# Copyright (c) 2011, 2025, 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
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
|
||||
include LibCommon.gmk
|
||||
include Execute.gmk
|
||||
|
||||
# Prepare the find cache.
|
||||
$(call FillFindCache, $(wildcard $(TOPDIR)/src/java.desktop/*/native))
|
||||
|
||||
################################################################################
|
||||
# Create the AWT/2D libraries
|
||||
|
||||
include lib/AwtLibraries.gmk
|
||||
include lib/ClientLibraries.gmk
|
||||
|
||||
ifeq ($(call isTargetOs, aix), false)
|
||||
##############################################################################
|
||||
# Build libjsound
|
||||
##############################################################################
|
||||
|
||||
LIBJSOUND_CFLAGS := \
|
||||
$(ALSA_CFLAGS) \
|
||||
-DX_PLATFORM=X_$(OPENJDK_TARGET_OS_UPPERCASE) \
|
||||
-DUSE_PORTS=TRUE \
|
||||
-DUSE_DAUDIO=TRUE \
|
||||
-DUSE_PLATFORM_MIDI_OUT=TRUE \
|
||||
-DUSE_PLATFORM_MIDI_IN=TRUE \
|
||||
#
|
||||
|
||||
LIBJSOUND_LINK_TYPE := C
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
LIBJSOUND_LINK_TYPE := C++
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJSOUND, \
|
||||
NAME := jsound, \
|
||||
LINK_TYPE := $(LIBJSOUND_LINK_TYPE), \
|
||||
OPTIMIZATION := LOW, \
|
||||
EXTRA_HEADER_DIRS := java.base:libjava, \
|
||||
CFLAGS := $(LIBJSOUND_CFLAGS), \
|
||||
CXXFLAGS := $(LIBJSOUND_CFLAGS), \
|
||||
DISABLED_WARNINGS_gcc := undef unused-variable, \
|
||||
DISABLED_WARNINGS_clang := undef unused-variable, \
|
||||
DISABLED_WARNINGS_clang_PLATFORM_API_MacOSX_MidiUtils.c := \
|
||||
unused-but-set-variable, \
|
||||
DISABLED_WARNINGS_clang_DirectAudioDevice.c := unused-function, \
|
||||
LIBS_linux := $(ALSA_LIBS), \
|
||||
LIBS_macosx := \
|
||||
-framework AudioToolbox \
|
||||
-framework AudioUnit \
|
||||
-framework CoreAudio \
|
||||
-framework CoreFoundation \
|
||||
-framework CoreMIDI \
|
||||
-framework CoreServices, \
|
||||
LIBS_windows := advapi32.lib dsound.lib ole32.lib user32.lib winmm.lib, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBJSOUND)
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
##############################################################################
|
||||
# Build libosxapp
|
||||
##############################################################################
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBOSXAPP, \
|
||||
NAME := osxapp, \
|
||||
OPTIMIZATION := LOW, \
|
||||
DISABLED_WARNINGS_clang_NSApplicationAWT.m := deprecated-declarations \
|
||||
format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_QueuingApplicationDelegate.m := \
|
||||
objc-method-access, \
|
||||
JDK_LIBS := java.base:libjava, \
|
||||
LIBS_macosx := \
|
||||
-framework Accelerate \
|
||||
-framework ApplicationServices \
|
||||
-framework AudioToolbox \
|
||||
-framework Carbon \
|
||||
-framework Cocoa \
|
||||
-framework ExceptionHandling \
|
||||
-framework IOSurface \
|
||||
-framework JavaRuntimeSupport \
|
||||
-framework OpenGL \
|
||||
-framework QuartzCore \
|
||||
-framework Security, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBOSXAPP)
|
||||
|
||||
##############################################################################
|
||||
# Build libosx
|
||||
##############################################################################
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBOSX, \
|
||||
NAME := osx, \
|
||||
OPTIMIZATION := LOW, \
|
||||
EXTRA_HEADER_DIRS := java.base:libjava, \
|
||||
DISABLED_WARNINGS_clang_CFileManager.m := deprecated-declarations, \
|
||||
JDK_LIBS := libosxapp, \
|
||||
LIBS_macosx := \
|
||||
-framework ApplicationServices \
|
||||
-framework Cocoa \
|
||||
-framework JavaRuntimeSupport \
|
||||
-framework SystemConfiguration, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBOSX)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
67
make/modules/java.desktop/gendata/GendataFontConfig.gmk
Normal file
67
make/modules/java.desktop/gendata/GendataFontConfig.gmk
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
#
|
||||
# Copyright (c) 2011, 2025, 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
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
include MakeIncludeStart.gmk
|
||||
ifeq ($(INCLUDE), true)
|
||||
|
||||
################################################################################
|
||||
|
||||
FONTCONFIG_DATA_DIR := $(MODULE_SRC)/$(OPENJDK_TARGET_OS)/data/fontconfig
|
||||
FONTCONFIG_SRC_FILE := $(FONTCONFIG_DATA_DIR)/fontconfig.properties
|
||||
|
||||
FONTCONFIG_DEST_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE)
|
||||
FONTCONFIG_OUT_FILE := $(FONTCONFIG_DEST_DIR)/fontconfig.properties.src
|
||||
FONTCONFIG_OUT_BIN_FILE := $(FONTCONFIG_DEST_DIR)/fontconfig.bfc
|
||||
|
||||
ifneq ($(findstring $(LOG_LEVEL), debug trace), )
|
||||
FONTCONFIG_VERBOSE_FLAG := -verbose
|
||||
endif
|
||||
|
||||
# Not all OSes have a fontconfig file
|
||||
ifneq ($(wildcard $(FONTCONFIG_SRC_FILE)), )
|
||||
|
||||
# Copy properties file as-is
|
||||
$(FONTCONFIG_OUT_FILE): $(FONTCONFIG_SRC_FILE)
|
||||
$(call LogInfo, Copying fontconfig.properties)
|
||||
$(call install-file)
|
||||
|
||||
TARGETS += $(FONTCONFIG_OUT_FILE)
|
||||
|
||||
# Generate binary representation
|
||||
$(FONTCONFIG_OUT_BIN_FILE): $(FONTCONFIG_SRC_FILE) $(BUILD_TOOLS_JDK)
|
||||
$(call LogInfo, Compiling fontconfig.properties to binary)
|
||||
$(call MakeTargetDir)
|
||||
$(RM) $@
|
||||
$(TOOL_COMPILEFONTCONFIG) $(FONTCONFIG_VERBOSE_FLAG) $< $@
|
||||
$(CHMOD) 444 $@
|
||||
|
||||
TARGETS += $(FONTCONFIG_OUT_BIN_FILE)
|
||||
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
endif # include guard
|
||||
include MakeIncludeEnd.gmk
|
||||
45
make/modules/java.desktop/gendata/GendataHtml32dtd.gmk
Normal file
45
make/modules/java.desktop/gendata/GendataHtml32dtd.gmk
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
#
|
||||
# Copyright (c) 2011, 2025, 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
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
include MakeIncludeStart.gmk
|
||||
ifeq ($(INCLUDE), true)
|
||||
|
||||
################################################################################
|
||||
|
||||
GENDATA_HTML32DTD :=
|
||||
|
||||
HTML32DTD = $(JDK_OUTPUTDIR)/modules/java.desktop/javax/swing/text/html/parser/html32.bdtd
|
||||
$(HTML32DTD): $(BUILD_TOOLS_JDK)
|
||||
$(call LogInfo, Generating HTML DTD file)
|
||||
$(call MakeTargetDir)
|
||||
$(RM) $@
|
||||
($(TOOL_DTDBUILDER) html32 > $@) || exit 1
|
||||
|
||||
TARGETS += $(HTML32DTD)
|
||||
|
||||
################################################################################
|
||||
|
||||
endif # include guard
|
||||
include MakeIncludeEnd.gmk
|
||||
120
make/modules/java.desktop/gensrc/GensrcIcons.gmk
Normal file
120
make/modules/java.desktop/gensrc/GensrcIcons.gmk
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
#
|
||||
# Copyright (c) 2011, 2025, 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
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
include MakeIncludeStart.gmk
|
||||
ifeq ($(INCLUDE), true)
|
||||
|
||||
################################################################################
|
||||
|
||||
GENSRC_AWT_ICONS :=
|
||||
GENSRC_AWT_ICONS_SRC :=
|
||||
GENSRC_AWT_ICONS_TMP := $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop
|
||||
GENSRC_AWT_ICONS_DST := $(GENSRC_AWT_ICONS_TMP)/sun/awt/
|
||||
|
||||
# Allow this to be overridden from a custom makefile
|
||||
X11_ICONS_PATH_PREFIX ?= $(MODULE_SRC)/$(OPENJDK_TARGET_OS_TYPE)
|
||||
|
||||
GENSRC_AWT_ICONS_SRC += \
|
||||
$(X11_ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon16.png \
|
||||
$(X11_ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon24.png \
|
||||
$(X11_ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon32.png \
|
||||
$(X11_ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon48.png
|
||||
|
||||
GENSRC_AWT_ICONS_FILES := $(notdir $(GENSRC_AWT_ICONS_SRC))
|
||||
|
||||
GENSRC_AWT_ICONS_SHORT_NAME = $(subst .,_,$(subst -,_,$(1)))
|
||||
GENSRC_AWT_ICONS_DST_NAME = AWTIcon$(2)_$(subst .,_,$(subst -,_,$(1)))
|
||||
|
||||
################################################################################
|
||||
|
||||
$(GENSRC_AWT_ICONS_TMP)/_the.icons.dir:
|
||||
$(call LogInfo, Generating icon classes)
|
||||
$(call MakeDir, $(GENSRC_AWT_ICONS_DST))
|
||||
$(TOUCH) $@
|
||||
|
||||
################################################################################
|
||||
|
||||
define SetupGensrcAWTIcon
|
||||
# param 1 is for src-file
|
||||
# param 2 is for src-dir
|
||||
$1_SHORTNAME := $(call GENSRC_AWT_ICONS_SHORT_NAME,$1)
|
||||
$1_NAME32 := $(call GENSRC_AWT_ICONS_DST_NAME,$1,32)
|
||||
$1_TARGET32 := $(GENSRC_AWT_ICONS_DST)/$$($1_NAME32).java
|
||||
$1_NAME64 := $(call GENSRC_AWT_ICONS_DST_NAME,$1,64)
|
||||
$1_TARGET64 := $(GENSRC_AWT_ICONS_DST)/$$($1_NAME64).java
|
||||
|
||||
$$($1_TARGET32): $2/$1 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir $(BUILD_TOOLS_JDK)
|
||||
$(RM) $$@ $$@.tmp
|
||||
$(ECHO) "package sun.awt;" > $$@.tmp
|
||||
$(ECHO) "public class $$($1_NAME32) {" >> $$@.tmp
|
||||
$(ECHO) "public static int[] $$($1_SHORTNAME) = { " >> $$@.tmp
|
||||
$(CAT) $$< | $(TOOL_AWT_TOBIN) >> $$@.tmp
|
||||
$(ECHO) "}; }" >> $$@.tmp
|
||||
$(MV) $$@.tmp $$@
|
||||
|
||||
GENSRC_AWT_ICONS += $$($1_TARGET32)
|
||||
|
||||
$$($1_TARGET64): $2/$1 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir $(BUILD_TOOLS_JDK)
|
||||
$(RM) $$@ $$@.tmp
|
||||
$(ECHO) "package sun.awt;" > $$@.tmp
|
||||
$(ECHO) "public class $$($1_NAME64) {" >> $$@.tmp
|
||||
$(ECHO) "public static long[] $$($1_SHORTNAME) = { " >> $$@.tmp
|
||||
$(CAT) $$< | $(TOOL_AWT_TOBIN) >> $$@.tmp
|
||||
$(ECHO) "}; }" >> $$@.tmp
|
||||
$(MV) $$@.tmp $$@
|
||||
|
||||
GENSRC_AWT_ICONS += $$($1_TARGET64)
|
||||
endef
|
||||
|
||||
$(foreach I, $(GENSRC_AWT_ICONS_SRC), $(eval $(call SetupGensrcAWTIcon,$(notdir $(I)),$(dir $(I)))))
|
||||
|
||||
TARGETS += $(GENSRC_AWT_ICONS)
|
||||
|
||||
################################################################################
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
|
||||
GENSRC_OSX_ICONS_DST := $(SUPPORT_OUTPUTDIR)/headers/java.desktop
|
||||
GENSRC_OSX_ICONS := $(GENSRC_OSX_ICONS_DST)/AWTIconData.h
|
||||
|
||||
GENSRC_OSX_ICONS_SRC ?= $(MODULE_SRC)/macosx/data/macosxicons/JavaApp.icns
|
||||
|
||||
|
||||
$(GENSRC_OSX_ICONS): $(GENSRC_OSX_ICONS_SRC) $(BUILD_TOOLS_JDK)
|
||||
$(call LogInfo, Generating $(patsubst $(OUTPUTDIR)/%, %, $@))
|
||||
$(call MakeDir, $(@D))
|
||||
$(RM) $@ $@.tmp
|
||||
$(ECHO) "static unsigned char sAWTIconData[] = { " >> $@.tmp
|
||||
$(CAT) $< | $(TOOL_OSX_TOBIN) >> $@.tmp
|
||||
$(ECHO) "};" >> $@.tmp
|
||||
$(MV) $@.tmp $@
|
||||
|
||||
TARGETS += $(GENSRC_OSX_ICONS)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
endif # include guard
|
||||
include MakeIncludeEnd.gmk
|
||||
52
make/modules/java.desktop/gensrc/GensrcSwing.gmk
Normal file
52
make/modules/java.desktop/gensrc/GensrcSwing.gmk
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
#
|
||||
# Copyright (c) 2011, 2025, 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
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
include MakeIncludeStart.gmk
|
||||
ifeq ($(INCLUDE), true)
|
||||
|
||||
################################################################################
|
||||
# Generate java files for javax.swing.plaf package
|
||||
################################################################################
|
||||
|
||||
NIMBUS_PACKAGE = javax.swing.plaf
|
||||
NIMBUS_GENSRC_DIR = $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/javax/swing/plaf/nimbus
|
||||
NIMBUS_SKIN_FILE = $(MODULE_SRC)/share/classes/javax/swing/plaf/nimbus/skin.laf
|
||||
|
||||
$(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/_the.generated_nimbus: $(NIMBUS_SKIN_FILE) $(BUILD_TOOLS_JDK)
|
||||
$(call LogInfo, Generating Nimbus source files)
|
||||
$(call MakeTargetDir)
|
||||
$(TOOL_GENERATENIMBUS) $(LOG_DEBUG) \
|
||||
-skinFile $(NIMBUS_SKIN_FILE) -buildDir $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop \
|
||||
-packagePrefix $(NIMBUS_PACKAGE).nimbus -lafName Nimbus
|
||||
$(TOUCH) $@
|
||||
|
||||
GENSRC_SWING_NIMBUS := $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/_the.generated_nimbus
|
||||
|
||||
TARGETS += $(GENSRC_SWING_NIMBUS)
|
||||
|
||||
################################################################################
|
||||
|
||||
endif # include guard
|
||||
include MakeIncludeEnd.gmk
|
||||
57
make/modules/java.desktop/gensrc/GensrcX11Wrappers.gmk
Normal file
57
make/modules/java.desktop/gensrc/GensrcX11Wrappers.gmk
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
#
|
||||
# Copyright (c) 2012, 2025, 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
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
include MakeIncludeStart.gmk
|
||||
ifeq ($(INCLUDE), true)
|
||||
|
||||
################################################################################
|
||||
# Generate java sources using the X11 offsets that are precalculated in files
|
||||
# src/java.desktop/unix/data/x11wrappergen/sizes-<address size>.txt.
|
||||
################################################################################
|
||||
|
||||
# Put the generated Java classes used to interface X11 from awt here.
|
||||
GENSRC_X11WRAPPERS_OUTPUTDIR := $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/sun/awt/X11
|
||||
|
||||
# The pre-calculated offset file are stored here:
|
||||
GENSRC_X11WRAPPERS_DATADIR := $(MODULE_SRC)/unix/data/x11wrappergen
|
||||
GENSRC_X11WRAPPERS_DATA := $(GENSRC_X11WRAPPERS_DATADIR)/sizes-$(OPENJDK_TARGET_CPU_BITS).txt
|
||||
|
||||
# Run the tool on the offset files to generate several Java classes used in awt.
|
||||
$(eval $(call SetupExecute, gen_x11wrappers, \
|
||||
INFO := Generating X11 wrapper source files, \
|
||||
DEPS := $(BUILD_TOOLS_JDK) $(GENSRC_X11WRAPPERS_DATA) \
|
||||
$(GENSRC_X11WRAPPERS_DATADIR)/xlibtypes.txt, \
|
||||
OUTPUT_DIR := $(GENSRC_X11WRAPPERS_OUTPUTDIR), \
|
||||
COMMAND := $(TOOL_WRAPPERGENERATOR) gen_java $(GENSRC_X11WRAPPERS_OUTPUTDIR) \
|
||||
$(GENSRC_X11WRAPPERS_DATADIR)/xlibtypes.txt $(GENSRC_X11WRAPPERS_DATA) \
|
||||
$(OPENJDK_TARGET_CPU_BITS), \
|
||||
))
|
||||
|
||||
TARGETS += $(gen_x11wrappers_TARGET)
|
||||
|
||||
################################################################################
|
||||
|
||||
endif # include guard
|
||||
include MakeIncludeEnd.gmk
|
||||
479
make/modules/java.desktop/lib/AwtLibraries.gmk
Normal file
479
make/modules/java.desktop/lib/AwtLibraries.gmk
Normal file
|
|
@ -0,0 +1,479 @@
|
|||
#
|
||||
# Copyright (c) 2011, 2026, 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
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
include MakeIncludeStart.gmk
|
||||
ifeq ($(INCLUDE), true)
|
||||
|
||||
################################################################################
|
||||
# This file will build all AWT/2D native libraries with "awt" in the name.
|
||||
# Note that this does not imply that the code they bring in belong to AWT.
|
||||
# This split is purely made to keep the size of the Makefiles reasonable.
|
||||
################################################################################
|
||||
|
||||
include CopyFiles.gmk
|
||||
|
||||
LIBAWT_DEFAULT_HEADER_DIRS := \
|
||||
common/awt/utility \
|
||||
libawt/awt/image \
|
||||
libawt/awt/image/cvutils \
|
||||
libawt/java2d \
|
||||
libawt/java2d/loops \
|
||||
libawt/java2d/pipe \
|
||||
#
|
||||
|
||||
################################################################################
|
||||
## Build libawt
|
||||
################################################################################
|
||||
|
||||
LIBAWT_EXTRA_SRC := \
|
||||
common/awt/debug \
|
||||
$(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
|
||||
#
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
LIBAWT_EXTRA_SRC += \
|
||||
$(TOPDIR)/src/$(MODULE)/share/native/common/awt/utility \
|
||||
$(TOPDIR)/src/$(MODULE)/share/native/common/font \
|
||||
$(TOPDIR)/src/$(MODULE)/share/native/common/java2d/opengl \
|
||||
$(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt/systemscale \
|
||||
#
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, linux macosx aix), true)
|
||||
LIBAWT_EXCLUDE_FILES += awt_Font.c CUPSfuncs.c fontpath.c X11Color.c
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
LIBAWT_EXCLUDE_FILES += initIDs.c img_colors.c
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
LIBAWT_EXCLUDE_FILES += D3DShaderGen.c img_colors.c
|
||||
endif
|
||||
|
||||
LIBAWT_EXTRA_HEADER_DIRS := \
|
||||
$(LIBAWT_DEFAULT_HEADER_DIRS) \
|
||||
$(call GetJavaHeaderDir, java.base) \
|
||||
libawt/awt/medialib \
|
||||
libawt/java2d/d3d \
|
||||
libawt/java2d/opengl \
|
||||
libawt/java2d/windows \
|
||||
libawt/windows \
|
||||
common/awt/medialib \
|
||||
libmlib_image \
|
||||
include \
|
||||
#
|
||||
|
||||
LIBAWT_CFLAGS := -D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES -DMLIB_NO_LIBSUNMATH
|
||||
|
||||
ifeq ($(ENABLE_HEADLESS_ONLY), true)
|
||||
LIBAWT_CFLAGS += -DHEADLESS
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
LIBAWT_CFLAGS += -EHsc -DUNICODE -D_UNICODE -DMLIB_OS64BIT
|
||||
LIBAWT_RCFLAGS ?= -I$(TOPDIR)/src/java.base/windows/native/launcher/icons
|
||||
LIBAWT_VERSIONINFO_RESOURCE := \
|
||||
$(TOPDIR)/src/$(MODULE)/windows/native/libawt/windows/awt.rc
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, aix), true)
|
||||
# This is the object file to provide the dladdr API, which is not
|
||||
# part of AIX. It occurs several times in the jdk code base.
|
||||
# Do not include it. When statically linking the java
|
||||
# launcher with all JDK and VM static libraries, we use the
|
||||
# --whole-archive linker option. The duplicate objects in different
|
||||
# static libraries cause linking errors due to duplicate symbols.
|
||||
LIBAWT_STATIC_EXCLUDE_OBJS := porting_aix.o
|
||||
|
||||
LIBAWT_CFLAGS += -I$(TOPDIR)/src/java.base/aix/native/include
|
||||
endif
|
||||
|
||||
# -fgcse-after-reload improves performance of MaskFill in Java2D by 20% for
|
||||
# some gcc
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBAWT, \
|
||||
NAME := awt, \
|
||||
EXTRA_SRC := $(LIBAWT_EXTRA_SRC), \
|
||||
EXCLUDE_FILES := $(LIBAWT_EXCLUDE_FILES), \
|
||||
OPTIMIZATION := HIGHEST, \
|
||||
CFLAGS := $(LIBAWT_CFLAGS) $(X_CFLAGS), \
|
||||
CXXFLAGS := $(LIBAWT_CFLAGS) $(X_CFLAGS), \
|
||||
CFLAGS_gcc := -fgcse-after-reload, \
|
||||
EXTRA_HEADER_DIRS := $(LIBAWT_EXTRA_HEADER_DIRS), \
|
||||
DISABLED_WARNINGS_gcc := unused-but-set-variable unused-variable, \
|
||||
DISABLED_WARNINGS_gcc_awt_LoadLibrary.c := unused-result, \
|
||||
DISABLED_WARNINGS_gcc_debug_mem.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_gcc_ProcessPath.c := maybe-uninitialized, \
|
||||
DISABLED_WARNINGS_gcc_Region.c := maybe-uninitialized, \
|
||||
DISABLED_WARNINGS_gcc_SurfaceData.c := unused-value, \
|
||||
DISABLED_WARNINGS_gcc_TransformHelper.c := sign-compare, \
|
||||
DISABLED_WARNINGS_clang := unused-but-set-variable unused-variable, \
|
||||
DISABLED_WARNINGS_clang_awt_ImagingLib.c := deprecated-non-prototype, \
|
||||
DISABLED_WARNINGS_clang_debug_trace.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_Trace.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_TransformHelper.c := sign-compare, \
|
||||
DISABLED_WARNINGS_microsoft := 4244 4996, \
|
||||
DISABLED_WARNINGS_microsoft_awt_Toolkit.cpp := 4267, \
|
||||
LDFLAGS_windows := -delayload:comctl32.dll -delayload:comdlg32.dll \
|
||||
-delayload:gdi32.dll -delayload:imm32.dll -delayload:ole32.dll \
|
||||
-delayload:shell32.dll -delayload:shlwapi.dll -delayload:user32.dll \
|
||||
-delayload:winmm.dll -delayload:winspool.drv, \
|
||||
JDK_LIBS := java.base:libjava java.base:libjvm, \
|
||||
LIBS_unix := $(LIBM), \
|
||||
LIBS_linux := $(LIBDL), \
|
||||
LIBS_aix := $(LIBDL), \
|
||||
LIBS_macosx := \
|
||||
-framework ApplicationServices \
|
||||
-framework AudioToolbox \
|
||||
-framework Cocoa \
|
||||
-framework JavaRuntimeSupport \
|
||||
-framework Metal \
|
||||
-framework OpenGL, \
|
||||
LIBS_windows := advapi32.lib comctl32.lib comdlg32.lib delayimp.lib \
|
||||
gdi32.lib imm32.lib kernel32.lib ole32.lib shell32.lib shlwapi.lib \
|
||||
user32.lib uuid.lib winmm.lib winspool.lib, \
|
||||
VERSIONINFO_RESOURCE := $(LIBAWT_VERSIONINFO_RESOURCE), \
|
||||
EXTRA_RCFLAGS := $(LIBAWT_RCFLAGS), \
|
||||
STATIC_LIB_EXCLUDE_OBJS := $(LIBAWT_STATIC_EXCLUDE_OBJS), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBAWT)
|
||||
|
||||
# Mac and Windows only use the native AWT lib, do not build libawt_headless
|
||||
ifeq ($(call isTargetOs, windows macosx), false)
|
||||
##############################################################################
|
||||
## Build libawt_headless
|
||||
##############################################################################
|
||||
|
||||
LIBAWT_HEADLESS_EXTRA_SRC := \
|
||||
common/font \
|
||||
common/java2d \
|
||||
$(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
|
||||
#
|
||||
|
||||
LIBAWT_HEADLESS_EXCLUDE_FILES := \
|
||||
GLXGraphicsConfig.c \
|
||||
GLXSurfaceData.c \
|
||||
X11PMBlitLoops.c \
|
||||
X11Renderer.c \
|
||||
X11SurfaceData.c \
|
||||
#
|
||||
|
||||
LIBAWT_HEADLESS_EXTRA_HEADER_DIRS := \
|
||||
$(LIBAWT_DEFAULT_HEADER_DIRS) \
|
||||
common/awt/debug \
|
||||
common/font \
|
||||
java.base:libjvm \
|
||||
#
|
||||
|
||||
# These are the object files provided by the awt native
|
||||
# library. Do not include these external (non-awt_headless library)
|
||||
# objects in the static library. When statically linking the java
|
||||
# launcher with all JDK and VM static libraries, we use the
|
||||
# --whole-archive linker option. The duplicate objects in different
|
||||
# static libraries cause linking errors due to duplicate symbols.
|
||||
LIBAWT_HEADLESS_STATIC_EXCLUDE_OBJS := systemScale.o
|
||||
|
||||
ifneq ($(ENABLE_HEADLESS_ONLY), true)
|
||||
# We cannot link with both awt_headless and awt_xawt at the same time
|
||||
LIBAWT_HEADLESS_ONLY_EXPORTED := true
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBAWT_HEADLESS, \
|
||||
NAME := awt_headless, \
|
||||
EXTRA_SRC := $(LIBAWT_HEADLESS_EXTRA_SRC), \
|
||||
EXCLUDES := medialib opengl, \
|
||||
EXCLUDE_FILES := $(LIBAWT_HEADLESS_EXCLUDE_FILES), \
|
||||
ONLY_EXPORTED := $(LIBAWT_HEADLESS_ONLY_EXPORTED), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := -DHEADLESS=true $(CUPS_CFLAGS) $(FONTCONFIG_CFLAGS) \
|
||||
$(X_CFLAGS), \
|
||||
EXTRA_HEADER_DIRS := $(LIBAWT_HEADLESS_EXTRA_HEADER_DIRS), \
|
||||
DISABLED_WARNINGS_gcc := unused-variable, \
|
||||
DISABLED_WARNINGS_clang := unused-variable, \
|
||||
DISABLED_WARNINGS_gcc_X11Renderer.c := unused-function, \
|
||||
DISABLED_WARNINGS_gcc_X11SurfaceData.c := unused-function, \
|
||||
DISABLED_WARNINGS_clang_X11Renderer.c := unused-function, \
|
||||
DISABLED_WARNINGS_clang_X11SurfaceData.c := unused-function, \
|
||||
JDK_LIBS := libawt java.base:libjava, \
|
||||
LIBS_linux := $(LIBDL) $(LIBM), \
|
||||
STATIC_LIB_EXCLUDE_OBJS := $(LIBAWT_HEADLESS_STATIC_EXCLUDE_OBJS), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBAWT_HEADLESS)
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, windows macosx)+$(ENABLE_HEADLESS_ONLY), false+false)
|
||||
##############################################################################
|
||||
## Build libawt_xawt
|
||||
##############################################################################
|
||||
|
||||
LIBAWT_XAWT_EXTRA_SRC := \
|
||||
common/awt \
|
||||
common/java2d \
|
||||
common/font \
|
||||
#
|
||||
|
||||
LIBAWT_XAWT_EXTRA_HEADER_DIRS := \
|
||||
$(LIBAWT_DEFAULT_HEADER_DIRS) \
|
||||
libawt_xawt/awt \
|
||||
include \
|
||||
common/awt/debug \
|
||||
common/awt/systemscale \
|
||||
common/font \
|
||||
common/java2d/opengl \
|
||||
common/java2d/x11 \
|
||||
java.base:libjvm \
|
||||
#
|
||||
|
||||
# exclude pipewire from the AIX build, no Wayland support
|
||||
ifeq ($(call isTargetOs, aix), false)
|
||||
LIBAWT_XAWT_EXTRA_HEADER_DIRS += libpipewire/include
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
ifeq ($(DISABLE_XRENDER), true)
|
||||
LIBAWT_XAWT_CFLAGS += -DDISABLE_XRENDER_BY_DEFAULT=true
|
||||
endif
|
||||
endif
|
||||
|
||||
# These are the object files provided by the awt native
|
||||
# library. Do not include these external (non-awt_xawt library)
|
||||
# objects in the static library. When statically linking the java
|
||||
# launcher with all JDK and VM static libraries, we use the
|
||||
# --whole-archive linker option. The duplicate objects in different
|
||||
# static libraries cause linking errors due to duplicate symbols.
|
||||
LIBAWT_XAWT_STATIC_EXCLUDE_OBJS := systemScale.o
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBAWT_XAWT, \
|
||||
NAME := awt_xawt, \
|
||||
EXTRA_SRC := $(LIBAWT_XAWT_EXTRA_SRC), \
|
||||
EXTRA_HEADER_DIRS := $(LIBAWT_XAWT_EXTRA_HEADER_DIRS), \
|
||||
EXCLUDES := medialib debug, \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := -DXAWT -DXAWT_HACK $(LIBAWT_XAWT_CFLAGS) \
|
||||
$(FONTCONFIG_CFLAGS) $(CUPS_CFLAGS) $(X_CFLAGS), \
|
||||
DISABLED_WARNINGS_gcc := int-to-pointer-cast unused-variable, \
|
||||
DISABLED_WARNINGS_clang := unused-variable, \
|
||||
DISABLED_WARNINGS_gcc_awt_Taskbar.c := parentheses, \
|
||||
DISABLED_WARNINGS_gcc_GLXSurfaceData.c := unused-function, \
|
||||
DISABLED_WARNINGS_gcc_gtk3_interface.c := parentheses type-limits \
|
||||
unused-function, \
|
||||
DISABLED_WARNINGS_gcc_OGLBufImgOps.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_gcc_OGLPaints.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_gcc_screencast_pipewire.c := undef, \
|
||||
DISABLED_WARNINGS_gcc_screencast_portal.c := undef, \
|
||||
DISABLED_WARNINGS_gcc_sun_awt_X11_GtkFileDialogPeer.c := parentheses, \
|
||||
DISABLED_WARNINGS_gcc_X11Color.c := unused-but-set-variable, \
|
||||
DISABLED_WARNINGS_gcc_X11SurfaceData.c := implicit-fallthrough \
|
||||
pointer-to-int-cast unused-but-set-variable, \
|
||||
DISABLED_WARNINGS_gcc_X11TextRenderer_md.c := unused-but-set-variable, \
|
||||
DISABLED_WARNINGS_gcc_XlibWrapper.c := type-limits pointer-to-int-cast, \
|
||||
DISABLED_WARNINGS_gcc_XRBackendNative.c := maybe-uninitialized, \
|
||||
DISABLED_WARNINGS_gcc_XWindow.c := unused-function, \
|
||||
DISABLED_WARNINGS_clang_awt_Taskbar.c := parentheses, \
|
||||
DISABLED_WARNINGS_clang_gtk3_interface.c := unused-function parentheses, \
|
||||
DISABLED_WARNINGS_clang_GLXSurfaceData.c := unused-function, \
|
||||
DISABLED_WARNINGS_clang_OGLBufImgOps.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_OGLPaints.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_screencast_pipewire.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_sun_awt_X11_GtkFileDialogPeer.c := parentheses, \
|
||||
DISABLED_WARNINGS_clang_XWindow.c := unused-function, \
|
||||
DISABLED_WARNINGS_clang_aix := deprecated-non-prototype, \
|
||||
DISABLED_WARNINGS_clang_aix_awt_Taskbar.c := parentheses, \
|
||||
DISABLED_WARNINGS_clang_aix_OGLPaints.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_aix_OGLBufImgOps.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_aix_gtk3_interface.c := unused-function parentheses \
|
||||
logical-op-parentheses, \
|
||||
DISABLED_WARNINGS_clang_aix_sun_awt_X11_GtkFileDialogPeer.c := \
|
||||
parentheses, \
|
||||
DISABLED_WARNINGS_clang_aix_awt_InputMethod.c := unused-function sign-compare, \
|
||||
JDK_LIBS := libawt java.base:libjava, \
|
||||
LIBS_unix := $(LIBDL) $(LIBM) $(X_LIBS) -lX11 -lXext -lXi -lXrender \
|
||||
-lXtst, \
|
||||
LIBS_linux := $(LIBPTHREAD), \
|
||||
STATIC_LIB_EXCLUDE_OBJS := $(LIBAWT_XAWT_STATIC_EXCLUDE_OBJS), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBAWT_XAWT)
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
##############################################################################
|
||||
## Build libawt_lwawt
|
||||
##############################################################################
|
||||
|
||||
LIBAWT_LWAWT_EXTRA_SRC := \
|
||||
$(TOPDIR)/src/$(MODULE)/unix/native/common/awt \
|
||||
$(TOPDIR)/src/$(MODULE)/share/native/common/font \
|
||||
$(TOPDIR)/src/$(MODULE)/share/native/common/java2d \
|
||||
#
|
||||
|
||||
LIBAWT_LWAWT_EXTRA_HEADER_DIRS := \
|
||||
$(LIBAWT_DEFAULT_HEADER_DIRS) \
|
||||
libawt_lwawt/awt \
|
||||
libawt_lwawt/font \
|
||||
libawt_lwawt/java2d/opengl \
|
||||
libawt_lwawt/java2d/metal \
|
||||
include \
|
||||
common/awt/debug \
|
||||
common/java2d/opengl \
|
||||
java.base:libjvm \
|
||||
#
|
||||
|
||||
LIBAWT_LWAWT_EXCLUDE_FILES := fontpath.c awt_Font.c X11Color.c
|
||||
LIBAWT_LWAWT_EXCLUDES := $(TOPDIR)/src/$(MODULE)/unix/native/common/awt/medialib
|
||||
|
||||
LIBAWT_LWAWT_STATIC_EXCLUDE_OBJS := systemScale.o
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBAWT_LWAWT, \
|
||||
NAME := awt_lwawt, \
|
||||
EXTRA_SRC := $(LIBAWT_LWAWT_EXTRA_SRC), \
|
||||
EXCLUDE_FILES := $(LIBAWT_LWAWT_EXCLUDE_FILES), \
|
||||
EXCLUDES := $(LIBAWT_LWAWT_EXCLUDES), \
|
||||
OPTIMIZATION := LOW, \
|
||||
EXTRA_HEADER_DIRS := $(LIBAWT_LWAWT_EXTRA_HEADER_DIRS), \
|
||||
DISABLED_WARNINGS_clang := deprecated-declarations extra-tokens \
|
||||
incompatible-pointer-types incomplete-implementation \
|
||||
objc-method-access sign-compare undef unused-function \
|
||||
unused-variable, \
|
||||
DISABLED_WARNINGS_clang_AWTWindow.m := bitwise-op-parentheses, \
|
||||
DISABLED_WARNINGS_clang_CFileDialog.m := semicolon-before-method-body, \
|
||||
DISABLED_WARNINGS_clang_CGGlyphImages.m := pointer-arith, \
|
||||
DISABLED_WARNINGS_clang_CGLLayer.m := semicolon-before-method-body, \
|
||||
DISABLED_WARNINGS_clang_ImageSurfaceData.m := enum-conversion \
|
||||
parentheses-equality, \
|
||||
DISABLED_WARNINGS_clang_MTLBlitLoops.m := pointer-arith, \
|
||||
DISABLED_WARNINGS_clang_MTLPipelineStatesStorage.m := \
|
||||
semicolon-before-method-body, \
|
||||
DISABLED_WARNINGS_clang_MTLRenderer.m := gnu-folding-constant, \
|
||||
DISABLED_WARNINGS_clang_MTLVertexCache.m := pointer-arith, \
|
||||
DISABLED_WARNINGS_clang_OGLBufImgOps.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_OGLPaints.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_PrinterView.m := enum-conversion, \
|
||||
JDK_LIBS := libawt java.base:libjava libosxapp, \
|
||||
LIBS_macosx := $(LIBM) \
|
||||
-framework Accelerate \
|
||||
-framework ApplicationServices \
|
||||
-framework AudioToolbox \
|
||||
-framework Carbon \
|
||||
-framework Cocoa \
|
||||
-framework ExceptionHandling \
|
||||
-framework JavaRuntimeSupport \
|
||||
-framework Metal \
|
||||
-framework OpenGL \
|
||||
-framework QuartzCore \
|
||||
-framework Security, \
|
||||
STATIC_LIB_EXCLUDE_OBJS := $(LIBAWT_LWAWT_STATIC_EXCLUDE_OBJS), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBAWT_LWAWT)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
## Build libjawt
|
||||
################################################################################
|
||||
|
||||
LIBJAWT_EXTRA_HEADER_DIRS := \
|
||||
include \
|
||||
java.base:libjava \
|
||||
#
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
LIBJAWT_EXTRA_HEADER_DIRS += \
|
||||
common/awt/debug \
|
||||
common/awt/utility \
|
||||
libawt/awt/image/cvutils \
|
||||
libawt/java2d \
|
||||
libawt/java2d/windows \
|
||||
libawt/windows \
|
||||
java.base:libjvm \
|
||||
#
|
||||
else
|
||||
LIBJAWT_EXTRA_HEADER_DIRS += \
|
||||
common/awt \
|
||||
#
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
# libjawt on macosx does not use the unix code
|
||||
LIBJAWT_EXCLUDE_SRC_PATTERNS := /unix/
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, linux)+$(ENABLE_HEADLESS_ONLY), true+true)
|
||||
LIBJAWT_CFLAGS += -DHEADLESS
|
||||
endif
|
||||
ifeq ($(call isTargetOs, aix)+$(ENABLE_HEADLESS_ONLY), true+true)
|
||||
LIBJAWT_CFLAGS += -DHEADLESS
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, windows)+$(call isTargetCpu, x86), true+true)
|
||||
LIBJAWT_LIBS_windows := kernel32.lib
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOsType, unix)+$(call isTargetOs, macosx), true+false)
|
||||
LIBJAWT_JDK_LIBS_unix := libawt
|
||||
ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
LIBJAWT_JDK_LIBS_unix += libawt_xawt
|
||||
else
|
||||
LIBJAWT_JDK_LIBS_unix += libawt_headless
|
||||
endif
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJAWT, \
|
||||
NAME := jawt, \
|
||||
EXCLUDE_SRC_PATTERNS := $(LIBJAWT_EXCLUDE_SRC_PATTERNS), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(LIBJAWT_CFLAGS), \
|
||||
CFLAGS_windows := -EHsc -DUNICODE -D_UNICODE, \
|
||||
CXXFLAGS_windows := -EHsc -DUNICODE -D_UNICODE, \
|
||||
DISABLED_WARNINGS_clang_jawt.m := sign-compare, \
|
||||
EXTRA_HEADER_DIRS := $(LIBJAWT_EXTRA_HEADER_DIRS), \
|
||||
LDFLAGS_windows := $(LDFLAGS_CXX_JDK), \
|
||||
LDFLAGS_macosx := -Wl$(COMMA)-rpath$(COMMA)@loader_path, \
|
||||
JDK_LIBS_unix := $(LIBJAWT_JDK_LIBS_unix), \
|
||||
JDK_LIBS_windows := libawt, \
|
||||
JDK_LIBS_macosx := libawt_lwawt, \
|
||||
LIBS_macosx := -framework Cocoa, \
|
||||
LIBS_windows := advapi32.lib $(LIBJAWT_LIBS_windows), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBJAWT)
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
$(eval $(call SetupCopyFiles, COPY_JAWT_LIB, \
|
||||
FILES := $(BUILD_LIBJAWT_IMPORT_LIBRARY), \
|
||||
DEST := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
|
||||
))
|
||||
|
||||
$(COPY_JAWT_LIB): $(BUILD_LIBJAWT)
|
||||
|
||||
TARGETS += $(COPY_JAWT_LIB)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
endif # include guard
|
||||
include MakeIncludeEnd.gmk
|
||||
482
make/modules/java.desktop/lib/ClientLibraries.gmk
Normal file
482
make/modules/java.desktop/lib/ClientLibraries.gmk
Normal file
|
|
@ -0,0 +1,482 @@
|
|||
#
|
||||
# Copyright (c) 2011, 2025, 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
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
include MakeIncludeStart.gmk
|
||||
ifeq ($(INCLUDE), true)
|
||||
|
||||
################################################################################
|
||||
# This file will build all AWT/2D native libraries that does not have "awt" in
|
||||
# the name. Note that this does not imply anything about the logical ownership
|
||||
# of the code they compile.
|
||||
# This split is purely made to keep the size of the Makefiles reasonable.
|
||||
################################################################################
|
||||
|
||||
################################################################################
|
||||
## Build libmlib_image
|
||||
################################################################################
|
||||
|
||||
ifeq ($(call isTargetCpuBits, 64), true)
|
||||
LIBMLIB_IMAGE_CFLAGS := -DMLIB_OS64BIT
|
||||
endif
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBMLIB_IMAGE, \
|
||||
NAME := mlib_image, \
|
||||
EXTRA_SRC := common/awt/medialib, \
|
||||
EXTRA_HEADER_DIRS := java.base:libjava, \
|
||||
EXCLUDE_FILES := mlib_c_ImageBlendTable.c, \
|
||||
OPTIMIZATION := HIGHEST, \
|
||||
CFLAGS := -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES -DMLIB_NO_LIBSUNMATH \
|
||||
$(LIBMLIB_IMAGE_CFLAGS), \
|
||||
DISABLED_WARNINGS_gcc := unused-function, \
|
||||
DISABLED_WARNINGS_clang_mlib_ImageCreate.c := unused-function, \
|
||||
LIBS_unix := $(LIBM), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBMLIB_IMAGE)
|
||||
|
||||
################################################################################
|
||||
## Build liblcms
|
||||
################################################################################
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LCMS), true)
|
||||
# If we're using an external library, we'll just need the wrapper part.
|
||||
# By including it explicitly, all other files will be excluded.
|
||||
LIBLCMS_INCLUDE_FILES := LCMS.c
|
||||
# If we're using an external library, we can't include our own SRC path
|
||||
# as includes, instead the system headers should be used.
|
||||
LIBLCMS_HEADERS_FROM_SRC := false
|
||||
endif
|
||||
|
||||
ifeq ($(TOOLCHAIN_TYPE)+$(TOOLCHAIN_VERSION), clang+10.1)
|
||||
# Work around an optimizer bug seen with Xcode 10.1, but fixed by 10.3
|
||||
BUILD_LIBLCMS_cmsopt.c_CFLAGS := -O0
|
||||
endif
|
||||
|
||||
# We use CMS_DONT_USE_FAST_FLOOR and CMS_NO_HALF_SUPPORT since the fast floor
|
||||
# code loses precision.
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBLCMS, \
|
||||
NAME := lcms, \
|
||||
INCLUDE_FILES := $(LIBLCMS_INCLUDE_FILES), \
|
||||
OPTIMIZATION := HIGHEST, \
|
||||
CFLAGS := -DCMS_DONT_USE_FAST_FLOOR -DCMS_NO_HALF_SUPPORT $(LCMS_CFLAGS), \
|
||||
CFLAGS_windows := -DCMS_IS_WINDOWS_, \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
common/awt/debug \
|
||||
libawt/java2d \
|
||||
java.base:libjvm, \
|
||||
HEADERS_FROM_SRC := $(LIBLCMS_HEADERS_FROM_SRC), \
|
||||
DISABLED_WARNINGS_gcc := format-nonliteral stringop-truncation \
|
||||
unused-variable, \
|
||||
DISABLED_WARNINGS_clang := format-nonliteral, \
|
||||
JDK_LIBS := libawt java.base:libjava, \
|
||||
LIBS_unix := $(LCMS_LIBS) $(LIBM), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBLCMS)
|
||||
|
||||
################################################################################
|
||||
## Build libjavajpeg
|
||||
################################################################################
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LIBJPEG), true)
|
||||
LIBJAVAJPEG_INCLUDE_FILES := \
|
||||
imageioJPEG.c \
|
||||
jpegdecoder.c \
|
||||
#
|
||||
# If we're using an external library, we can't include our own SRC path
|
||||
# as includes, instead the system headers should be used.
|
||||
LIBJAVAJPEG_HEADERS_FROM_SRC := false
|
||||
endif
|
||||
|
||||
# "DISABLED_WARNINGS_gcc := clobbered" rationale:
|
||||
# Suppress gcc warnings like "variable might be clobbered by 'longjmp'
|
||||
# or 'vfork'": this warning indicates that some variable is placed to
|
||||
# a register by optimized compiler and it's value might be lost on longjmp().
|
||||
# Recommended way to avoid such warning is to declare the variable as
|
||||
# volatile to prevent the optimization. However, this approach does not
|
||||
# work because we have to declare all variables as volatile in result.
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJAVAJPEG, \
|
||||
NAME := javajpeg, \
|
||||
INCLUDE_FILES := $(LIBJAVAJPEG_INCLUDE_FILES), \
|
||||
OPTIMIZATION := HIGHEST, \
|
||||
HEADERS_FROM_SRC := $(LIBJAVAJPEG_HEADERS_FROM_SRC), \
|
||||
DISABLED_WARNINGS_gcc_imageioJPEG.c := array-bounds clobbered \
|
||||
unused-but-set-variable, \
|
||||
DISABLED_WARNINGS_gcc_jcmaster.c := implicit-fallthrough, \
|
||||
DISABLED_WARNINGS_gcc_jdphuff.c := shift-negative-value, \
|
||||
DISABLED_WARNINGS_clang_imageioJPEG.c := unused-but-set-variable, \
|
||||
JDK_LIBS := java.base:libjava, \
|
||||
LIBS := $(LIBJPEG_LIBS), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBJAVAJPEG)
|
||||
|
||||
################################################################################
|
||||
## Build libsplashscreen
|
||||
################################################################################
|
||||
|
||||
ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
LIBSPLASHSCREEN_EXTRA_SRC := \
|
||||
common/awt/systemscale \
|
||||
#
|
||||
|
||||
LIBSPLASHSCREEN_HEADER_DIRS := \
|
||||
common/awt/utility \
|
||||
libosxapp \
|
||||
java.base:libjava \
|
||||
java.base:libjvm \
|
||||
#
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LIBGIF), false)
|
||||
LIBSPLASHSCREEN_HEADER_DIRS += libsplashscreen/giflib
|
||||
else
|
||||
LIBSPLASHSCREEN_EXCLUDES += giflib
|
||||
endif
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LIBJPEG), false)
|
||||
LIBSPLASHSCREEN_EXTRA_SRC += libjavajpeg
|
||||
LIBJAVA_JPEG_OBJS := $(sort $(patsubst %.c,%.o, $(filter-out imageioJPEG.c, \
|
||||
$(notdir $(wildcard $(TOPDIR)/src/java.desktop/share/native/libjavajpeg/*.c)))))
|
||||
LIBSPLASHSCREEN_STATIC_LIB_EXCLUDE_OBJS += $(LIBJAVA_JPEG_OBJS)
|
||||
endif
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LIBPNG), false)
|
||||
LIBSPLASHSCREEN_HEADER_DIRS += libsplashscreen/libpng
|
||||
LIBSPLASHSCREEN_CFLAGS += -DPNG_NO_MMX_CODE -DPNG_ARM_NEON_OPT=0 \
|
||||
-DPNG_ARM_NEON_IMPLEMENTATION=0 -DPNG_LOONGARCH_LSX_OPT=0
|
||||
|
||||
ifeq ($(call isTargetOs, linux)+$(call isTargetCpuArch, ppc), true+true)
|
||||
LIBSPLASHSCREEN_CFLAGS += -DPNG_POWERPC_VSX_OPT=0
|
||||
endif
|
||||
|
||||
# The libpng bundled with jdk is a reduced version which does not
|
||||
# contain .png_init_filter_functions_vsx.
|
||||
# Therefore we need to disable PNG_POWERPC_VSX_OPT explicitly by setting
|
||||
# it to 0. If this define is not set, it would be automatically set to 2,
|
||||
# because
|
||||
# "#if defined(__PPC64__) && defined(__ALTIVEC__) && defined(__VSX__)"
|
||||
# expands to true. This would results in the fact that
|
||||
# .png_init_filter_functions_vsx is needed in libpng.
|
||||
ifeq ($(call isTargetOs, aix), true)
|
||||
LIBSPLASHSCREEN_CFLAGS += -DPNG_POWERPC_VSX_OPT=0
|
||||
endif
|
||||
else
|
||||
LIBSPLASHSCREEN_EXCLUDES += libpng
|
||||
endif
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LIBZ), false)
|
||||
LIBSPLASHSCREEN_EXTRA_SRC += java.base:libzip/zlib
|
||||
LIBZIP_SRC_PATH := $(TOPDIR)/src/java.base/share/native/libzip
|
||||
LIBZIP_OBJS := $(sort $(patsubst %.c,%.o, $(notdir \
|
||||
$(wildcard $(LIBZIP_SRC_PATH)/*.c $(LIBZIP_SRC_PATH)/zlib/*.c))))
|
||||
LIBSPLASHSCREEN_STATIC_LIB_EXCLUDE_OBJS += $(LIBZIP_OBJS)
|
||||
endif
|
||||
|
||||
LIBSPLASHSCREEN_CFLAGS += -DSPLASHSCREEN
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
# libsplashscreen on macosx does not use the unix code
|
||||
LIBSPLASHSCREEN_EXCLUDE_SRC_PATTERNS := /unix/
|
||||
|
||||
BUILD_LIBSPLASHSCREEN_java_awt_SplashScreen.c_CFLAGS := -x objective-c -O0
|
||||
BUILD_LIBSPLASHSCREEN_splashscreen_gfx_impl.c_CFLAGS := -x objective-c -O0
|
||||
BUILD_LIBSPLASHSCREEN_splashscreen_gif.c_CFLAGS := -x objective-c -O0
|
||||
BUILD_LIBSPLASHSCREEN_splashscreen_impl.c_CFLAGS := -x objective-c -O0
|
||||
BUILD_LIBSPLASHSCREEN_splashscreen_jpeg.c_CFLAGS := -x objective-c -O0
|
||||
BUILD_LIBSPLASHSCREEN_splashscreen_png.c_CFLAGS := -x objective-c -O0
|
||||
BUILD_LIBSPLASHSCREEN_splashscreen_sys.m_CFLAGS := -O0
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX
|
||||
else ifeq ($(call isTargetOs, windows), true)
|
||||
LIBSPLASHSCREEN_CFLAGS += -DWITH_WIN32
|
||||
else
|
||||
LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 $(X_CFLAGS)
|
||||
endif
|
||||
|
||||
LIBSPLASHSCREEN_STATIC_LIB_EXCLUDE_OBJS += systemScale.o
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBSPLASHSCREEN, \
|
||||
NAME := splashscreen, \
|
||||
EXTRA_SRC := $(LIBSPLASHSCREEN_EXTRA_SRC), \
|
||||
EXCLUDE_SRC_PATTERNS := $(LIBSPLASHSCREEN_EXCLUDE_SRC_PATTERNS), \
|
||||
EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
|
||||
EXCLUDES := $(LIBSPLASHSCREEN_EXCLUDES), \
|
||||
OPTIMIZATION := SIZE, \
|
||||
LINK_TIME_OPTIMIZATION := true, \
|
||||
CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) \
|
||||
$(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS) \
|
||||
$(ICONV_CFLAGS), \
|
||||
CXXFLAGS := $(LIBSPLASHSCREEN_CFLAGS) \
|
||||
$(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS) \
|
||||
$(ICONV_CFLAGS), \
|
||||
EXTRA_HEADER_DIRS := $(LIBSPLASHSCREEN_HEADER_DIRS), \
|
||||
DISABLED_WARNINGS_gcc_dgif_lib.c := sign-compare, \
|
||||
DISABLED_WARNINGS_gcc_jcmaster.c := implicit-fallthrough, \
|
||||
DISABLED_WARNINGS_gcc_jdphuff.c := shift-negative-value, \
|
||||
DISABLED_WARNINGS_gcc_png.c := maybe-uninitialized, \
|
||||
DISABLED_WARNINGS_gcc_pngerror.c := maybe-uninitialized, \
|
||||
DISABLED_WARNINGS_gcc_splashscreen_gfx_impl.c := implicit-fallthrough \
|
||||
maybe-uninitialized, \
|
||||
DISABLED_WARNINGS_gcc_splashscreen_impl.c := implicit-fallthrough \
|
||||
sign-compare unused-function, \
|
||||
DISABLED_WARNINGS_gcc_splashscreen_sys.c := type-limits \
|
||||
unused-but-set-variable unused-result unused-variable, \
|
||||
DISABLED_WARNINGS_clang := deprecated-non-prototype, \
|
||||
DISABLED_WARNINGS_clang_dgif_lib.c := sign-compare, \
|
||||
DISABLED_WARNINGS_clang_gzwrite.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_splashscreen_impl.c := sign-compare \
|
||||
unused-but-set-variable unused-function, \
|
||||
DISABLED_WARNINGS_clang_splashscreen_png.c := \
|
||||
incompatible-pointer-types, \
|
||||
DISABLED_WARNINGS_clang_splashscreen_sys.m := deprecated-declarations \
|
||||
unused-variable unused-but-set-variable, \
|
||||
DISABLED_WARNINGS_microsoft_dgif_lib.c := 4018 4267, \
|
||||
DISABLED_WARNINGS_microsoft_splashscreen_impl.c := 4018 4267 4244, \
|
||||
DISABLED_WARNINGS_microsoft_splashscreen_png.c := 4267, \
|
||||
DISABLED_WARNINGS_microsoft_splashscreen_sys.c := 4267 4244, \
|
||||
LDFLAGS := $(ICONV_LDFLAGS), \
|
||||
LDFLAGS_windows := -delayload:user32.dll, \
|
||||
JDK_LIBS_windows := java.base:libjava, \
|
||||
JDK_LIBS_macosx := libosxapp, \
|
||||
LIBS := $(GIFLIB_LIBS) $(LIBJPEG_LIBS) $(LIBZ_LIBS) $(PNG_LIBS) $(ICONV_LIBS), \
|
||||
LIBS_unix := $(LIBM) $(LIBPTHREAD), \
|
||||
LIBS_linux := $(X_LIBS) -lX11 -lXext, \
|
||||
LIBS_macosx := \
|
||||
-framework ApplicationServices \
|
||||
-framework Cocoa \
|
||||
-framework Foundation \
|
||||
-framework Metal \
|
||||
-framework Security, \
|
||||
LIBS_aix := $(LIBDL) $(X_LIBS) -lX11 -lXext, \
|
||||
LIBS_windows := delayimp.lib gdi32.lib kernel32.lib user32.lib, \
|
||||
STATIC_LIB_EXCLUDE_OBJS := $(LIBSPLASHSCREEN_STATIC_LIB_EXCLUDE_OBJS), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBSPLASHSCREEN)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
## Build libfreetype
|
||||
################################################################################
|
||||
|
||||
ifeq ($(FREETYPE_TO_USE), bundled)
|
||||
# freetype requires you to manually define DLL_EXPORT for windows (see ftconfig.h)
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBFREETYPE, \
|
||||
NAME := freetype, \
|
||||
OPTIMIZATION := HIGHEST, \
|
||||
CFLAGS := -DFT2_BUILD_LIBRARY, \
|
||||
CFLAGS_windows := -DDLL_EXPORT, \
|
||||
EXTRA_HEADER_DIRS := java.base:libjava libfreetype/include, \
|
||||
DISABLED_WARNINGS_microsoft := 4267 4244 4996, \
|
||||
DISABLED_WARNINGS_gcc := dangling-pointer stringop-overflow, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBFREETYPE)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
## Build libfontmanager
|
||||
################################################################################
|
||||
|
||||
ifeq ($(USE_EXTERNAL_HARFBUZZ), true)
|
||||
LIBFONTMANAGER_EXTRA_SRC =
|
||||
LIBFONTMANAGER_LIBS += $(HARFBUZZ_LIBS)
|
||||
LIBFONTMANAGER_CFLAGS += $(HARFBUZZ_CFLAGS)
|
||||
else
|
||||
LIBFONTMANAGER_EXTRA_SRC = libharfbuzz
|
||||
|
||||
ifeq ($(call isTargetOs, windows), false)
|
||||
HARFBUZZ_CFLAGS += -DGETPAGESIZE -DHAVE_MPROTECT -DHAVE_PTHREAD \
|
||||
-DHAVE_SYSCONF -DHAVE_SYS_MMAN_H -DHAVE_UNISTD_H \
|
||||
-DHB_NO_PRAGMA_GCC_DIAGNOSTIC
|
||||
endif
|
||||
ifeq ($(call isTargetOs, linux macosx), true)
|
||||
HARFBUZZ_CFLAGS += -DHAVE_INTEL_ATOMIC_PRIMITIVES -DHB_NO_VISIBILITY
|
||||
endif
|
||||
|
||||
# hb-ft.cc is not presently needed, and requires freetype 2.4.2 or later.
|
||||
# hb-subset and hb-style APIs are not needed, excluded to cut on compilation
|
||||
# time.
|
||||
LIBFONTMANAGER_EXCLUDE_FILES += gsubgpos-context.cc hb-ft.cc hb-style.cc \
|
||||
hb-subset-cff-common.cc hb-subset-cff1.cc hb-subset-cff2.cc \
|
||||
hb-subset-input.cc hb-subset-instancer-solver.cc hb-subset-plan.cc \
|
||||
hb-subset.cc
|
||||
|
||||
# list of disabled warnings and the compilers for which it was specifically
|
||||
# added.
|
||||
# array-bounds -> GCC 12 on Alpine Linux
|
||||
# parentheses -> GCC 6
|
||||
# range-loop-analysis -> clang on Xcode12
|
||||
|
||||
HARFBUZZ_DISABLED_WARNINGS_gcc := missing-field-initializers \
|
||||
strict-aliasing unused-result array-bounds parentheses \
|
||||
unused-variable dangling-pointer
|
||||
# noexcept-type required for GCC 7 builds. Not required for GCC 8+.
|
||||
# expansion-to-defined required for GCC 9 builds. Not required for GCC 10+.
|
||||
# maybe-uninitialized required for GCC 8 builds. Not required for GCC 9+.
|
||||
# calloc-transposed-args required for GCC 14 builds. (fixed upstream in
|
||||
# Harfbuzz 032c931e1c0cfb20f18e5acb8ba005775242bd92)
|
||||
HARFBUZZ_DISABLED_WARNINGS_CXX_gcc := class-memaccess noexcept-type \
|
||||
expansion-to-defined dangling-reference maybe-uninitialized \
|
||||
calloc-transposed-args
|
||||
HARFBUZZ_DISABLED_WARNINGS_clang := missing-field-initializers \
|
||||
range-loop-analysis unused-variable
|
||||
HARFBUZZ_DISABLED_WARNINGS_microsoft := 4267 4244
|
||||
|
||||
LIBFONTMANAGER_CFLAGS += $(HARFBUZZ_CFLAGS)
|
||||
endif
|
||||
|
||||
LIBFONTMANAGER_EXTRA_HEADER_DIRS := \
|
||||
common/awt \
|
||||
common/awt/utility \
|
||||
common/font \
|
||||
libawt/java2d \
|
||||
libawt/java2d/pipe \
|
||||
libawt/java2d/loops \
|
||||
#
|
||||
|
||||
ifeq ($(FREETYPE_TO_USE), system)
|
||||
LIBFONTMANAGER_CFLAGS += $(FREETYPE_CFLAGS)
|
||||
LIBFONTMANAGER_LIBS += $(FREETYPE_LIBS)
|
||||
else
|
||||
LIBFONTMANAGER_EXTRA_HEADER_DIRS += libfreetype/include
|
||||
LIBFONTMANAGER_JDK_LIBS += libfreetype
|
||||
endif
|
||||
|
||||
ifneq ($(filter $(TOOLCHAIN_TYPE), gcc clang), )
|
||||
# gcc (and to an extent clang) is particularly bad at optimizing these files,
|
||||
# causing a massive spike in compile time. We don't care about these
|
||||
# particular files anyway, so lower optimization level.
|
||||
BUILD_LIBFONTMANAGER_hb-subset.cc_OPTIMIZATION := SIZE
|
||||
BUILD_LIBFONTMANAGER_hb-subset-plan.cc_OPTIMIZATION := SIZE
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c X11TextRenderer.c
|
||||
else ifeq ($(call isTargetOs, macosx), true)
|
||||
LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c X11TextRenderer.c \
|
||||
fontpath.c lcdglyph.c
|
||||
else
|
||||
LIBFONTMANAGER_EXCLUDE_FILES += fontpath.c lcdglyph.c
|
||||
endif
|
||||
|
||||
LIBFONTMANAGER_CFLAGS += $(X_CFLAGS) -DLE_STANDALONE -DHEADLESS
|
||||
|
||||
# LDFLAGS clarification:
|
||||
# Filter relevant linker flags disallowing unresolved symbols as we cannot
|
||||
# build-time decide to which library to link against (libawt_headless or
|
||||
# libawt_xawt). See JDK-8196516 for details.
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBFONTMANAGER, \
|
||||
NAME := fontmanager, \
|
||||
LINK_TYPE := C++, \
|
||||
EXCLUDE_FILES := $(LIBFONTMANAGER_EXCLUDE_FILES) \
|
||||
AccelGlyphCache.c, \
|
||||
CFLAGS := $(LIBFONTMANAGER_CFLAGS), \
|
||||
CXXFLAGS := $(LIBFONTMANAGER_CFLAGS), \
|
||||
OPTIMIZATION := HIGHEST, \
|
||||
CFLAGS_windows = -DCC_NOEX, \
|
||||
EXTRA_HEADER_DIRS := $(LIBFONTMANAGER_EXTRA_HEADER_DIRS), \
|
||||
EXTRA_SRC := $(LIBFONTMANAGER_EXTRA_SRC), \
|
||||
DISABLED_WARNINGS_gcc := $(HARFBUZZ_DISABLED_WARNINGS_gcc), \
|
||||
DISABLED_WARNINGS_CXX_gcc := $(HARFBUZZ_DISABLED_WARNINGS_CXX_gcc), \
|
||||
DISABLED_WARNINGS_clang := $(HARFBUZZ_DISABLED_WARNINGS_clang), \
|
||||
DISABLED_WARNINGS_microsoft := $(HARFBUZZ_DISABLED_WARNINGS_microsoft), \
|
||||
LDFLAGS := $(LDFLAGS_CXX_JDK), \
|
||||
LDFLAGS_FILTER_OUT := -Wl$(COMMA)-z$(COMMA)defs, \
|
||||
LDFLAGS_aix := -Wl$(COMMA)-berok, \
|
||||
JDK_LIBS := libawt java.base:libjava $(LIBFONTMANAGER_JDK_LIBS), \
|
||||
JDK_LIBS_macosx := libawt_lwawt, \
|
||||
JDK_LIBS_unix := java.base:libjvm, \
|
||||
LIBS := $(LIBFONTMANAGER_LIBS), \
|
||||
LIBS_unix := $(LIBM), \
|
||||
LIBS_macosx := \
|
||||
-framework CoreFoundation \
|
||||
-framework CoreGraphics \
|
||||
-framework CoreText, \
|
||||
LIBS_windows := advapi32.lib gdi32.lib user32.lib, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBFONTMANAGER)
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
##############################################################################
|
||||
## Build libosxui
|
||||
##############################################################################
|
||||
|
||||
SHADERS_SRC := \
|
||||
$(TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/shaders.metal
|
||||
SHADERS_SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/native/java.desktop/libosxui
|
||||
SHADERS_AIR := $(SHADERS_SUPPORT_DIR)/shaders.air
|
||||
SHADERS_LIB := $(call FindLibDirForModule, $(MODULE))/shaders.metallib
|
||||
|
||||
$(eval $(call SetupExecute, metal_shaders, \
|
||||
INFO := Running metal on $(notdir $(SHADERS_SRC)) (for libosxui.dylib), \
|
||||
DEPS := $(SHADERS_SRC), \
|
||||
OUTPUT_FILE := $(SHADERS_AIR), \
|
||||
SUPPORT_DIR := $(SHADERS_SUPPORT_DIR), \
|
||||
COMMAND := $(METAL) -c -std=osx-metal2.0 \
|
||||
-mmacosx-version-min=$(MACOSX_VERSION_MIN) \
|
||||
-o $(SHADERS_AIR) $(SHADERS_SRC), \
|
||||
))
|
||||
|
||||
$(eval $(call SetupExecute, metallib_shaders, \
|
||||
INFO := Running metallib on $(notdir $(SHADERS_AIR)) (for libosxui.dylib), \
|
||||
DEPS := $(SHADERS_AIR), \
|
||||
OUTPUT_FILE := $(SHADERS_LIB), \
|
||||
SUPPORT_DIR := $(SHADERS_SUPPORT_DIR), \
|
||||
COMMAND := $(METALLIB) -o $(SHADERS_LIB) $(SHADERS_AIR), \
|
||||
))
|
||||
|
||||
TARGETS += $(SHADERS_LIB)
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBOSXUI, \
|
||||
NAME := osxui, \
|
||||
OPTIMIZATION := LOW, \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
libawt_lwawt/awt, \
|
||||
DISABLED_WARNINGS_clang_AquaFileView.m := deprecated-declarations \
|
||||
sign-compare, \
|
||||
DISABLED_WARNINGS_clang_ScreenMenu.m := deprecated-declarations, \
|
||||
APPEND_LDFLAGS := -Wl$(COMMA)-rpath$(COMMA)@loader_path, \
|
||||
JDK_LIBS := java.base:libjava libosxapp, \
|
||||
LIBS_macosx := \
|
||||
-framework ApplicationServices \
|
||||
-framework Carbon \
|
||||
-framework Cocoa \
|
||||
-framework JavaRuntimeSupport \
|
||||
-framework Metal, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBOSXUI)
|
||||
|
||||
$(BUILD_LIBOSXUI): $(SHADERS_LIB)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
endif # include guard
|
||||
include MakeIncludeEnd.gmk
|
||||
Loading…
Add table
Add a link
Reference in a new issue