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 BUILD_LIBLCMS_DISABLE_WARNINGS_gcc := format-nonliteral type-limits \
 375     misleading-indentation undef unused-function
 376 ifeq ($(TOOLCHAIN_TYPE), gcc)
 377   GCC_MAJOR_VER := $(shell $(ECHO) $(CC_VERSION_NUMBER) | $(CUT) -d . -f 1)
 378   GCC_8_OR_LATER := $(shell [ $(GCC_MAJOR_VER) -ge 8 ] && echo true)
 379   ifeq ($(GCC_8_OR_LATER), true)
 380     BUILD_LIBLCMS_DISABLE_WARNINGS_gcc += stringop-truncation
 381   endif
 382 endif
 383 
 384 $(eval $(call SetupJdkLibrary, BUILD_LIBLCMS, \
 385     NAME := lcms, \
 386     INCLUDE_FILES := $(BUILD_LIBLCMS_INCLUDE_FILES), \
 387     OPTIMIZATION := HIGHEST, \
 388     CFLAGS := $(CFLAGS_JDKLIB) \
 389         $(LCMS_CFLAGS), \
 390     CFLAGS_windows := -DCMS_IS_WINDOWS_, \
 391     EXTRA_HEADER_DIRS := \
 392         common/awt/debug \
 393         libawt/java2d, \
 394     HEADERS_FROM_SRC := $(LIBLCMS_HEADERS_FROM_SRC), \
 395     DISABLED_WARNINGS_gcc := $(BUILD_LIBLCMS_DISABLE_WARNINGS_gcc), \

 396     DISABLED_WARNINGS_clang := tautological-compare format-nonliteral undef, \
 397     DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
 398     DISABLED_WARNINGS_microsoft := 4819, \
 399     LDFLAGS := $(LDFLAGS_JDKLIB) \
 400         $(call SET_SHARED_LIBRARY_ORIGIN), \
 401     LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
 402     LIBS_unix := -lawt -ljvm -ljava $(LCMS_LIBS) $(LIBM), \
 403     LIBS_windows := $(WIN_AWT_LIB) $(WIN_JAVA_LIB), \
 404 ))
 405 
 406 TARGETS += $(BUILD_LIBLCMS)
 407 
 408 $(BUILD_LIBLCMS): $(BUILD_LIBAWT)
 409 
 410 ################################################################################
 411 
 412 # "DISABLED_WARNINGS_gcc := clobbered" rationale:
 413 # Suppress gcc warnings like "variable might be clobbered by 'longjmp'
 414 # or 'vfork'": this warning indicates that some variable is placed to
 415 # a register by optimized compiler and it's value might be lost on longjmp().
 416 # Recommended way to avoid such warning is to declare the variable as
 417 # volatile to prevent the optimization. However, this approach does not
 418 # work because we have to declare all variables as volatile in result.
 419 
 420 ifeq ($(USE_EXTERNAL_LIBJPEG), true)
 421   LIBJPEG_LIBS := -ljpeg
 422   BUILD_LIBJAVAJPEG_INCLUDE_FILES := \
 423       imageioJPEG.c \
 424       jpegdecoder.c
 425   # If we're using an external library, we can't include our own SRC path
 426   # as includes, instead the system headers should be used.
 427   LIBJPEG_HEADERS_FROM_SRC := false
 428 else
 429   LIBJPEG_LIBS :=
 430   BUILD_LIBJAVAJPEG_INCLUDE_FILES :=
 431 endif
 432 
 433 $(eval $(call SetupJdkLibrary, BUILD_LIBJAVAJPEG, \
 434     NAME := javajpeg, \
 435     INCLUDE_FILES := $(BUILD_LIBJAVAJPEG_INCLUDE_FILES), \
 436     OPTIMIZATION := HIGHEST, \
 437     CFLAGS := $(CFLAGS_JDKLIB), \
 438     HEADERS_FROM_SRC := $(LIBJPEG_HEADERS_FROM_SRC), \
 439     DISABLED_WARNINGS_gcc := clobbered implicit-fallthrough shift-negative-value, \
 440     LDFLAGS := $(LDFLAGS_JDKLIB) \
 441         $(call SET_SHARED_LIBRARY_ORIGIN), \
 442     LIBS := $(LIBJPEG_LIBS) $(JDKLIB_LIBS), \
 443     LIBS_windows := $(WIN_JAVA_LIB) jvm.lib, \
 444 ))
 445 
 446 $(BUILD_LIBJAVAJPEG): $(call FindLib, java.base, java)
 447 
 448 TARGETS += $(BUILD_LIBJAVAJPEG)
 449 
 450 ################################################################################
 451 
 452 # Mac and Windows only use the native AWT lib, do not build libawt_headless
 453 ifeq ($(call isTargetOs, windows macosx), false)
 454 
 455   LIBAWT_HEADLESS_EXTRA_SRC := \
 456       common/font \
 457       common/java2d \
 458       $(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
 459       #
 460 
 461   LIBAWT_HEADLESS_EXCLUDES := medialib
 462 
 463   LIBAWT_HEADLESS_EXTRA_HEADER_DIRS := \
 464       $(LIBAWT_DEFAULT_HEADER_DIRS) \
 465       common/awt/debug \
 466       common/font \
 467       common/java2d/opengl \
 468       #
 469 
 470   LIBAWT_HEADLESS_CFLAGS := $(CUPS_CFLAGS) $(FONTCONFIG_CFLAGS) $(X_CFLAGS) \
 471       -DHEADLESS=true
 472 
 473   $(eval $(call SetupJdkLibrary, BUILD_LIBAWT_HEADLESS, \
 474       NAME := awt_headless, \
 475       EXTRA_SRC := $(LIBAWT_HEADLESS_EXTRA_SRC), \
 476       EXCLUDES := $(LIBAWT_HEADLESS_EXCLUDES), \
 477       OPTIMIZATION := LOW, \
 478       CFLAGS := $(CFLAGS_JDKLIB) \
 479           $(LIBAWT_HEADLESS_CFLAGS), \
 480       EXTRA_HEADER_DIRS := $(LIBAWT_HEADLESS_EXTRA_HEADER_DIRS), \
 481       DISABLED_WARNINGS_gcc := unused-function, \
 482       DISABLED_WARNINGS_solstudio := E_EMPTY_TRANSLATION_UNIT, \
 483       LDFLAGS := $(LDFLAGS_JDKLIB) \
 484           $(call SET_SHARED_LIBRARY_ORIGIN), \
 485       LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
 486       LIBS_unix := -lawt -ljvm -ljava, \
 487       LIBS_linux := $(LIBM) $(LIBDL), \
 488       LIBS_solaris := $(LIBM) $(LIBDL) $(LIBCXX), \
 489   ))
 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 ($(call isTargetOs, windows), true)
 510     LIBFREETYPE_LIBS := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfreetype/freetype.lib
 511     # freetype now requires you to manually define this (see ftconfig.h)
 512     BUILD_LIBFREETYPE_CFLAGS += -DDLL_EXPORT
 513   else
 514     LIBFREETYPE_LIBS := -lfreetype
 515   endif
 516 
 517   $(eval $(call SetupJdkLibrary, BUILD_LIBFREETYPE, \
 518       NAME := freetype, \
 519       OPTIMIZATION := HIGHEST, \
 520       CFLAGS := $(CFLAGS_JDKLIB) \
 521           $(BUILD_LIBFREETYPE_CFLAGS), \
 522       EXTRA_HEADER_DIRS := $(BUILD_LIBFREETYPE_HEADER_DIRS), \
 523       DISABLED_WARNINGS_solstudio := \
 524          E_STATEMENT_NOT_REACHED \
 525          E_END_OF_LOOP_CODE_NOT_REACHED, \
 526       DISABLED_WARNINGS_microsoft := 4018 4267 4244 4312 4819, \
 527       DISABLED_WARNINGS_gcc := implicit-fallthrough cast-function-type bad-function-cast, \
 528       LDFLAGS := $(LDFLAGS_JDKLIB) \
 529           $(call SET_SHARED_LIBRARY_ORIGIN), \
 530   ))
 531 
 532   TARGETS += $(BUILD_LIBFREETYPE)
 533 endif
 534 
 535 ###########################################################################
 536 
 537 #### Begin harfbuzz configuration
 538 
 539 HARFBUZZ_CFLAGS := -DHAVE_OT -DHAVE_FALLBACK -DHAVE_UCDN -DHAVE_ROUND
 540 
 541 ifeq ($(call isTargetOs, windows), false)
 542   HARFBUZZ_CFLAGS += -DGETPAGESIZE -DHAVE_MPROTECT -DHAVE_PTHREAD \
 543                       -DHAVE_SYSCONF -DHAVE_SYS_MMAN_H -DHAVE_UNISTD_H \
 544                       -DHB_NO_PRAGMA_GCC_DIAGNOSTIC
 545 endif
 546 ifeq ($(call isTargetOs, linux macosx), true)
 547   HARFBUZZ_CFLAGS += -DHAVE_INTEL_ATOMIC_PRIMITIVES
 548 endif
 549 ifeq ($(call isTargetOs, solaris), true)
 550   HARFBUZZ_CFLAGS += -DHAVE_SOLARIS_ATOMIC_OPS
 551 endif
 552 ifeq ($(call isTargetOs, macosx), true)
 553   HARFBUZZ_CFLAGS += -DHAVE_CORETEXT
 554 endif
 555 ifeq ($(call isTargetOs, macosx), false)
 556   LIBFONTMANAGER_EXCLUDE_FILES += harfbuzz/hb-coretext.cc
 557 endif
 558 # hb-ft.cc is not presently needed, and requires freetype 2.4.2 or later.
 559 LIBFONTMANAGER_EXCLUDE_FILES += harfbuzz/hb-ft.cc
 560 
 561 LIBFONTMANAGER_CFLAGS += $(HARFBUZZ_CFLAGS)
 562 
 563 #### End harfbuzz configuration
 564 
 565 LIBFONTMANAGER_EXTRA_HEADER_DIRS := \
 566     libfontmanager/harfbuzz \
 567     libfontmanager/harfbuzz/hb-ucdn \
 568     common/awt \
 569     common/font \
 570     libawt/java2d \
 571     libawt/java2d/pipe \
 572     libawt/java2d/loops \
 573     #
 574 
 575 LIBFONTMANAGER_CFLAGS += $(LIBFREETYPE_CFLAGS)
 576 BUILD_LIBFONTMANAGER_FONTLIB += $(LIBFREETYPE_LIBS)
 577 
 578 LIBFONTMANAGER_OPTIMIZATION := HIGH
 579 
 580 ifeq ($(call isTargetOs, windows), true)
 581   LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
 582       X11TextRenderer.c
 583   LIBFONTMANAGER_OPTIMIZATION := HIGHEST
 584 else ifeq ($(call isTargetOs, macosx), true)
 585   LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
 586       X11TextRenderer.c \
 587       fontpath.c \
 588       lcdglyph.c
 589 else
 590   LIBFONTMANAGER_EXCLUDE_FILES += fontpath.c \
 591       lcdglyph.c
 592 endif
 593 
 594 LIBFONTMANAGER_CFLAGS += $(X_CFLAGS) -DLE_STANDALONE -DHEADLESS
 595 
 596 ifeq ($(TOOLCHAIN_TYPE), gcc)
 597   # Turn off all warnings for sunFont.c. This is needed because the specific warning
 598   # about discarding 'const' qualifier cannot be turned off individually.
 599   BUILD_LIBFONTMANAGER_sunFont.c_CFLAGS := -w
 600 endif
 601 
 602 # LDFLAGS clarification:
 603 #   Filter relevant linker flags disallowing unresolved symbols as we cannot
 604 #   build-time decide to which library to link against (libawt_headless or
 605 #   libawt_xawt). See JDK-8196516 for details.
 606 $(eval $(call SetupJdkLibrary, BUILD_LIBFONTMANAGER, \
 607     NAME := fontmanager, \
 608     EXCLUDE_FILES := $(LIBFONTMANAGER_EXCLUDE_FILES) \
 609         AccelGlyphCache.c, \
 610     TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
 611     CFLAGS := $(CFLAGS_JDKLIB) $(LIBFONTMANAGER_CFLAGS), \
 612     CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBFONTMANAGER_CFLAGS), \
 613     OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \
 614     CFLAGS_windows = -DCC_NOEX, \
 615     EXTRA_HEADER_DIRS := $(LIBFONTMANAGER_EXTRA_HEADER_DIRS), \
 616     WARNINGS_AS_ERRORS_xlc := false, \
 617     DISABLED_WARNINGS_gcc := sign-compare int-to-pointer-cast \
 618         type-limits missing-field-initializers implicit-fallthrough \
 619         strict-aliasing undef unused-function, \
 620     DISABLED_WARNINGS_CXX_gcc := reorder delete-non-virtual-dtor strict-overflow \
 621         maybe-uninitialized class-memaccess, \
 622     DISABLED_WARNINGS_clang := unused-value incompatible-pointer-types \
 623         tautological-constant-out-of-range-compare int-to-pointer-cast \
 624         sign-compare undef missing-field-initializers, \
 625     DISABLED_WARNINGS_C_solstudio = \
 626         E_INTEGER_OVERFLOW_DETECTED \
 627         E_ARG_INCOMPATIBLE_WITH_ARG_L \
 628         E_ENUM_VAL_OVERFLOWS_INT_MAX, \
 629     DISABLED_WARNINGS_CXX_solstudio := \
 630         truncwarn wvarhidenmem wvarhidemem wbadlkginit identexpected \
 631         hidevf w_novirtualdescr arrowrtn2 refmemnoconstr_aggr unknownpragma \
 632         doubunder wunreachable, \
 633     DISABLED_WARNINGS_microsoft := 4267 4244 4018 4090 4996 4146 4334 4819 4101 4068 4805 4138, \
 634     LDFLAGS := $(subst -Xlinker -z -Xlinker defs,, \
 635         $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB))) $(LDFLAGS_CXX_JDK) \
 636         $(call SET_SHARED_LIBRARY_ORIGIN), \
 637     LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
 638     LDFLAGS_aix := -Wl$(COMMA)-berok, \
 639     LIBS := $(BUILD_LIBFONTMANAGER_FONTLIB), \
 640     LIBS_unix := -lawt -ljava -ljvm $(LIBM) $(LIBCXX), \
 641     LIBS_macosx := -lawt_lwawt -framework CoreText -framework CoreFoundation \
 642         -framework CoreGraphics, \
 643     LIBS_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib gdi32.lib \
 644         $(WIN_AWT_LIB), \
 645 ))
 646 
 647 $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT)
 648 
 649 ifeq ($(call isTargetOs, macosx), true)
 650   $(BUILD_LIBFONTMANAGER): $(call FindLib, $(MODULE), awt_lwawt)
 651 endif
 652 
 653 ifeq ($(FREETYPE_TO_USE), bundled)
 654   $(BUILD_LIBFONTMANAGER): $(BUILD_LIBFREETYPE)
 655 endif
 656 
 657 TARGETS += $(BUILD_LIBFONTMANAGER)
 658 
 659 ################################################################################
 660 
 661 ifeq ($(call isTargetOs, windows), true)
 662 
 663   LIBJAWT_CFLAGS := -EHsc -DUNICODE -D_UNICODE
 664 
 665   LIBJAWT_EXTRA_HEADER_DIRS := \
 666       include \
 667       common/awt/debug \
 668       libawt/awt/image/cvutils \
 669       libawt/java2d \
 670       libawt/java2d/windows \
 671       libawt/windows \
 672       java.base:include \
 673       java.base:libjava \
 674       #
 675 
 676   ifeq ($(call isTargetCpu, x86), true)
 677     KERNEL32_LIB := kernel32.lib
 678   endif
 679 
 680   $(eval $(call SetupJdkLibrary, BUILD_LIBJAWT, \
 681       NAME := jawt, \
 682       OPTIMIZATION := LOW, \
 683       CFLAGS := $(CXXFLAGS_JDKLIB) \
 684           $(LIBJAWT_CFLAGS), \
 685       EXTRA_HEADER_DIRS := $(LIBJAWT_EXTRA_HEADER_DIRS), \
 686       LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \
 687       LIBS := $(JDKLIB_LIBS) $(KERNEL32_LIB) advapi32.lib $(WIN_AWT_LIB), \
 688   ))
 689 
 690   $(BUILD_LIBJAWT): $(BUILD_LIBAWT)
 691 
 692   $(eval $(call SetupCopyFiles, COPY_JAWT_LIB, \
 693       FILES := $(BUILD_LIBJAWT_IMPORT_LIBRARY), \
 694       DEST := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
 695   ))
 696 
 697   $(COPY_JAWT_LIB): $(BUILD_LIBJAWT)
 698 
 699   TARGETS += $(COPY_JAWT_LIB)
 700 
 701 else # not windows
 702 
 703   ifeq ($(call isTargetOs, macosx), true)
 704     # libjawt on macosx do not use the unix code
 705     LIBJAWT_EXCLUDE_SRC_PATTERNS := /unix/
 706   endif
 707 
 708   ifeq ($(call isTargetOs, macosx), true)
 709     JAWT_LIBS := -lawt_lwawt
 710   else
 711     JAWT_LIBS :=
 712     ifeq ($(call isTargetOs, solaris), false)
 713       JAWT_LIBS += -lawt
 714     endif
 715     ifeq ($(ENABLE_HEADLESS_ONLY), false)
 716       JAWT_LIBS += -lawt_xawt
 717     else
 718       JAWT_LIBS += -lawt_headless
 719       ifeq ($(call isTargetOs, linux), true)
 720         JAWT_CFLAGS += -DHEADLESS
 721       endif
 722     endif
 723   endif
 724 
 725   $(eval $(call SetupJdkLibrary, BUILD_LIBJAWT, \
 726       NAME := jawt, \
 727       EXCLUDE_SRC_PATTERNS := $(LIBJAWT_EXCLUDE_SRC_PATTERNS), \
 728       INCLUDE_FILES := $(JAWT_FILES), \
 729       OPTIMIZATION := LOW, \
 730       CFLAGS := $(CFLAGS_JDKLIB) \
 731           $(JAWT_CFLAGS), \
 732       DISABLED_WARNINGS_clang := sign-compare, \
 733       EXTRA_HEADER_DIRS := \
 734           include \
 735           common/awt, \
 736       LDFLAGS := $(LDFLAGS_JDKLIB) \
 737           $(call SET_SHARED_LIBRARY_ORIGIN), \
 738       LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
 739       LDFLAGS_macosx := -Wl$(COMMA)-rpath$(COMMA)@loader_path, \
 740       LIBS_unix := $(JAWT_LIBS) $(JDKLIB_LIBS), \
 741       LIBS_solaris := $(X_LIBS) -lXrender, \
 742       LIBS_macosx := -framework Cocoa, \
 743   ))
 744 
 745   ifeq ($(ENABLE_HEADLESS_ONLY), false)
 746     $(BUILD_LIBJAWT): $(BUILD_LIBAWT_XAWT)
 747   else
 748     $(BUILD_LIBJAWT): $(call FindLib, $(MODULE), awt_headless)
 749   endif
 750 
 751   ifeq ($(call isTargetOs, macosx), true)
 752    $(BUILD_LIBJAWT): $(call FindLib, $(MODULE), awt_lwawt)
 753   endif
 754 
 755 endif
 756 
 757 TARGETS += $(BUILD_LIBJAWT)
 758 
 759 ################################################################################
 760 
 761 ifeq ($(ENABLE_HEADLESS_ONLY), false)
 762 
 763   LIBSPLASHSCREEN_EXTRA_SRC := \
 764       common/awt/systemscale \
 765       #
 766 
 767   ifeq ($(USE_EXTERNAL_LIBGIF), false)
 768     LIBSPLASHSCREEN_HEADER_DIRS += libsplashscreen/giflib
 769   else
 770     LIBSPLASHSCREEN_EXCLUDES := giflib
 771     GIFLIB_LIBS := -lgif
 772   endif
 773 
 774   ifeq ($(USE_EXTERNAL_LIBJPEG), false)
 775     # While the following ought to work, it will currently pull in the closed
 776     # additions to this library, and this was not done previously in the build.
 777     # LIBSPLASHSCREEN_EXTRA_SRC += libjavajpeg
 778     LIBSPLASHSCREEN_EXTRA_SRC += $(TOPDIR)/src/java.desktop/share/native/libjavajpeg
 779   else
 780     LIBJPEG_LIBS := -ljpeg
 781   endif
 782 
 783   ifeq ($(USE_EXTERNAL_LIBPNG), false)
 784     LIBSPLASHSCREEN_HEADER_DIRS += libsplashscreen/libpng
 785   else
 786     LIBSPLASHSCREEN_EXCLUDES += libpng
 787   endif
 788 
 789   ifeq ($(USE_EXTERNAL_LIBZ), false)
 790     LIBSPLASHSCREEN_EXTRA_SRC += java.base:libzip/zlib
 791   endif
 792 
 793   ifeq ($(call isTargetOs, macosx), true)
 794     # libsplashscreen on macosx do not use the unix code
 795     LIBSPLASHSCREEN_EXCLUDE_SRC_PATTERNS := /unix/
 796   endif
 797 
 798   LIBSPLASHSCREEN_CFLAGS += -DSPLASHSCREEN -DPNG_NO_MMX_CODE \
 799                             -DPNG_ARM_NEON_OPT=0 -DPNG_ARM_NEON_IMPLEMENTATION=0
 800 
 801   ifeq ($(call isTargetOs, linux), true)
 802     ifeq ($(call isTargetCpuArch, ppc), true)
 803       LIBSPLASHSCREEN_CFLAGS += -DPNG_POWERPC_VSX_OPT=0
 804     endif
 805   endif
 806 
 807   ifeq ($(call isTargetOs, macosx), true)
 808     LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX
 809 
 810     BUILD_LIBSPLASHSCREEN_java_awt_SplashScreen.c_CFLAGS := -x objective-c -O0
 811     BUILD_LIBSPLASHSCREEN_splashscreen_gfx_impl.c_CFLAGS := -x objective-c -O0
 812     BUILD_LIBSPLASHSCREEN_splashscreen_gif.c_CFLAGS := -x objective-c -O0
 813     BUILD_LIBSPLASHSCREEN_splashscreen_impl.c_CFLAGS := -x objective-c -O0
 814     BUILD_LIBSPLASHSCREEN_splashscreen_jpeg.c_CFLAGS := -x objective-c -O0
 815     BUILD_LIBSPLASHSCREEN_splashscreen_png.c_CFLAGS := -x objective-c -O0
 816     BUILD_LIBSPLASHSCREEN_splashscreen_sys.m_CFLAGS := -O0
 817 
 818   else ifeq ($(call isTargetOs, windows), true)
 819     LIBSPLASHSCREEN_CFLAGS += -DWITH_WIN32
 820   else
 821     LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 $(X_CFLAGS)
 822   endif
 823 
 824   LIBSPLASHSCREEN_LIBS :=
 825 
 826   ifeq ($(call isTargetOs, macosx), true)
 827     LIBSPLASHSCREEN_LIBS += \
 828         $(LIBM) -lpthread -liconv -losxapp \
 829         -framework ApplicationServices \
 830         -framework Foundation \
 831         -framework Security \
 832         -framework Cocoa \
 833         -framework JavaNativeFoundation
 834   else ifeq ($(call isTargetOs, windows), true)
 835     LIBSPLASHSCREEN_LIBS += kernel32.lib user32.lib gdi32.lib delayimp.lib $(WIN_JAVA_LIB) jvm.lib
 836   else
 837     LIBSPLASHSCREEN_LIBS += $(X_LIBS) -lX11 -lXext $(LIBM) -lpthread -ldl
 838   endif
 839 
 840   LIBSPLASHSCREEN_HEADER_DIRS += \
 841       libosxapp \
 842       java.base:include \
 843       java.base:libjava \
 844       #
 845 
 846   $(eval $(call SetupJdkLibrary, BUILD_LIBSPLASHSCREEN, \
 847       NAME := splashscreen, \
 848       EXTRA_SRC := $(LIBSPLASHSCREEN_EXTRA_SRC), \
 849       EXCLUDE_SRC_PATTERNS := $(LIBSPLASHSCREEN_EXCLUDE_SRC_PATTERNS), \
 850       EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
 851       EXCLUDES := $(LIBSPLASHSCREEN_EXCLUDES), \
 852       OPTIMIZATION := LOW, \
 853       CFLAGS := $(CFLAGS_JDKLIB) $(LIBSPLASHSCREEN_CFLAGS) \
 854           $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS), \
 855       EXTRA_HEADER_DIRS := $(LIBSPLASHSCREEN_HEADER_DIRS), \
 856       DISABLED_WARNINGS_gcc := sign-compare type-limits unused-result \
 857           maybe-uninitialized shift-negative-value implicit-fallthrough \
 858           unused-function, \
 859       DISABLED_WARNINGS_clang := incompatible-pointer-types sign-compare, \
 860       DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
 861       DISABLED_WARNINGS_microsoft := 4018 4244 4267, \
 862       LDFLAGS := $(LDFLAGS_JDKLIB) \
 863           $(call SET_SHARED_LIBRARY_ORIGIN), \
 864       LDFLAGS_macosx := -L$(INSTALL_LIBRARIES_HERE), \
 865       LDFLAGS_windows := -delayload:user32.dll, \
 866       LIBS := $(JDKLIB_LIBS) $(LIBSPLASHSCREEN_LIBS) $(LIBZ_LIBS) \
 867           $(GIFLIB_LIBS) $(LIBJPEG_LIBS) $(PNG_LIBS), \
 868       LIBS_aix := -liconv, \
 869   ))
 870 
 871   TARGETS += $(BUILD_LIBSPLASHSCREEN)
 872 
 873   ifeq ($(call isTargetOs, macosx), true)
 874     $(BUILD_LIBSPLASHSCREEN): $(call FindLib, $(MODULE), osxapp)
 875   endif
 876 
 877 endif
 878 
 879 ################################################################################
 880 
 881 ifeq ($(call isTargetOs, macosx), true)
 882 
 883   LIBAWT_LWAWT_EXTRA_SRC := \
 884       $(TOPDIR)/src/$(MODULE)/unix/native/common/awt \
 885       $(TOPDIR)/src/$(MODULE)/share/native/common/font \
 886       $(TOPDIR)/src/$(MODULE)/share/native/common/java2d \
 887       #
 888 
 889   LIBAWT_LWAWT_EXTRA_HEADER_DIRS := \
 890       $(LIBAWT_DEFAULT_HEADER_DIRS) \
 891       libawt_lwawt/awt \
 892       libawt_lwawt/font \
 893       libawt_lwawt/java2d/opengl \
 894       include \
 895       common/awt/debug \
 896       common/java2d/opengl \
 897       libosxapp \
 898       #
 899 
 900   LIBAWT_LWAWT_CFLAGS := $(X_CFLAGS) $(X_LIBS)
 901 
 902   LIBAWT_LWAWT_EXFILES := fontpath.c awt_Font.c X11Color.c
 903   LIBAWT_LWAWT_EXCLUDES := $(TOPDIR)/src/$(MODULE)/unix/native/common/awt/medialib
 904 
 905   $(eval $(call SetupJdkLibrary, BUILD_LIBAWT_LWAWT, \
 906       NAME := awt_lwawt, \
 907       EXTRA_SRC := $(LIBAWT_LWAWT_EXTRA_SRC), \
 908       INCLUDE_FILES := $(LIBAWT_LWAWT_FILES), \
 909       EXCLUDE_FILES := $(LIBAWT_LWAWT_EXFILES), \
 910       EXCLUDES := $(LIBAWT_LWAWT_EXCLUDES), \
 911       OPTIMIZATION := LOW, \
 912       CFLAGS := $(CFLAGS_JDKLIB) \
 913           $(LIBAWT_LWAWT_CFLAGS), \
 914       EXTRA_HEADER_DIRS := $(LIBAWT_LWAWT_EXTRA_HEADER_DIRS), \
 915       DISABLED_WARNINGS_clang := incomplete-implementation enum-conversion \
 916           deprecated-declarations objc-method-access bitwise-op-parentheses \
 917           incompatible-pointer-types parentheses-equality extra-tokens \
 918           sign-compare semicolon-before-method-body format-nonliteral undef \
 919           pointer-arith, \
 920       LDFLAGS := $(LDFLAGS_JDKLIB) \
 921           $(call SET_SHARED_LIBRARY_ORIGIN) \
 922           -L$(INSTALL_LIBRARIES_HERE), \
 923       LIBS := -lawt -lmlib_image -losxapp -ljvm $(LIBM) \
 924           -framework Accelerate \
 925           -framework ApplicationServices \
 926           -framework AudioToolbox \
 927           -framework Carbon \
 928           -framework Cocoa \
 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 ($(call isTargetOs, macosx), true)
 952 
 953   $(eval $(call SetupJdkLibrary, BUILD_LIBOSXUI, \
 954       NAME := osxui, \
 955       OPTIMIZATION := LOW, \
 956       CFLAGS := $(CFLAGS_JDKLIB), \
 957       EXTRA_HEADER_DIRS := \
 958           libawt_lwawt/awt \
 959           libosxapp, \
 960       DISABLED_WARNINGS_clang := deprecated-declarations sign-compare, \
 961       LDFLAGS := $(LDFLAGS_JDKLIB) \
 962           $(call SET_SHARED_LIBRARY_ORIGIN) \
 963           -Wl$(COMMA)-rpath$(COMMA)@loader_path \
 964           -L$(INSTALL_LIBRARIES_HERE), \
 965       LIBS := -lawt -losxapp -lawt_lwawt \
 966           -framework Cocoa \
 967           -framework Carbon \
 968           -framework ApplicationServices \
 969           -framework JavaNativeFoundation \
 970           -framework JavaRuntimeSupport \
 971           -ljava -ljvm, \
 972   ))
 973 
 974   TARGETS += $(BUILD_LIBOSXUI)
 975 
 976   $(BUILD_LIBOSXUI): $(BUILD_LIBAWT)
 977 
 978   $(BUILD_LIBOSXUI): $(call FindLib, $(MODULE), osxapp)
 979 
 980   $(BUILD_LIBOSXUI): $(BUILD_LIBAWT_LWAWT)
 981 
 982 endif
 983 
 984 ################################################################################
 985 
 986 # Hook to include the corresponding custom file, if present.
 987 $(eval $(call IncludeCustomExtension, lib/Awt2dLibraries.gmk))
--- EOF ---