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     ifeq ($(OPENJDK_TARGET_OS), solaris)
 331       LIBAWT_XAWT_CFLAGS += -DFUNCPROTO=15
 332     endif
 333 
 334     ifeq ($(OPENJDK_TARGET_OS), linux)
 335       ifeq ($(DISABLE_XRENDER), true)
 336         LIBAWT_XAWT_CFLAGS += -DDISABLE_XRENDER_BY_DEFAULT=true
 337       endif
 338     endif
 339 
 340     LIBAWT_XAWT_LIBS := $(LIBM) -lawt -lXext -lX11 -lXrender $(LIBDL) -lXtst -lXi -ljava -ljvm -lc
 341 
 342     ifeq ($(OPENJDK_TARGET_OS), linux)
 343       LIBAWT_XAWT_LIBS += -lpthread
 344     endif
 345 
 346     $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_XAWT, \
 347         LIBRARY := awt_xawt, \
 348         OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 349         SRC := $(LIBAWT_XAWT_DIRS), \
 350         EXCLUDES := $(LIBAWT_XAWT_EXCLUDES), \
 351         OPTIMIZATION := LOW, \
 352         CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_XAWT_CFLAGS) \
 353             $(X_CFLAGS), \
 354         DISABLED_WARNINGS_gcc := type-limits pointer-to-int-cast \
 355             deprecated-declarations unused-result maybe-uninitialized format \
 356             format-security int-to-pointer-cast parentheses, \
 357         DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE \
 358             E_ASSIGNMENT_TYPE_MISMATCH E_NON_CONST_INIT, \
 359         WARNINGS_AS_ERRORS_gcc := false, \
 360         MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_xawt/mapfile-vers, \
 361         LDFLAGS := $(LDFLAGS_JDKLIB) \
 362             $(call SET_SHARED_LIBRARY_ORIGIN) \
 363             $(call SET_SHARED_LIBRARY_ORIGIN,/..) \
 364             -L$(INSTALL_LIBRARIES_HERE), \
 365         LIBS :=  $(X_LIBS) $(LIBAWT_XAWT_LIBS), \
 366         VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 367         RC_FLAGS := $(RC_FLAGS) \
 368             -D "JDK_FNAME=xawt.dll" \
 369             -D "JDK_INTERNAL_NAME=xawt" \
 370             -D "JDK_FTYPE=0x2L", \
 371         OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt_xawt, \
 372     ))
 373 
 374     $(BUILD_LIBAWT_XAWT): $(call FindLib, java.base, java)
 375 
 376     $(BUILD_LIBAWT_XAWT): $(BUILD_LIBAWT)
 377 
 378     TARGETS += $(BUILD_LIBAWT_XAWT)
 379 
 380   endif
 381 endif
 382 
 383 ################################################################################
 384 
 385 LIBLCMS_SRC := $(JDK_TOPDIR)/src/java.desktop/share/native/liblcms
 386 LIBLCMS_CPPFLAGS += -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
 387     -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d \
 388     -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/debug \
 389     $(LIBJAVA_HEADER_FLAGS) \
 390     #
 391 # The fast floor code loses precision.
 392 LCMS_CFLAGS=-DCMS_DONT_USE_FAST_FLOOR
 393 
 394 ifeq ($(USE_EXTERNAL_LCMS), true)
 395   # If we're using an external library, we'll just need the wrapper part.
 396   # By including it explicitely, all other files will be excluded.
 397   BUILD_LIBLCMS_INCLUDE_FILES := LCMS.c
 398 else
 399   BUILD_LIBLCMS_INCLUDE_FILES :=
 400   # If we're using the bundled library, we'll need to include it in the
 401   # include path explicitly. Otherwise the system headers will be used.
 402   LIBLCMS_CPPFLAGS += $(addprefix -I, $(LIBLCMS_SRC))
 403 endif
 404 
 405 $(eval $(call SetupNativeCompilation,BUILD_LIBLCMS, \
 406     LIBRARY := lcms, \
 407     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 408     SRC := $(LIBLCMS_SRC), \
 409     INCLUDE_FILES := $(BUILD_LIBLCMS_INCLUDE_FILES), \
 410     OPTIMIZATION := HIGHEST, \
 411     CFLAGS := $(filter-out -xc99=%none, $(CFLAGS_JDKLIB)) \
 412         $(LIBLCMS_CPPFLAGS) \
 413         $(LCMS_CFLAGS), \
 414     CFLAGS_solaris := -xc99=no_lib, \
 415     CFLAGS_windows := -DCMS_IS_WINDOWS_, \
 416     DISABLED_WARNINGS_gcc := format-nonliteral type-limits, \
 417     DISABLED_WARNINGS_clang := tautological-compare, \
 418     DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
 419     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/liblcms/mapfile-vers, \
 420     LDFLAGS := $(LDFLAGS_JDKLIB) \
 421         $(call SET_SHARED_LIBRARY_ORIGIN), \
 422     LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
 423     LDFLAGS_solaris := /usr/lib$(OPENJDK_TARGET_CPU_ISADIR)/libm.so.2, \
 424     LIBS_unix := -lawt -ljvm -ljava $(LCMS_LIBS), \
 425     LIBS_linux := $(LIBM), \
 426     LIBS_macosx := $(LIBM), \
 427     LIBS_solaris := -lc, \
 428     LIBS_aix := $(LIBM),\
 429     LIBS_windows := $(WIN_AWT_LIB) $(WIN_JAVA_LIB), \
 430     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 431     RC_FLAGS := $(RC_FLAGS) \
 432         -D "JDK_FNAME=lcms.dll" \
 433         -D "JDK_INTERNAL_NAME=lcms" \
 434         -D "JDK_FTYPE=0x2L", \
 435     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/liblcms, \
 436 ))
 437 
 438 TARGETS += $(BUILD_LIBLCMS)
 439 
 440 $(BUILD_LIBLCMS): $(BUILD_LIBAWT)
 441 
 442 ################################################################################
 443 
 444 ifdef OPENJDK
 445   BUILD_LIBJAVAJPEG_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers
 446 else
 447   BUILD_LIBJAVAJPEG_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers-closed
 448   LIBJAVAJPEG_SRC += $(JDK_TOPDIR)/src/closed/java.desktop/share/native/libjavajpeg
 449 endif
 450 
 451 LIBJAVAJPEG_SRC += $(JDK_TOPDIR)/src/java.desktop/share/native/libjavajpeg
 452 
 453 BUILD_LIBJAVAJPEG_REORDER :=
 454 ifeq ($(OPENJDK_TARGET_OS), solaris)
 455   ifneq ($(OPENJDK_TARGET_CPU), x86_64)
 456     BUILD_LIBJAVAJPEG_REORDER := $(JDK_TOPDIR)/make/mapfiles/libjpeg/reorder-$(OPENJDK_TARGET_CPU)
 457   endif
 458 endif
 459 
 460 
 461 # Suppress gcc warnings like "variable might be clobbered by 'longjmp'
 462 # or 'vfork'": this warning indicates that some variable is placed to
 463 # a register by optimized compiler and it's value might be lost on longjmp().
 464 # Recommended way to avoid such warning is to declare the variable as
 465 # volatile to prevent the optimization. However, this approach does not
 466 # work because we have to declare all variables as volatile in result.
 467 #ifndef CROSS_COMPILE_ARCH
 468 #  CC_43_OR_NEWER := \
 469 #      $(shell $(EXPR) $(CC_MAJORVER) \> 4 \| \
 470 #          \( $(CC_MAJORVER) = 4 \& $(CC_MINORVER) \>= 3 \) )
 471 #  ifeq ($(CC_43_OR_NEWER), 1)
 472 #    BUILD_LIBJAVAJPEG_CFLAGS_linux += -Wno-clobbered
 473 #  endif
 474 #endif
 475 
 476 ifeq ($(USE_EXTERNAL_LIBJPEG), true)
 477   LIBJPEG_LIBS := -ljpeg
 478   BUILD_LIBJAVAJPEG_INCLUDE_FILES := \
 479       imageioJPEG.c \
 480       jpegdecoder.c
 481   BUILD_LIBJAVAJPEG_HEADERS :=
 482 else
 483   LIBJPEG_LIBS :=
 484   BUILD_LIBJAVAJPEG_INCLUDE_FILES :=
 485   BUILD_LIBJAVAJPEG_HEADERS := $(addprefix -I, $(LIBJAVAJPEG_SRC))
 486 endif
 487 
 488 $(eval $(call SetupNativeCompilation,BUILD_LIBJAVAJPEG, \
 489     LIBRARY := javajpeg, \
 490     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 491     SRC := $(LIBJAVAJPEG_SRC), \
 492     INCLUDE_FILES := $(BUILD_LIBJAVAJPEG_INCLUDE_FILES), \
 493     OPTIMIZATION := HIGHEST, \
 494     CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBJAVAJPEG_HEADERS) \
 495         $(LIBJAVA_HEADER_FLAGS) \
 496         -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop, \
 497     DISABLED_WARNINGS_gcc := clobbered parentheses array-bounds, \
 498     DISABLED_WARNINGS_clang := logical-op-parentheses, \
 499     DISABLED_WARNINGS_microsoft := 4267, \
 500     MAPFILE := $(BUILD_LIBJAVAJPEG_MAPFILE), \
 501     LDFLAGS := $(LDFLAGS_JDKLIB) \
 502         $(call SET_SHARED_LIBRARY_ORIGIN), \
 503     LIBS := $(LIBJPEG_LIBS) $(JDKLIB_LIBS), \
 504     LIBS_windows := $(WIN_JAVA_LIB) jvm.lib, \
 505     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 506     RC_FLAGS := $(RC_FLAGS) \
 507         -D "JDK_FNAME=javajpeg.dll" \
 508         -D "JDK_INTERNAL_NAME=javajpeg" \
 509         -D "JDK_FTYPE=0x2L", \
 510     REORDER := $(BUILD_LIBJAVAJPEG_REORDER), \
 511     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjavajpeg, \
 512 ))
 513 
 514 $(BUILD_LIBJAVAJPEG): $(call FindLib, java.base, java)
 515 
 516 TARGETS += $(BUILD_LIBJAVAJPEG)
 517 
 518 ################################################################################
 519 
 520 ifeq ($(BUILD_HEADLESS), true)
 521   # Mac and Windows only use the native AWT lib, do not build libawt_headless
 522   ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx),)
 523 
 524     LIBAWT_HEADLESS_DIRS := $(JDK_TOPDIR)/src/java.desktop/unix/native/libawt_headless/awt \
 525         $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
 526         $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/opengl \
 527         $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/x11 \
 528         $(JDK_TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
 529         $(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
 530         #
 531 
 532     LIBAWT_HEADLESS_EXCLUDES := medialib
 533     LIBAWT_HEADLESS_CFLAGS := -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
 534         $(addprefix -I, $(LIBAWT_HEADLESS_DIRS)) \
 535         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d \
 536         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/loops \
 537         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
 538         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe \
 539         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image \
 540         -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/java2d \
 541         -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
 542         -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/debug \
 543         -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/font \
 544         -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libsunwjdga/ \
 545         $(LIBJAVA_HEADER_FLAGS) \
 546         #
 547 
 548     LIBAWT_HEADLESS_REORDER :=
 549     ifeq ($(OPENJDK_TARGET_OS), solaris)
 550       ifneq ($(OPENJDK_TARGET_CPU), x86_64)
 551         LIBAWT_HEADLESS_REORDER := $(JDK_TOPDIR)/make/mapfiles/libawt_headless/reorder-$(OPENJDK_TARGET_CPU)
 552       endif
 553     endif
 554 
 555     $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_HEADLESS, \
 556         LIBRARY := awt_headless, \
 557         OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 558         SRC := $(LIBAWT_HEADLESS_DIRS), \
 559         EXCLUDES := $(LIBAWT_HEADLESS_EXCLUDES), \
 560         OPTIMIZATION := LOW, \
 561         CFLAGS := $(CFLAGS_JDKLIB) \
 562             -DHEADLESS=true \
 563             -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
 564             $(CUPS_CFLAGS) \
 565             $(X_CFLAGS) \
 566             $(LIBAWT_HEADLESS_CFLAGS), \
 567         DISABLED_WARNINGS_gcc := maybe-uninitialized int-to-pointer-cast, \
 568         DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE \
 569             E_EMPTY_TRANSLATION_UNIT, \
 570         MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_headless/mapfile-vers, \
 571         LDFLAGS := $(LDFLAGS_JDKLIB) \
 572             $(call SET_SHARED_LIBRARY_ORIGIN), \
 573         LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
 574         LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
 575         LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
 576         REORDER := $(LIBAWT_HEADLESS_REORDER), \
 577         LIBS_unix := -lawt -ljvm -ljava, \
 578         LIBS_linux := -lm $(LIBDL), \
 579         LIBS_solaris := -lm $(LIBDL) $(LIBCXX) -lc, \
 580         OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt_headless, \
 581     ))
 582 
 583     $(BUILD_LIBAWT_HEADLESS): $(BUILD_LIBAWT)
 584 
 585     TARGETS += $(BUILD_LIBAWT_HEADLESS)
 586 
 587   endif
 588 endif
 589 
 590 ################################################################################
 591 
 592 LIBFONTMANAGER_SRC := $(JDK_TOPDIR)/src/java.desktop/share/native/libfontmanager \
 593     $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libfontmanager
 594 LIBFONTMANAGER_CFLAGS := \
 595     $(addprefix -I, $(shell $(FIND) \
 596       $(LIBFONTMANAGER_SRC) \
 597       $(JDK_TOPDIR)/src/java.desktop/share/native/libawt \
 598       $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt \
 599       $(JDK_TOPDIR)/src/java.desktop/share/native/common \
 600       $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common -type d)) \
 601     -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
 602     $(LIBJAVA_HEADER_FLAGS) \
 603     #
 604 
 605 #### Begin harfbuzz configuration
 606 
 607 HARFBUZZ_CFLAGS := -DHAVE_OT -DHAVE_FALLBACK -DHAVE_UCDN
 608 
 609 ifneq ($(OPENJDK_TARGET_OS), windows)
 610   HARFBUZZ_CFLAGS += -DGETPAGESIZE -DHAVE_MPROTECT -DHAVE_PTHREAD \
 611                       -DHAVE_SYSCONF -DHAVE_SYS_MMAN_H -DHAVE_UNISTD_H
 612 endif
 613 ifneq (, $(findstring $(OPENJDK_TARGET_OS), linux macosx))
 614   HARFBUZZ_CFLAGS += -DHAVE_INTEL_ATOMIC_PRIMITIVES
 615 endif
 616 ifeq ($(OPENJDK_TARGET_OS), solaris)
 617   HARFBUZZ_CFLAGS += -DHAVE_SOLARIS_ATOMIC_OPS
 618 endif
 619 ifeq ($(OPENJDK_TARGET_OS), macosx)
 620   HARFBUZZ_CFLAGS += -DHAVE_CORETEXT
 621 endif
 622 ifneq ($(OPENJDK_TARGET_OS), macosx)
 623   LIBFONTMANAGER_EXCLUDE_FILES += harfbuzz/hb-coretext.cc
 624 endif
 625 # hb-ft.cc is not presently needed, and requires freetype 2.4.2 or later.
 626 LIBFONTMANAGER_EXCLUDE_FILES += harfbuzz/hb-ft.cc
 627 
 628 LIBFONTMANAGER_CFLAGS += $(HARFBUZZ_CFLAGS)
 629 
 630 #### End harfbuzz configuration
 631 
 632 ifndef OPENJDK
 633   LIBFONTMANAGER_CFLAGS += -I$(JDK_TOPDIR)/src/closed/java.desktop/share/native/libt2k
 634   BUILD_LIBFONTMANAGER_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libfontmanager/mapfile-vers
 635   LIBFONTMANAGER_EXCLUDE_FILES += freetypeScaler.c
 636 else
 637   LIBFONTMANAGER_CFLAGS += $(FREETYPE_CFLAGS)
 638   BUILD_LIBFONTMANAGER_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libfontmanager/mapfile-vers.openjdk
 639   BUILD_LIBFONTMANAGER_FONTLIB := $(FREETYPE_LIBS)
 640 endif
 641 
 642 LIBFONTMANAGER_OPTIMIZATION := HIGH
 643 
 644 ifeq ($(OPENJDK_TARGET_OS), windows)
 645   LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
 646       X11TextRenderer.c
 647   LIBFONTMANAGER_OPTIMIZATION := HIGHEST
 648   LIBFONTMANAGER_CFLAGS += -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/windows
 649 else ifeq ($(OPENJDK_TARGET_OS), macosx)
 650   LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
 651       X11TextRenderer.c \
 652       fontpath.c \
 653       lcdglyph.c
 654 else
 655   LIBFONTMANAGER_EXCLUDE_FILES += fontpath.c \
 656       lcdglyph.c
 657 endif
 658 
 659 LIBFONTMANAGER_CFLAGS += $(FONT_HEADERS) $(X_CFLAGS) -DLE_STANDALONE -DHEADLESS
 660 
 661 # Turn off aliasing with GCC for ExtensionSubtables.cpp
 662 ifeq ($(OPENJDK_TARGET_OS), linux)
 663   BUILD_LIBFONTMANAGER_ExtensionSubtables.cpp_CXXFLAGS := -fno-strict-aliasing
 664 endif
 665 
 666 $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \
 667     LIBRARY := fontmanager, \
 668     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 669     SRC := $(LIBFONTMANAGER_SRC), \
 670     EXCLUDE_FILES := $(LIBFONTMANAGER_EXCLUDE_FILES) \
 671         AccelGlyphCache.c, \
 672     TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
 673     CFLAGS := $(CFLAGS_JDKLIB) $(LIBFONTMANAGER_CFLAGS), \
 674     CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBFONTMANAGER_CFLAGS), \
 675     OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \
 676     CFLAGS_windows = -DCC_NOEX, \
 677     DISABLED_WARNINGS_gcc := sign-compare int-to-pointer-cast reorder \
 678         delete-non-virtual-dtor type-limits missing-field-initializers, \
 679     DISABLED_WARNINGS_clang := unused-value incompatible-pointer-types \
 680         tautological-constant-out-of-range-compare int-to-pointer-cast, \
 681     DISABLED_WARNINGS_solstudio := truncwarn, \
 682     DISABLED_WARNINGS_microsoft := 4267 4244 4018 4090 4996 4146 4334, \
 683     WARNINGS_AS_ERRORS_gcc := false, \
 684     WARNINGS_AS_ERRORS_solstudio := false, \
 685     MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \
 686     LDFLAGS := $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \
 687         $(call SET_SHARED_LIBRARY_ORIGIN), \
 688     LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
 689     LDFLAGS_macosx := -undefined dynamic_lookup, \
 690     LIBS := $(BUILD_LIBFONTMANAGER_FONTLIB), \
 691     LIBS_unix := -lawt -ljava -ljvm $(LIBM) $(LIBCXX), \
 692     LIBS_linux := -lc, \
 693     LIBS_solaris := -lawt_headless -lc, \
 694     LIBS_aix := -lawt_headless,\
 695     LIBS_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib gdi32.lib \
 696         $(WIN_AWT_LIB), \
 697     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 698     RC_FLAGS := $(RC_FLAGS) \
 699         -D "JDK_FNAME=fontmanager.dll" \
 700         -D "JDK_INTERNAL_NAME=fontmanager" \
 701         -D "JDK_FTYPE=0x2L", \
 702     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfontmanager, \
 703 ))
 704 
 705 $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT)
 706 
 707 ifneq (, $(findstring $(OPENJDK_TARGET_OS), solaris aix))
 708   $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT_HEADLESS)
 709 endif
 710 
 711 TARGETS += $(BUILD_LIBFONTMANAGER)
 712 
 713 ################################################################################
 714 
 715 ifeq ($(OPENJDK_TARGET_OS), windows)
 716   LIBJAWT_SRC := $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libjawt
 717   LIBJAWT_CFLAGS := -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/windows \
 718       -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/debug \
 719       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d \
 720       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
 721       -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/java2d/windows \
 722       -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
 723       -I$(JDK_TOPDIR)/src/java.desktop/windows/native/include \
 724       -I$(JDK_TOPDIR)/src/java.desktop/share/native/include \
 725       $(LIBJAVA_HEADER_FLAGS) \
 726       #
 727 
 728   ifeq ($(OPENJDK_TARGET_CPU), x86)
 729     KERNEL32_LIB := kernel32.lib
 730   endif
 731   $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT, \
 732       LIBRARY := jawt, \
 733       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 734       SRC := $(LIBJAWT_SRC), \
 735       INCLUDE_FILES := $(LIBJAWT_INCLUDE_FILES), \
 736       OPTIMIZATION := LOW, \
 737       CFLAGS := $(CXXFLAGS_JDKLIB) \
 738           -EHsc -DUNICODE -D_UNICODE \
 739           $(LIBJAWT_CFLAGS), \
 740       LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \
 741       LIBS := $(JDKLIB_LIBS) $(KERNEL32_LIB) advapi32.lib $(WIN_AWT_LIB), \
 742       VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 743       RC_FLAGS := $(RC_FLAGS) \
 744           -D "JDK_FNAME=jawt.dll" \
 745           -D "JDK_INTERNAL_NAME=jawt" \
 746           -D "JDK_FTYPE=0x2L", \
 747       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjawt, \
 748   ))
 749 
 750   $(BUILD_LIBJAWT): $(BUILD_LIBAWT)
 751 
 752   $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX): $(BUILD_LIBJAWT)
 753         $(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%, %, $@))
 754         $(call MakeDir, $(@D))
 755         $(CP) $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjawt/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX) $@
 756 
 757   TARGETS += $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
 758 
 759 else # OPENJDK_TARGET_OS not windows
 760 
 761   ifeq ($(OPENJDK_TARGET_OS), macosx)
 762     LIBJAWT_SRC := $(JDK_TOPDIR)/src/java.desktop/macosx/native/libjawt
 763   else
 764     LIBJAWT_SRC := $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libjawt
 765   endif
 766   LIBJAWT_CFLAGS := \
 767       -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
 768       -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS)/native/include \
 769       -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/include \
 770       -I$(JDK_TOPDIR)/src/java.desktop/share/native/include \
 771       $(LIBJAVA_HEADER_FLAGS) \
 772       #
 773 
 774   ifeq ($(OPENJDK_TARGET_OS), macosx)
 775     JAWT_LIBS := -lawt_lwawt
 776   else
 777     JAWT_LIBS :=
 778     ifneq ($(OPENJDK_TARGET_OS), solaris)
 779       JAWT_LIBS += -lawt
 780     endif
 781     ifndef BUILD_HEADLESS_ONLY
 782       JAWT_LIBS += -lawt_xawt
 783     else
 784       JAWT_LIBS += -lawt_headless
 785       HEADLESS_CFLAG += -DHEADLESS
 786     endif
 787   endif
 788 
 789   $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT, \
 790       LIBRARY := jawt, \
 791       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 792       SRC := $(LIBJAWT_SRC), \
 793       INCLUDE_FILES := $(JAWT_FILES), \
 794       OPTIMIZATION := LOW, \
 795       CFLAGS := $(CFLAGS_JDKLIB) \
 796           $(LIBJAWT_CFLAGS), \
 797       CFLAGS_linux := $(HEADLESS_CFLAG), \
 798       CFLAGS_macosx := $(LIBJAWT_CFLAGS_macosx), \
 799       MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjawt/mapfile-vers, \
 800       LDFLAGS := $(LDFLAGS_JDKLIB) \
 801           $(call SET_SHARED_LIBRARY_ORIGIN), \
 802       LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
 803       LDFLAGS_macosx := -Wl$(COMMA)-rpath$(COMMA)@loader_path, \
 804       LIBS_unix := $(JAWT_LIBS) $(JDKLIB_LIBS), \
 805       LIBS_solaris := $(X_LIBS) -lXrender, \
 806       LIBS_macosx := -framework Cocoa, \
 807       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjawt, \
 808   ))
 809 
 810   ifndef BUILD_HEADLESS_ONLY
 811     $(BUILD_LIBJAWT): $(BUILD_LIBAWT_XAWT)
 812   else
 813     $(BUILD_LIBJAWT): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_headless$(SHARED_LIBRARY_SUFFIX)
 814   endif
 815 
 816   ifeq ($(OPENJDK_TARGET_OS), macosx)
 817     $(BUILD_LIBJAWT): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_lwawt$(SHARED_LIBRARY_SUFFIX)
 818   endif
 819 
 820 endif # OPENJDK_TARGET_OS
 821 
 822 TARGETS += $(BUILD_LIBJAWT)
 823 
 824 ################################################################################
 825 
 826 ifndef BUILD_HEADLESS_ONLY
 827 
 828   LIBSPLASHSCREEN_DIRS := \
 829       $(JDK_TOPDIR)/src/java.desktop/share/native/libjavajpeg \
 830       $(JDK_TOPDIR)/src/java.desktop/share/native/libsplashscreen \
 831       #
 832 
 833   ifeq ($(USE_EXTERNAL_LIBGIF), true)
 834     GIFLIB_LIBS := -lgif
 835     LIBSPLASHSCREEN_EXCLUDES := giflib
 836   else
 837     LIBSPLASHSCREEN_CFLAGS += -I$(JDK_TOPDIR)/src/java.desktop/share/native/libsplashscreen/giflib
 838   endif
 839 
 840   ifeq ($(USE_EXTERNAL_LIBJPEG), true)
 841     LIBJPEG_LIBS := -ljpeg
 842   else
 843     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.desktop/share/native/libjavajpeg
 844     LIBJPEG_CFLAGS := -I$(JDK_TOPDIR)/src/java.desktop/share/native/libjavajpeg
 845   endif
 846 
 847   ifeq ($(USE_EXTERNAL_LIBPNG), false)
 848     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.desktop/share/native/libsplashscreen/libpng
 849   else
 850     LIBSPLASHSCREEN_EXCLUDES += libpng
 851   endif
 852 
 853   ifneq ($(OPENJDK_TARGET_OS), macosx)
 854     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libsplashscreen
 855   else
 856     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.desktop/macosx/native/libsplashscreen
 857   endif
 858 
 859   LIBSPLASHSCREEN_CFLAGS += -DSPLASHSCREEN -DPNG_NO_MMX_CODE -DPNG_ARM_NEON_OPT=0 \
 860       $(addprefix -I, $(LIBSPLASHSCREEN_DIRS)) \
 861       $(LIBJAVA_HEADER_FLAGS) \
 862       #
 863 





 864   ifeq ($(OPENJDK_TARGET_OS), macosx)
 865     LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX
 866     LIBSPLASHSCREEN_CFLAGS += -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libosxapp
 867 
 868     BUILD_LIBSPLASHSCREEN_java_awt_SplashScreen.c_CFLAGS := -x objective-c -O0
 869     BUILD_LIBSPLASHSCREEN_splashscreen_gfx_impl.c_CFLAGS := -x objective-c -O0
 870     BUILD_LIBSPLASHSCREEN_splashscreen_gif.c_CFLAGS := -x objective-c -O0
 871     BUILD_LIBSPLASHSCREEN_splashscreen_impl.c_CFLAGS := -x objective-c -O0
 872     BUILD_LIBSPLASHSCREEN_splashscreen_jpeg.c_CFLAGS := -x objective-c -O0
 873     BUILD_LIBSPLASHSCREEN_splashscreen_png.c_CFLAGS := -x objective-c -O0
 874     BUILD_LIBSPLASHSCREEN_splashscreen_sys.m_CFLAGS := -O0
 875 
 876   else ifeq ($(OPENJDK_TARGET_OS), windows)
 877     LIBSPLASHSCREEN_CFLAGS += -DWITH_WIN32
 878   else
 879     LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 $(X_CFLAGS)
 880   endif
 881 
 882   LIBSPLASHSCREEN_LIBS :=
 883 
 884   ifneq ($(USE_EXTERNAL_LIBZ), true)
 885     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib-1.2.8
 886     LIBSPLASHSCREEN_CFLAGS += $(ZLIB_CPPFLAGS)
 887   endif
 888 
 889   ifeq ($(OPENJDK_TARGET_OS), macosx)
 890     LIBSPLASHSCREEN_LDFLAGS := -L$(INSTALL_LIBRARIES_HERE)
 891     LIBSPLASHSCREEN_LIBS += \
 892         $(LIBM) -lpthread -liconv -losxapp \
 893         -framework ApplicationServices \
 894         -framework Foundation \
 895         -framework Cocoa \
 896         -framework JavaNativeFoundation
 897   else ifeq ($(OPENJDK_TARGET_OS), windows)
 898     LIBSPLASHSCREEN_LDFLAGS := -delayload:user32.dll
 899     LIBSPLASHSCREEN_LIBS += kernel32.lib user32.lib gdi32.lib delayimp.lib
 900   else
 901     LIBSPLASHSCREEN_LIBS += $(X_LIBS) -lX11 -lXext $(LIBM) -lpthread
 902   endif
 903 
 904   $(eval $(call SetupNativeCompilation,BUILD_LIBSPLASHSCREEN, \
 905       LIBRARY := splashscreen, \
 906       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 907       SRC := $(LIBSPLASHSCREEN_DIRS), \
 908       EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
 909       EXCLUDES := $(LIBSPLASHSCREEN_EXCLUDES), \
 910       OPTIMIZATION := LOW, \
 911       CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) \
 912                 $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS), \
 913       DISABLED_WARNINGS_gcc := sign-compare type-limits unused-result maybe-uninitialized, \
 914       DISABLED_WARNINGS_clang := incompatible-pointer-types, \
 915       DISABLED_WARNINGS_solstudio := E_NEWLINE_NOT_LAST E_DECLARATION_IN_CODE \
 916           E_STATEMENT_NOT_REACHED, \
 917       DISABLED_WARNINGS_microsoft := 4018 4244 4267, \
 918       MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libsplashscreen/mapfile-vers, \
 919       LDFLAGS := $(LIBSPLASHSCREEN_LDFLAGS) $(LDFLAGS_JDKLIB) \
 920           $(call SET_SHARED_LIBRARY_ORIGIN), \
 921       LIBS := $(JDKLIB_LIBS) $(LIBSPLASHSCREEN_LIBS) $(LIBZ) \
 922                         $(GIFLIB_LIBS) $(LIBJPEG_LIBS) $(PNG_LIBS), \
 923       LIBS_aix := -liconv, \
 924       VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 925       RC_FLAGS := $(RC_FLAGS) \
 926           -D "JDK_FNAME=splashscreen.dll" \
 927           -D "JDK_INTERNAL_NAME=splashscreen" \
 928           -D "JDK_FTYPE=0x2L", \
 929       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libsplashscreen, \
 930   ))
 931 
 932   TARGETS += $(BUILD_LIBSPLASHSCREEN)
 933 
 934   ifeq ($(OPENJDK_TARGET_OS), macosx)
 935     $(BUILD_LIBSPLASHSCREEN): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)osxapp$(SHARED_LIBRARY_SUFFIX)
 936   endif
 937 
 938 endif
 939 
 940 ################################################################################
 941 
 942 ifeq ($(OPENJDK_TARGET_OS), macosx)
 943 
 944   LIBAWT_LWAWT_DIRS := \
 945       $(JDK_TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt \
 946       $(JDK_TOPDIR)/src/java.desktop/unix/native/common/awt \
 947       $(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
 948       $(JDK_TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
 949       #
 950 
 951   LIBAWT_LWAWT_CFLAGS := \
 952       $(addprefix -I, $(LIBAWT_LWAWT_DIRS)) \
 953       -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
 954       -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/include \
 955       -I$(JDK_TOPDIR)/src/java.desktop/share/native/include \
 956       -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl \
 957       -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/awt \
 958       -I$(JDK_TOPDIR)/src/java.desktop/unix/native/libawt_xawt/awt \
 959       -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/font \
 960       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image \
 961       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d \
 962       -I$(JDK_TOPDIR)/src/java.desktop/unix/native/libawt/java2d \
 963       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libmlib_image/ \
 964       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
 965       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/loops \
 966       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe \
 967       -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/debug \
 968       -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libosxapp \
 969       $(LIBJAVA_HEADER_FLAGS) \
 970       #
 971 
 972   LIBAWT_LWAWT_EXFILES := fontpath.c awt_Font.c X11Color.c
 973   LIBAWT_LWAWT_EXCLUDES := $(JDK_TOPDIR)/src/java.desktop/unix/native/common/awt/medialib
 974 
 975   $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_LWAWT, \
 976       LIBRARY := awt_lwawt, \
 977       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 978       SRC := $(LIBAWT_LWAWT_DIRS), \
 979       INCLUDE_FILES := $(LIBAWT_LWAWT_FILES), \
 980       EXCLUDE_FILES := $(LIBAWT_LWAWT_EXFILES), \
 981       EXCLUDES := $(LIBAWT_LWAWT_EXCLUDES), \
 982       OPTIMIZATION := LOW, \
 983       CFLAGS := $(CFLAGS_JDKLIB) \
 984           $(X_CFLAGS) \
 985           $(X_LIBS) \
 986           $(LIBAWT_LWAWT_CFLAGS), \
 987       DISABLED_WARNINGS_clang := incomplete-implementation enum-conversion \
 988           deprecated-declarations objc-method-access bitwise-op-parentheses \
 989           incompatible-pointer-types parentheses-equality extra-tokens, \
 990       LDFLAGS := $(LDFLAGS_JDKLIB) \
 991           $(call SET_SHARED_LIBRARY_ORIGIN) \
 992           -L$(INSTALL_LIBRARIES_HERE), \
 993       LIBS := -lawt -lmlib_image -losxapp -ljvm $(LIBM) \
 994           -framework Accelerate \
 995           -framework ApplicationServices \
 996           -framework AudioToolbox \
 997           -framework Carbon \
 998           -framework Cocoa \
 999           -framework Security \
1000           -framework ExceptionHandling \
1001           -framework JavaNativeFoundation \
1002           -framework JavaRuntimeSupport \
1003           -framework OpenGL \
1004           -framework QuartzCore -ljava, \
1005       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt_lwawt, \
1006   ))
1007 
1008   TARGETS += $(BUILD_LIBAWT_LWAWT)
1009 
1010   $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBAWT)
1011 
1012   $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBMLIB_IMAGE)
1013 
1014   $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBOSXAPP)
1015 
1016   $(BUILD_LIBAWT_LWAWT): $(call FindLib, java.base, java)
1017 
1018 endif
1019 
1020 ################################################################################
1021 
1022 ifeq ($(OPENJDK_TARGET_OS), macosx)
1023 
1024   $(eval $(call SetupNativeCompilation,BUILD_LIBOSXUI, \
1025       LIBRARY := osxui, \
1026       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
1027       SRC := $(JDK_TOPDIR)/src/java.desktop/macosx/native/libosxui, \
1028       OPTIMIZATION := LOW, \
1029       CFLAGS := $(CFLAGS_JDKLIB) \
1030           -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libosxui \
1031           -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/awt \
1032           -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libosxapp \
1033           -I$(JDK_TOPDIR)/src/java.base/share/native/libjava \
1034           -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
1035           -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop,  \
1036       LDFLAGS := $(LDFLAGS_JDKLIB) \
1037           $(call SET_SHARED_LIBRARY_ORIGIN) \
1038           -Wl$(COMMA)-rpath$(COMMA)@loader_path \
1039           -L$(INSTALL_LIBRARIES_HERE), \
1040       LIBS := -lawt -losxapp -lawt_lwawt \
1041           -framework Cocoa \
1042           -framework Carbon \
1043           -framework ApplicationServices \
1044           -framework JavaNativeFoundation \
1045           -framework JavaRuntimeSupport \
1046           -ljava -ljvm, \
1047       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libosxui, \
1048   ))
1049 
1050   TARGETS += $(BUILD_LIBOSXUI)
1051 
1052   $(BUILD_LIBOSXUI): $(BUILD_LIBAWT)
1053 
1054   $(BUILD_LIBOSXUI): $(BUILD_LIBOSXAPP)
1055 
1056   $(BUILD_LIBOSXUI): $(BUILD_LIBAWT_LWAWT)
1057 
1058   #$(BUILD_LIBOSXUI): $(call FindLib, java.base, java)
1059 
1060 endif
1061 
1062 ################################################################################
1063 
1064 # Hook to include the corresponding custom file, if present.
1065 $(eval $(call IncludeCustomExtension, jdk, lib/Awt2dLibraries.gmk))
--- EOF ---