1 #
   2 # Copyright (c) 2011, 2018, 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 ################################################################################
  31 
  32 BUILD_LIBMLIB_SRC := $(TOPDIR)/src/java.desktop/share/native/libmlib_image \
  33     $(TOPDIR)/src/java.desktop/share/native/common/awt/medialib
  34 BUILD_LIBMLIB_CFLAGS := -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES \
  35     $(addprefix -I, $(BUILD_LIBMLIB_SRC)) \
  36     -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libmlib_image
  37 
  38 BUILD_LIBMLIB_LDLIBS :=

  39 
  40 BUILD_LIBMLIB_CFLAGS += -DMLIB_NO_LIBSUNMATH
  41 
  42 ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
  43   BUILD_LIBMLIB_CFLAGS += -DMLIB_OS64BIT
  44 endif
  45 
  46 ifneq ($(OPENJDK_TARGET_OS), windows)
  47   BUILD_LIBMLIB_LDLIBS += $(LIBM) $(LIBDL)
  48 endif
  49 
  50 $(eval $(call SetupJdkLibrary, BUILD_LIBMLIB_IMAGE, \
  51     NAME := mlib_image, \
  52     SRC := $(BUILD_LIBMLIB_SRC), \
  53     EXCLUDE_FILES := mlib_c_ImageBlendTable.c, \
  54     OPTIMIZATION := HIGHEST, \
  55     CFLAGS := $(CFLAGS_JDKLIB) \
  56         $(BUILD_LIBMLIB_CFLAGS), \

  57     LDFLAGS := $(LDFLAGS_JDKLIB) \
  58         $(call SET_SHARED_LIBRARY_ORIGIN), \
  59     LIBS := $(BUILD_LIBMLIB_LDLIBS) \
  60         $(JDKLIB_LIBS), \
  61 ))
  62 
  63 $(BUILD_LIBMLIB_IMAGE): $(call FindLib, java.base, java)
  64 
  65 TARGETS += $(BUILD_LIBMLIB_IMAGE)
  66 
  67 ################################################################################
  68 
  69 ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
  70 
  71   LIBMLIB_IMAGE_V_SRC := $(TOPDIR)/src/java.desktop/share/native/libmlib_image \
  72       $(TOPDIR)/src/java.desktop/unix/native/libmlib_image \
  73       $(TOPDIR)/src/java.desktop/share/native/common/awt/medialib \
  74       $(TOPDIR)/src/java.desktop/unix/native/common/awt/medialib \
  75       #
  76   LIBMLIB_IMAGE_V_CFLAGS := $(TOPDIR)/src/java.desktop/unix/native/libmlib_image/vis_$(OPENJDK_TARGET_CPU_BITS).il \
  77       $(addprefix -I, $(LIBMLIB_IMAGE_V_SRC)) \
  78       #
  79 
  80   BUILD_LIBMLIB_IMAGE_V_EXFILES := \
  81       awt_ImagingLib.c \
  82       mlib_c_ImageAffine_BC.c \
  83       mlib_c_ImageAffine_BC_S16.c \
  84       mlib_c_ImageAffine_BC_U16.c \
  85       mlib_c_ImageAffine_BL.c \
  86       mlib_c_ImageAffine_BL_S16.c \
  87       mlib_c_ImageAffine_BL_U16.c \
  88       mlib_c_ImageAffine_NN.c \
  89       mlib_c_ImageConvClearEdge.c \
  90       mlib_c_ImageConvCopyEdge.c \
  91       mlib_c_ImageConv_f.c \
  92       mlib_c_ImageConvVersion.c \
  93       mlib_c_ImageCopy.c \
  94       mlib_c_ImageLookUp.c \
  95       mlib_c_ImageLookUp_f.c \
  96       #
  97 
  98   LIBMLIB_IMAGE_V_CFLAGS += $(filter-out -DMLIB_NO_LIBSUNMATH, $(BUILD_LIBMLIB_CFLAGS))
  99 
 100   $(eval $(call SetupJdkLibrary, BUILD_LIBMLIB_IMAGE_V, \
 101       NAME := mlib_image_v, \
 102       SRC := $(LIBMLIB_IMAGE_V_SRC), \
 103       EXCLUDE_FILES := $(BUILD_LIBMLIB_IMAGE_V_EXFILES), \
 104       OPTIMIZATION := HIGHEST, \
 105       CFLAGS := -xarch=sparcvis \
 106           $(LIBMLIB_IMAGE_V_CFLAGS) \
 107           $(CFLAGS_JDKLIB), \

 108       LDFLAGS := $(LDFLAGS_JDKLIB) \
 109           $(call SET_SHARED_LIBRARY_ORIGIN), \
 110       LIBS := -ljava -ljvm $(BUILD_LIBMLIB_LDLIBS), \
 111   ))
 112 
 113   $(BUILD_LIBMLIB_IMAGE_V): $(call FindLib, java.base, java)
 114 
 115   TARGETS += $(BUILD_LIBMLIB_IMAGE_V)
 116 
 117 endif
 118 
 119 ################################################################################
 120 
 121 LIBAWT_DIRS := $(TOPDIR)/src/java.desktop/share/native/libawt \
 122     $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt \
 123     $(TOPDIR)/src/java.desktop/share/native/common/awt/debug \
 124     $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
 125     #
 126 
 127 ifeq ($(OPENJDK_TARGET_OS), aix)
 128   LIBAWT_DIRS += $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS)/native/libawt
 129 endif
 130 
 131 ifeq ($(OPENJDK_TARGET_OS), windows)
 132   LIBAWT_DIRS += $(TOPDIR)/src/java.desktop/share/native/common/awt/utility
 133 endif
 134 
 135 ifneq ($(filter $(OPENJDK_TARGET_OS), solaris linux macosx aix), )
 136   LIBAWT_EXFILES += awt_Font.c CUPSfuncs.c fontpath.c X11Color.c
 137 endif
 138 
 139 ifeq ($(OPENJDK_TARGET_OS), macosx)
 140   LIBAWT_EXFILES += initIDs.c awt/image/cvutils/img_colors.c
 141 endif
 142 
 143 LIBAWT_CFLAGS += -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
 144     $(addprefix -I, $(shell find $(LIBAWT_DIRS) -type d)) \
 145     $(LIBJAVA_HEADER_FLAGS) \
 146     $(addprefix -I, $(BUILD_LIBMLIB_IMAGE_SRC)) \
 147     #
 148 
 149 LIBAWT_CFLAGS += -D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES $(X_CFLAGS)
 150 
 151 ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
 152   LIBAWT_CFLAGS += -DMLIB_ADD_SUFF
 153   LIBAWT_CFLAGS += -xarch=sparcvis
 154 
 155   LIBAWT_CFLAGS += $(TOPDIR)/src/java.desktop/unix/native/libmlib_image/vis_$(OPENJDK_TARGET_CPU_BITS).il
 156   LIBAWT_DIRS += $(TOPDIR)/src/java.desktop/share/native/common/awt/medialib
 157   LIBAWT_EXFILES += java2d/loops/MapAccelFunc.c
 158 
 159   ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
 160     LIBAWT_ASFLAGS = -P -xarch=v9a
 161   else
 162     LIBAWT_ASFLAGS = -P -xarch=v8plusa
 163   endif
 164 else
 165   LIBAWT_EXCLUDES += \
 166       $(TOPDIR)/src/java.desktop/unix/native/libawt/awt/medialib \
 167       $(TOPDIR)/src/java.desktop/unix/native/libawt/java2d/loops \
 168       $(TOPDIR)/src/java.desktop/unix/native/common/awt/medialib \
 169       #
 170 endif
 171 
 172 ifneq ($(OPENJDK_TARGET_OS), solaris)
 173   LIBAWT_CFLAGS += -DMLIB_NO_LIBSUNMATH
 174 endif
 175 
 176 ifeq ($(OPENJDK_TARGET_OS), windows)
 177   LIBAWT_DIRS += $(TOPDIR)/src/java.desktop/share/native/common/font \
 178       $(TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
 179       $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt/systemscale \
 180   # Why does libawt need java.base headers?
 181   LIBAWT_CFLAGS += -I$(TOPDIR)/src/java.desktop/share/native/common/font \
 182       -I$(TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
 183       -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/opengl \
 184       -I$(TOPDIR)/src/java.desktop/windows/native/include \
 185       -I$(TOPDIR)/src/java.desktop/share/native/include \
 186       -I$(SUPPORT_OUTPUTDIR)/headers/java.base \
 187       #
 188   LIBAWT_EXFILES += \
 189       java2d/d3d/D3DShaderGen.c \
 190       awt/image/cvutils/img_colors.c \
 191       #
 192 
 193   LIBAWT_CFLAGS += -EHsc -DUNICODE -D_UNICODE
 194   ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
 195     LIBAWT_CFLAGS += -DMLIB_OS64BIT
 196   endif
 197 
 198   LIBAWT_RC_FLAGS ?= -I $(TOPDIR)/src/java.base/windows/native/launcher/icons
 199   LIBAWT_VERSIONINFO_RESOURCE := $(TOPDIR)/src/java.desktop/windows/native/libawt/windows/awt.rc
 200 endif
 201 

 202 ifeq ($(OPENJDK_TARGET_OS), linux)
 203   # FIXME: This is probably not what we want to do, but keep it now for compatibility.
 204   LIBAWT_CFLAGS += $(EXPORT_ALL_SYMBOLS)
 205 endif
 206 
 207 # Turn off all warnings for debug_mem.c This is needed because the specific warning
 208 # about initializing a declared 'extern' cannot be turned off individually. Only
 209 # applies to debug builds.
 210 ifeq ($(TOOLCHAIN_TYPE), gcc)
 211   BUILD_LIBAWT_debug_mem.c_CFLAGS := -w
 212   # This option improves performance of MaskFill in Java2D by 20% for some gcc
 213   LIBAWT_CFLAGS += -fgcse-after-reload
 214 endif
 215 
 216 $(eval $(call SetupJdkLibrary, BUILD_LIBAWT, \
 217     NAME := awt, \
 218     SRC := $(LIBAWT_DIRS), \
 219     EXCLUDES := $(LIBAWT_EXCLUDES), \
 220     EXCLUDE_FILES := $(LIBAWT_EXFILES), \
 221     OPTIMIZATION := LOW, \
 222     CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_CFLAGS), \
 223     DISABLED_WARNINGS_gcc := sign-compare unused-result maybe-uninitialized \
 224         format-nonliteral parentheses, \
 225     DISABLED_WARNINGS_clang := logical-op-parentheses extern-initializer, \
 226     DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE, \
 227     DISABLED_WARNINGS_microsoft := 4297 4244 4267 4996, \
 228     ASFLAGS := $(LIBAWT_ASFLAGS), \

 229     LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN), \
 230     LDFLAGS_macosx := -L$(INSTALL_LIBRARIES_HERE), \
 231     LDFLAGS_windows := -delayload:user32.dll -delayload:gdi32.dll \
 232         -delayload:shell32.dll -delayload:winmm.dll \
 233         -delayload:winspool.drv -delayload:imm32.dll \
 234         -delayload:ole32.dll -delayload:comdlg32.dll \
 235         -delayload:comctl32.dll -delayload:shlwapi.dll, \
 236     LIBS_unix := -ljvm -ljava $(LIBM), \
 237     LIBS_linux :=  $(LIBDL), \
 238     LIBS_solaris := $(LIBDL), \
 239     LIBS_aix := $(LIBDL),\
 240     LIBS_macosx := -lmlib_image \
 241         -framework Cocoa \
 242         -framework OpenGL \
 243         -framework JavaNativeFoundation \
 244         -framework JavaRuntimeSupport \
 245         -framework ApplicationServices \
 246         -framework AudioToolbox, \
 247     LIBS_windows := kernel32.lib user32.lib gdi32.lib winspool.lib \
 248         imm32.lib ole32.lib uuid.lib shell32.lib \
 249         comdlg32.lib winmm.lib comctl32.lib shlwapi.lib \
 250         delayimp.lib jvm.lib $(WIN_JAVA_LIB) advapi32.lib, \
 251     VERSIONINFO_RESOURCE := $(LIBAWT_VERSIONINFO_RESOURCE), \
 252     RC_FLAGS := $(RC_FLAGS) $(LIBAWT_RC_FLAGS) \
 253         -D "JDK_FNAME=awt.dll" \
 254         -D "JDK_INTERNAL_NAME=awt" \
 255         -D "JDK_FTYPE=0x2L", \
 256 ))
 257 
 258 $(BUILD_LIBAWT): $(call FindLib, java.base, java)
 259 
 260 ifeq ($(OPENJDK_TARGET_OS), macosx)
 261   $(BUILD_LIBAWT): $(BUILD_LIBMLIB_IMAGE)
 262 endif
 263 
 264 TARGETS += $(BUILD_LIBAWT)
 265 
 266 ################################################################################
 267 
 268 ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),)
 269   ifeq ($(ENABLE_HEADLESS_ONLY), false)
 270 
 271     LIBAWT_XAWT_DIRS := \
 272         $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt_xawt \
 273         $(TOPDIR)/src/java.desktop/share/native/common/awt/debug \
 274         $(TOPDIR)/src/java.desktop/share/native/common/awt/utility \
 275         $(TOPDIR)/src/java.desktop/share/native/common/font \
 276         $(TOPDIR)/src/java.desktop/share/native/common/java2d \
 277         $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d \
 278         $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
 279         #
 280 
 281     ifneq ($(filter $(OPENJDK_TARGET_OS),linux solaris aix), )
 282       LIBAWT_XAWT_DIRS += $(TOPDIR)/src/java.desktop/unix/native/common/awt/systemscale
 283     endif
 284 
 285     LIBAWT_XAWT_EXCLUDES := medialib
 286 
 287     LIBAWT_XAWT_CFLAGS := $(addprefix -I, $(shell $(FIND) $(LIBAWT_XAWT_DIRS) -type d)) \
 288         -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
 289         -I$(TOPDIR)/src/java.desktop/share/native/include \
 290         -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS)/native/include \
 291         -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/include \
 292         -I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d \
 293         -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/java2d \
 294         -I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d/loops \
 295         -I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe \
 296         -I$(TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
 297         -I$(TOPDIR)/src/java.desktop/share/native/libawt/awt/image \
 298         -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/font \
 299         $(LIBJAVA_HEADER_FLAGS)
 300         #
 301 
 302     LIBAWT_XAWT_CFLAGS += -DXAWT -DXAWT_HACK \
 303         -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
 304         $(FONTCONFIG_CFLAGS) \
 305         $(CUPS_CFLAGS)
 306 
 307     ifeq ($(OPENJDK_TARGET_OS), solaris)
 308       LIBAWT_XAWT_CFLAGS += -DFUNCPROTO=15
 309     endif
 310 
 311     ifeq ($(OPENJDK_TARGET_OS), linux)
 312       ifeq ($(DISABLE_XRENDER), true)
 313         LIBAWT_XAWT_CFLAGS += -DDISABLE_XRENDER_BY_DEFAULT=true
 314       endif
 315     endif
 316 
 317     LIBAWT_XAWT_LIBS := $(LIBM) -lawt -lXext -lX11 -lXrender $(LIBDL) -lXtst -lXi -ljava -ljvm
 318 
 319     ifeq ($(OPENJDK_TARGET_OS), linux)
 320       LIBAWT_XAWT_LIBS += -lpthread
 321     endif
 322 
 323     ifeq ($(TOOLCHAIN_TYPE), gcc)
 324       # Turn off all warnings for the following files since they contain warnings
 325       # that cannot be turned of individually.
 326       # redefining a macro
 327       BUILD_LIBAWT_XAWT_gtk2_interface.c_CFLAGS := -w
 328       # comparison between pointer and integer
 329       BUILD_LIBAWT_XAWT_awt_Font.c_CFLAGS := -w
 330       # initializing a declared 'extern'
 331       BUILD_LIBAWT_XAWT_debug_mem.c_CFLAGS := -w
 332    endif
 333 
 334     $(eval $(call SetupJdkLibrary, BUILD_LIBAWT_XAWT, \
 335         NAME := awt_xawt, \
 336         SRC := $(LIBAWT_XAWT_DIRS), \
 337         EXCLUDES := $(LIBAWT_XAWT_EXCLUDES), \
 338         OPTIMIZATION := LOW, \
 339         CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_XAWT_CFLAGS) \
 340             $(X_CFLAGS), \
 341         WARNINGS_AS_ERRORS_xlc := false, \
 342         DISABLED_WARNINGS_gcc := type-limits pointer-to-int-cast \
 343             unused-result maybe-uninitialized format \
 344             format-security int-to-pointer-cast parentheses \
 345             implicit-fallthrough, \
 346         DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE \
 347             E_ASSIGNMENT_TYPE_MISMATCH E_NON_CONST_INIT, \

 348         LDFLAGS := $(LDFLAGS_JDKLIB) \
 349             $(call SET_SHARED_LIBRARY_ORIGIN) \
 350             -L$(INSTALL_LIBRARIES_HERE), \
 351         LIBS :=  $(X_LIBS) $(LIBAWT_XAWT_LIBS), \
 352         RC_FLAGS := $(RC_FLAGS) \
 353             -D "JDK_FNAME=xawt.dll" \
 354             -D "JDK_INTERNAL_NAME=xawt" \
 355             -D "JDK_FTYPE=0x2L", \
 356     ))
 357 
 358     $(BUILD_LIBAWT_XAWT): $(call FindLib, java.base, java)
 359 
 360     $(BUILD_LIBAWT_XAWT): $(BUILD_LIBAWT)
 361 
 362     TARGETS += $(BUILD_LIBAWT_XAWT)
 363 
 364   endif
 365 endif
 366 
 367 ################################################################################
 368 
 369 LIBLCMS_SRC := $(TOPDIR)/src/java.desktop/share/native/liblcms
 370 LIBLCMS_CPPFLAGS += -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
 371     -I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d \
 372     -I$(TOPDIR)/src/java.desktop/share/native/common/awt/debug \
 373     $(LIBJAVA_HEADER_FLAGS) \
 374     #
 375 # The fast floor code loses precision.
 376 LCMS_CFLAGS=-DCMS_DONT_USE_FAST_FLOOR
 377 
 378 ifeq ($(USE_EXTERNAL_LCMS), true)
 379   # If we're using an external library, we'll just need the wrapper part.
 380   # By including it explicitly, all other files will be excluded.
 381   BUILD_LIBLCMS_INCLUDE_FILES := LCMS.c
 382 else
 383   BUILD_LIBLCMS_INCLUDE_FILES :=
 384   # If we're using the bundled library, we'll need to include it in the
 385   # include path explicitly. Otherwise the system headers will be used.
 386   LIBLCMS_CPPFLAGS += $(addprefix -I, $(LIBLCMS_SRC))
 387 endif
 388 
 389 $(eval $(call SetupJdkLibrary, BUILD_LIBLCMS, \
 390     NAME := lcms, \
 391     SRC := $(LIBLCMS_SRC), \
 392     INCLUDE_FILES := $(BUILD_LIBLCMS_INCLUDE_FILES), \
 393     OPTIMIZATION := HIGHEST, \
 394     CFLAGS := $(filter-out -xc99=%none, $(CFLAGS_JDKLIB)) \
 395         $(LIBLCMS_CPPFLAGS) \
 396         $(LCMS_CFLAGS), \
 397     CFLAGS_solaris := -xc99=no_lib, \
 398     CFLAGS_windows := -DCMS_IS_WINDOWS_, \
 399     DISABLED_WARNINGS_gcc := format-nonliteral type-limits misleading-indentation, \
 400     DISABLED_WARNINGS_clang := tautological-compare, \
 401     DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
 402     DISABLED_WARNINGS_microsoft := 4819, \

 403     LDFLAGS := $(LDFLAGS_JDKLIB) \
 404         $(call SET_SHARED_LIBRARY_ORIGIN), \
 405     LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
 406     LDFLAGS_solaris := /usr/lib$(OPENJDK_TARGET_CPU_ISADIR)/libm.so.2, \
 407     LIBS_unix := -lawt -ljvm -ljava $(LCMS_LIBS), \
 408     LIBS_linux := $(LIBM), \
 409     LIBS_macosx := $(LIBM), \
 410     LIBS_aix := $(LIBM),\
 411     LIBS_windows := $(WIN_AWT_LIB) $(WIN_JAVA_LIB), \
 412 ))
 413 
 414 TARGETS += $(BUILD_LIBLCMS)
 415 
 416 $(BUILD_LIBLCMS): $(BUILD_LIBAWT)
 417 
 418 ################################################################################
 419 
 420 LIBJAVAJPEG_SRC += $(TOPDIR)/src/java.desktop/share/native/libjavajpeg
 421 
 422 # "DISABLED_WARNINGS_gcc := clobbered" rationale:







 423 # Suppress gcc warnings like "variable might be clobbered by 'longjmp'
 424 # or 'vfork'": this warning indicates that some variable is placed to
 425 # a register by optimized compiler and it's value might be lost on longjmp().
 426 # Recommended way to avoid such warning is to declare the variable as
 427 # volatile to prevent the optimization. However, this approach does not
 428 # work because we have to declare all variables as volatile in result.








 429 
 430 ifeq ($(USE_EXTERNAL_LIBJPEG), true)
 431   LIBJPEG_LIBS := -ljpeg
 432   BUILD_LIBJAVAJPEG_INCLUDE_FILES := \
 433       imageioJPEG.c \
 434       jpegdecoder.c
 435   BUILD_LIBJAVAJPEG_HEADERS :=
 436 else
 437   LIBJPEG_LIBS :=
 438   BUILD_LIBJAVAJPEG_INCLUDE_FILES :=
 439   BUILD_LIBJAVAJPEG_HEADERS := $(addprefix -I, $(LIBJAVAJPEG_SRC))
 440 endif
 441 
 442 $(eval $(call SetupJdkLibrary, BUILD_LIBJAVAJPEG, \
 443     NAME := javajpeg, \
 444     SRC := $(LIBJAVAJPEG_SRC), \
 445     INCLUDE_FILES := $(BUILD_LIBJAVAJPEG_INCLUDE_FILES), \
 446     OPTIMIZATION := HIGHEST, \
 447     CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBJAVAJPEG_HEADERS) \
 448         $(LIBJAVA_HEADER_FLAGS) \
 449         -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop, \
 450     DISABLED_WARNINGS_gcc := clobbered implicit-fallthrough shift-negative-value, \

 451     LDFLAGS := $(LDFLAGS_JDKLIB) \
 452         $(call SET_SHARED_LIBRARY_ORIGIN), \
 453     LIBS := $(LIBJPEG_LIBS) $(JDKLIB_LIBS), \
 454     LIBS_windows := $(WIN_JAVA_LIB) jvm.lib, \

 455 ))
 456 
 457 $(BUILD_LIBJAVAJPEG): $(call FindLib, java.base, java)
 458 
 459 TARGETS += $(BUILD_LIBJAVAJPEG)
 460 
 461 ################################################################################
 462 
 463 # Mac and Windows only use the native AWT lib, do not build libawt_headless
 464 ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx),)
 465 
 466   LIBAWT_HEADLESS_DIRS := $(TOPDIR)/src/java.desktop/unix/native/libawt_headless/awt \
 467       $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
 468       $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d \
 469       $(TOPDIR)/src/java.desktop/share/native/common/java2d \
 470       $(TOPDIR)/src/java.desktop/share/native/common/font \
 471       #
 472 
 473   LIBAWT_HEADLESS_EXCLUDES := medialib
 474   LIBAWT_HEADLESS_CFLAGS := -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
 475       $(addprefix -I, $(LIBAWT_HEADLESS_DIRS)) \
 476       -I$(TOPDIR)/src/java.desktop/share/native/libawt/awt/image \
 477       -I$(TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
 478       -I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d \
 479       -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/java2d \
 480       -I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d/loops \
 481       -I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe \
 482       -I$(TOPDIR)/src/java.desktop/share/native/common/awt/debug \
 483       -I$(TOPDIR)/src/java.desktop/share/native/common/font \
 484       -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/font \
 485       -I$(TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
 486       -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/opengl \
 487       $(LIBJAVA_HEADER_FLAGS) \
 488       #
 489 







 490   $(eval $(call SetupJdkLibrary, BUILD_LIBAWT_HEADLESS, \
 491       NAME := awt_headless, \
 492       SRC := $(LIBAWT_HEADLESS_DIRS), \
 493       EXCLUDES := $(LIBAWT_HEADLESS_EXCLUDES), \
 494       OPTIMIZATION := LOW, \
 495       CFLAGS := $(CFLAGS_JDKLIB) \
 496           -DHEADLESS=true \
 497           -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
 498           $(CUPS_CFLAGS) \
 499           $(FONTCONFIG_CFLAGS) \
 500           $(X_CFLAGS) \
 501           $(LIBAWT_HEADLESS_CFLAGS), \
 502       DISABLED_WARNINGS_xlc := 1506-356, \
 503       DISABLED_WARNINGS_solstudio := E_EMPTY_TRANSLATION_UNIT, \

 504       LDFLAGS := $(LDFLAGS_JDKLIB) \
 505           $(call SET_SHARED_LIBRARY_ORIGIN), \
 506       LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \

 507       LIBS_unix := -lawt -ljvm -ljava, \
 508       LIBS_linux := $(LIBM) $(LIBDL), \
 509       LIBS_solaris := $(LIBM) $(LIBDL) $(LIBCXX), \
 510   ))
 511 
 512   # AIX warning explanation:
 513   # 1506-356 : (W) Compilation unit is empty.
 514   #            This happens during the headless build
 515 
 516   $(BUILD_LIBAWT_HEADLESS): $(BUILD_LIBAWT)
 517 
 518   TARGETS += $(BUILD_LIBAWT_HEADLESS)
 519 
 520 endif
 521 
 522 ################################################################################
 523 
 524 ifeq ($(FREETYPE_TO_USE), system)
 525   LIBFREETYPE_CFLAGS := $(FREETYPE_CFLAGS)
 526   LIBFREETYPE_LIBS := $(FREETYPE_LIBS)
 527 else
 528   LIBFREETYPE_SRC := $(TOPDIR)/src/java.desktop/share/native/libfreetype
 529   BUILD_LIBFREETYPE_HEADERS := $(addprefix -I, $(LIBFREETYPE_SRC)/include)
 530   LIBFREETYPE_CFLAGS := $(BUILD_LIBFREETYPE_HEADERS)
 531   ifeq ($(OPENJDK_TARGET_OS), windows)
 532     LIBFREETYPE_LIBS := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfreetype/freetype.lib
 533   else
 534     LIBFREETYPE_LIBS := -lfreetype
 535   endif
 536 
 537   $(eval $(call SetupJdkLibrary, BUILD_LIBFREETYPE, \
 538       NAME := freetype, \
 539       SRC := $(LIBFREETYPE_SRC)/src, \
 540       OPTIMIZATION := HIGHEST, \
 541       CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBFREETYPE_HEADERS) \
 542           -DFT2_BUILD_LIBRARY $(EXPORT_ALL_SYMBOLS), \
 543       DISABLED_WARNINGS_solstudio := \
 544          E_STATEMENT_NOT_REACHED \
 545          E_END_OF_LOOP_CODE_NOT_REACHED, \
 546       DISABLED_WARNINGS_microsoft := 4267 2220 4244, \
 547       LDFLAGS := $(LDFLAGS_JDKLIB) \
 548           $(call SET_SHARED_LIBRARY_ORIGIN), \
 549   ))
 550 
 551   TARGETS += $(BUILD_LIBFREETYPE)
 552 endif
 553 
 554 ###########################################################################
 555 
 556 LIBFONTMANAGER_SRC := $(TOPDIR)/src/java.desktop/share/native/libfontmanager \
 557     $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libfontmanager
 558 LIBFONTMANAGER_CFLAGS := \
 559     $(addprefix -I, $(shell $(FIND) \
 560       $(LIBFONTMANAGER_SRC) \
 561       $(TOPDIR)/src/java.desktop/share/native/libawt \
 562       $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt \
 563       $(TOPDIR)/src/java.desktop/share/native/common \
 564       $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common -type d)) \
 565     -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
 566     $(LIBJAVA_HEADER_FLAGS) \
 567     #
 568 
 569 #### Begin harfbuzz configuration
 570 
 571 HARFBUZZ_CFLAGS := -DHAVE_OT -DHAVE_FALLBACK -DHAVE_UCDN
 572 
 573 ifneq ($(OPENJDK_TARGET_OS), windows)
 574   HARFBUZZ_CFLAGS += -DGETPAGESIZE -DHAVE_MPROTECT -DHAVE_PTHREAD \
 575                       -DHAVE_SYSCONF -DHAVE_SYS_MMAN_H -DHAVE_UNISTD_H
 576 endif
 577 ifneq (, $(findstring $(OPENJDK_TARGET_OS), linux macosx))
 578   HARFBUZZ_CFLAGS += -DHAVE_INTEL_ATOMIC_PRIMITIVES
 579 endif
 580 ifeq ($(OPENJDK_TARGET_OS), solaris)
 581   HARFBUZZ_CFLAGS += -DHAVE_SOLARIS_ATOMIC_OPS
 582 endif
 583 ifeq ($(OPENJDK_TARGET_OS), macosx)
 584   HARFBUZZ_CFLAGS += -DHAVE_CORETEXT
 585 endif
 586 ifneq ($(OPENJDK_TARGET_OS), macosx)
 587   LIBFONTMANAGER_EXCLUDE_FILES += harfbuzz/hb-coretext.cc
 588 endif
 589 # hb-ft.cc is not presently needed, and requires freetype 2.4.2 or later.
 590 LIBFONTMANAGER_EXCLUDE_FILES += harfbuzz/hb-ft.cc
 591 
 592 LIBFONTMANAGER_CFLAGS += $(HARFBUZZ_CFLAGS)
 593 
 594 #### End harfbuzz configuration
 595 
 596 LIBFONTMANAGER_CFLAGS += $(LIBFREETYPE_CFLAGS)


 597 BUILD_LIBFONTMANAGER_FONTLIB += $(LIBFREETYPE_LIBS)
 598 
 599 LIBFONTMANAGER_OPTIMIZATION := HIGH
 600 
 601 ifeq ($(OPENJDK_TARGET_OS), windows)
 602   LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
 603       X11TextRenderer.c
 604   LIBFONTMANAGER_OPTIMIZATION := HIGHEST
 605   LIBFONTMANAGER_CFLAGS += -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/windows
 606 else ifeq ($(OPENJDK_TARGET_OS), macosx)
 607   LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
 608       X11TextRenderer.c \
 609       fontpath.c \
 610       lcdglyph.c
 611 else
 612   LIBFONTMANAGER_EXCLUDE_FILES += fontpath.c \
 613       lcdglyph.c
 614 endif
 615 
 616 LIBFONTMANAGER_CFLAGS += $(FONT_HEADERS) $(X_CFLAGS) -DLE_STANDALONE -DHEADLESS
 617 
 618 ifeq ($(TOOLCHAIN_TYPE), gcc)
 619   # Turn off all warnings for sunFont.c. This is needed because the specific warning
 620   # about discarding 'const' qualifier cannot be turned off individually.
 621   BUILD_LIBFONTMANAGER_sunFont.c_CFLAGS := -w
 622   # Turn off aliasing with GCC for ExtensionSubtables.cpp
 623   BUILD_LIBFONTMANAGER_ExtensionSubtables.cpp_CXXFLAGS := -fno-strict-aliasing
 624 endif
 625 
 626 $(eval $(call SetupJdkLibrary, BUILD_LIBFONTMANAGER, \
 627     NAME := fontmanager, \
 628     SRC := $(LIBFONTMANAGER_SRC), \
 629     EXCLUDE_FILES := $(LIBFONTMANAGER_EXCLUDE_FILES) \
 630         AccelGlyphCache.c, \
 631     TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
 632     CFLAGS := $(CFLAGS_JDKLIB) $(LIBFONTMANAGER_CFLAGS), \
 633     CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBFONTMANAGER_CFLAGS), \
 634     OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \
 635     CFLAGS_windows = -DCC_NOEX, \
 636     WARNINGS_AS_ERRORS_xlc := false, \
 637     DISABLED_WARNINGS_gcc := sign-compare int-to-pointer-cast \
 638         type-limits missing-field-initializers implicit-fallthrough, \
 639     DISABLED_WARNINGS_CXX_gcc := reorder delete-non-virtual-dtor strict-overflow \
 640         maybe-uninitialized, \
 641     DISABLED_WARNINGS_clang := unused-value incompatible-pointer-types \
 642         tautological-constant-out-of-range-compare int-to-pointer-cast, \
 643     DISABLED_WARNINGS_C_solstudio = \
 644         E_INTEGER_OVERFLOW_DETECTED \
 645         E_ARG_INCOMPATIBLE_WITH_ARG_L \
 646         E_ENUM_VAL_OVERFLOWS_INT_MAX, \
 647     DISABLED_WARNINGS_CXX_solstudio := \
 648         truncwarn wvarhidenmem wvarhidemem wbadlkginit identexpected \
 649         hidevf w_novirtualdescr arrowrtn2, \
 650     DISABLED_WARNINGS_microsoft := 4267 4244 4018 4090 4996 4146 4334 4819 4101, \

 651     LDFLAGS := $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \
 652         $(call SET_SHARED_LIBRARY_ORIGIN), \
 653     LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
 654     LDFLAGS_macosx := -undefined dynamic_lookup, \
 655     LIBS := $(BUILD_LIBFONTMANAGER_FONTLIB), \
 656     LIBS_unix := -lawt -ljava -ljvm $(LIBM) $(LIBCXX), \
 657     LIBS_aix := -lawt_headless,\
 658     LIBS_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib gdi32.lib \
 659         $(WIN_AWT_LIB), \
 660 ))
 661 
 662 $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT)
 663 
 664 ifneq (, $(findstring $(OPENJDK_TARGET_OS), solaris aix))
 665   $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT_HEADLESS)
 666 endif
 667 
 668 ifeq ($(FREETYPE_TO_USE), bundled)
 669   $(BUILD_LIBFONTMANAGER): $(BUILD_LIBFREETYPE)
 670 endif
 671 
 672 TARGETS += $(BUILD_LIBFONTMANAGER)
 673 
 674 ################################################################################
 675 
 676 ifeq ($(OPENJDK_TARGET_OS), windows)
 677   LIBJAWT_SRC := $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libjawt
 678   LIBJAWT_CFLAGS := -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/windows \
 679       -I$(TOPDIR)/src/java.desktop/share/native/common/awt/debug \
 680       -I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d \
 681       -I$(TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
 682       -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/java2d/windows \
 683       -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
 684       -I$(TOPDIR)/src/java.desktop/windows/native/include \
 685       -I$(TOPDIR)/src/java.desktop/share/native/include \
 686       $(LIBJAVA_HEADER_FLAGS) \
 687       #
 688 
 689   ifeq ($(OPENJDK_TARGET_CPU), x86)
 690     KERNEL32_LIB := kernel32.lib
 691   endif
 692   $(eval $(call SetupJdkLibrary, BUILD_LIBJAWT, \
 693       NAME := jawt, \
 694       SRC := $(LIBJAWT_SRC), \
 695       INCLUDE_FILES := $(LIBJAWT_INCLUDE_FILES), \
 696       OPTIMIZATION := LOW, \
 697       CFLAGS := $(CXXFLAGS_JDKLIB) \
 698           -EHsc -DUNICODE -D_UNICODE \
 699           $(LIBJAWT_CFLAGS), \
 700       LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \
 701       LIBS := $(JDKLIB_LIBS) $(KERNEL32_LIB) advapi32.lib $(WIN_AWT_LIB), \
 702   ))
 703 
 704   $(BUILD_LIBJAWT): $(BUILD_LIBAWT)
 705 
 706   $(eval $(call SetupCopyFiles, COPY_JAWT_LIB, \
 707       FILES := $(BUILD_LIBJAWT_IMPORT_LIBRARY), \
 708       DEST := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
 709   ))
 710 
 711   $(COPY_JAWT_LIB): $(BUILD_LIBJAWT)
 712 
 713   TARGETS += $(COPY_JAWT_LIB)
 714 
 715 else # OPENJDK_TARGET_OS not windows
 716 
 717   ifeq ($(OPENJDK_TARGET_OS), macosx)
 718     LIBJAWT_SRC := $(TOPDIR)/src/java.desktop/macosx/native/libjawt
 719   else
 720     LIBJAWT_SRC := $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libjawt
 721   endif
 722   LIBJAWT_CFLAGS := \
 723       -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
 724       -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS)/native/include \
 725       -I$(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/include \
 726       -I$(TOPDIR)/src/java.desktop/share/native/include \
 727       $(LIBJAVA_HEADER_FLAGS) \
 728       #
 729 
 730   ifeq ($(OPENJDK_TARGET_OS), macosx)
 731     JAWT_LIBS := -lawt_lwawt
 732   else
 733     JAWT_LIBS :=
 734     ifneq ($(OPENJDK_TARGET_OS), solaris)
 735       JAWT_LIBS += -lawt
 736     endif
 737     ifeq ($(ENABLE_HEADLESS_ONLY), false)
 738       JAWT_LIBS += -lawt_xawt
 739     else
 740       JAWT_LIBS += -lawt_headless
 741       HEADLESS_CFLAG += -DHEADLESS
 742     endif
 743   endif
 744 
 745   $(eval $(call SetupJdkLibrary, BUILD_LIBJAWT, \
 746       NAME := jawt, \
 747       SRC := $(LIBJAWT_SRC), \
 748       INCLUDE_FILES := $(JAWT_FILES), \
 749       OPTIMIZATION := LOW, \
 750       CFLAGS := $(CFLAGS_JDKLIB) \
 751           $(LIBJAWT_CFLAGS), \
 752       CFLAGS_linux := $(HEADLESS_CFLAG), \
 753       CFLAGS_macosx := $(LIBJAWT_CFLAGS_macosx), \

 754       LDFLAGS := $(LDFLAGS_JDKLIB) \
 755           $(call SET_SHARED_LIBRARY_ORIGIN), \
 756       LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
 757       LDFLAGS_macosx := -Wl$(COMMA)-rpath$(COMMA)@loader_path, \
 758       LIBS_unix := $(JAWT_LIBS) $(JDKLIB_LIBS), \
 759       LIBS_solaris := $(X_LIBS) -lXrender, \
 760       LIBS_macosx := -framework Cocoa, \
 761   ))
 762 
 763   ifeq ($(ENABLE_HEADLESS_ONLY), false)
 764     $(BUILD_LIBJAWT): $(BUILD_LIBAWT_XAWT)
 765   else
 766     $(BUILD_LIBJAWT): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_headless$(SHARED_LIBRARY_SUFFIX)
 767   endif
 768 
 769   ifeq ($(OPENJDK_TARGET_OS), macosx)
 770     $(BUILD_LIBJAWT): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_lwawt$(SHARED_LIBRARY_SUFFIX)
 771   endif
 772 
 773 endif # OPENJDK_TARGET_OS
 774 
 775 TARGETS += $(BUILD_LIBJAWT)
 776 
 777 ################################################################################
 778 
 779 ifeq ($(ENABLE_HEADLESS_ONLY), false)
 780 
 781   LIBSPLASHSCREEN_DIRS := \
 782       $(TOPDIR)/src/java.desktop/share/native/libjavajpeg \
 783       $(TOPDIR)/src/java.desktop/share/native/libsplashscreen \
 784       #
 785 
 786   ifeq ($(USE_EXTERNAL_LIBGIF), true)
 787     GIFLIB_LIBS := -lgif
 788     LIBSPLASHSCREEN_EXCLUDES := giflib
 789   else
 790     LIBSPLASHSCREEN_CFLAGS += -I$(TOPDIR)/src/java.desktop/share/native/libsplashscreen/giflib
 791   endif
 792 
 793   ifeq ($(USE_EXTERNAL_LIBJPEG), true)
 794     LIBJPEG_LIBS := -ljpeg
 795   else
 796     LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.desktop/share/native/libjavajpeg
 797     LIBJPEG_CFLAGS := -I$(TOPDIR)/src/java.desktop/share/native/libjavajpeg
 798   endif
 799 
 800   ifeq ($(USE_EXTERNAL_LIBPNG), false)
 801     LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.desktop/share/native/libsplashscreen/libpng
 802   else
 803     LIBSPLASHSCREEN_EXCLUDES += libpng
 804   endif
 805 
 806   ifneq ($(OPENJDK_TARGET_OS), macosx)
 807     LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libsplashscreen
 808   else
 809     LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.desktop/macosx/native/libsplashscreen
 810   endif
 811 
 812   ifneq ($(filter $(OPENJDK_TARGET_OS),linux solaris aix), )
 813     LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.desktop/unix/native/common/awt/systemscale
 814   endif
 815 
 816   ifeq ($(OPENJDK_TARGET_OS), windows)
 817     LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.desktop/windows/native/common/awt/systemscale
 818   endif
 819   LIBSPLASHSCREEN_CFLAGS += -DSPLASHSCREEN -DPNG_NO_MMX_CODE -DPNG_ARM_NEON_OPT=0 \
 820       $(addprefix -I, $(LIBSPLASHSCREEN_DIRS)) \
 821       $(LIBJAVA_HEADER_FLAGS) \
 822       #
 823 
 824   ifeq ($(OPENJDK_TARGET_OS), macosx)
 825     LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX
 826     LIBSPLASHSCREEN_CFLAGS += -I$(TOPDIR)/src/java.desktop/macosx/native/libosxapp
 827 
 828     BUILD_LIBSPLASHSCREEN_java_awt_SplashScreen.c_CFLAGS := -x objective-c -O0
 829     BUILD_LIBSPLASHSCREEN_splashscreen_gfx_impl.c_CFLAGS := -x objective-c -O0
 830     BUILD_LIBSPLASHSCREEN_splashscreen_gif.c_CFLAGS := -x objective-c -O0
 831     BUILD_LIBSPLASHSCREEN_splashscreen_impl.c_CFLAGS := -x objective-c -O0
 832     BUILD_LIBSPLASHSCREEN_splashscreen_jpeg.c_CFLAGS := -x objective-c -O0
 833     BUILD_LIBSPLASHSCREEN_splashscreen_png.c_CFLAGS := -x objective-c -O0
 834     BUILD_LIBSPLASHSCREEN_splashscreen_sys.m_CFLAGS := -O0
 835 
 836   else ifeq ($(OPENJDK_TARGET_OS), windows)
 837     LIBSPLASHSCREEN_CFLAGS += -DWITH_WIN32
 838   else
 839     LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 $(X_CFLAGS)
 840   endif
 841 
 842   LIBSPLASHSCREEN_LIBS :=
 843 
 844   ifeq ($(USE_EXTERNAL_LIBZ), false)
 845     LIBSPLASHSCREEN_DIRS += $(TOPDIR)/src/java.base/share/native/libzip/zlib
 846   else
 847     ifeq ($(OPENJDK_TARGET_OS), macosx)
 848       ifeq ($(USE_EXTERNAL_LIBPNG), false)
 849         # When building our own libpng and using an external libz, we need to
 850         # inject our own libz.h to tweak the exported ZLIB_VERNUM macro. See
 851         # $(TOPDIR)/src/java.desktop/macosx/native/libsplashscreen/libpng/zlib.h
 852         # for details.
 853         LIBSPLASHSCREEN_CFLAGS += -iquote $(TOPDIR)/src/java.desktop/macosx/native/libsplashscreen/libpng
 854       endif
 855     endif
 856   endif
 857 
 858   ifeq ($(OPENJDK_TARGET_OS), macosx)
 859     LIBSPLASHSCREEN_LIBS += \
 860         $(LIBM) -lpthread -liconv -losxapp \
 861         -framework ApplicationServices \
 862         -framework Foundation \
 863         -framework Cocoa \
 864         -framework JavaNativeFoundation
 865   else ifeq ($(OPENJDK_TARGET_OS), windows)
 866     LIBSPLASHSCREEN_LIBS += kernel32.lib user32.lib gdi32.lib delayimp.lib $(WIN_JAVA_LIB) jvm.lib
 867   else
 868     LIBSPLASHSCREEN_LIBS += $(X_LIBS) -lX11 -lXext $(LIBM) -lpthread -ldl
 869   endif
 870 
 871   $(eval $(call SetupJdkLibrary, BUILD_LIBSPLASHSCREEN, \
 872       NAME := splashscreen, \
 873       SRC := $(LIBSPLASHSCREEN_DIRS), \
 874       EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
 875       EXCLUDES := $(LIBSPLASHSCREEN_EXCLUDES), \
 876       OPTIMIZATION := LOW, \
 877       CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) \
 878           $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS), \
 879       DISABLED_WARNINGS_gcc := sign-compare type-limits unused-result \
 880           maybe-uninitialized shift-negative-value implicit-fallthrough, \
 881       DISABLED_WARNINGS_clang := incompatible-pointer-types, \
 882       DISABLED_WARNINGS_solstudio := E_NEWLINE_NOT_LAST E_DECLARATION_IN_CODE \
 883           E_STATEMENT_NOT_REACHED, \
 884       DISABLED_WARNINGS_microsoft := 4018 4244 4267, \

 885       LDFLAGS := $(LDFLAGS_JDKLIB) \
 886           $(call SET_SHARED_LIBRARY_ORIGIN), \
 887       LDFLAGS_macosx := -L$(INSTALL_LIBRARIES_HERE), \
 888       LDFLAGS_windows := -delayload:user32.dll, \
 889       LIBS := $(JDKLIB_LIBS) $(LIBSPLASHSCREEN_LIBS) $(LIBZ_LIBS) \
 890           $(GIFLIB_LIBS) $(LIBJPEG_LIBS) $(PNG_LIBS), \
 891       LIBS_aix := -liconv, \
 892   ))
 893 
 894   TARGETS += $(BUILD_LIBSPLASHSCREEN)
 895 
 896   ifeq ($(OPENJDK_TARGET_OS), macosx)
 897     $(BUILD_LIBSPLASHSCREEN): $(call FindLib, java.desktop, osxapp)
 898   endif
 899 
 900 endif
 901 
 902 ################################################################################
 903 
 904 ifeq ($(OPENJDK_TARGET_OS), macosx)
 905 
 906   LIBAWT_LWAWT_DIRS := \
 907       $(TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt \
 908       $(TOPDIR)/src/java.desktop/unix/native/common/awt \
 909       $(TOPDIR)/src/java.desktop/share/native/common/font \
 910       $(TOPDIR)/src/java.desktop/share/native/common/java2d \
 911       #
 912 
 913   LIBAWT_LWAWT_CFLAGS := \
 914       $(addprefix -I, $(LIBAWT_LWAWT_DIRS)) \
 915       -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
 916       -I$(TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/awt \
 917       -I$(TOPDIR)/src/java.desktop/unix/native/libawt_xawt/awt \
 918       -I$(TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/font \
 919       -I$(TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl \
 920       -I$(TOPDIR)/src/java.desktop/share/native/common/awt/debug \
 921       -I$(TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
 922       -I$(TOPDIR)/src/java.desktop/macosx/native/include \
 923       -I$(TOPDIR)/src/java.desktop/share/native/include \
 924       -I$(TOPDIR)/src/java.desktop/share/native/libawt/awt/image \
 925       -I$(TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
 926       -I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d \
 927       -I$(TOPDIR)/src/java.desktop/unix/native/libawt/java2d \
 928       -I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d/loops \
 929       -I$(TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe \
 930       -I$(TOPDIR)/src/java.desktop/share/native/libmlib_image/ \
 931       -I$(TOPDIR)/src/java.desktop/macosx/native/libosxapp \
 932       $(LIBJAVA_HEADER_FLAGS) \
 933       #
 934 
 935   LIBAWT_LWAWT_EXFILES := fontpath.c awt_Font.c X11Color.c
 936   LIBAWT_LWAWT_EXCLUDES := $(TOPDIR)/src/java.desktop/unix/native/common/awt/medialib
 937 
 938   $(eval $(call SetupJdkLibrary, BUILD_LIBAWT_LWAWT, \
 939       NAME := awt_lwawt, \
 940       SRC := $(LIBAWT_LWAWT_DIRS), \
 941       INCLUDE_FILES := $(LIBAWT_LWAWT_FILES), \
 942       EXCLUDE_FILES := $(LIBAWT_LWAWT_EXFILES), \
 943       EXCLUDES := $(LIBAWT_LWAWT_EXCLUDES), \
 944       OPTIMIZATION := LOW, \
 945       CFLAGS := $(CFLAGS_JDKLIB) \
 946           $(X_CFLAGS) \
 947           $(X_LIBS) \
 948           $(LIBAWT_LWAWT_CFLAGS), \
 949       DISABLED_WARNINGS_clang := incomplete-implementation enum-conversion \
 950           deprecated-declarations objc-method-access bitwise-op-parentheses \
 951           incompatible-pointer-types parentheses-equality extra-tokens, \
 952       LDFLAGS := $(LDFLAGS_JDKLIB) \
 953           $(call SET_SHARED_LIBRARY_ORIGIN) \
 954           -L$(INSTALL_LIBRARIES_HERE), \
 955       LIBS := -lawt -lmlib_image -losxapp -ljvm $(LIBM) \
 956           -framework Accelerate \
 957           -framework ApplicationServices \
 958           -framework AudioToolbox \
 959           -framework Carbon \
 960           -framework Cocoa \
 961           -framework Security \
 962           -framework ExceptionHandling \
 963           -framework JavaNativeFoundation \
 964           -framework JavaRuntimeSupport \
 965           -framework OpenGL \
 966           -framework QuartzCore -ljava, \
 967   ))
 968 
 969   TARGETS += $(BUILD_LIBAWT_LWAWT)
 970 
 971   $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBAWT)
 972 
 973   $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBMLIB_IMAGE)
 974 
 975   $(BUILD_LIBAWT_LWAWT): $(call FindLib, java.desktop, osxapp)
 976 
 977   $(BUILD_LIBAWT_LWAWT): $(call FindLib, java.base, java)
 978 
 979 endif
 980 
 981 ################################################################################
 982 
 983 ifeq ($(OPENJDK_TARGET_OS), macosx)
 984 
 985   $(eval $(call SetupJdkLibrary, BUILD_LIBOSXUI, \
 986       NAME := osxui, \
 987       SRC := $(TOPDIR)/src/java.desktop/macosx/native/libosxui, \
 988       OPTIMIZATION := LOW, \
 989       CFLAGS := $(CFLAGS_JDKLIB) \
 990           -I$(TOPDIR)/src/java.desktop/macosx/native/libosxui \
 991           -I$(TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/awt \
 992           -I$(TOPDIR)/src/java.desktop/macosx/native/libosxapp \
 993           -I$(TOPDIR)/src/java.base/share/native/libjava \
 994           -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
 995           -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop,  \
 996       LDFLAGS := $(LDFLAGS_JDKLIB) \
 997           $(call SET_SHARED_LIBRARY_ORIGIN) \
 998           -Wl$(COMMA)-rpath$(COMMA)@loader_path \
 999           -L$(INSTALL_LIBRARIES_HERE), \
1000       LIBS := -lawt -losxapp -lawt_lwawt \
1001           -framework Cocoa \
1002           -framework Carbon \
1003           -framework ApplicationServices \
1004           -framework JavaNativeFoundation \
1005           -framework JavaRuntimeSupport \
1006           -ljava -ljvm, \
1007   ))
1008 
1009   TARGETS += $(BUILD_LIBOSXUI)
1010 
1011   $(BUILD_LIBOSXUI): $(BUILD_LIBAWT)
1012 
1013   $(BUILD_LIBOSXUI): $(call FindLib, java.desktop, osxapp)
1014 
1015   $(BUILD_LIBOSXUI): $(BUILD_LIBAWT_LWAWT)
1016 
1017 endif
1018 
1019 ################################################################################
1020 
1021 # Hook to include the corresponding custom file, if present.
1022 $(eval $(call IncludeCustomExtension, lib/Awt2dLibraries.gmk))
--- EOF ---