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