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 ($(call isTargetCpuBits, 64), true)
  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 ($(call And, $(call isTargetOs, solaris) $(call isTargetCpuArch, sparc)), true)
  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 ($(call isTargetCpuBits, 64), true)
  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 ($(call And, $(call isTargetOs, solaris) $(call isTargetCpuArch, sparc)), true)
 131   LIBAWT_EXTRA_SRC += $(TOPDIR)/src/$(MODULE)/share/native/common/awt/medialib
 132 endif
 133 
 134 ifeq ($(call isTargetOs, windows), true)
 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 ifeq ($(call isTargetOs, solaris linux macosx aix), true)
 144   LIBAWT_EXFILES += awt_Font.c CUPSfuncs.c fontpath.c X11Color.c
 145 endif
 146 
 147 ifeq ($(call isTargetOs, macosx), true)
 148   LIBAWT_EXFILES += initIDs.c awt/image/cvutils/img_colors.c
 149 endif
 150 
 151 ifeq ($(call isTargetOs, windows), true)
 152   LIBAWT_EXFILES += \
 153       java2d/d3d/D3DShaderGen.c \
 154       awt/image/cvutils/img_colors.c \
 155       #
 156 endif
 157 
 158 ifeq ($(call And, $(call isTargetOs, solaris) $(call isTargetCpu, sparcv9)), true)
 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 ($(call And, $(call isTargetOs, solaris) $(call isTargetCpu, sparcv9)), true)
 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 ifeq ($(call isTargetOs, solaris), false)
 193   LIBAWT_CFLAGS += -DMLIB_NO_LIBSUNMATH
 194 endif
 195 
 196 ifeq ($(call isTargetOs, windows), true)
 197   LIBAWT_CFLAGS += -EHsc -DUNICODE -D_UNICODE
 198   ifeq ($(call isTargetCpuBits, 64), true)
 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 ($(call isTargetOs, linux), true)
 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_microsoft := 4244 4267 4996, \
 233     ASFLAGS := $(LIBAWT_ASFLAGS), \
 234     LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN), \
 235     LDFLAGS_macosx := -L$(INSTALL_LIBRARIES_HERE), \
 236     LDFLAGS_windows := -delayload:user32.dll -delayload:gdi32.dll \
 237         -delayload:shell32.dll -delayload:winmm.dll \
 238         -delayload:winspool.drv -delayload:imm32.dll \
 239         -delayload:ole32.dll -delayload:comdlg32.dll \
 240         -delayload:comctl32.dll -delayload:shlwapi.dll, \
 241     LIBS_unix := -ljvm -ljava $(LIBM), \
 242     LIBS_linux :=  $(LIBDL), \
 243     LIBS_solaris := $(LIBDL), \
 244     LIBS_aix := $(LIBDL),\
 245     LIBS_macosx := -lmlib_image \
 246         -framework Cocoa \
 247         -framework OpenGL \
 248         -framework JavaNativeFoundation \
 249         -framework JavaRuntimeSupport \
 250         -framework ApplicationServices \
 251         -framework AudioToolbox, \
 252     LIBS_windows := kernel32.lib user32.lib gdi32.lib winspool.lib \
 253         imm32.lib ole32.lib uuid.lib shell32.lib \
 254         comdlg32.lib winmm.lib comctl32.lib shlwapi.lib \
 255         delayimp.lib jvm.lib $(WIN_JAVA_LIB) advapi32.lib, \
 256     VERSIONINFO_RESOURCE := $(LIBAWT_VERSIONINFO_RESOURCE), \
 257     RC_FLAGS := $(RC_FLAGS) $(LIBAWT_RC_FLAGS) \
 258         -D "JDK_FNAME=awt.dll" \
 259         -D "JDK_INTERNAL_NAME=awt" \
 260         -D "JDK_FTYPE=0x2L", \
 261 ))
 262 
 263 $(BUILD_LIBAWT): $(call FindLib, java.base, java)
 264 
 265 ifeq ($(call isTargetOs, macosx), true)
 266   $(BUILD_LIBAWT): $(BUILD_LIBMLIB_IMAGE)
 267 endif
 268 
 269 TARGETS += $(BUILD_LIBAWT)
 270 
 271 ################################################################################
 272 
 273 ifeq ($(call isTargetOs, windows macosx), false)
 274   ifeq ($(ENABLE_HEADLESS_ONLY), false)
 275 
 276     LIBAWT_XAWT_EXTRA_SRC := \
 277         common/awt \
 278         common/java2d \
 279         common/font \
 280         #
 281 
 282     LIBAWT_XAWT_EXCLUDES := medialib debug
 283 
 284     LIBAWT_XAWT_EXTRA_HEADER_DIRS := \
 285         $(LIBAWT_DEFAULT_HEADER_DIRS) \
 286         libawt_xawt/awt \
 287         include \
 288         common/awt/debug \
 289         common/awt/systemscale \
 290         common/font \
 291         common/java2d/opengl \
 292         common/java2d/x11 \
 293         #
 294 
 295     LIBAWT_XAWT_CFLAGS += -DXAWT -DXAWT_HACK \
 296         $(FONTCONFIG_CFLAGS) \
 297         $(CUPS_CFLAGS)
 298 
 299     ifeq ($(call isTargetOs, solaris), true)
 300       LIBAWT_XAWT_CFLAGS += -DFUNCPROTO=15
 301     endif
 302 
 303     ifeq ($(call isTargetOs, linux), true)
 304       ifeq ($(DISABLE_XRENDER), true)
 305         LIBAWT_XAWT_CFLAGS += -DDISABLE_XRENDER_BY_DEFAULT=true
 306       endif
 307     endif
 308 
 309     LIBAWT_XAWT_LIBS := $(LIBM) -lawt -lXext -lX11 -lXrender $(LIBDL) -lXtst -lXi -ljava -ljvm
 310 
 311     ifeq ($(call isTargetOs, linux), true)
 312       LIBAWT_XAWT_LIBS += -lpthread
 313     endif
 314 
 315     ifeq ($(TOOLCHAIN_TYPE), gcc)
 316       # Turn off all warnings for the following files since they contain warnings
 317       # that cannot be turned of individually.
 318       # redefining a macro
 319       BUILD_LIBAWT_XAWT_gtk2_interface.c_CFLAGS := -w
 320       # comparison between pointer and integer
 321       BUILD_LIBAWT_XAWT_awt_Font.c_CFLAGS := -w
 322       # initializing a declared 'extern'
 323       BUILD_LIBAWT_XAWT_debug_mem.c_CFLAGS := -w
 324     endif
 325 
 326     $(eval $(call SetupJdkLibrary, BUILD_LIBAWT_XAWT, \
 327         NAME := awt_xawt, \
 328         EXTRA_SRC := $(LIBAWT_XAWT_EXTRA_SRC), \
 329         EXTRA_HEADER_DIRS := $(LIBAWT_XAWT_EXTRA_HEADER_DIRS), \
 330         EXCLUDES := $(LIBAWT_XAWT_EXCLUDES), \
 331         OPTIMIZATION := LOW, \
 332         CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_XAWT_CFLAGS) \
 333             $(X_CFLAGS), \
 334         WARNINGS_AS_ERRORS_xlc := false, \
 335         DISABLED_WARNINGS_gcc := type-limits pointer-to-int-cast \
 336             unused-result maybe-uninitialized format \
 337             format-security int-to-pointer-cast parentheses \
 338             implicit-fallthrough undef unused-function, \
 339         DISABLED_WARNINGS_clang := parentheses format undef \
 340             logical-op-parentheses format-nonliteral int-conversion, \
 341         DISABLED_WARNINGS_solstudio := E_ASSIGNMENT_TYPE_MISMATCH \
 342              E_NON_CONST_INIT, \
 343         LDFLAGS := $(LDFLAGS_JDKLIB) \
 344             $(call SET_SHARED_LIBRARY_ORIGIN) \
 345             -L$(INSTALL_LIBRARIES_HERE), \
 346         LIBS :=  $(X_LIBS) $(LIBAWT_XAWT_LIBS), \
 347     ))
 348 
 349     $(BUILD_LIBAWT_XAWT): $(call FindLib, java.base, java)
 350 
 351     $(BUILD_LIBAWT_XAWT): $(BUILD_LIBAWT)
 352 
 353     TARGETS += $(BUILD_LIBAWT_XAWT)
 354 
 355   endif
 356 endif
 357 
 358 ################################################################################
 359 
 360 # The fast floor code loses precision.
 361 LCMS_CFLAGS=-DCMS_DONT_USE_FAST_FLOOR
 362 
 363 ifeq ($(USE_EXTERNAL_LCMS), true)
 364   # If we're using an external library, we'll just need the wrapper part.
 365   # By including it explicitly, all other files will be excluded.
 366   BUILD_LIBLCMS_INCLUDE_FILES := LCMS.c
 367   # If we're using an external library, we can't include our own SRC path
 368   # as includes, instead the system headers should be used.
 369   LIBLCMS_HEADERS_FROM_SRC := false
 370 else
 371   BUILD_LIBLCMS_INCLUDE_FILES :=
 372 endif
 373 
 374 $(eval $(call SetupJdkLibrary, BUILD_LIBLCMS, \
 375     NAME := lcms, \
 376     INCLUDE_FILES := $(BUILD_LIBLCMS_INCLUDE_FILES), \
 377     OPTIMIZATION := HIGHEST, \
 378     CFLAGS := $(CFLAGS_JDKLIB) \
 379         $(LCMS_CFLAGS), \
 380     CFLAGS_windows := -DCMS_IS_WINDOWS_, \
 381     EXTRA_HEADER_DIRS := \
 382         common/awt/debug \
 383         libawt/java2d, \
 384     HEADERS_FROM_SRC := $(LIBLCMS_HEADERS_FROM_SRC), \
 385     DISABLED_WARNINGS_gcc := format-nonliteral type-limits \
 386         misleading-indentation undef unused-function stringop-truncation, \
 387     DISABLED_WARNINGS_clang := tautological-compare format-nonliteral undef, \
 388     DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
 389     DISABLED_WARNINGS_microsoft := 4819, \
 390     LDFLAGS := $(LDFLAGS_JDKLIB) \
 391         $(call SET_SHARED_LIBRARY_ORIGIN), \
 392     LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
 393     LIBS_unix := -lawt -ljvm -ljava $(LCMS_LIBS) $(LIBM), \
 394     LIBS_windows := $(WIN_AWT_LIB) $(WIN_JAVA_LIB), \
 395 ))
 396 
 397 TARGETS += $(BUILD_LIBLCMS)
 398 
 399 $(BUILD_LIBLCMS): $(BUILD_LIBAWT)
 400 
 401 ################################################################################
 402 
 403 # "DISABLED_WARNINGS_gcc := clobbered" rationale:
 404 # Suppress gcc warnings like "variable might be clobbered by 'longjmp'
 405 # or 'vfork'": this warning indicates that some variable is placed to
 406 # a register by optimized compiler and it's value might be lost on longjmp().
 407 # Recommended way to avoid such warning is to declare the variable as
 408 # volatile to prevent the optimization. However, this approach does not
 409 # work because we have to declare all variables as volatile in result.
 410 
 411 ifeq ($(USE_EXTERNAL_LIBJPEG), true)
 412   LIBJPEG_LIBS := -ljpeg
 413   BUILD_LIBJAVAJPEG_INCLUDE_FILES := \
 414       imageioJPEG.c \
 415       jpegdecoder.c
 416   # If we're using an external library, we can't include our own SRC path
 417   # as includes, instead the system headers should be used.
 418   LIBJPEG_HEADERS_FROM_SRC := false
 419 else
 420   LIBJPEG_LIBS :=
 421   BUILD_LIBJAVAJPEG_INCLUDE_FILES :=
 422 endif
 423 
 424 $(eval $(call SetupJdkLibrary, BUILD_LIBJAVAJPEG, \
 425     NAME := javajpeg, \
 426     INCLUDE_FILES := $(BUILD_LIBJAVAJPEG_INCLUDE_FILES), \
 427     OPTIMIZATION := HIGHEST, \
 428     CFLAGS := $(CFLAGS_JDKLIB), \
 429     HEADERS_FROM_SRC := $(LIBJPEG_HEADERS_FROM_SRC), \
 430     DISABLED_WARNINGS_gcc := clobbered implicit-fallthrough shift-negative-value, \
 431     LDFLAGS := $(LDFLAGS_JDKLIB) \
 432         $(call SET_SHARED_LIBRARY_ORIGIN), \
 433     LIBS := $(LIBJPEG_LIBS) $(JDKLIB_LIBS), \
 434     LIBS_windows := $(WIN_JAVA_LIB) jvm.lib, \
 435 ))
 436 
 437 $(BUILD_LIBJAVAJPEG): $(call FindLib, java.base, java)
 438 
 439 TARGETS += $(BUILD_LIBJAVAJPEG)
 440 
 441 ################################################################################
 442 
 443 # Mac and Windows only use the native AWT lib, do not build libawt_headless
 444 ifeq ($(call isTargetOs, windows macosx), false)
 445 
 446   LIBAWT_HEADLESS_EXTRA_SRC := \
 447       common/font \
 448       common/java2d \
 449       $(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
 450       #
 451 
 452   LIBAWT_HEADLESS_EXCLUDES := medialib
 453 
 454   LIBAWT_HEADLESS_EXTRA_HEADER_DIRS := \
 455       $(LIBAWT_DEFAULT_HEADER_DIRS) \
 456       common/awt/debug \
 457       common/font \
 458       common/java2d/opengl \
 459       #
 460 
 461   LIBAWT_HEADLESS_CFLAGS := $(CUPS_CFLAGS) $(FONTCONFIG_CFLAGS) $(X_CFLAGS) \
 462       -DHEADLESS=true
 463 
 464   $(eval $(call SetupJdkLibrary, BUILD_LIBAWT_HEADLESS, \
 465       NAME := awt_headless, \
 466       EXTRA_SRC := $(LIBAWT_HEADLESS_EXTRA_SRC), \
 467       EXCLUDES := $(LIBAWT_HEADLESS_EXCLUDES), \
 468       OPTIMIZATION := LOW, \
 469       CFLAGS := $(CFLAGS_JDKLIB) \
 470           $(LIBAWT_HEADLESS_CFLAGS), \
 471       EXTRA_HEADER_DIRS := $(LIBAWT_HEADLESS_EXTRA_HEADER_DIRS), \
 472       DISABLED_WARNINGS_gcc := unused-function, \
 473       DISABLED_WARNINGS_solstudio := E_EMPTY_TRANSLATION_UNIT, \
 474       LDFLAGS := $(LDFLAGS_JDKLIB) \
 475           $(call SET_SHARED_LIBRARY_ORIGIN), \
 476       LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
 477       LIBS_unix := -lawt -ljvm -ljava, \
 478       LIBS_linux := $(LIBM) $(LIBDL), \
 479       LIBS_solaris := $(LIBM) $(LIBDL) $(LIBCXX), \
 480   ))
 481 
 482   $(BUILD_LIBAWT_HEADLESS): $(BUILD_LIBAWT)
 483 
 484   TARGETS += $(BUILD_LIBAWT_HEADLESS)
 485 
 486 endif
 487 
 488 ################################################################################
 489 
 490 ifeq ($(FREETYPE_TO_USE), system)
 491   # For use by libfontmanager:
 492   LIBFREETYPE_CFLAGS := $(FREETYPE_CFLAGS)
 493   LIBFREETYPE_LIBS := $(FREETYPE_LIBS)
 494 else
 495   BUILD_LIBFREETYPE_HEADER_DIRS := $(TOPDIR)/src/$(MODULE)/share/native/libfreetype/include
 496   BUILD_LIBFREETYPE_CFLAGS := -DFT2_BUILD_LIBRARY $(EXPORT_ALL_SYMBOLS)
 497 
 498   # For use by libfontmanager:
 499   LIBFREETYPE_CFLAGS := -I$(BUILD_LIBFREETYPE_HEADER_DIRS)
 500   ifeq ($(call isTargetOs, windows), true)
 501     LIBFREETYPE_LIBS := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfreetype/freetype.lib
 502     # freetype now requires you to manually define this (see ftconfig.h)
 503     BUILD_LIBFREETYPE_CFLAGS += -DDLL_EXPORT
 504   else
 505     LIBFREETYPE_LIBS := -lfreetype
 506   endif
 507 
 508   $(eval $(call SetupJdkLibrary, BUILD_LIBFREETYPE, \
 509       NAME := freetype, \
 510       OPTIMIZATION := HIGHEST, \
 511       CFLAGS := $(CFLAGS_JDKLIB) \
 512           $(BUILD_LIBFREETYPE_CFLAGS), \
 513       EXTRA_HEADER_DIRS := $(BUILD_LIBFREETYPE_HEADER_DIRS), \
 514       DISABLED_WARNINGS_solstudio := \
 515          E_STATEMENT_NOT_REACHED \
 516          E_END_OF_LOOP_CODE_NOT_REACHED, \
 517       DISABLED_WARNINGS_microsoft := 4018 4267 4244 4312 4819, \
 518       DISABLED_WARNINGS_gcc := implicit-fallthrough cast-function-type bad-function-cast, \
 519       LDFLAGS := $(LDFLAGS_JDKLIB) \
 520           $(call SET_SHARED_LIBRARY_ORIGIN), \
 521   ))
 522 
 523   TARGETS += $(BUILD_LIBFREETYPE)
 524 endif
 525 
 526 ###########################################################################
 527 
 528 #### Begin harfbuzz configuration
 529 
 530 HARFBUZZ_CFLAGS := -DHAVE_OT -DHAVE_FALLBACK -DHAVE_UCDN -DHAVE_ROUND
 531 
 532 ifeq ($(call isTargetOs, windows), false)
 533   HARFBUZZ_CFLAGS += -DGETPAGESIZE -DHAVE_MPROTECT -DHAVE_PTHREAD \
 534                       -DHAVE_SYSCONF -DHAVE_SYS_MMAN_H -DHAVE_UNISTD_H \
 535                       -DHB_NO_PRAGMA_GCC_DIAGNOSTIC
 536 endif
 537 ifeq ($(call isTargetOs, linux macosx), true)
 538   HARFBUZZ_CFLAGS += -DHAVE_INTEL_ATOMIC_PRIMITIVES
 539 endif
 540 ifeq ($(call isTargetOs, solaris), true)
 541   HARFBUZZ_CFLAGS += -DHAVE_SOLARIS_ATOMIC_OPS
 542 endif
 543 ifeq ($(call isTargetOs, macosx), true)
 544   HARFBUZZ_CFLAGS += -DHAVE_CORETEXT
 545 endif
 546 ifeq ($(call isTargetOs, macosx), false)
 547   LIBFONTMANAGER_EXCLUDE_FILES += harfbuzz/hb-coretext.cc
 548 endif
 549 # hb-ft.cc is not presently needed, and requires freetype 2.4.2 or later.
 550 LIBFONTMANAGER_EXCLUDE_FILES += harfbuzz/hb-ft.cc
 551 
 552 LIBFONTMANAGER_CFLAGS += $(HARFBUZZ_CFLAGS)
 553 
 554 #### End harfbuzz configuration
 555 
 556 LIBFONTMANAGER_EXTRA_HEADER_DIRS := \
 557     libfontmanager/harfbuzz \
 558     libfontmanager/harfbuzz/hb-ucdn \
 559     common/awt \
 560     common/font \
 561     libawt/java2d \
 562     libawt/java2d/pipe \
 563     libawt/java2d/loops \
 564     #
 565 
 566 LIBFONTMANAGER_CFLAGS += $(LIBFREETYPE_CFLAGS)
 567 BUILD_LIBFONTMANAGER_FONTLIB += $(LIBFREETYPE_LIBS)
 568 
 569 LIBFONTMANAGER_OPTIMIZATION := HIGH
 570 
 571 ifeq ($(call isTargetOs, windows), true)
 572   LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
 573       X11TextRenderer.c
 574   LIBFONTMANAGER_OPTIMIZATION := HIGHEST
 575 else ifeq ($(call isTargetOs, macosx), true)
 576   LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
 577       X11TextRenderer.c \
 578       fontpath.c \
 579       lcdglyph.c
 580 else
 581   LIBFONTMANAGER_EXCLUDE_FILES += fontpath.c \
 582       lcdglyph.c
 583 endif
 584 
 585 LIBFONTMANAGER_CFLAGS += $(X_CFLAGS) -DLE_STANDALONE -DHEADLESS
 586 
 587 ifeq ($(TOOLCHAIN_TYPE), gcc)
 588   # Turn off all warnings for sunFont.c. This is needed because the specific warning
 589   # about discarding 'const' qualifier cannot be turned off individually.
 590   BUILD_LIBFONTMANAGER_sunFont.c_CFLAGS := -w
 591 endif
 592 
 593 # LDFLAGS clarification:
 594 #   Filter relevant linker flags disallowing unresolved symbols as we cannot
 595 #   build-time decide to which library to link against (libawt_headless or
 596 #   libawt_xawt). See JDK-8196516 for details.
 597 $(eval $(call SetupJdkLibrary, BUILD_LIBFONTMANAGER, \
 598     NAME := fontmanager, \
 599     EXCLUDE_FILES := $(LIBFONTMANAGER_EXCLUDE_FILES) \
 600         AccelGlyphCache.c, \
 601     TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
 602     CFLAGS := $(CFLAGS_JDKLIB) $(LIBFONTMANAGER_CFLAGS), \
 603     CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBFONTMANAGER_CFLAGS), \
 604     OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \
 605     CFLAGS_windows = -DCC_NOEX, \
 606     EXTRA_HEADER_DIRS := $(LIBFONTMANAGER_EXTRA_HEADER_DIRS), \
 607     WARNINGS_AS_ERRORS_xlc := false, \
 608     DISABLED_WARNINGS_gcc := sign-compare int-to-pointer-cast \
 609         type-limits missing-field-initializers implicit-fallthrough \
 610         strict-aliasing undef unused-function, \
 611     DISABLED_WARNINGS_CXX_gcc := reorder delete-non-virtual-dtor strict-overflow \
 612         maybe-uninitialized class-memaccess, \
 613     DISABLED_WARNINGS_clang := unused-value incompatible-pointer-types \
 614         tautological-constant-out-of-range-compare int-to-pointer-cast \
 615         sign-compare undef missing-field-initializers, \
 616     DISABLED_WARNINGS_C_solstudio = \
 617         E_INTEGER_OVERFLOW_DETECTED \
 618         E_ARG_INCOMPATIBLE_WITH_ARG_L \
 619         E_ENUM_VAL_OVERFLOWS_INT_MAX, \
 620     DISABLED_WARNINGS_CXX_solstudio := \
 621         truncwarn wvarhidenmem wvarhidemem wbadlkginit identexpected \
 622         hidevf w_novirtualdescr arrowrtn2 refmemnoconstr_aggr unknownpragma \
 623         doubunder wunreachable, \
 624     DISABLED_WARNINGS_microsoft := 4267 4244 4018 4090 4996 4146 4334 4819 4101 4068 4805 4138, \
 625     LDFLAGS := $(subst -Xlinker -z -Xlinker defs,, \
 626         $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB))) $(LDFLAGS_CXX_JDK) \
 627         $(call SET_SHARED_LIBRARY_ORIGIN), \
 628     LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
 629     LDFLAGS_aix := -Wl$(COMMA)-berok, \
 630     LIBS := $(BUILD_LIBFONTMANAGER_FONTLIB), \
 631     LIBS_unix := -lawt -ljava -ljvm $(LIBM) $(LIBCXX), \
 632     LIBS_macosx := -lawt_lwawt -framework CoreText -framework CoreFoundation \
 633         -framework CoreGraphics, \
 634     LIBS_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib gdi32.lib \
 635         $(WIN_AWT_LIB), \
 636 ))
 637 
 638 $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT)
 639 
 640 ifeq ($(call isTargetOs, macosx), true)
 641   $(BUILD_LIBFONTMANAGER): $(call FindLib, $(MODULE), awt_lwawt)
 642 endif
 643 
 644 ifeq ($(FREETYPE_TO_USE), bundled)
 645   $(BUILD_LIBFONTMANAGER): $(BUILD_LIBFREETYPE)
 646 endif
 647 
 648 TARGETS += $(BUILD_LIBFONTMANAGER)
 649 
 650 ################################################################################
 651 
 652 ifeq ($(call isTargetOs, windows), true)
 653 
 654   LIBJAWT_CFLAGS := -EHsc -DUNICODE -D_UNICODE
 655 
 656   LIBJAWT_EXTRA_HEADER_DIRS := \
 657       include \
 658       common/awt/debug \
 659       libawt/awt/image/cvutils \
 660       libawt/java2d \
 661       libawt/java2d/windows \
 662       libawt/windows \
 663       java.base:include \
 664       java.base:libjava \
 665       #
 666 
 667   ifeq ($(call isTargetCpu, x86), true)
 668     KERNEL32_LIB := kernel32.lib
 669   endif
 670 
 671   $(eval $(call SetupJdkLibrary, BUILD_LIBJAWT, \
 672       NAME := jawt, \
 673       OPTIMIZATION := LOW, \
 674       CFLAGS := $(CXXFLAGS_JDKLIB) \
 675           $(LIBJAWT_CFLAGS), \
 676       EXTRA_HEADER_DIRS := $(LIBJAWT_EXTRA_HEADER_DIRS), \
 677       LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \
 678       LIBS := $(JDKLIB_LIBS) $(KERNEL32_LIB) advapi32.lib $(WIN_AWT_LIB), \
 679   ))
 680 
 681   $(BUILD_LIBJAWT): $(BUILD_LIBAWT)
 682 
 683   $(eval $(call SetupCopyFiles, COPY_JAWT_LIB, \
 684       FILES := $(BUILD_LIBJAWT_IMPORT_LIBRARY), \
 685       DEST := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
 686   ))
 687 
 688   $(COPY_JAWT_LIB): $(BUILD_LIBJAWT)
 689 
 690   TARGETS += $(COPY_JAWT_LIB)
 691 
 692 else # not windows
 693 
 694   ifeq ($(call isTargetOs, macosx), true)
 695     # libjawt on macosx do not use the unix code
 696     LIBJAWT_EXCLUDE_SRC_PATTERNS := /unix/
 697   endif
 698 
 699   ifeq ($(call isTargetOs, macosx), true)
 700     JAWT_LIBS := -lawt_lwawt
 701   else
 702     JAWT_LIBS :=
 703     ifeq ($(call isTargetOs, solaris), false)
 704       JAWT_LIBS += -lawt
 705     endif
 706     ifeq ($(ENABLE_HEADLESS_ONLY), false)
 707       JAWT_LIBS += -lawt_xawt
 708     else
 709       JAWT_LIBS += -lawt_headless
 710       ifeq ($(call isTargetOs, linux), true)
 711         JAWT_CFLAGS += -DHEADLESS
 712       endif
 713     endif
 714   endif
 715 
 716   $(eval $(call SetupJdkLibrary, BUILD_LIBJAWT, \
 717       NAME := jawt, \
 718       EXCLUDE_SRC_PATTERNS := $(LIBJAWT_EXCLUDE_SRC_PATTERNS), \
 719       INCLUDE_FILES := $(JAWT_FILES), \
 720       OPTIMIZATION := LOW, \
 721       CFLAGS := $(CFLAGS_JDKLIB) \
 722           $(JAWT_CFLAGS), \
 723       DISABLED_WARNINGS_clang := sign-compare, \
 724       EXTRA_HEADER_DIRS := \
 725           include \
 726           common/awt, \
 727       LDFLAGS := $(LDFLAGS_JDKLIB) \
 728           $(call SET_SHARED_LIBRARY_ORIGIN), \
 729       LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
 730       LDFLAGS_macosx := -Wl$(COMMA)-rpath$(COMMA)@loader_path, \
 731       LIBS_unix := $(JAWT_LIBS) $(JDKLIB_LIBS), \
 732       LIBS_solaris := $(X_LIBS) -lXrender, \
 733       LIBS_macosx := -framework Cocoa, \
 734   ))
 735 
 736   ifeq ($(ENABLE_HEADLESS_ONLY), false)
 737     $(BUILD_LIBJAWT): $(BUILD_LIBAWT_XAWT)
 738   else
 739     $(BUILD_LIBJAWT): $(call FindLib, $(MODULE), awt_headless)
 740   endif
 741 
 742   ifeq ($(call isTargetOs, macosx), true)
 743    $(BUILD_LIBJAWT): $(call FindLib, $(MODULE), awt_lwawt)
 744   endif
 745 
 746 endif
 747 
 748 TARGETS += $(BUILD_LIBJAWT)
 749 
 750 ################################################################################
 751 
 752 ifeq ($(ENABLE_HEADLESS_ONLY), false)
 753 
 754   LIBSPLASHSCREEN_EXTRA_SRC := \
 755       common/awt/systemscale \
 756       #
 757 
 758   ifeq ($(USE_EXTERNAL_LIBGIF), false)
 759     LIBSPLASHSCREEN_HEADER_DIRS += libsplashscreen/giflib
 760   else
 761     LIBSPLASHSCREEN_EXCLUDES := giflib
 762     GIFLIB_LIBS := -lgif
 763   endif
 764 
 765   ifeq ($(USE_EXTERNAL_LIBJPEG), false)
 766     # While the following ought to work, it will currently pull in the closed
 767     # additions to this library, and this was not done previously in the build.
 768     # LIBSPLASHSCREEN_EXTRA_SRC += libjavajpeg
 769     LIBSPLASHSCREEN_EXTRA_SRC += $(TOPDIR)/src/java.desktop/share/native/libjavajpeg
 770   else
 771     LIBJPEG_LIBS := -ljpeg
 772   endif
 773 
 774   ifeq ($(USE_EXTERNAL_LIBPNG), false)
 775     LIBSPLASHSCREEN_HEADER_DIRS += libsplashscreen/libpng
 776   else
 777     LIBSPLASHSCREEN_EXCLUDES += libpng
 778   endif
 779 
 780   ifeq ($(USE_EXTERNAL_LIBZ), false)
 781     LIBSPLASHSCREEN_EXTRA_SRC += java.base:libzip/zlib
 782   endif
 783 
 784   ifeq ($(call isTargetOs, macosx), true)
 785     # libsplashscreen on macosx do not use the unix code
 786     LIBSPLASHSCREEN_EXCLUDE_SRC_PATTERNS := /unix/
 787   endif
 788 
 789   LIBSPLASHSCREEN_CFLAGS += -DSPLASHSCREEN -DPNG_NO_MMX_CODE \
 790                             -DPNG_ARM_NEON_OPT=0 -DPNG_ARM_NEON_IMPLEMENTATION=0
 791 
 792   ifeq ($(call isTargetOs, linux), true)
 793     ifeq ($(call isTargetCpuArch, ppc), true)
 794       LIBSPLASHSCREEN_CFLAGS += -DPNG_POWERPC_VSX_OPT=0
 795     endif
 796   endif
 797 
 798   ifeq ($(call isTargetOs, macosx), true)
 799     LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX
 800 
 801     BUILD_LIBSPLASHSCREEN_java_awt_SplashScreen.c_CFLAGS := -x objective-c -O0
 802     BUILD_LIBSPLASHSCREEN_splashscreen_gfx_impl.c_CFLAGS := -x objective-c -O0
 803     BUILD_LIBSPLASHSCREEN_splashscreen_gif.c_CFLAGS := -x objective-c -O0
 804     BUILD_LIBSPLASHSCREEN_splashscreen_impl.c_CFLAGS := -x objective-c -O0
 805     BUILD_LIBSPLASHSCREEN_splashscreen_jpeg.c_CFLAGS := -x objective-c -O0
 806     BUILD_LIBSPLASHSCREEN_splashscreen_png.c_CFLAGS := -x objective-c -O0
 807     BUILD_LIBSPLASHSCREEN_splashscreen_sys.m_CFLAGS := -O0
 808 
 809   else ifeq ($(call isTargetOs, windows), true)
 810     LIBSPLASHSCREEN_CFLAGS += -DWITH_WIN32
 811   else
 812     LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 $(X_CFLAGS)
 813   endif
 814 
 815   LIBSPLASHSCREEN_LIBS :=
 816 
 817   ifeq ($(call isTargetOs, macosx), true)
 818     LIBSPLASHSCREEN_LIBS += \
 819         $(LIBM) -lpthread -liconv -losxapp \
 820         -framework ApplicationServices \
 821         -framework Foundation \
 822         -framework Security \
 823         -framework Cocoa \
 824         -framework JavaNativeFoundation
 825   else ifeq ($(call isTargetOs, windows), true)
 826     LIBSPLASHSCREEN_LIBS += kernel32.lib user32.lib gdi32.lib delayimp.lib $(WIN_JAVA_LIB) jvm.lib
 827   else
 828     LIBSPLASHSCREEN_LIBS += $(X_LIBS) -lX11 -lXext $(LIBM) -lpthread -ldl
 829   endif
 830 
 831   LIBSPLASHSCREEN_HEADER_DIRS += \
 832       libosxapp \
 833       java.base:include \
 834       java.base:libjava \
 835       #
 836 
 837   $(eval $(call SetupJdkLibrary, BUILD_LIBSPLASHSCREEN, \
 838       NAME := splashscreen, \
 839       EXTRA_SRC := $(LIBSPLASHSCREEN_EXTRA_SRC), \
 840       EXCLUDE_SRC_PATTERNS := $(LIBSPLASHSCREEN_EXCLUDE_SRC_PATTERNS), \
 841       EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
 842       EXCLUDES := $(LIBSPLASHSCREEN_EXCLUDES), \
 843       OPTIMIZATION := LOW, \
 844       CFLAGS := $(CFLAGS_JDKLIB) $(LIBSPLASHSCREEN_CFLAGS) \
 845           $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS), \
 846       EXTRA_HEADER_DIRS := $(LIBSPLASHSCREEN_HEADER_DIRS), \
 847       DISABLED_WARNINGS_gcc := sign-compare type-limits unused-result \
 848           maybe-uninitialized shift-negative-value implicit-fallthrough \
 849           unused-function, \
 850       DISABLED_WARNINGS_clang := incompatible-pointer-types sign-compare, \
 851       DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
 852       DISABLED_WARNINGS_microsoft := 4018 4244 4267, \
 853       LDFLAGS := $(LDFLAGS_JDKLIB) \
 854           $(call SET_SHARED_LIBRARY_ORIGIN), \
 855       LDFLAGS_macosx := -L$(INSTALL_LIBRARIES_HERE), \
 856       LDFLAGS_windows := -delayload:user32.dll, \
 857       LIBS := $(JDKLIB_LIBS) $(LIBSPLASHSCREEN_LIBS) $(LIBZ_LIBS) \
 858           $(GIFLIB_LIBS) $(LIBJPEG_LIBS) $(PNG_LIBS), \
 859       LIBS_aix := -liconv, \
 860   ))
 861 
 862   TARGETS += $(BUILD_LIBSPLASHSCREEN)
 863 
 864   ifeq ($(call isTargetOs, macosx), true)
 865     $(BUILD_LIBSPLASHSCREEN): $(call FindLib, $(MODULE), osxapp)
 866   endif
 867 
 868 endif
 869 
 870 ################################################################################
 871 
 872 ifeq ($(call isTargetOs, macosx), true)
 873 
 874   LIBAWT_LWAWT_EXTRA_SRC := \
 875       $(TOPDIR)/src/$(MODULE)/unix/native/common/awt \
 876       $(TOPDIR)/src/$(MODULE)/share/native/common/font \
 877       $(TOPDIR)/src/$(MODULE)/share/native/common/java2d \
 878       #
 879 
 880   LIBAWT_LWAWT_EXTRA_HEADER_DIRS := \
 881       $(LIBAWT_DEFAULT_HEADER_DIRS) \
 882       libawt_lwawt/awt \
 883       libawt_lwawt/font \
 884       libawt_lwawt/java2d/opengl \
 885       include \
 886       common/awt/debug \
 887       common/java2d/opengl \
 888       libosxapp \
 889       #
 890 
 891   LIBAWT_LWAWT_CFLAGS := $(X_CFLAGS) $(X_LIBS)
 892 
 893   LIBAWT_LWAWT_EXFILES := fontpath.c awt_Font.c X11Color.c
 894   LIBAWT_LWAWT_EXCLUDES := $(TOPDIR)/src/$(MODULE)/unix/native/common/awt/medialib
 895 
 896   $(eval $(call SetupJdkLibrary, BUILD_LIBAWT_LWAWT, \
 897       NAME := awt_lwawt, \
 898       EXTRA_SRC := $(LIBAWT_LWAWT_EXTRA_SRC), \
 899       INCLUDE_FILES := $(LIBAWT_LWAWT_FILES), \
 900       EXCLUDE_FILES := $(LIBAWT_LWAWT_EXFILES), \
 901       EXCLUDES := $(LIBAWT_LWAWT_EXCLUDES), \
 902       OPTIMIZATION := LOW, \
 903       CFLAGS := $(CFLAGS_JDKLIB) \
 904           $(LIBAWT_LWAWT_CFLAGS), \
 905       EXTRA_HEADER_DIRS := $(LIBAWT_LWAWT_EXTRA_HEADER_DIRS), \
 906       DISABLED_WARNINGS_clang := incomplete-implementation enum-conversion \
 907           deprecated-declarations objc-method-access bitwise-op-parentheses \
 908           incompatible-pointer-types parentheses-equality extra-tokens \
 909           sign-compare semicolon-before-method-body format-nonliteral undef \
 910           pointer-arith, \
 911       LDFLAGS := $(LDFLAGS_JDKLIB) \
 912           $(call SET_SHARED_LIBRARY_ORIGIN) \
 913           -L$(INSTALL_LIBRARIES_HERE), \
 914       LIBS := -lawt -lmlib_image -losxapp -ljvm $(LIBM) \
 915           -framework Accelerate \
 916           -framework ApplicationServices \
 917           -framework AudioToolbox \
 918           -framework Carbon \
 919           -framework Cocoa \
 920           -framework Security \
 921           -framework ExceptionHandling \
 922           -framework JavaNativeFoundation \
 923           -framework JavaRuntimeSupport \
 924           -framework OpenGL \
 925           -framework QuartzCore -ljava, \
 926   ))
 927 
 928   TARGETS += $(BUILD_LIBAWT_LWAWT)
 929 
 930   $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBAWT)
 931 
 932   $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBMLIB_IMAGE)
 933 
 934   $(BUILD_LIBAWT_LWAWT): $(call FindLib, $(MODULE), osxapp)
 935 
 936   $(BUILD_LIBAWT_LWAWT): $(call FindLib, java.base, java)
 937 
 938 endif
 939 
 940 ################################################################################
 941 
 942 ifeq ($(call isTargetOs, macosx), true)
 943 
 944   $(eval $(call SetupJdkLibrary, BUILD_LIBOSXUI, \
 945       NAME := osxui, \
 946       OPTIMIZATION := LOW, \
 947       CFLAGS := $(CFLAGS_JDKLIB), \
 948       EXTRA_HEADER_DIRS := \
 949           libawt_lwawt/awt \
 950           libosxapp, \
 951       DISABLED_WARNINGS_clang := deprecated-declarations sign-compare, \
 952       LDFLAGS := $(LDFLAGS_JDKLIB) \
 953           $(call SET_SHARED_LIBRARY_ORIGIN) \
 954           -Wl$(COMMA)-rpath$(COMMA)@loader_path \
 955           -L$(INSTALL_LIBRARIES_HERE), \
 956       LIBS := -lawt -losxapp -lawt_lwawt \
 957           -framework Cocoa \
 958           -framework Carbon \
 959           -framework ApplicationServices \
 960           -framework JavaNativeFoundation \
 961           -framework JavaRuntimeSupport \
 962           -ljava -ljvm, \
 963   ))
 964 
 965   TARGETS += $(BUILD_LIBOSXUI)
 966 
 967   $(BUILD_LIBOSXUI): $(BUILD_LIBAWT)
 968 
 969   $(BUILD_LIBOSXUI): $(call FindLib, $(MODULE), osxapp)
 970 
 971   $(BUILD_LIBOSXUI): $(BUILD_LIBAWT_LWAWT)
 972 
 973 endif
 974 
 975 ################################################################################
 976 
 977 # Hook to include the corresponding custom file, if present.
 978 $(eval $(call IncludeCustomExtension, lib/Awt2dLibraries.gmk))