1 #
   2 # Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #
  25 
  26 $(eval $(call IncludeCustomExtension, lib/Awt2dLibraries-pre.gmk))
  27 
  28 WIN_AWT_LIB := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt/awt.lib
  29 
  30 LIBAWT_DEFAULT_HEADER_DIRS := \
  31     libawt/awt/image \
  32     libawt/awt/image/cvutils \
  33     libawt/java2d \
  34     libawt/java2d/loops \
  35     libawt/java2d/pipe \
  36     #
  37 
  38 ################################################################################
  39 
  40 # We must not include java.desktop/unix/native/libmlib_image, which is only
  41 # for usage by solaris-sparc in libmlib_image_v.
  42 BUILD_LIBMLIB_EXCLUDE_SRC_PATTERNS := unix
  43 
  44 BUILD_LIBMLIB_CFLAGS := -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES -DMLIB_NO_LIBSUNMATH
  45 
  46 ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
  47   BUILD_LIBMLIB_CFLAGS += -DMLIB_OS64BIT
  48 endif
  49 
  50 $(eval $(call SetupJdkLibrary, BUILD_LIBMLIB_IMAGE, \
  51     NAME := mlib_image, \
  52     EXTRA_SRC := common/awt/medialib, \
  53     EXCLUDE_FILES := mlib_c_ImageBlendTable.c, \
  54     EXCLUDE_SRC_PATTERNS := $(BUILD_LIBMLIB_EXCLUDE_SRC_PATTERNS), \
  55     OPTIMIZATION := HIGHEST, \
  56     CFLAGS := $(CFLAGS_JDKLIB) \
  57         $(BUILD_LIBMLIB_CFLAGS), \
  58     DISABLED_WARNINGS_gcc := unused-function, \
  59     LDFLAGS := $(LDFLAGS_JDKLIB) \
  60         $(call SET_SHARED_LIBRARY_ORIGIN), \
  61     LIBS := $(JDKLIB_LIBS), \
  62     LIBS_unix := $(LIBM) $(LIBDL), \
  63 ))
  64 
  65 $(BUILD_LIBMLIB_IMAGE): $(call FindLib, java.base, java)
  66 
  67 TARGETS += $(BUILD_LIBMLIB_IMAGE)
  68 
  69 ################################################################################
  70 
  71 ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
  72 
  73   # libmlib_image_v is basically built from mlib_image sources, with some additions
  74   # and some exclusions.
  75   LIBMLIB_IMAGE_V_SRC := \
  76      libmlib_image \
  77      common/awt/medialib \
  78      #
  79 
  80   LIBMLIB_IMAGE_V_CFLAGS := -xarch=sparcvis -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES \
  81       $(TOPDIR)/src/$(MODULE)/unix/native/libmlib_image/vis_$(OPENJDK_TARGET_CPU_BITS).il
  82 
  83   ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
  84     LIBMLIB_IMAGE_V_CFLAGS += -DMLIB_OS64BIT
  85   endif
  86 
  87   BUILD_LIBMLIB_IMAGE_V_EXFILES := \
  88       awt_ImagingLib.c \
  89       mlib_c_ImageAffine_BC.c \
  90       mlib_c_ImageAffine_BC_S16.c \
  91       mlib_c_ImageAffine_BC_U16.c \
  92       mlib_c_ImageAffine_BL.c \
  93       mlib_c_ImageAffine_BL_S16.c \
  94       mlib_c_ImageAffine_BL_U16.c \
  95       mlib_c_ImageAffine_NN.c \
  96       mlib_c_ImageConvClearEdge.c \
  97       mlib_c_ImageConvCopyEdge.c \
  98       mlib_c_ImageConv_f.c \
  99       mlib_c_ImageConvVersion.c \
 100       mlib_c_ImageCopy.c \
 101       mlib_c_ImageLookUp.c \
 102       mlib_c_ImageLookUp_f.c \
 103       #
 104 
 105   $(eval $(call SetupJdkLibrary, BUILD_LIBMLIB_IMAGE_V, \
 106       NAME := mlib_image_v, \
 107       SRC := $(LIBMLIB_IMAGE_V_SRC), \
 108       EXCLUDE_FILES := $(BUILD_LIBMLIB_IMAGE_V_EXFILES), \
 109       OPTIMIZATION := HIGHEST, \
 110       CFLAGS := $(CFLAGS_JDKLIB) \
 111           $(LIBMLIB_IMAGE_V_CFLAGS), \
 112       LDFLAGS := $(LDFLAGS_JDKLIB) \
 113           $(call SET_SHARED_LIBRARY_ORIGIN), \
 114       LIBS := -ljava -ljvm $(LIBM) $(LIBDL), \
 115   ))
 116 
 117   $(BUILD_LIBMLIB_IMAGE_V): $(call FindLib, java.base, java)
 118 
 119   TARGETS += $(BUILD_LIBMLIB_IMAGE_V)
 120 
 121 endif
 122 
 123 ################################################################################
 124 
 125 LIBAWT_EXTRA_SRC := \
 126     common/awt/debug \
 127     $(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
 128     #
 129 
 130 ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
 131   LIBAWT_EXTRA_SRC += $(TOPDIR)/src/$(MODULE)/share/native/common/awt/medialib
 132 endif
 133 
 134 ifeq ($(OPENJDK_TARGET_OS), windows)
 135   LIBAWT_EXTRA_SRC += \
 136       $(TOPDIR)/src/$(MODULE)/share/native/common/awt/utility \
 137       $(TOPDIR)/src/$(MODULE)/share/native/common/font \
 138       $(TOPDIR)/src/$(MODULE)/share/native/common/java2d/opengl \
 139       $(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt/systemscale \
 140       #
 141 endif
 142 
 143 ifneq ($(filter $(OPENJDK_TARGET_OS), solaris linux macosx aix), )
 144   LIBAWT_EXFILES += awt_Font.c CUPSfuncs.c fontpath.c X11Color.c
 145 endif
 146 
 147 ifeq ($(OPENJDK_TARGET_OS), macosx)
 148   LIBAWT_EXFILES += initIDs.c awt/image/cvutils/img_colors.c
 149 endif
 150 
 151 ifeq ($(OPENJDK_TARGET_OS), windows)
 152   LIBAWT_EXFILES += \
 153       java2d/d3d/D3DShaderGen.c \
 154       awt/image/cvutils/img_colors.c \
 155       #
 156 endif
 157 
 158 ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), solaris-sparcv9)
 159   LIBAWT_EXFILES += java2d/loops/MapAccelFunc.c
 160 else
 161   LIBAWT_EXCLUDES += \
 162       $(TOPDIR)/src/$(MODULE)/unix/native/libawt/awt/medialib \
 163       $(TOPDIR)/src/$(MODULE)/unix/native/libawt/java2d/loops \
 164       $(TOPDIR)/src/$(MODULE)/unix/native/common/awt/medialib \
 165       #
 166 endif
 167 
 168 LIBAWT_EXTRA_HEADER_DIRS := \
 169     $(LIBAWT_DEFAULT_HEADER_DIRS) \
 170     $(call GetJavaHeaderDir, java.base) \
 171     libawt/awt/medialib \
 172     libawt/java2d/d3d \
 173     libawt/java2d/opengl \
 174     libawt/java2d/windows \
 175     libawt/windows \
 176     common/awt/medialib \
 177     libmlib_image \
 178     include \
 179     java.base:libjava \
 180     java.base:include \
 181     #
 182 
 183 LIBAWT_CFLAGS += -D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES $(X_CFLAGS)
 184 
 185 ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), solaris-sparcv9)
 186   LIBAWT_CFLAGS += -xarch=sparcvis -DMLIB_ADD_SUFF \
 187       $(TOPDIR)/src/$(MODULE)/unix/native/libmlib_image/vis_$(OPENJDK_TARGET_CPU_BITS).il
 188 
 189   LIBAWT_ASFLAGS = -P -xarch=v9a
 190 endif
 191 
 192 ifneq ($(OPENJDK_TARGET_OS), solaris)
 193   LIBAWT_CFLAGS += -DMLIB_NO_LIBSUNMATH
 194 endif
 195 
 196 ifeq ($(OPENJDK_TARGET_OS), windows)
 197   LIBAWT_CFLAGS += -EHsc -DUNICODE -D_UNICODE
 198   ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
 199     LIBAWT_CFLAGS += -DMLIB_OS64BIT
 200   endif
 201 
 202   LIBAWT_RC_FLAGS ?= -I $(TOPDIR)/src/java.base/windows/native/launcher/icons
 203   LIBAWT_VERSIONINFO_RESOURCE := $(TOPDIR)/src/$(MODULE)/windows/native/libawt/windows/awt.rc
 204 endif
 205 
 206 ifeq ($(OPENJDK_TARGET_OS), linux)
 207   # FIXME: This is probably not what we want to do, but keep it now for compatibility.
 208   LIBAWT_CFLAGS += $(EXPORT_ALL_SYMBOLS)
 209 endif
 210 
 211 # Turn off all warnings for debug_mem.c This is needed because the specific warning
 212 # about initializing a declared 'extern' cannot be turned off individually. Only
 213 # applies to debug builds.
 214 ifeq ($(TOOLCHAIN_TYPE), gcc)
 215   BUILD_LIBAWT_debug_mem.c_CFLAGS := -w
 216   # This option improves performance of MaskFill in Java2D by 20% for some gcc
 217   LIBAWT_CFLAGS += -fgcse-after-reload
 218 endif
 219 
 220 $(eval $(call SetupJdkLibrary, BUILD_LIBAWT, \
 221     NAME := awt, \
 222     EXTRA_SRC := $(LIBAWT_EXTRA_SRC), \
 223     EXCLUDES := $(LIBAWT_EXCLUDES), \
 224     EXCLUDE_FILES := $(LIBAWT_EXFILES), \
 225     OPTIMIZATION := LOW, \
 226     CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_CFLAGS), \
 227     EXTRA_HEADER_DIRS := $(LIBAWT_EXTRA_HEADER_DIRS), \
 228     DISABLED_WARNINGS_gcc := sign-compare unused-result maybe-uninitialized \
 229         format-nonliteral parentheses unused-value unused-function, \
 230     DISABLED_WARNINGS_clang := logical-op-parentheses extern-initializer \
 231         sign-compare format-nonliteral, \
 232     DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE, \
 233     DISABLED_WARNINGS_microsoft := 4244 4267 4996, \
 234     ASFLAGS := $(LIBAWT_ASFLAGS), \
 235     LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN), \
 236     LDFLAGS_macosx := -L$(INSTALL_LIBRARIES_HERE), \
 237     LDFLAGS_windows := -delayload:user32.dll -delayload:gdi32.dll \
 238         -delayload:shell32.dll -delayload:winmm.dll \
 239         -delayload:winspool.drv -delayload:imm32.dll \
 240         -delayload:ole32.dll -delayload:comdlg32.dll \
 241         -delayload:comctl32.dll -delayload:shlwapi.dll, \
 242     LIBS_unix := -ljvm -ljava $(LIBM), \
 243     LIBS_linux :=  $(LIBDL), \
 244     LIBS_solaris := $(LIBDL), \
 245     LIBS_aix := $(LIBDL),\
 246     LIBS_macosx := -lmlib_image \
 247         -framework Cocoa \
 248         -framework OpenGL \
 249         -framework Metal \
 250         -framework MetalKit \
 251         -framework JavaNativeFoundation \
 252         -framework JavaRuntimeSupport \
 253         -framework ApplicationServices \
 254         -framework AudioToolbox, \
 255     LIBS_windows := kernel32.lib user32.lib gdi32.lib winspool.lib \
 256         imm32.lib ole32.lib uuid.lib shell32.lib \
 257         comdlg32.lib winmm.lib comctl32.lib shlwapi.lib \
 258         delayimp.lib jvm.lib $(WIN_JAVA_LIB) advapi32.lib, \
 259     VERSIONINFO_RESOURCE := $(LIBAWT_VERSIONINFO_RESOURCE), \
 260     RC_FLAGS := $(RC_FLAGS) $(LIBAWT_RC_FLAGS) \
 261         -D "JDK_FNAME=awt.dll" \
 262         -D "JDK_INTERNAL_NAME=awt" \
 263         -D "JDK_FTYPE=0x2L", \
 264 ))
 265 
 266 $(BUILD_LIBAWT): $(call FindLib, java.base, java)
 267 
 268 ifeq ($(OPENJDK_TARGET_OS), macosx)
 269   $(BUILD_LIBAWT): $(BUILD_LIBMLIB_IMAGE)
 270 endif
 271 
 272 TARGETS += $(BUILD_LIBAWT)
 273 
 274 ################################################################################
 275 
 276 ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx), )
 277   ifeq ($(ENABLE_HEADLESS_ONLY), false)
 278 
 279     LIBAWT_XAWT_EXTRA_SRC := \
 280         common/awt \
 281         common/java2d \
 282         common/font \
 283         #
 284 
 285     LIBAWT_XAWT_EXCLUDES := medialib debug
 286 
 287     LIBAWT_XAWT_EXTRA_HEADER_DIRS := \
 288         $(LIBAWT_DEFAULT_HEADER_DIRS) \
 289         libawt_xawt/awt \
 290         include \
 291         common/awt/debug \
 292         common/awt/systemscale \
 293         common/font \
 294         common/java2d/opengl \
 295         common/java2d/x11 \
 296         #
 297 
 298     LIBAWT_XAWT_CFLAGS += -DXAWT -DXAWT_HACK \
 299         $(FONTCONFIG_CFLAGS) \
 300         $(CUPS_CFLAGS)
 301 
 302     ifeq ($(OPENJDK_TARGET_OS), solaris)
 303       LIBAWT_XAWT_CFLAGS += -DFUNCPROTO=15
 304     endif
 305 
 306     ifeq ($(OPENJDK_TARGET_OS), linux)
 307       ifeq ($(DISABLE_XRENDER), true)
 308         LIBAWT_XAWT_CFLAGS += -DDISABLE_XRENDER_BY_DEFAULT=true
 309       endif
 310     endif
 311 
 312     LIBAWT_XAWT_LIBS := $(LIBM) -lawt -lXext -lX11 -lXrender $(LIBDL) -lXtst -lXi -ljava -ljvm
 313 
 314     ifeq ($(OPENJDK_TARGET_OS), linux)
 315       LIBAWT_XAWT_LIBS += -lpthread
 316     endif
 317 
 318     ifeq ($(TOOLCHAIN_TYPE), gcc)
 319       # Turn off all warnings for the following files since they contain warnings
 320       # that cannot be turned of individually.
 321       # redefining a macro
 322       BUILD_LIBAWT_XAWT_gtk2_interface.c_CFLAGS := -w
 323       # comparison between pointer and integer
 324       BUILD_LIBAWT_XAWT_awt_Font.c_CFLAGS := -w
 325       # initializing a declared 'extern'
 326       BUILD_LIBAWT_XAWT_debug_mem.c_CFLAGS := -w
 327     endif
 328 
 329     $(eval $(call SetupJdkLibrary, BUILD_LIBAWT_XAWT, \
 330         NAME := awt_xawt, \
 331         EXTRA_SRC := $(LIBAWT_XAWT_EXTRA_SRC), \
 332         EXTRA_HEADER_DIRS := $(LIBAWT_XAWT_EXTRA_HEADER_DIRS), \
 333         EXCLUDES := $(LIBAWT_XAWT_EXCLUDES), \
 334         OPTIMIZATION := LOW, \
 335         CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_XAWT_CFLAGS) \
 336             $(X_CFLAGS), \
 337         WARNINGS_AS_ERRORS_xlc := false, \
 338         DISABLED_WARNINGS_gcc := type-limits pointer-to-int-cast \
 339             unused-result maybe-uninitialized format \
 340             format-security int-to-pointer-cast parentheses \
 341             implicit-fallthrough undef unused-function, \
 342         DISABLED_WARNINGS_clang := parentheses format undef \
 343             logical-op-parentheses format-nonliteral int-conversion, \
 344         DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE \
 345             E_ASSIGNMENT_TYPE_MISMATCH E_NON_CONST_INIT, \
 346         LDFLAGS := $(LDFLAGS_JDKLIB) \
 347             $(call SET_SHARED_LIBRARY_ORIGIN) \
 348             -L$(INSTALL_LIBRARIES_HERE), \
 349         LIBS :=  $(X_LIBS) $(LIBAWT_XAWT_LIBS), \
 350     ))
 351 
 352     $(BUILD_LIBAWT_XAWT): $(call FindLib, java.base, java)
 353 
 354     $(BUILD_LIBAWT_XAWT): $(BUILD_LIBAWT)
 355 
 356     TARGETS += $(BUILD_LIBAWT_XAWT)
 357 
 358   endif
 359 endif
 360 
 361 ################################################################################
 362 
 363 # The fast floor code loses precision.
 364 LCMS_CFLAGS=-DCMS_DONT_USE_FAST_FLOOR
 365 
 366 ifeq ($(USE_EXTERNAL_LCMS), true)
 367   # If we're using an external library, we'll just need the wrapper part.
 368   # By including it explicitly, all other files will be excluded.
 369   BUILD_LIBLCMS_INCLUDE_FILES := LCMS.c
 370   # If we're using an external library, we can't include our own SRC path
 371   # as includes, instead the system headers should be used.
 372   LIBLCMS_HEADERS_FROM_SRC := false
 373 else
 374   BUILD_LIBLCMS_INCLUDE_FILES :=
 375 endif
 376 
 377 $(eval $(call SetupJdkLibrary, BUILD_LIBLCMS, \
 378     NAME := lcms, \
 379     INCLUDE_FILES := $(BUILD_LIBLCMS_INCLUDE_FILES), \
 380     OPTIMIZATION := HIGHEST, \
 381     CFLAGS := $(CFLAGS_JDKLIB) \
 382         $(LCMS_CFLAGS), \
 383     CFLAGS_solaris := -xc99=no_lib, \
 384     CFLAGS_windows := -DCMS_IS_WINDOWS_, \
 385     EXTRA_HEADER_DIRS := \
 386         common/awt/debug \
 387         libawt/java2d, \
 388     HEADERS_FROM_SRC := $(LIBLCMS_HEADERS_FROM_SRC), \
 389     DISABLED_WARNINGS_gcc := format-nonliteral type-limits \
 390         misleading-indentation undef unused-function, \
 391     DISABLED_WARNINGS_clang := tautological-compare format-nonliteral undef, \
 392     DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
 393     DISABLED_WARNINGS_microsoft := 4819, \
 394     LDFLAGS := $(LDFLAGS_JDKLIB) \
 395         $(call SET_SHARED_LIBRARY_ORIGIN), \
 396     LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
 397     LIBS_unix := -lawt -ljvm -ljava $(LCMS_LIBS) $(LIBM), \
 398     LIBS_windows := $(WIN_AWT_LIB) $(WIN_JAVA_LIB), \
 399 ))
 400 
 401 TARGETS += $(BUILD_LIBLCMS)
 402 
 403 $(BUILD_LIBLCMS): $(BUILD_LIBAWT)
 404 
 405 ################################################################################
 406 
 407 # "DISABLED_WARNINGS_gcc := clobbered" rationale:
 408 # Suppress gcc warnings like "variable might be clobbered by 'longjmp'
 409 # or 'vfork'": this warning indicates that some variable is placed to
 410 # a register by optimized compiler and it's value might be lost on longjmp().
 411 # Recommended way to avoid such warning is to declare the variable as
 412 # volatile to prevent the optimization. However, this approach does not
 413 # work because we have to declare all variables as volatile in result.
 414 
 415 ifeq ($(USE_EXTERNAL_LIBJPEG), true)
 416   LIBJPEG_LIBS := -ljpeg
 417   BUILD_LIBJAVAJPEG_INCLUDE_FILES := \
 418       imageioJPEG.c \
 419       jpegdecoder.c
 420   # If we're using an external library, we can't include our own SRC path
 421   # as includes, instead the system headers should be used.
 422   LIBJPEG_HEADERS_FROM_SRC := false
 423 else
 424   LIBJPEG_LIBS :=
 425   BUILD_LIBJAVAJPEG_INCLUDE_FILES :=
 426 endif
 427 
 428 $(eval $(call SetupJdkLibrary, BUILD_LIBJAVAJPEG, \
 429     NAME := javajpeg, \
 430     INCLUDE_FILES := $(BUILD_LIBJAVAJPEG_INCLUDE_FILES), \
 431     OPTIMIZATION := HIGHEST, \
 432     CFLAGS := $(CFLAGS_JDKLIB), \
 433     HEADERS_FROM_SRC := $(LIBJPEG_HEADERS_FROM_SRC), \
 434     DISABLED_WARNINGS_gcc := clobbered implicit-fallthrough shift-negative-value, \
 435     LDFLAGS := $(LDFLAGS_JDKLIB) \
 436         $(call SET_SHARED_LIBRARY_ORIGIN), \
 437     LIBS := $(LIBJPEG_LIBS) $(JDKLIB_LIBS), \
 438     LIBS_windows := $(WIN_JAVA_LIB) jvm.lib, \
 439 ))
 440 
 441 $(BUILD_LIBJAVAJPEG): $(call FindLib, java.base, java)
 442 
 443 TARGETS += $(BUILD_LIBJAVAJPEG)
 444 
 445 ################################################################################
 446 
 447 # Mac and Windows only use the native AWT lib, do not build libawt_headless
 448 ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx),)
 449 
 450   LIBAWT_HEADLESS_EXTRA_SRC := \
 451       common/font \
 452       common/java2d \
 453       $(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
 454       #
 455 
 456   LIBAWT_HEADLESS_EXCLUDES := medialib
 457 
 458   LIBAWT_HEADLESS_EXTRA_HEADER_DIRS := \
 459       $(LIBAWT_DEFAULT_HEADER_DIRS) \
 460       common/awt/debug \
 461       common/font \
 462       common/java2d/opengl \
 463       #
 464 
 465   LIBAWT_HEADLESS_CFLAGS := $(CUPS_CFLAGS) $(FONTCONFIG_CFLAGS) $(X_CFLAGS) \
 466       -DHEADLESS=true
 467 
 468   $(eval $(call SetupJdkLibrary, BUILD_LIBAWT_HEADLESS, \
 469       NAME := awt_headless, \
 470       EXTRA_SRC := $(LIBAWT_HEADLESS_EXTRA_SRC), \
 471       EXCLUDES := $(LIBAWT_HEADLESS_EXCLUDES), \
 472       OPTIMIZATION := LOW, \
 473       CFLAGS := $(CFLAGS_JDKLIB) \
 474           $(LIBAWT_HEADLESS_CFLAGS), \
 475       EXTRA_HEADER_DIRS := $(LIBAWT_HEADLESS_EXTRA_HEADER_DIRS), \
 476       DISABLED_WARNINGS_gcc := unused-function, \
 477       DISABLED_WARNINGS_xlc := 1506-356, \
 478       DISABLED_WARNINGS_solstudio := E_EMPTY_TRANSLATION_UNIT, \
 479       LDFLAGS := $(LDFLAGS_JDKLIB) \
 480           $(call SET_SHARED_LIBRARY_ORIGIN), \
 481       LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
 482       LIBS_unix := -lawt -ljvm -ljava, \
 483       LIBS_linux := $(LIBM) $(LIBDL), \
 484       LIBS_solaris := $(LIBM) $(LIBDL) $(LIBCXX), \
 485   ))
 486 
 487   # AIX warning explanation:
 488   # 1506-356 : (W) Compilation unit is empty.
 489   #            This happens during the headless build
 490 
 491   $(BUILD_LIBAWT_HEADLESS): $(BUILD_LIBAWT)
 492 
 493   TARGETS += $(BUILD_LIBAWT_HEADLESS)
 494 
 495 endif
 496 
 497 ################################################################################
 498 
 499 ifeq ($(FREETYPE_TO_USE), system)
 500   # For use by libfontmanager:
 501   LIBFREETYPE_CFLAGS := $(FREETYPE_CFLAGS)
 502   LIBFREETYPE_LIBS := $(FREETYPE_LIBS)
 503 else
 504   BUILD_LIBFREETYPE_HEADER_DIRS := $(TOPDIR)/src/$(MODULE)/share/native/libfreetype/include
 505   BUILD_LIBFREETYPE_CFLAGS := -DFT2_BUILD_LIBRARY $(EXPORT_ALL_SYMBOLS)
 506 
 507   # For use by libfontmanager:
 508   LIBFREETYPE_CFLAGS := -I$(BUILD_LIBFREETYPE_HEADER_DIRS)
 509   ifeq ($(OPENJDK_TARGET_OS), windows)
 510     LIBFREETYPE_LIBS := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfreetype/freetype.lib
 511   else
 512     LIBFREETYPE_LIBS := -lfreetype
 513   endif
 514 
 515   $(eval $(call SetupJdkLibrary, BUILD_LIBFREETYPE, \
 516       NAME := freetype, \
 517       OPTIMIZATION := HIGHEST, \
 518       CFLAGS := $(CFLAGS_JDKLIB) \
 519           $(BUILD_LIBFREETYPE_CFLAGS), \
 520       EXTRA_HEADER_DIRS := $(BUILD_LIBFREETYPE_HEADER_DIRS), \
 521       DISABLED_WARNINGS_solstudio := \
 522          E_STATEMENT_NOT_REACHED \
 523          E_END_OF_LOOP_CODE_NOT_REACHED, \
 524       DISABLED_WARNINGS_microsoft := 4267 4244 4312 4819, \
 525       DISABLED_WARNINGS_gcc := implicit-fallthrough, \
 526       LDFLAGS := $(LDFLAGS_JDKLIB) \
 527           $(call SET_SHARED_LIBRARY_ORIGIN), \
 528   ))
 529 
 530   TARGETS += $(BUILD_LIBFREETYPE)
 531 endif
 532 
 533 ###########################################################################
 534 
 535 #### Begin harfbuzz configuration
 536 
 537 HARFBUZZ_CFLAGS := -DHAVE_OT -DHAVE_FALLBACK -DHAVE_UCDN -DHAVE_ROUND
 538 
 539 ifneq ($(OPENJDK_TARGET_OS), windows)
 540   HARFBUZZ_CFLAGS += -DGETPAGESIZE -DHAVE_MPROTECT -DHAVE_PTHREAD \
 541                       -DHAVE_SYSCONF -DHAVE_SYS_MMAN_H -DHAVE_UNISTD_H
 542 endif
 543 ifneq (, $(findstring $(OPENJDK_TARGET_OS), linux macosx))
 544   HARFBUZZ_CFLAGS += -DHAVE_INTEL_ATOMIC_PRIMITIVES
 545 endif
 546 ifeq ($(OPENJDK_TARGET_OS), solaris)
 547   HARFBUZZ_CFLAGS += -DHAVE_SOLARIS_ATOMIC_OPS
 548 endif
 549 ifeq ($(OPENJDK_TARGET_OS), macosx)
 550   HARFBUZZ_CFLAGS += -DHAVE_CORETEXT
 551 endif
 552 ifneq ($(OPENJDK_TARGET_OS), macosx)
 553   LIBFONTMANAGER_EXCLUDE_FILES += harfbuzz/hb-coretext.cc
 554 endif
 555 # hb-ft.cc is not presently needed, and requires freetype 2.4.2 or later.
 556 LIBFONTMANAGER_EXCLUDE_FILES += harfbuzz/hb-ft.cc
 557 
 558 LIBFONTMANAGER_CFLAGS += $(HARFBUZZ_CFLAGS)
 559 
 560 #### End harfbuzz configuration
 561 
 562 LIBFONTMANAGER_EXTRA_HEADER_DIRS := \
 563     libfontmanager/harfbuzz \
 564     libfontmanager/harfbuzz/hb-ucdn \
 565     common/awt \
 566     common/font \
 567     libawt/java2d \
 568     libawt/java2d/pipe \
 569     libawt/java2d/loops \
 570     #
 571 
 572 LIBFONTMANAGER_CFLAGS += $(LIBFREETYPE_CFLAGS)
 573 BUILD_LIBFONTMANAGER_FONTLIB += $(LIBFREETYPE_LIBS)
 574 
 575 LIBFONTMANAGER_OPTIMIZATION := HIGH
 576 
 577 ifeq ($(OPENJDK_TARGET_OS), windows)
 578   LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
 579       X11TextRenderer.c
 580   LIBFONTMANAGER_OPTIMIZATION := HIGHEST
 581 else ifeq ($(OPENJDK_TARGET_OS), macosx)
 582   LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
 583       X11TextRenderer.c \
 584       fontpath.c \
 585       lcdglyph.c
 586 else
 587   LIBFONTMANAGER_EXCLUDE_FILES += fontpath.c \
 588       lcdglyph.c
 589 endif
 590 
 591 LIBFONTMANAGER_CFLAGS += $(X_CFLAGS) -DLE_STANDALONE -DHEADLESS
 592 
 593 ifeq ($(TOOLCHAIN_TYPE), gcc)
 594   # Turn off all warnings for sunFont.c. This is needed because the specific warning
 595   # about discarding 'const' qualifier cannot be turned off individually.
 596   BUILD_LIBFONTMANAGER_sunFont.c_CFLAGS := -w
 597 endif
 598 
 599 # LDFLAGS clarification:
 600 #   Filter relevant linker flags disallowing unresolved symbols as we cannot
 601 #   build-time decide to which library to link against (libawt_headless or
 602 #   libawt_xawt). See JDK-8196516 for details.
 603 $(eval $(call SetupJdkLibrary, BUILD_LIBFONTMANAGER, \
 604     NAME := fontmanager, \
 605     EXCLUDE_FILES := $(LIBFONTMANAGER_EXCLUDE_FILES) \
 606         AccelGlyphCache.c, \
 607     TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
 608     CFLAGS := $(CFLAGS_JDKLIB) $(LIBFONTMANAGER_CFLAGS), \
 609     CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBFONTMANAGER_CFLAGS), \
 610     OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \
 611     CFLAGS_windows = -DCC_NOEX, \
 612     EXTRA_HEADER_DIRS := $(LIBFONTMANAGER_EXTRA_HEADER_DIRS), \
 613     WARNINGS_AS_ERRORS_xlc := false, \
 614     DISABLED_WARNINGS_gcc := sign-compare int-to-pointer-cast \
 615         type-limits missing-field-initializers implicit-fallthrough \
 616         strict-aliasing undef unused-function, \
 617     DISABLED_WARNINGS_CXX_gcc := reorder delete-non-virtual-dtor strict-overflow \
 618         maybe-uninitialized, \
 619     DISABLED_WARNINGS_clang := unused-value incompatible-pointer-types \
 620         tautological-constant-out-of-range-compare int-to-pointer-cast \
 621         sign-compare undef missing-field-initializers, \
 622     DISABLED_WARNINGS_C_solstudio = \
 623         E_INTEGER_OVERFLOW_DETECTED \
 624         E_ARG_INCOMPATIBLE_WITH_ARG_L \
 625         E_ENUM_VAL_OVERFLOWS_INT_MAX, \
 626     DISABLED_WARNINGS_CXX_solstudio := \
 627         truncwarn wvarhidenmem wvarhidemem wbadlkginit identexpected \
 628         hidevf w_novirtualdescr arrowrtn2, \
 629     DISABLED_WARNINGS_microsoft := 4267 4244 4018 4090 4996 4146 4334 4819 4101, \
 630     LDFLAGS := $(subst -Xlinker -z -Xlinker defs,, \
 631         $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB))) $(LDFLAGS_CXX_JDK) \
 632         $(call SET_SHARED_LIBRARY_ORIGIN), \
 633     LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
 634     LDFLAGS_aix := -Wl$(COMMA)-berok, \
 635     LIBS := $(BUILD_LIBFONTMANAGER_FONTLIB), \
 636     LIBS_unix := -lawt -ljava -ljvm $(LIBM) $(LIBCXX), \
 637     LIBS_macosx := -lawt_lwawt -framework CoreText -framework CoreFoundation \
 638         -framework CoreGraphics, \
 639     LIBS_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib gdi32.lib \
 640         $(WIN_AWT_LIB), \
 641 ))
 642 
 643 $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT)
 644 
 645 ifeq ($(OPENJDK_TARGET_OS), macosx)
 646   $(BUILD_LIBFONTMANAGER): $(call FindLib, $(MODULE), awt_lwawt)
 647 endif
 648 
 649 ifeq ($(FREETYPE_TO_USE), bundled)
 650   $(BUILD_LIBFONTMANAGER): $(BUILD_LIBFREETYPE)
 651 endif
 652 
 653 TARGETS += $(BUILD_LIBFONTMANAGER)
 654 
 655 ################################################################################
 656 
 657 ifeq ($(OPENJDK_TARGET_OS), windows)
 658 
 659   LIBJAWT_CFLAGS := -EHsc -DUNICODE -D_UNICODE
 660 
 661   LIBJAWT_EXTRA_HEADER_DIRS := \
 662       include \
 663       common/awt/debug \
 664       libawt/awt/image/cvutils \
 665       libawt/java2d \
 666       libawt/java2d/windows \
 667       libawt/windows \
 668       java.base:include \
 669       java.base:libjava \
 670       #
 671 
 672   ifeq ($(OPENJDK_TARGET_CPU), x86)
 673     KERNEL32_LIB := kernel32.lib
 674   endif
 675 
 676   $(eval $(call SetupJdkLibrary, BUILD_LIBJAWT, \
 677       NAME := jawt, \
 678       OPTIMIZATION := LOW, \
 679       CFLAGS := $(CXXFLAGS_JDKLIB) \
 680           $(LIBJAWT_CFLAGS), \
 681       EXTRA_HEADER_DIRS := $(LIBJAWT_EXTRA_HEADER_DIRS), \
 682       LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \
 683       LIBS := $(JDKLIB_LIBS) $(KERNEL32_LIB) advapi32.lib $(WIN_AWT_LIB), \
 684   ))
 685 
 686   $(BUILD_LIBJAWT): $(BUILD_LIBAWT)
 687 
 688   $(eval $(call SetupCopyFiles, COPY_JAWT_LIB, \
 689       FILES := $(BUILD_LIBJAWT_IMPORT_LIBRARY), \
 690       DEST := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
 691   ))
 692 
 693   $(COPY_JAWT_LIB): $(BUILD_LIBJAWT)
 694 
 695   TARGETS += $(COPY_JAWT_LIB)
 696 
 697 else # OPENJDK_TARGET_OS not windows
 698 
 699   ifeq ($(OPENJDK_TARGET_OS), macosx)
 700     # libjawt on macosx do not use the unix code
 701     LIBJAWT_EXCLUDE_SRC_PATTERNS := unix
 702   endif
 703 
 704   ifeq ($(OPENJDK_TARGET_OS), macosx)
 705     JAWT_LIBS := -lawt_lwawt
 706   else
 707     JAWT_LIBS :=
 708     ifneq ($(OPENJDK_TARGET_OS), solaris)
 709       JAWT_LIBS += -lawt
 710     endif
 711     ifeq ($(ENABLE_HEADLESS_ONLY), false)
 712       JAWT_LIBS += -lawt_xawt
 713     else
 714       JAWT_LIBS += -lawt_headless
 715       ifeq ($(OPENJDK_TARGET_OS), linux)
 716         JAWT_CFLAGS += -DHEADLESS
 717       endif
 718     endif
 719   endif
 720 
 721   $(eval $(call SetupJdkLibrary, BUILD_LIBJAWT, \
 722       NAME := jawt, \
 723       EXCLUDE_SRC_PATTERNS := $(LIBJAWT_EXCLUDE_SRC_PATTERNS), \
 724       INCLUDE_FILES := $(JAWT_FILES), \
 725       OPTIMIZATION := LOW, \
 726       CFLAGS := $(CFLAGS_JDKLIB) \
 727           $(JAWT_CFLAGS), \
 728       DISABLED_WARNINGS_clang := sign-compare, \
 729       EXTRA_HEADER_DIRS := \
 730           include \
 731           common/awt, \
 732       LDFLAGS := $(LDFLAGS_JDKLIB) \
 733           $(call SET_SHARED_LIBRARY_ORIGIN), \
 734       LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
 735       LDFLAGS_macosx := -Wl$(COMMA)-rpath$(COMMA)@loader_path, \
 736       LIBS_unix := $(JAWT_LIBS) $(JDKLIB_LIBS), \
 737       LIBS_solaris := $(X_LIBS) -lXrender, \
 738       LIBS_macosx := -framework Cocoa, \
 739   ))
 740 
 741   ifeq ($(ENABLE_HEADLESS_ONLY), false)
 742     $(BUILD_LIBJAWT): $(BUILD_LIBAWT_XAWT)
 743   else
 744     $(BUILD_LIBJAWT): $(call FindLib, $(MODULE), awt_headless)
 745   endif
 746 
 747   ifeq ($(OPENJDK_TARGET_OS), macosx)
 748    $(BUILD_LIBJAWT): $(call FindLib, $(MODULE), awt_lwawt)
 749   endif
 750 
 751 endif # OPENJDK_TARGET_OS
 752 
 753 TARGETS += $(BUILD_LIBJAWT)
 754 
 755 ################################################################################
 756 
 757 ifeq ($(ENABLE_HEADLESS_ONLY), false)
 758 
 759   LIBSPLASHSCREEN_EXTRA_SRC := \
 760       common/awt/systemscale \
 761       #
 762 
 763   ifeq ($(USE_EXTERNAL_LIBGIF), false)
 764     LIBSPLASHSCREEN_HEADER_DIRS += libsplashscreen/giflib
 765   else
 766     LIBSPLASHSCREEN_EXCLUDES := giflib
 767     GIFLIB_LIBS := -lgif
 768   endif
 769 
 770   ifeq ($(USE_EXTERNAL_LIBJPEG), false)
 771     # While the following ought to work, it will currently pull in the closed
 772     # additions to this library, and this was not done previously in the build.
 773     # LIBSPLASHSCREEN_EXTRA_SRC += libjavajpeg
 774     LIBSPLASHSCREEN_EXTRA_SRC += $(TOPDIR)/src/java.desktop/share/native/libjavajpeg
 775   else
 776     LIBJPEG_LIBS := -ljpeg
 777   endif
 778 
 779   ifeq ($(USE_EXTERNAL_LIBPNG), false)
 780     LIBSPLASHSCREEN_HEADER_DIRS += libsplashscreen/libpng
 781   else
 782     LIBSPLASHSCREEN_EXCLUDES += libpng
 783   endif
 784 
 785   ifeq ($(USE_EXTERNAL_LIBZ), false)
 786     LIBSPLASHSCREEN_EXTRA_SRC += java.base:libzip/zlib
 787   endif
 788 
 789   ifeq ($(OPENJDK_TARGET_OS), macosx)
 790     # libsplashscreen on macosx do not use the unix code
 791     LIBSPLASHSCREEN_EXCLUDE_SRC_PATTERNS := unix
 792   endif
 793 
 794   LIBSPLASHSCREEN_CFLAGS += -DSPLASHSCREEN -DPNG_NO_MMX_CODE -DPNG_ARM_NEON_OPT=0
 795 
 796   ifeq ($(OPENJDK_TARGET_OS), linux)
 797     ifeq ($(OPENJDK_TARGET_CPU_ARCH), ppc)
 798       LIBSPLASHSCREEN_CFLAGS += -DPNG_POWERPC_VSX_OPT=0
 799     endif
 800   endif
 801 
 802   ifeq ($(OPENJDK_TARGET_OS), macosx)
 803     LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX
 804 
 805     BUILD_LIBSPLASHSCREEN_java_awt_SplashScreen.c_CFLAGS := -x objective-c -O0
 806     BUILD_LIBSPLASHSCREEN_splashscreen_gfx_impl.c_CFLAGS := -x objective-c -O0
 807     BUILD_LIBSPLASHSCREEN_splashscreen_gif.c_CFLAGS := -x objective-c -O0
 808     BUILD_LIBSPLASHSCREEN_splashscreen_impl.c_CFLAGS := -x objective-c -O0
 809     BUILD_LIBSPLASHSCREEN_splashscreen_jpeg.c_CFLAGS := -x objective-c -O0
 810     BUILD_LIBSPLASHSCREEN_splashscreen_png.c_CFLAGS := -x objective-c -O0
 811     BUILD_LIBSPLASHSCREEN_splashscreen_sys.m_CFLAGS := -O0
 812 
 813   else ifeq ($(OPENJDK_TARGET_OS), windows)
 814     LIBSPLASHSCREEN_CFLAGS += -DWITH_WIN32
 815   else
 816     LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 $(X_CFLAGS)
 817   endif
 818 
 819   LIBSPLASHSCREEN_LIBS :=
 820 
 821   ifeq ($(OPENJDK_TARGET_OS), macosx)
 822     LIBSPLASHSCREEN_LIBS += \
 823         $(LIBM) -lpthread -liconv -losxapp \
 824         -framework ApplicationServices \
 825         -framework Foundation \
 826         -framework Cocoa \
 827         -framework Metal \
 828         -framework MetalKit \
 829         -framework JavaNativeFoundation
 830   else ifeq ($(OPENJDK_TARGET_OS), windows)
 831     LIBSPLASHSCREEN_LIBS += kernel32.lib user32.lib gdi32.lib delayimp.lib $(WIN_JAVA_LIB) jvm.lib
 832   else
 833     LIBSPLASHSCREEN_LIBS += $(X_LIBS) -lX11 -lXext $(LIBM) -lpthread -ldl
 834   endif
 835 
 836   LIBSPLASHSCREEN_HEADER_DIRS += \
 837       libosxapp \
 838       java.base:include \
 839       java.base:libjava \
 840       #
 841 
 842   $(eval $(call SetupJdkLibrary, BUILD_LIBSPLASHSCREEN, \
 843       NAME := splashscreen, \
 844       EXTRA_SRC := $(LIBSPLASHSCREEN_EXTRA_SRC), \
 845       EXCLUDE_SRC_PATTERNS := $(LIBSPLASHSCREEN_EXCLUDE_SRC_PATTERNS), \
 846       EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
 847       EXCLUDES := $(LIBSPLASHSCREEN_EXCLUDES), \
 848       OPTIMIZATION := LOW, \
 849       CFLAGS := $(CFLAGS_JDKLIB) $(LIBSPLASHSCREEN_CFLAGS) \
 850           $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS), \
 851       EXTRA_HEADER_DIRS := $(LIBSPLASHSCREEN_HEADER_DIRS), \
 852       DISABLED_WARNINGS_gcc := sign-compare type-limits unused-result \
 853           maybe-uninitialized shift-negative-value implicit-fallthrough \
 854           unused-function, \
 855       DISABLED_WARNINGS_clang := incompatible-pointer-types sign-compare, \
 856       DISABLED_WARNINGS_solstudio := E_NEWLINE_NOT_LAST E_DECLARATION_IN_CODE \
 857           E_STATEMENT_NOT_REACHED, \
 858       DISABLED_WARNINGS_microsoft := 4018 4244 4267, \
 859       LDFLAGS := $(LDFLAGS_JDKLIB) \
 860           $(call SET_SHARED_LIBRARY_ORIGIN), \
 861       LDFLAGS_macosx := -L$(INSTALL_LIBRARIES_HERE), \
 862       LDFLAGS_windows := -delayload:user32.dll, \
 863       LIBS := $(JDKLIB_LIBS) $(LIBSPLASHSCREEN_LIBS) $(LIBZ_LIBS) \
 864           $(GIFLIB_LIBS) $(LIBJPEG_LIBS) $(PNG_LIBS), \
 865       LIBS_aix := -liconv, \
 866   ))
 867 
 868   TARGETS += $(BUILD_LIBSPLASHSCREEN)
 869 
 870   ifeq ($(OPENJDK_TARGET_OS), macosx)
 871     $(BUILD_LIBSPLASHSCREEN): $(call FindLib, $(MODULE), osxapp)
 872   endif
 873 
 874 endif
 875 
 876 ################################################################################
 877 
 878 ifeq ($(OPENJDK_TARGET_OS), macosx)
 879 
 880   LIBAWT_LWAWT_EXTRA_SRC := \
 881       $(TOPDIR)/src/$(MODULE)/unix/native/common/awt \
 882       $(TOPDIR)/src/$(MODULE)/share/native/common/font \
 883       $(TOPDIR)/src/$(MODULE)/share/native/common/java2d \
 884       #
 885 
 886   LIBAWT_LWAWT_EXTRA_HEADER_DIRS := \
 887       $(LIBAWT_DEFAULT_HEADER_DIRS) \
 888       libawt_lwawt/awt \
 889       libawt_lwawt/font \
 890       libawt_lwawt/java2d/opengl \
 891       libawt_lwawt/java2d/metal \
 892       include \
 893       common/awt/debug \
 894       common/java2d/opengl \
 895       libosxapp \
 896       #
 897 
 898   LIBAWT_LWAWT_CFLAGS := $(X_CFLAGS) $(X_LIBS)
 899 
 900   LIBAWT_LWAWT_EXFILES := fontpath.c awt_Font.c X11Color.c
 901   LIBAWT_LWAWT_EXCLUDES := $(TOPDIR)/src/$(MODULE)/unix/native/common/awt/medialib
 902 
 903   $(eval $(call SetupJdkLibrary, BUILD_LIBAWT_LWAWT, \
 904       NAME := awt_lwawt, \
 905       EXTRA_SRC := $(LIBAWT_LWAWT_EXTRA_SRC), \
 906       INCLUDE_FILES := $(LIBAWT_LWAWT_FILES), \
 907       EXCLUDE_FILES := $(LIBAWT_LWAWT_EXFILES), \
 908       EXCLUDES := $(LIBAWT_LWAWT_EXCLUDES), \
 909       OPTIMIZATION := LOW, \
 910       CFLAGS := $(CFLAGS_JDKLIB) \
 911           $(LIBAWT_LWAWT_CFLAGS), \
 912       EXTRA_HEADER_DIRS := $(LIBAWT_LWAWT_EXTRA_HEADER_DIRS), \
 913       DISABLED_WARNINGS_clang := incomplete-implementation enum-conversion \
 914           deprecated-declarations objc-method-access bitwise-op-parentheses \
 915           incompatible-pointer-types parentheses-equality extra-tokens \
 916           sign-compare semicolon-before-method-body format-nonliteral undef \
 917           pointer-arith, \
 918       LDFLAGS := $(LDFLAGS_JDKLIB) \
 919           $(call SET_SHARED_LIBRARY_ORIGIN) \
 920           -L$(INSTALL_LIBRARIES_HERE), \
 921       LIBS := -lawt -lmlib_image -losxapp -ljvm $(LIBM) \
 922           -framework Accelerate \
 923           -framework ApplicationServices \
 924           -framework AudioToolbox \
 925           -framework Carbon \
 926           -framework Cocoa \
 927           -framework Metal \
 928           -framework MetalKit \
 929           -framework Security \
 930           -framework ExceptionHandling \
 931           -framework JavaNativeFoundation \
 932           -framework JavaRuntimeSupport \
 933           -framework OpenGL \
 934           -framework QuartzCore -ljava, \
 935   ))
 936 
 937   TARGETS += $(BUILD_LIBAWT_LWAWT)
 938 
 939   $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBAWT)
 940 
 941   $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBMLIB_IMAGE)
 942 
 943   $(BUILD_LIBAWT_LWAWT): $(call FindLib, $(MODULE), osxapp)
 944 
 945   $(BUILD_LIBAWT_LWAWT): $(call FindLib, java.base, java)
 946 
 947 endif
 948 
 949 ################################################################################
 950 
 951 ifeq ($(OPENJDK_TARGET_OS), macosx)
 952   XCODE_PATH := $(shell /usr/bin/xcode-select -p)
 953   CompileMetalShaders :
 954         $(XCODE_PATH)/Platforms/MacOSX.platform/usr/bin/metal -O2 -std=osx-metal1.1 -o $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libosxui/shaders.air $(TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/awt/shaders.metal
 955         $(XCODE_PATH)/Platforms/MacOSX.platform/usr/bin/metal-ar r $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libosxui/shaders.metal-ar $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libosxui/shaders.air
 956         $(XCODE_PATH)/Platforms/MacOSX.platform/usr/bin/metallib -o $(INSTALL_LIBRARIES_HERE)/shaders.metallib $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libosxui/shaders.metal-ar
 957 
 958   $(eval $(call SetupJdkLibrary, BUILD_LIBOSXUI, \
 959       NAME := osxui, \
 960       OPTIMIZATION := LOW, \
 961       CFLAGS := $(CFLAGS_JDKLIB), \
 962       EXTRA_HEADER_DIRS := \
 963           libawt_lwawt/awt \
 964           libosxapp, \
 965       DISABLED_WARNINGS_clang := deprecated-declarations sign-compare, \
 966       LDFLAGS := $(LDFLAGS_JDKLIB) \
 967           $(call SET_SHARED_LIBRARY_ORIGIN) \
 968           -Wl$(COMMA)-rpath$(COMMA)@loader_path \
 969           -L$(INSTALL_LIBRARIES_HERE), \
 970       LIBS := -lawt -losxapp -lawt_lwawt \
 971           -framework Cocoa \
 972           -framework Metal \
 973           -framework MetalKit \
 974           -framework OpenGL \
 975           -framework Carbon \
 976           -framework ApplicationServices \
 977           -framework JavaNativeFoundation \
 978           -framework JavaRuntimeSupport \
 979           -ljava -ljvm, \
 980   ))
 981 
 982   TARGETS += $(BUILD_LIBOSXUI)
 983   $(BUILD_LIBOSXUI): CompileMetalShaders
 984 
 985   $(BUILD_LIBOSXUI): $(BUILD_LIBAWT)
 986 
 987   $(BUILD_LIBOSXUI): $(call FindLib, $(MODULE), osxapp)
 988 
 989   $(BUILD_LIBOSXUI): $(BUILD_LIBAWT_LWAWT)
 990 
 991 endif
 992 
 993 ################################################################################
 994 
 995 # Hook to include the corresponding custom file, if present.
 996 $(eval $(call IncludeCustomExtension, lib/Awt2dLibraries.gmk))