1 #
   2 # Copyright (c) 2011, 2015, 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 WIN_AWT_LIB := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt/awt.lib
  27 
  28 ################################################################################
  29 
  30 BUILD_LIBMLIB_SRC := $(JDK_TOPDIR)/src/java.desktop/share/native/libmlib_image \
  31     $(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/medialib
  32 BUILD_LIBMLIB_CFLAGS := -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES \
  33     $(addprefix -I, $(BUILD_LIBMLIB_SRC)) \
  34     -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libmlib_image
  35 
  36 BUILD_LIBMLIB_LDLIBS :=
  37 BUILD_LIBMLIB_IMAGE_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libmlib_image/mapfile-vers
  38 
  39 BUILD_LIBMLIB_CFLAGS += -DMLIB_NO_LIBSUNMATH
  40 
  41 ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
  42   BUILD_LIBMLIB_CFLAGS += -DMLIB_OS64BIT
  43 endif
  44 
  45 ifneq ($(OPENJDK_TARGET_OS), windows)
  46   BUILD_LIBMLIB_LDLIBS += $(LIBM) $(LIBDL)
  47 endif
  48 
  49 $(eval $(call SetupNativeCompilation,BUILD_LIBMLIB_IMAGE, \
  50     LIBRARY := mlib_image, \
  51     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
  52     SRC := $(BUILD_LIBMLIB_SRC), \
  53     EXCLUDE_FILES := mlib_c_ImageBlendTable.c, \
  54     OPTIMIZATION := HIGHEST, \
  55     CFLAGS := $(CFLAGS_JDKLIB) \
  56         $(BUILD_LIBMLIB_CFLAGS), \
  57     DISABLED_WARNINGS_gcc := parentheses array-bounds, \
  58     DISABLED_WARNINGS_clang := parentheses, \
  59     DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
  60     MAPFILE := $(BUILD_LIBMLIB_IMAGE_MAPFILE), \
  61     LDFLAGS := $(LDFLAGS_JDKLIB) \
  62         $(call SET_SHARED_LIBRARY_ORIGIN), \
  63     LIBS := $(BUILD_LIBMLIB_LDLIBS) \
  64         $(JDKLIB_LIBS), \
  65     LIBS_solaris := -lc, \
  66     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
  67     RC_FLAGS := $(RC_FLAGS) \
  68         -D "JDK_FNAME=mlib_image.dll" \
  69         -D "JDK_INTERNAL_NAME=mlib_image" \
  70         -D "JDK_FTYPE=0x2L", \
  71     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libmlib_image, \
  72 ))
  73 
  74 $(BUILD_LIBMLIB_IMAGE): $(call FindLib, java.base, java)
  75 
  76 TARGETS += $(BUILD_LIBMLIB_IMAGE)
  77 
  78 ################################################################################
  79 
  80 ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
  81 
  82   LIBMLIB_IMAGE_V_SRC := $(JDK_TOPDIR)/src/java.desktop/share/native/libmlib_image \
  83       $(JDK_TOPDIR)/src/java.desktop/unix/native/libmlib_image \
  84       $(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/medialib \
  85       $(JDK_TOPDIR)/src/java.desktop/unix/native/common/awt/medialib \
  86       #
  87   LIBMLIB_IMAGE_V_CFLAGS := $(JDK_TOPDIR)/src/java.desktop/unix/native/libmlib_image/vis_$(OPENJDK_TARGET_CPU_BITS).il \
  88       $(addprefix -I, $(LIBMLIB_IMAGE_V_SRC)) \
  89       #
  90 
  91   BUILD_LIBMLIB_IMAGE_V_EXFILES := \
  92       awt_ImagingLib.c \
  93       mlib_c_ImageAffine_BC.c \
  94       mlib_c_ImageAffine_BC_S16.c \
  95       mlib_c_ImageAffine_BC_U16.c \
  96       mlib_c_ImageAffine_BL.c \
  97       mlib_c_ImageAffine_BL_S16.c \
  98       mlib_c_ImageAffine_BL_U16.c \
  99       mlib_c_ImageAffineIndex_BC.c \
 100       mlib_c_ImageAffineIndex_BL.c \
 101       mlib_c_ImageAffine_NN.c \
 102       mlib_c_ImageBlendTable.c \
 103       mlib_c_ImageConvClearEdge.c \
 104       mlib_c_ImageConvCopyEdge.c \
 105       mlib_c_ImageConv_f.c \
 106       mlib_c_ImageConvVersion.c \
 107       mlib_c_ImageCopy.c \
 108       mlib_c_ImageLookUp.c \
 109       mlib_c_ImageLookUp_f.c \
 110       mlib_v_ImageChannelExtract.c \
 111       mlib_v_ImageChannelExtract_f.c \
 112       mlib_v_ImageChannelInsert_34.c \
 113       mlib_v_ImageChannelInsert.c \
 114       mlib_v_ImageConvIndex3_8_16nw.c \
 115       mlib_v_ImageConvIndex3_8_8nw.c \
 116       mlib_v_ImageCopy.c \
 117       mlib_v_ImageCopy_blk.s \
 118       #
 119 
 120   LIBMLIB_IMAGE_V_CFLAGS += $(filter-out -DMLIB_NO_LIBSUNMATH, $(BUILD_LIBMLIB_CFLAGS))
 121 
 122   $(eval $(call SetupNativeCompilation,BUILD_LIBMLIB_IMAGE_V, \
 123       LIBRARY := mlib_image_v, \
 124       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 125       SRC := $(LIBMLIB_IMAGE_V_SRC), \
 126       EXCLUDE_FILES := $(BUILD_LIBMLIB_IMAGE_V_EXFILES), \
 127       OPTIMIZATION := HIGHEST, \
 128       CFLAGS := -xarch=sparcvis \
 129           $(LIBMLIB_IMAGE_V_CFLAGS) \
 130           $(CFLAGS_JDKLIB), \
 131       DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
 132       MAPFILE := $(BUILD_LIBMLIB_IMAGE_MAPFILE), \
 133       LDFLAGS := $(LDFLAGS_JDKLIB) \
 134           $(call SET_SHARED_LIBRARY_ORIGIN), \
 135       LIBS := -ljava -ljvm -lc $(BUILD_LIBMLIB_LDLIBS), \
 136       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libmlib_image_v, \
 137   ))
 138 
 139   $(BUILD_LIBMLIB_IMAGE_V): $(call FindLib, java.base, java)
 140 
 141   TARGETS += $(BUILD_LIBMLIB_IMAGE_V)
 142 
 143 endif
 144 
 145 ################################################################################
 146 
 147 LIBAWT_DIRS := $(JDK_TOPDIR)/src/java.desktop/share/native/libawt \
 148     $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt \
 149     $(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/debug \
 150     $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
 151     #
 152 
 153 ifeq ($(OPENJDK_TARGET_OS), aix)
 154   LIBAWT_DIRS += $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS)/native/libawt
 155 endif
 156 
 157 ifeq ($(OPENJDK_TARGET_OS), windows)
 158   LIBAWT_DIRS += $(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/utility
 159 else
 160   LIBAWT_EXFILES := java2d/ShaderList.c
 161 endif
 162 
 163 ifneq ($(filter $(OPENJDK_TARGET_OS), solaris linux macosx aix), )
 164   LIBAWT_EXFILES += awt_Font.c CUPSfuncs.c fontpath.c X11Color.c
 165 endif
 166 
 167 ifeq ($(OPENJDK_TARGET_OS), macosx)
 168   LIBAWT_EXFILES += initIDs.c awt/image/cvutils/img_colors.c
 169 endif
 170 
 171 LIBAWT_CFLAGS += -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
 172     $(addprefix -I, $(shell find $(LIBAWT_DIRS) -type d)) \
 173     $(LIBJAVA_HEADER_FLAGS) \
 174     $(addprefix -I, $(BUILD_LIBMLIB_IMAGE_SRC)) \
 175     #
 176 
 177 LIBAWT_CFLAGS += -D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES $(X_CFLAGS)
 178 
 179 ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
 180   LIBAWT_CFLAGS += -DMLIB_ADD_SUFF
 181   LIBAWT_CFLAGS += -xarch=sparcvis
 182 
 183   LIBAWT_CFLAGS += $(JDK_TOPDIR)/src/java.desktop/unix/native/libmlib_image/vis_$(OPENJDK_TARGET_CPU_BITS).il
 184   LIBAWT_DIRS += $(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/medialib
 185   LIBAWT_EXFILES += java2d/loops/MapAccelFunc.c
 186 
 187   ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
 188     LIBAWT_ASFLAGS = -P -xarch=v9a
 189   else
 190     LIBAWT_ASFLAGS = -P -xarch=v8plusa
 191   endif
 192 else
 193   LIBAWT_EXCLUDES += \
 194       $(JDK_TOPDIR)/src/java.desktop/unix/native/libawt/awt/medialib \
 195       $(JDK_TOPDIR)/src/java.desktop/unix/native/libawt/java2d/loops \
 196       $(JDK_TOPDIR)/src/java.desktop/unix/native/common/awt/medialib \
 197       #
 198 endif
 199 
 200 ifneq ($(OPENJDK_TARGET_OS), solaris)
 201   LIBAWT_CFLAGS += -DMLIB_NO_LIBSUNMATH
 202 endif
 203 
 204 ifeq ($(OPENJDK_TARGET_OS), windows)
 205   LIBAWT_DIRS += $(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
 206       $(JDK_TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
 207   # Why does libawt need java.base headers?
 208   LIBAWT_CFLAGS += -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
 209       -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
 210       -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/opengl \
 211       -I$(JDK_TOPDIR)/src/java.desktop/windows/native/include \
 212       -I$(JDK_TOPDIR)/src/java.desktop/share/native/include \
 213       -I$(SUPPORT_OUTPUTDIR)/headers/java.base \
 214       #
 215   LIBAWT_EXFILES += \
 216       java2d/d3d/D3DShaderGen.c \
 217       awt/image/cvutils/img_colors.c \
 218       #
 219 
 220   LIBAWT_CFLAGS += -EHsc -DUNICODE -D_UNICODE
 221   ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
 222     LIBAWT_CFLAGS += -DMLIB_OS64BIT
 223   endif
 224 
 225   ifdef OPENJDK
 226     LIBAWT_RC_FLAGS := -i "$(JDK_TOPDIR)/src/java.base/windows/native/launcher/icons"
 227   else
 228     LIBAWT_RC_FLAGS := -i "$(JDK_TOPDIR)/src/closed/java.base/windows/native/launcher/icons"
 229   endif
 230   LIBAWT_VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/java.desktop/windows/native/libawt/windows/awt.rc
 231 endif
 232 
 233 LIBAWT_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt/mapfile-vers
 234 ifeq ($(OPENJDK_TARGET_OS), linux)
 235   LIBAWT_MAPFILE :=
 236 endif
 237 
 238 $(eval $(call SetupNativeCompilation,BUILD_LIBAWT, \
 239     LIBRARY := awt, \
 240     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 241     SRC := $(LIBAWT_DIRS), \
 242     EXCLUDES := $(LIBAWT_EXCLUDES), \
 243     EXCLUDE_FILES := $(LIBAWT_EXFILES), \
 244     OPTIMIZATION := LOW, \
 245     CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_CFLAGS), \
 246     DISABLED_WARNINGS_gcc := sign-compare unused-result maybe-uninitialized \
 247         format-nonliteral parentheses, \
 248     DISABLED_WARNINGS_clang := logical-op-parentheses extern-initializer, \
 249     DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE, \
 250     DISABLED_WARNINGS_microsoft := 4297 4244 4267 4996, \
 251     WARNINGS_AS_ERRORS_gcc := false, \
 252     ASFLAGS := $(LIBAWT_ASFLAGS), \
 253     MAPFILE := $(LIBAWT_MAPFILE), \
 254     LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN), \
 255     LDFLAGS_macosx := -L$(INSTALL_LIBRARIES_HERE), \
 256     LDFLAGS_windows := -delayload:user32.dll -delayload:gdi32.dll \
 257         -delayload:shell32.dll -delayload:winmm.dll \
 258         -delayload:winspool.drv -delayload:imm32.dll \
 259         -delayload:ole32.dll -delayload:comdlg32.dll \
 260         -delayload:comctl32.dll -delayload:shlwapi.dll, \
 261     LIBS_unix := -ljvm -ljava $(LIBM), \
 262     LIBS_linux :=  $(LIBDL), \
 263     LIBS_solaris := $(LIBDL) -lc, \
 264     LIBS_aix := $(LIBDL),\
 265     LIBS_macosx := -lmlib_image \
 266         -framework Cocoa \
 267         -framework OpenGL \
 268         -framework JavaNativeFoundation \
 269         -framework JavaRuntimeSupport \
 270         -framework ApplicationServices \
 271         -framework AudioToolbox, \
 272     LIBS_windows := kernel32.lib user32.lib gdi32.lib winspool.lib \
 273         imm32.lib ole32.lib uuid.lib shell32.lib \
 274         comdlg32.lib winmm.lib comctl32.lib shlwapi.lib \
 275         delayimp.lib jvm.lib $(WIN_JAVA_LIB) advapi32.lib, \
 276     VERSIONINFO_RESOURCE := $(LIBAWT_VERSIONINFO_RESOURCE), \
 277     RC_FLAGS := $(RC_FLAGS) $(LIBAWT_RC_FLAGS) \
 278         -D "JDK_FNAME=awt.dll" \
 279         -D "JDK_INTERNAL_NAME=awt" \
 280         -D "JDK_FTYPE=0x2L", \
 281     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt, \
 282 ))
 283 
 284 $(BUILD_LIBAWT): $(call FindLib, java.base, java)
 285 
 286 ifeq ($(OPENJDK_TARGET_OS), macosx)
 287   $(BUILD_LIBAWT): $(BUILD_LIBMLIB_IMAGE)
 288 endif
 289 
 290 TARGETS += $(BUILD_LIBAWT)
 291 
 292 ################################################################################
 293 
 294 ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),)
 295   ifndef BUILD_HEADLESS_ONLY
 296 
 297     LIBAWT_XAWT_DIRS := \
 298         $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt_xawt \
 299         $(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/debug \
 300         $(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/utility \
 301         $(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
 302         $(JDK_TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
 303         $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/opengl \
 304         $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/x11 \
 305         $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
 306         #
 307 
 308     LIBAWT_XAWT_EXCLUDES := medialib
 309 
 310     LIBAWT_XAWT_CFLAGS := $(addprefix -I, $(shell $(FIND) $(LIBAWT_XAWT_DIRS) -type d)) \
 311         -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
 312         -I$(JDK_TOPDIR)/src/java.desktop/share/native/include \
 313         -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS)/native/include \
 314         -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/include \
 315         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d \
 316         -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/java2d \
 317         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/loops \
 318         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe \
 319         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
 320         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image \
 321         -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libsunwjdga \
 322         -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/font \
 323         $(LIBJAVA_HEADER_FLAGS)
 324         #
 325 
 326     LIBAWT_XAWT_CFLAGS += -DXAWT -DXAWT_HACK \
 327         -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
 328         $(CUPS_CFLAGS)
 329 
 330     ifneq (,$(filter $(OPENJDK_TARGET_OS),linux solaris))
 331         LIBAWT_XAWT_DIRS += $(JDK_TOPDIR)/src/java.desktop/unix/native/common/awt/systemscale
 332         LIBAWT_XAWT_CFLAGS += -I$(JDK_TOPDIR)/src/java.desktop/unix/native/common/awt/systemscale
 333     endif
 334     
 335     ifeq ($(OPENJDK_TARGET_OS), solaris)
 336       LIBAWT_XAWT_CFLAGS += -DFUNCPROTO=15
 337     endif
 338 
 339     ifeq ($(OPENJDK_TARGET_OS), linux)
 340       ifeq ($(DISABLE_XRENDER), true)
 341         LIBAWT_XAWT_CFLAGS += -DDISABLE_XRENDER_BY_DEFAULT=true
 342       endif
 343     endif
 344 
 345     LIBAWT_XAWT_LIBS := $(LIBM) -lawt -lXext -lX11 -lXrender $(LIBDL) -lXtst -lXi -ljava -ljvm -lc
 346 
 347     ifeq ($(OPENJDK_TARGET_OS), linux)
 348       LIBAWT_XAWT_LIBS += -lpthread
 349     endif
 350 
 351     $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_XAWT, \
 352         LIBRARY := awt_xawt, \
 353         OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 354         SRC := $(LIBAWT_XAWT_DIRS), \
 355         EXCLUDES := $(LIBAWT_XAWT_EXCLUDES), \
 356         OPTIMIZATION := LOW, \
 357         CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_XAWT_CFLAGS) \
 358             $(X_CFLAGS), \
 359         DISABLED_WARNINGS_gcc := type-limits pointer-to-int-cast \
 360             deprecated-declarations unused-result maybe-uninitialized format \
 361             format-security int-to-pointer-cast parentheses, \
 362         DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE \
 363             E_ASSIGNMENT_TYPE_MISMATCH E_NON_CONST_INIT, \
 364         WARNINGS_AS_ERRORS_gcc := false, \
 365         MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_xawt/mapfile-vers, \
 366         LDFLAGS := $(LDFLAGS_JDKLIB) \
 367             $(call SET_SHARED_LIBRARY_ORIGIN) \
 368             $(call SET_SHARED_LIBRARY_ORIGIN,/..) \
 369             -L$(INSTALL_LIBRARIES_HERE), \
 370         LIBS :=  $(X_LIBS) $(LIBAWT_XAWT_LIBS), \
 371         VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 372         RC_FLAGS := $(RC_FLAGS) \
 373             -D "JDK_FNAME=xawt.dll" \
 374             -D "JDK_INTERNAL_NAME=xawt" \
 375             -D "JDK_FTYPE=0x2L", \
 376         OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt_xawt, \
 377     ))
 378 
 379     $(BUILD_LIBAWT_XAWT): $(call FindLib, java.base, java)
 380 
 381     $(BUILD_LIBAWT_XAWT): $(BUILD_LIBAWT)
 382 
 383     TARGETS += $(BUILD_LIBAWT_XAWT)
 384 
 385   endif
 386 endif
 387 
 388 ################################################################################
 389 
 390 LIBLCMS_SRC := $(JDK_TOPDIR)/src/java.desktop/share/native/liblcms
 391 LIBLCMS_CPPFLAGS += -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
 392     -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d \
 393     -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/debug \
 394     $(LIBJAVA_HEADER_FLAGS) \
 395     #
 396 # The fast floor code loses precision.
 397 LCMS_CFLAGS=-DCMS_DONT_USE_FAST_FLOOR
 398 
 399 ifeq ($(USE_EXTERNAL_LCMS), true)
 400   # If we're using an external library, we'll just need the wrapper part.
 401   # By including it explicitely, all other files will be excluded.
 402   BUILD_LIBLCMS_INCLUDE_FILES := LCMS.c
 403 else
 404   BUILD_LIBLCMS_INCLUDE_FILES :=
 405   # If we're using the bundled library, we'll need to include it in the
 406   # include path explicitly. Otherwise the system headers will be used.
 407   LIBLCMS_CPPFLAGS += $(addprefix -I, $(LIBLCMS_SRC))
 408 endif
 409 
 410 $(eval $(call SetupNativeCompilation,BUILD_LIBLCMS, \
 411     LIBRARY := lcms, \
 412     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 413     SRC := $(LIBLCMS_SRC), \
 414     INCLUDE_FILES := $(BUILD_LIBLCMS_INCLUDE_FILES), \
 415     OPTIMIZATION := HIGHEST, \
 416     CFLAGS := $(filter-out -xc99=%none, $(CFLAGS_JDKLIB)) \
 417         $(LIBLCMS_CPPFLAGS) \
 418         $(LCMS_CFLAGS), \
 419     CFLAGS_solaris := -xc99=no_lib, \
 420     CFLAGS_windows := -DCMS_IS_WINDOWS_, \
 421     DISABLED_WARNINGS_gcc := format-nonliteral type-limits, \
 422     DISABLED_WARNINGS_clang := tautological-compare, \
 423     DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
 424     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/liblcms/mapfile-vers, \
 425     LDFLAGS := $(LDFLAGS_JDKLIB) \
 426         $(call SET_SHARED_LIBRARY_ORIGIN), \
 427     LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
 428     LDFLAGS_solaris := /usr/lib$(OPENJDK_TARGET_CPU_ISADIR)/libm.so.2, \
 429     LIBS_unix := -lawt -ljvm -ljava $(LCMS_LIBS), \
 430     LIBS_linux := $(LIBM), \
 431     LIBS_macosx := $(LIBM), \
 432     LIBS_solaris := -lc, \
 433     LIBS_aix := $(LIBM),\
 434     LIBS_windows := $(WIN_AWT_LIB) $(WIN_JAVA_LIB), \
 435     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 436     RC_FLAGS := $(RC_FLAGS) \
 437         -D "JDK_FNAME=lcms.dll" \
 438         -D "JDK_INTERNAL_NAME=lcms" \
 439         -D "JDK_FTYPE=0x2L", \
 440     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/liblcms, \
 441 ))
 442 
 443 TARGETS += $(BUILD_LIBLCMS)
 444 
 445 $(BUILD_LIBLCMS): $(BUILD_LIBAWT)
 446 
 447 ################################################################################
 448 
 449 ifdef OPENJDK
 450   BUILD_LIBJAVAJPEG_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers
 451 else
 452   BUILD_LIBJAVAJPEG_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers-closed
 453   LIBJAVAJPEG_SRC += $(JDK_TOPDIR)/src/closed/java.desktop/share/native/libjavajpeg
 454 endif
 455 
 456 LIBJAVAJPEG_SRC += $(JDK_TOPDIR)/src/java.desktop/share/native/libjavajpeg
 457 
 458 BUILD_LIBJAVAJPEG_REORDER :=
 459 ifeq ($(OPENJDK_TARGET_OS), solaris)
 460   ifneq ($(OPENJDK_TARGET_CPU), x86_64)
 461     BUILD_LIBJAVAJPEG_REORDER := $(JDK_TOPDIR)/make/mapfiles/libjpeg/reorder-$(OPENJDK_TARGET_CPU)
 462   endif
 463 endif
 464 
 465 
 466 # Suppress gcc warnings like "variable might be clobbered by 'longjmp'
 467 # or 'vfork'": this warning indicates that some variable is placed to
 468 # a register by optimized compiler and it's value might be lost on longjmp().
 469 # Recommended way to avoid such warning is to declare the variable as
 470 # volatile to prevent the optimization. However, this approach does not
 471 # work because we have to declare all variables as volatile in result.
 472 #ifndef CROSS_COMPILE_ARCH
 473 #  CC_43_OR_NEWER := \
 474 #      $(shell $(EXPR) $(CC_MAJORVER) \> 4 \| \
 475 #          \( $(CC_MAJORVER) = 4 \& $(CC_MINORVER) \>= 3 \) )
 476 #  ifeq ($(CC_43_OR_NEWER), 1)
 477 #    BUILD_LIBJAVAJPEG_CFLAGS_linux += -Wno-clobbered
 478 #  endif
 479 #endif
 480 
 481 ifeq ($(USE_EXTERNAL_LIBJPEG), true)
 482   LIBJPEG_LIBS := -ljpeg
 483   BUILD_LIBJAVAJPEG_INCLUDE_FILES := \
 484       imageioJPEG.c \
 485       jpegdecoder.c
 486   BUILD_LIBJAVAJPEG_HEADERS :=
 487 else
 488   LIBJPEG_LIBS :=
 489   BUILD_LIBJAVAJPEG_INCLUDE_FILES :=
 490   BUILD_LIBJAVAJPEG_HEADERS := $(addprefix -I, $(LIBJAVAJPEG_SRC))
 491 endif
 492 
 493 $(eval $(call SetupNativeCompilation,BUILD_LIBJAVAJPEG, \
 494     LIBRARY := javajpeg, \
 495     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 496     SRC := $(LIBJAVAJPEG_SRC), \
 497     INCLUDE_FILES := $(BUILD_LIBJAVAJPEG_INCLUDE_FILES), \
 498     OPTIMIZATION := HIGHEST, \
 499     CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBJAVAJPEG_HEADERS) \
 500         $(LIBJAVA_HEADER_FLAGS) \
 501         -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop, \
 502     DISABLED_WARNINGS_gcc := clobbered parentheses array-bounds, \
 503     DISABLED_WARNINGS_clang := logical-op-parentheses, \
 504     DISABLED_WARNINGS_microsoft := 4267, \
 505     MAPFILE := $(BUILD_LIBJAVAJPEG_MAPFILE), \
 506     LDFLAGS := $(LDFLAGS_JDKLIB) \
 507         $(call SET_SHARED_LIBRARY_ORIGIN), \
 508     LIBS := $(LIBJPEG_LIBS) $(JDKLIB_LIBS), \
 509     LIBS_windows := $(WIN_JAVA_LIB) jvm.lib, \
 510     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 511     RC_FLAGS := $(RC_FLAGS) \
 512         -D "JDK_FNAME=javajpeg.dll" \
 513         -D "JDK_INTERNAL_NAME=javajpeg" \
 514         -D "JDK_FTYPE=0x2L", \
 515     REORDER := $(BUILD_LIBJAVAJPEG_REORDER), \
 516     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjavajpeg, \
 517 ))
 518 
 519 $(BUILD_LIBJAVAJPEG): $(call FindLib, java.base, java)
 520 
 521 TARGETS += $(BUILD_LIBJAVAJPEG)
 522 
 523 ################################################################################
 524 
 525 ifeq ($(BUILD_HEADLESS), true)
 526   # Mac and Windows only use the native AWT lib, do not build libawt_headless
 527   ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx),)
 528 
 529     LIBAWT_HEADLESS_DIRS := $(JDK_TOPDIR)/src/java.desktop/unix/native/libawt_headless/awt \
 530         $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
 531         $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/opengl \
 532         $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/x11 \
 533         $(JDK_TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
 534         $(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
 535         #
 536 
 537     LIBAWT_HEADLESS_EXCLUDES := medialib
 538     LIBAWT_HEADLESS_CFLAGS := -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
 539         $(addprefix -I, $(LIBAWT_HEADLESS_DIRS)) \
 540         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d \
 541         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/loops \
 542         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
 543         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe \
 544         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image \
 545         -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/java2d \
 546         -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
 547         -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/debug \
 548         -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/font \
 549         -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libsunwjdga/ \
 550         $(LIBJAVA_HEADER_FLAGS) \
 551         #
 552 
 553     LIBAWT_HEADLESS_REORDER :=
 554     ifeq ($(OPENJDK_TARGET_OS), solaris)
 555       ifneq ($(OPENJDK_TARGET_CPU), x86_64)
 556         LIBAWT_HEADLESS_REORDER := $(JDK_TOPDIR)/make/mapfiles/libawt_headless/reorder-$(OPENJDK_TARGET_CPU)
 557       endif
 558     endif
 559 
 560     $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_HEADLESS, \
 561         LIBRARY := awt_headless, \
 562         OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 563         SRC := $(LIBAWT_HEADLESS_DIRS), \
 564         EXCLUDES := $(LIBAWT_HEADLESS_EXCLUDES), \
 565         OPTIMIZATION := LOW, \
 566         CFLAGS := $(CFLAGS_JDKLIB) \
 567             -DHEADLESS=true \
 568             -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
 569             $(CUPS_CFLAGS) \
 570             $(X_CFLAGS) \
 571             $(LIBAWT_HEADLESS_CFLAGS), \
 572         DISABLED_WARNINGS_gcc := maybe-uninitialized int-to-pointer-cast, \
 573         DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE \
 574             E_EMPTY_TRANSLATION_UNIT, \
 575         MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_headless/mapfile-vers, \
 576         LDFLAGS := $(LDFLAGS_JDKLIB) \
 577             $(call SET_SHARED_LIBRARY_ORIGIN), \
 578         LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
 579         LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
 580         LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
 581         REORDER := $(LIBAWT_HEADLESS_REORDER), \
 582         LIBS_unix := -lawt -ljvm -ljava, \
 583         LIBS_linux := -lm $(LIBDL), \
 584         LIBS_solaris := -lm $(LIBDL) $(LIBCXX) -lc, \
 585         OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt_headless, \
 586     ))
 587 
 588     $(BUILD_LIBAWT_HEADLESS): $(BUILD_LIBAWT)
 589 
 590     TARGETS += $(BUILD_LIBAWT_HEADLESS)
 591 
 592   endif
 593 endif
 594 
 595 ################################################################################
 596 
 597 LIBFONTMANAGER_SRC := $(JDK_TOPDIR)/src/java.desktop/share/native/libfontmanager \
 598     $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libfontmanager
 599 LIBFONTMANAGER_CFLAGS := \
 600     $(addprefix -I, $(shell $(FIND) \
 601       $(LIBFONTMANAGER_SRC) \
 602       $(JDK_TOPDIR)/src/java.desktop/share/native/libawt \
 603       $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt \
 604       $(JDK_TOPDIR)/src/java.desktop/share/native/common \
 605       $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common -type d)) \
 606     -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
 607     $(LIBJAVA_HEADER_FLAGS) \
 608     #
 609 
 610 #### Begin harfbuzz configuration
 611 
 612 HARFBUZZ_CFLAGS := -DHAVE_OT -DHAVE_FALLBACK -DHAVE_UCDN
 613 
 614 ifneq ($(OPENJDK_TARGET_OS), windows)
 615   HARFBUZZ_CFLAGS += -DGETPAGESIZE -DHAVE_MPROTECT -DHAVE_PTHREAD \
 616                       -DHAVE_SYSCONF -DHAVE_SYS_MMAN_H -DHAVE_UNISTD_H
 617 endif
 618 ifneq (, $(findstring $(OPENJDK_TARGET_OS), linux macosx))
 619   HARFBUZZ_CFLAGS += -DHAVE_INTEL_ATOMIC_PRIMITIVES
 620 endif
 621 ifeq ($(OPENJDK_TARGET_OS), solaris)
 622   HARFBUZZ_CFLAGS += -DHAVE_SOLARIS_ATOMIC_OPS
 623 endif
 624 ifeq ($(OPENJDK_TARGET_OS), macosx)
 625   HARFBUZZ_CFLAGS += -DHAVE_CORETEXT
 626 endif
 627 ifneq ($(OPENJDK_TARGET_OS), macosx)
 628   LIBFONTMANAGER_EXCLUDE_FILES += harfbuzz/hb-coretext.cc
 629 endif
 630 # hb-ft.cc is not presently needed, and requires freetype 2.4.2 or later.
 631 LIBFONTMANAGER_EXCLUDE_FILES += harfbuzz/hb-ft.cc
 632 
 633 LIBFONTMANAGER_CFLAGS += $(HARFBUZZ_CFLAGS)
 634 
 635 #### End harfbuzz configuration
 636 
 637 ifndef OPENJDK
 638   LIBFONTMANAGER_CFLAGS += -I$(JDK_TOPDIR)/src/closed/java.desktop/share/native/libt2k
 639   BUILD_LIBFONTMANAGER_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libfontmanager/mapfile-vers
 640   LIBFONTMANAGER_EXCLUDE_FILES += freetypeScaler.c
 641 else
 642   LIBFONTMANAGER_CFLAGS += $(FREETYPE_CFLAGS)
 643   BUILD_LIBFONTMANAGER_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libfontmanager/mapfile-vers.openjdk
 644   BUILD_LIBFONTMANAGER_FONTLIB := $(FREETYPE_LIBS)
 645 endif
 646 
 647 LIBFONTMANAGER_OPTIMIZATION := HIGH
 648 
 649 ifeq ($(OPENJDK_TARGET_OS), windows)
 650   LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
 651       X11TextRenderer.c
 652   LIBFONTMANAGER_OPTIMIZATION := HIGHEST
 653   LIBFONTMANAGER_CFLAGS += -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/windows
 654 else ifeq ($(OPENJDK_TARGET_OS), macosx)
 655   LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
 656       X11TextRenderer.c \
 657       fontpath.c \
 658       lcdglyph.c
 659 else
 660   LIBFONTMANAGER_EXCLUDE_FILES += fontpath.c \
 661       lcdglyph.c
 662 endif
 663 
 664 LIBFONTMANAGER_CFLAGS += $(FONT_HEADERS) $(X_CFLAGS) -DLE_STANDALONE -DHEADLESS
 665 
 666 # Turn off aliasing with GCC for ExtensionSubtables.cpp
 667 ifeq ($(OPENJDK_TARGET_OS), linux)
 668   BUILD_LIBFONTMANAGER_ExtensionSubtables.cpp_CXXFLAGS := -fno-strict-aliasing
 669 endif
 670 
 671 $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \
 672     LIBRARY := fontmanager, \
 673     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 674     SRC := $(LIBFONTMANAGER_SRC), \
 675     EXCLUDE_FILES := $(LIBFONTMANAGER_EXCLUDE_FILES) \
 676         AccelGlyphCache.c, \
 677     TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
 678     CFLAGS := $(CFLAGS_JDKLIB) $(LIBFONTMANAGER_CFLAGS), \
 679     CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBFONTMANAGER_CFLAGS), \
 680     OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \
 681     CFLAGS_windows = -DCC_NOEX, \
 682     DISABLED_WARNINGS_gcc := sign-compare int-to-pointer-cast reorder \
 683         delete-non-virtual-dtor type-limits missing-field-initializers, \
 684     DISABLED_WARNINGS_clang := unused-value incompatible-pointer-types \
 685         tautological-constant-out-of-range-compare int-to-pointer-cast, \
 686     DISABLED_WARNINGS_solstudio := truncwarn, \
 687     DISABLED_WARNINGS_microsoft := 4267 4244 4018 4090 4996 4146 4334, \
 688     WARNINGS_AS_ERRORS_gcc := false, \
 689     WARNINGS_AS_ERRORS_solstudio := false, \
 690     MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \
 691     LDFLAGS := $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \
 692         $(call SET_SHARED_LIBRARY_ORIGIN), \
 693     LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
 694     LDFLAGS_macosx := -undefined dynamic_lookup, \
 695     LIBS := $(BUILD_LIBFONTMANAGER_FONTLIB), \
 696     LIBS_unix := -lawt -ljava -ljvm $(LIBM) $(LIBCXX), \
 697     LIBS_linux := -lc, \
 698     LIBS_solaris := -lawt_headless -lc, \
 699     LIBS_aix := -lawt_headless,\
 700     LIBS_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib gdi32.lib \
 701         $(WIN_AWT_LIB), \
 702     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 703     RC_FLAGS := $(RC_FLAGS) \
 704         -D "JDK_FNAME=fontmanager.dll" \
 705         -D "JDK_INTERNAL_NAME=fontmanager" \
 706         -D "JDK_FTYPE=0x2L", \
 707     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfontmanager, \
 708 ))
 709 
 710 $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT)
 711 
 712 ifneq (, $(findstring $(OPENJDK_TARGET_OS), solaris aix))
 713   $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT_HEADLESS)
 714 endif
 715 
 716 TARGETS += $(BUILD_LIBFONTMANAGER)
 717 
 718 ################################################################################
 719 
 720 ifeq ($(OPENJDK_TARGET_OS), windows)
 721   LIBJAWT_SRC := $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libjawt
 722   LIBJAWT_CFLAGS := -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/windows \
 723       -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/debug \
 724       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d \
 725       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
 726       -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/java2d/windows \
 727       -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
 728       -I$(JDK_TOPDIR)/src/java.desktop/windows/native/include \
 729       -I$(JDK_TOPDIR)/src/java.desktop/share/native/include \
 730       $(LIBJAVA_HEADER_FLAGS) \
 731       #
 732 
 733   ifeq ($(OPENJDK_TARGET_CPU), x86)
 734     KERNEL32_LIB := kernel32.lib
 735   endif
 736   $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT, \
 737       LIBRARY := jawt, \
 738       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 739       SRC := $(LIBJAWT_SRC), \
 740       INCLUDE_FILES := $(LIBJAWT_INCLUDE_FILES), \
 741       OPTIMIZATION := LOW, \
 742       CFLAGS := $(CXXFLAGS_JDKLIB) \
 743           -EHsc -DUNICODE -D_UNICODE \
 744           $(LIBJAWT_CFLAGS), \
 745       LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \
 746       LIBS := $(JDKLIB_LIBS) $(KERNEL32_LIB) advapi32.lib $(WIN_AWT_LIB), \
 747       VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 748       RC_FLAGS := $(RC_FLAGS) \
 749           -D "JDK_FNAME=jawt.dll" \
 750           -D "JDK_INTERNAL_NAME=jawt" \
 751           -D "JDK_FTYPE=0x2L", \
 752       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjawt, \
 753   ))
 754 
 755   $(BUILD_LIBJAWT): $(BUILD_LIBAWT)
 756 
 757   $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX): $(BUILD_LIBJAWT)
 758         $(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%, %, $@))
 759         $(call MakeDir, $(@D))
 760         $(CP) $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjawt/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX) $@
 761 
 762   TARGETS += $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
 763 
 764 else # OPENJDK_TARGET_OS not windows
 765 
 766   ifeq ($(OPENJDK_TARGET_OS), macosx)
 767     LIBJAWT_SRC := $(JDK_TOPDIR)/src/java.desktop/macosx/native/libjawt
 768   else
 769     LIBJAWT_SRC := $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libjawt
 770   endif
 771   LIBJAWT_CFLAGS := \
 772       -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
 773       -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS)/native/include \
 774       -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/include \
 775       -I$(JDK_TOPDIR)/src/java.desktop/share/native/include \
 776       $(LIBJAVA_HEADER_FLAGS) \
 777       #
 778 
 779   ifeq ($(OPENJDK_TARGET_OS), macosx)
 780     JAWT_LIBS := -lawt_lwawt
 781   else
 782     JAWT_LIBS :=
 783     ifneq ($(OPENJDK_TARGET_OS), solaris)
 784       JAWT_LIBS += -lawt
 785     endif
 786     ifndef BUILD_HEADLESS_ONLY
 787       JAWT_LIBS += -lawt_xawt
 788     else
 789       JAWT_LIBS += -lawt_headless
 790       HEADLESS_CFLAG += -DHEADLESS
 791     endif
 792   endif
 793 
 794   $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT, \
 795       LIBRARY := jawt, \
 796       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 797       SRC := $(LIBJAWT_SRC), \
 798       INCLUDE_FILES := $(JAWT_FILES), \
 799       OPTIMIZATION := LOW, \
 800       CFLAGS := $(CFLAGS_JDKLIB) \
 801           $(LIBJAWT_CFLAGS), \
 802       CFLAGS_linux := $(HEADLESS_CFLAG), \
 803       CFLAGS_macosx := $(LIBJAWT_CFLAGS_macosx), \
 804       MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjawt/mapfile-vers, \
 805       LDFLAGS := $(LDFLAGS_JDKLIB) \
 806           $(call SET_SHARED_LIBRARY_ORIGIN), \
 807       LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
 808       LDFLAGS_macosx := -Wl$(COMMA)-rpath$(COMMA)@loader_path, \
 809       LIBS_unix := $(JAWT_LIBS) $(JDKLIB_LIBS), \
 810       LIBS_solaris := $(X_LIBS) -lXrender, \
 811       LIBS_macosx := -framework Cocoa, \
 812       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjawt, \
 813   ))
 814 
 815   ifndef BUILD_HEADLESS_ONLY
 816     $(BUILD_LIBJAWT): $(BUILD_LIBAWT_XAWT)
 817   else
 818     $(BUILD_LIBJAWT): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_headless$(SHARED_LIBRARY_SUFFIX)
 819   endif
 820 
 821   ifeq ($(OPENJDK_TARGET_OS), macosx)
 822     $(BUILD_LIBJAWT): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_lwawt$(SHARED_LIBRARY_SUFFIX)
 823   endif
 824 
 825 endif # OPENJDK_TARGET_OS
 826 
 827 TARGETS += $(BUILD_LIBJAWT)
 828 
 829 ################################################################################
 830 
 831 ifndef BUILD_HEADLESS_ONLY
 832 
 833   LIBSPLASHSCREEN_DIRS := \
 834       $(JDK_TOPDIR)/src/java.desktop/share/native/libjavajpeg \
 835       $(JDK_TOPDIR)/src/java.desktop/share/native/libsplashscreen \
 836       #
 837 
 838   ifeq ($(USE_EXTERNAL_LIBGIF), true)
 839     GIFLIB_LIBS := -lgif
 840     LIBSPLASHSCREEN_EXCLUDES := giflib
 841   else
 842     LIBSPLASHSCREEN_CFLAGS += -I$(JDK_TOPDIR)/src/java.desktop/share/native/libsplashscreen/giflib
 843   endif
 844 
 845   ifeq ($(USE_EXTERNAL_LIBJPEG), true)
 846     LIBJPEG_LIBS := -ljpeg
 847   else
 848     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.desktop/share/native/libjavajpeg
 849     LIBJPEG_CFLAGS := -I$(JDK_TOPDIR)/src/java.desktop/share/native/libjavajpeg
 850   endif
 851 
 852   ifeq ($(USE_EXTERNAL_LIBPNG), false)
 853     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.desktop/share/native/libsplashscreen/libpng
 854   else
 855     LIBSPLASHSCREEN_EXCLUDES += libpng
 856   endif
 857 
 858   ifneq ($(OPENJDK_TARGET_OS), macosx)
 859     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libsplashscreen
 860   else
 861     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.desktop/macosx/native/libsplashscreen
 862   endif
 863 
 864   LIBSPLASHSCREEN_CFLAGS += -DSPLASHSCREEN -DPNG_NO_MMX_CODE -DPNG_ARM_NEON_OPT=0 \
 865       $(addprefix -I, $(LIBSPLASHSCREEN_DIRS)) \
 866       $(LIBJAVA_HEADER_FLAGS) \
 867       #
 868 
 869   ifneq (,$(filter $(OPENJDK_TARGET_OS),linux solaris))
 870       LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.desktop/unix/native/common/awt/systemscale
 871       LIBSPLASHSCREEN_CFLAGS += -I$(JDK_TOPDIR)/src/java.desktop/unix/native/common/awt/systemscale
 872   endif
 873   
 874   ifeq ($(OPENJDK_TARGET_OS), macosx)
 875     LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX
 876     LIBSPLASHSCREEN_CFLAGS += -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libosxapp
 877 
 878     BUILD_LIBSPLASHSCREEN_java_awt_SplashScreen.c_CFLAGS := -x objective-c -O0
 879     BUILD_LIBSPLASHSCREEN_splashscreen_gfx_impl.c_CFLAGS := -x objective-c -O0
 880     BUILD_LIBSPLASHSCREEN_splashscreen_gif.c_CFLAGS := -x objective-c -O0
 881     BUILD_LIBSPLASHSCREEN_splashscreen_impl.c_CFLAGS := -x objective-c -O0
 882     BUILD_LIBSPLASHSCREEN_splashscreen_jpeg.c_CFLAGS := -x objective-c -O0
 883     BUILD_LIBSPLASHSCREEN_splashscreen_png.c_CFLAGS := -x objective-c -O0
 884     BUILD_LIBSPLASHSCREEN_splashscreen_sys.m_CFLAGS := -O0
 885 
 886   else ifeq ($(OPENJDK_TARGET_OS), windows)
 887     LIBSPLASHSCREEN_CFLAGS += -DWITH_WIN32
 888   else
 889     LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 $(X_CFLAGS)
 890   endif
 891 
 892   LIBSPLASHSCREEN_LIBS :=
 893 
 894   ifneq ($(USE_EXTERNAL_LIBZ), true)
 895     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib-1.2.8
 896     LIBSPLASHSCREEN_CFLAGS += $(ZLIB_CPPFLAGS)
 897   endif
 898 
 899   ifeq ($(OPENJDK_TARGET_OS), macosx)
 900     LIBSPLASHSCREEN_LDFLAGS := -L$(INSTALL_LIBRARIES_HERE)
 901     LIBSPLASHSCREEN_LIBS += \
 902         $(LIBM) -lpthread -liconv -losxapp \
 903         -framework ApplicationServices \
 904         -framework Foundation \
 905         -framework Cocoa \
 906         -framework JavaNativeFoundation
 907   else ifeq ($(OPENJDK_TARGET_OS), windows)
 908     LIBSPLASHSCREEN_LDFLAGS := -delayload:user32.dll
 909     LIBSPLASHSCREEN_LIBS += kernel32.lib user32.lib gdi32.lib delayimp.lib $(WIN_JAVA_LIB) jvm.lib
 910   else
 911     LIBSPLASHSCREEN_LIBS += $(X_LIBS) -lX11 -lXext $(LIBM) -lpthread
 912   endif
 913 
 914   $(eval $(call SetupNativeCompilation,BUILD_LIBSPLASHSCREEN, \
 915       LIBRARY := splashscreen, \
 916       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 917       SRC := $(LIBSPLASHSCREEN_DIRS), \
 918       EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
 919       EXCLUDES := $(LIBSPLASHSCREEN_EXCLUDES), \
 920       OPTIMIZATION := LOW, \
 921       CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) \
 922                 $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS), \
 923       DISABLED_WARNINGS_gcc := sign-compare type-limits unused-result maybe-uninitialized, \
 924       DISABLED_WARNINGS_clang := incompatible-pointer-types, \
 925       DISABLED_WARNINGS_solstudio := E_NEWLINE_NOT_LAST E_DECLARATION_IN_CODE \
 926           E_STATEMENT_NOT_REACHED, \
 927       DISABLED_WARNINGS_microsoft := 4018 4244 4267, \
 928       MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libsplashscreen/mapfile-vers, \
 929       LDFLAGS := $(LIBSPLASHSCREEN_LDFLAGS) $(LDFLAGS_JDKLIB) \
 930           $(call SET_SHARED_LIBRARY_ORIGIN), \
 931       LIBS := $(JDKLIB_LIBS) $(LIBSPLASHSCREEN_LIBS) $(LIBZ) \
 932                         $(GIFLIB_LIBS) $(LIBJPEG_LIBS) $(PNG_LIBS), \
 933       LIBS_aix := -liconv, \
 934       VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 935       RC_FLAGS := $(RC_FLAGS) \
 936           -D "JDK_FNAME=splashscreen.dll" \
 937           -D "JDK_INTERNAL_NAME=splashscreen" \
 938           -D "JDK_FTYPE=0x2L", \
 939       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libsplashscreen, \
 940   ))
 941 
 942   TARGETS += $(BUILD_LIBSPLASHSCREEN)
 943 
 944   ifeq ($(OPENJDK_TARGET_OS), macosx)
 945     $(BUILD_LIBSPLASHSCREEN): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)osxapp$(SHARED_LIBRARY_SUFFIX)
 946   endif
 947 
 948 endif
 949 
 950 ################################################################################
 951 
 952 ifeq ($(OPENJDK_TARGET_OS), macosx)
 953 
 954   LIBAWT_LWAWT_DIRS := \
 955       $(JDK_TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt \
 956       $(JDK_TOPDIR)/src/java.desktop/unix/native/common/awt \
 957       $(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
 958       $(JDK_TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
 959       #
 960 
 961   LIBAWT_LWAWT_CFLAGS := \
 962       $(addprefix -I, $(LIBAWT_LWAWT_DIRS)) \
 963       -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
 964       -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/include \
 965       -I$(JDK_TOPDIR)/src/java.desktop/share/native/include \
 966       -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl \
 967       -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/awt \
 968       -I$(JDK_TOPDIR)/src/java.desktop/unix/native/libawt_xawt/awt \
 969       -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/font \
 970       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image \
 971       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d \
 972       -I$(JDK_TOPDIR)/src/java.desktop/unix/native/libawt/java2d \
 973       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libmlib_image/ \
 974       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
 975       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/loops \
 976       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe \
 977       -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/debug \
 978       -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libosxapp \
 979       $(LIBJAVA_HEADER_FLAGS) \
 980       #
 981 
 982   LIBAWT_LWAWT_EXFILES := fontpath.c awt_Font.c X11Color.c
 983   LIBAWT_LWAWT_EXCLUDES := $(JDK_TOPDIR)/src/java.desktop/unix/native/common/awt/medialib
 984 
 985   $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_LWAWT, \
 986       LIBRARY := awt_lwawt, \
 987       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 988       SRC := $(LIBAWT_LWAWT_DIRS), \
 989       INCLUDE_FILES := $(LIBAWT_LWAWT_FILES), \
 990       EXCLUDE_FILES := $(LIBAWT_LWAWT_EXFILES), \
 991       EXCLUDES := $(LIBAWT_LWAWT_EXCLUDES), \
 992       OPTIMIZATION := LOW, \
 993       CFLAGS := $(CFLAGS_JDKLIB) \
 994           $(X_CFLAGS) \
 995           $(X_LIBS) \
 996           $(LIBAWT_LWAWT_CFLAGS), \
 997       DISABLED_WARNINGS_clang := incomplete-implementation enum-conversion \
 998           deprecated-declarations objc-method-access bitwise-op-parentheses \
 999           incompatible-pointer-types parentheses-equality extra-tokens, \
1000       LDFLAGS := $(LDFLAGS_JDKLIB) \
1001           $(call SET_SHARED_LIBRARY_ORIGIN) \
1002           -L$(INSTALL_LIBRARIES_HERE), \
1003       LIBS := -lawt -lmlib_image -losxapp -ljvm $(LIBM) \
1004           -framework Accelerate \
1005           -framework ApplicationServices \
1006           -framework AudioToolbox \
1007           -framework Carbon \
1008           -framework Cocoa \
1009           -framework Security \
1010           -framework ExceptionHandling \
1011           -framework JavaNativeFoundation \
1012           -framework JavaRuntimeSupport \
1013           -framework OpenGL \
1014           -framework QuartzCore -ljava, \
1015       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt_lwawt, \
1016   ))
1017 
1018   TARGETS += $(BUILD_LIBAWT_LWAWT)
1019 
1020   $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBAWT)
1021 
1022   $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBMLIB_IMAGE)
1023 
1024   $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBOSXAPP)
1025 
1026   $(BUILD_LIBAWT_LWAWT): $(call FindLib, java.base, java)
1027 
1028 endif
1029 
1030 ################################################################################
1031 
1032 ifeq ($(OPENJDK_TARGET_OS), macosx)
1033 
1034   $(eval $(call SetupNativeCompilation,BUILD_LIBOSXUI, \
1035       LIBRARY := osxui, \
1036       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
1037       SRC := $(JDK_TOPDIR)/src/java.desktop/macosx/native/libosxui, \
1038       OPTIMIZATION := LOW, \
1039       CFLAGS := $(CFLAGS_JDKLIB) \
1040           -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libosxui \
1041           -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/awt \
1042           -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libosxapp \
1043           -I$(JDK_TOPDIR)/src/java.base/share/native/libjava \
1044           -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
1045           -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop,  \
1046       LDFLAGS := $(LDFLAGS_JDKLIB) \
1047           $(call SET_SHARED_LIBRARY_ORIGIN) \
1048           -Wl$(COMMA)-rpath$(COMMA)@loader_path \
1049           -L$(INSTALL_LIBRARIES_HERE), \
1050       LIBS := -lawt -losxapp -lawt_lwawt \
1051           -framework Cocoa \
1052           -framework Carbon \
1053           -framework ApplicationServices \
1054           -framework JavaNativeFoundation \
1055           -framework JavaRuntimeSupport \
1056           -ljava -ljvm, \
1057       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libosxui, \
1058   ))
1059 
1060   TARGETS += $(BUILD_LIBOSXUI)
1061 
1062   $(BUILD_LIBOSXUI): $(BUILD_LIBAWT)
1063 
1064   $(BUILD_LIBOSXUI): $(BUILD_LIBOSXAPP)
1065 
1066   $(BUILD_LIBOSXUI): $(BUILD_LIBAWT_LWAWT)
1067 
1068   #$(BUILD_LIBOSXUI): $(call FindLib, java.base, java)
1069 
1070 endif
1071 
1072 ################################################################################
1073 
1074 # Hook to include the corresponding custom file, if present.
1075 $(eval $(call IncludeCustomExtension, jdk, lib/Awt2dLibraries.gmk))
--- EOF ---