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     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/liblcms/mapfile-vers, \
 417     LDFLAGS := $(LDFLAGS_JDKLIB) \
 418         $(call SET_SHARED_LIBRARY_ORIGIN), \
 419     LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
 420     LDFLAGS_solaris := /usr/lib$(OPENJDK_TARGET_CPU_ISADIR)/libm.so.2, \
 421     LIBS_unix := -lawt -ljvm -ljava $(LCMS_LIBS), \
 422     LIBS_linux := $(LIBM), \
 423     LIBS_macosx := $(LIBM), \
 424     LIBS_solaris := -lc, \
 425     LIBS_aix := $(LIBM),\
 426     LIBS_windows := $(WIN_AWT_LIB) $(WIN_JAVA_LIB), \
 427     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 428     RC_FLAGS := $(RC_FLAGS) \
 429         -D "JDK_FNAME=lcms.dll" \
 430         -D "JDK_INTERNAL_NAME=lcms" \
 431         -D "JDK_FTYPE=0x2L", \
 432     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/liblcms, \
 433 ))
 434 
 435 TARGETS += $(BUILD_LIBLCMS)
 436 
 437 $(BUILD_LIBLCMS): $(BUILD_LIBAWT)
 438 
 439 ################################################################################
 440 
 441 ifdef OPENJDK
 442   BUILD_LIBJAVAJPEG_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers
 443 else
 444   BUILD_LIBJAVAJPEG_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers-closed
 445   LIBJAVAJPEG_SRC += $(JDK_TOPDIR)/src/closed/java.desktop/share/native/libjavajpeg
 446 endif
 447 
 448 LIBJAVAJPEG_SRC += $(JDK_TOPDIR)/src/java.desktop/share/native/libjavajpeg
 449 
 450 BUILD_LIBJAVAJPEG_REORDER :=
 451 ifeq ($(OPENJDK_TARGET_OS), solaris)
 452   ifneq ($(OPENJDK_TARGET_CPU), x86_64)
 453     BUILD_LIBJAVAJPEG_REORDER := $(JDK_TOPDIR)/make/mapfiles/libjpeg/reorder-$(OPENJDK_TARGET_CPU)
 454   endif
 455 endif
 456 
 457 
 458 # Suppress gcc warnings like "variable might be clobbered by 'longjmp'
 459 # or 'vfork'": this warning indicates that some variable is placed to
 460 # a register by optimized compiler and it's value might be lost on longjmp().
 461 # Recommended way to avoid such warning is to declare the variable as
 462 # volatile to prevent the optimization. However, this approach does not
 463 # work because we have to declare all variables as volatile in result.
 464 #ifndef CROSS_COMPILE_ARCH
 465 #  CC_43_OR_NEWER := \
 466 #      $(shell $(EXPR) $(CC_MAJORVER) \> 4 \| \
 467 #          \( $(CC_MAJORVER) = 4 \& $(CC_MINORVER) \>= 3 \) )
 468 #  ifeq ($(CC_43_OR_NEWER), 1)
 469 #    BUILD_LIBJAVAJPEG_CFLAGS_linux += -Wno-clobbered
 470 #  endif
 471 #endif
 472 
 473 ifeq ($(USE_EXTERNAL_LIBJPEG), true)
 474   LIBJPEG_LIBS := -ljpeg
 475   BUILD_LIBJAVAJPEG_INCLUDE_FILES := \
 476       imageioJPEG.c \
 477       jpegdecoder.c
 478   BUILD_LIBJAVAJPEG_HEADERS :=
 479 else
 480   LIBJPEG_LIBS :=
 481   BUILD_LIBJAVAJPEG_INCLUDE_FILES :=
 482   BUILD_LIBJAVAJPEG_HEADERS := $(addprefix -I, $(LIBJAVAJPEG_SRC))
 483 endif
 484 
 485 $(eval $(call SetupNativeCompilation,BUILD_LIBJAVAJPEG, \
 486     LIBRARY := javajpeg, \
 487     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 488     SRC := $(LIBJAVAJPEG_SRC), \
 489     INCLUDE_FILES := $(BUILD_LIBJAVAJPEG_INCLUDE_FILES), \
 490     OPTIMIZATION := HIGHEST, \
 491     CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBJAVAJPEG_HEADERS) \
 492         $(LIBJAVA_HEADER_FLAGS) \
 493         -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop, \
 494     DISABLED_WARNINGS_gcc := clobbered parentheses array-bounds, \
 495     DISABLED_WARNINGS_clang := logical-op-parentheses, \
 496     DISABLED_WARNINGS_microsoft := 4267, \
 497     MAPFILE := $(BUILD_LIBJAVAJPEG_MAPFILE), \
 498     LDFLAGS := $(LDFLAGS_JDKLIB) \
 499         $(call SET_SHARED_LIBRARY_ORIGIN), \
 500     LIBS := $(LIBJPEG_LIBS) $(JDKLIB_LIBS), \
 501     LIBS_windows := $(WIN_JAVA_LIB) jvm.lib, \
 502     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 503     RC_FLAGS := $(RC_FLAGS) \
 504         -D "JDK_FNAME=javajpeg.dll" \
 505         -D "JDK_INTERNAL_NAME=javajpeg" \
 506         -D "JDK_FTYPE=0x2L", \
 507     REORDER := $(BUILD_LIBJAVAJPEG_REORDER), \
 508     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjavajpeg, \
 509 ))
 510 
 511 $(BUILD_LIBJAVAJPEG): $(call FindLib, java.base, java)
 512 
 513 TARGETS += $(BUILD_LIBJAVAJPEG)
 514 
 515 ################################################################################
 516 
 517 ifeq ($(BUILD_HEADLESS), true)
 518   # Mac and Windows only use the native AWT lib, do not build libawt_headless
 519   ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx),)
 520 
 521     LIBAWT_HEADLESS_DIRS := $(JDK_TOPDIR)/src/java.desktop/unix/native/libawt_headless/awt \
 522         $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
 523         $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/opengl \
 524         $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/x11 \
 525         $(JDK_TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
 526         $(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
 527         #
 528 
 529     LIBAWT_HEADLESS_EXCLUDES := medialib
 530     LIBAWT_HEADLESS_CFLAGS := -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
 531         $(addprefix -I, $(LIBAWT_HEADLESS_DIRS)) \
 532         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d \
 533         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/loops \
 534         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
 535         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe \
 536         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image \
 537         -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/java2d \
 538         -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
 539         -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/debug \
 540         -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/font \
 541         -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libsunwjdga/ \
 542         $(LIBJAVA_HEADER_FLAGS) \
 543         #
 544 
 545     LIBAWT_HEADLESS_REORDER :=
 546     ifeq ($(OPENJDK_TARGET_OS), solaris)
 547       ifneq ($(OPENJDK_TARGET_CPU), x86_64)
 548         LIBAWT_HEADLESS_REORDER := $(JDK_TOPDIR)/make/mapfiles/libawt_headless/reorder-$(OPENJDK_TARGET_CPU)
 549       endif
 550     endif
 551 
 552     $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_HEADLESS, \
 553         LIBRARY := awt_headless, \
 554         OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 555         SRC := $(LIBAWT_HEADLESS_DIRS), \
 556         EXCLUDES := $(LIBAWT_HEADLESS_EXCLUDES), \
 557         OPTIMIZATION := LOW, \
 558         CFLAGS := $(CFLAGS_JDKLIB) \
 559             -DHEADLESS=true \
 560             -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
 561             $(CUPS_CFLAGS) \
 562             $(X_CFLAGS) \
 563             $(LIBAWT_HEADLESS_CFLAGS), \
 564         DISABLED_WARNINGS_gcc := maybe-uninitialized int-to-pointer-cast, \
 565         DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE \
 566             E_EMPTY_TRANSLATION_UNIT, \
 567         MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_headless/mapfile-vers, \
 568         LDFLAGS := $(LDFLAGS_JDKLIB) \
 569             $(call SET_SHARED_LIBRARY_ORIGIN), \
 570         LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
 571         LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
 572         LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
 573         REORDER := $(LIBAWT_HEADLESS_REORDER), \
 574         LIBS_unix := -lawt -ljvm -ljava, \
 575         LIBS_linux := -lm $(LIBDL), \
 576         LIBS_solaris := -lm $(LIBDL) $(LIBCXX) -lc, \
 577         OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt_headless, \
 578     ))
 579 
 580     $(BUILD_LIBAWT_HEADLESS): $(BUILD_LIBAWT)
 581 
 582     TARGETS += $(BUILD_LIBAWT_HEADLESS)
 583 
 584   endif
 585 endif
 586 
 587 ################################################################################
 588 
 589 LIBFONTMANAGER_SRC := $(JDK_TOPDIR)/src/java.desktop/share/native/libfontmanager \
 590     $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libfontmanager
 591 LIBFONTMANAGER_CFLAGS := \
 592     $(addprefix -I, $(shell $(FIND) \
 593       $(LIBFONTMANAGER_SRC) \
 594       $(JDK_TOPDIR)/src/java.desktop/share/native/libawt \
 595       $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt \
 596       $(JDK_TOPDIR)/src/java.desktop/share/native/common \
 597       $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common -type d)) \
 598     -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
 599     $(LIBJAVA_HEADER_FLAGS) \
 600     #
 601 
 602 #### Begin harfbuzz configuration
 603 
 604 HARFBUZZ_CFLAGS := -DHAVE_OT -DHAVE_FALLBACK -DHAVE_UCDN
 605 
 606 ifneq ($(OPENJDK_TARGET_OS), windows)
 607   HARFBUZZ_CFLAGS += -DGETPAGESIZE -DHAVE_MPROTECT -DHAVE_PTHREAD \
 608                       -DHAVE_SYSCONF -DHAVE_SYS_MMAN_H -DHAVE_UNISTD_H
 609 endif
 610 ifneq (, $(findstring $(OPENJDK_TARGET_OS), linux macosx))
 611   HARFBUZZ_CFLAGS += -DHAVE_INTEL_ATOMIC_PRIMITIVES
 612 endif
 613 ifeq ($(OPENJDK_TARGET_OS), solaris)
 614   HARFBUZZ_CFLAGS += -DHAVE_SOLARIS_ATOMIC_OPS
 615 endif
 616 ifeq ($(OPENJDK_TARGET_OS), macosx)
 617   HARFBUZZ_CFLAGS += -DHAVE_CORETEXT
 618 endif
 619 ifneq ($(OPENJDK_TARGET_OS), macosx)
 620   LIBFONTMANAGER_EXCLUDE_FILES += harfbuzz/hb-coretext.cc
 621 endif
 622 # hb-ft.cc is not presently needed, and requires freetype 2.4.2 or later.
 623 LIBFONTMANAGER_EXCLUDE_FILES += harfbuzz/hb-ft.cc
 624 
 625 LIBFONTMANAGER_CFLAGS += $(HARFBUZZ_CFLAGS)
 626 
 627 #### End harfbuzz configuration
 628 
 629 ifndef OPENJDK
 630   LIBFONTMANAGER_CFLAGS += -I$(JDK_TOPDIR)/src/closed/java.desktop/share/native/libt2k
 631   BUILD_LIBFONTMANAGER_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libfontmanager/mapfile-vers
 632   LIBFONTMANAGER_EXCLUDE_FILES += freetypeScaler.c
 633 else
 634   LIBFONTMANAGER_CFLAGS += $(FREETYPE_CFLAGS)
 635   BUILD_LIBFONTMANAGER_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libfontmanager/mapfile-vers.openjdk
 636   BUILD_LIBFONTMANAGER_FONTLIB := $(FREETYPE_LIBS)
 637 endif
 638 
 639 LIBFONTMANAGER_OPTIMIZATION := HIGH
 640 
 641 ifeq ($(OPENJDK_TARGET_OS), windows)
 642   LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
 643       X11TextRenderer.c
 644   LIBFONTMANAGER_OPTIMIZATION := HIGHEST
 645   LIBFONTMANAGER_CFLAGS += -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/windows
 646 else ifeq ($(OPENJDK_TARGET_OS), macosx)
 647   LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
 648       X11TextRenderer.c \
 649       fontpath.c \
 650       lcdglyph.c
 651 else
 652   LIBFONTMANAGER_EXCLUDE_FILES += fontpath.c \
 653       lcdglyph.c
 654 endif
 655 
 656 LIBFONTMANAGER_CFLAGS += $(FONT_HEADERS) $(X_CFLAGS) -DLE_STANDALONE -DHEADLESS
 657 
 658 # Turn off aliasing with GCC for ExtensionSubtables.cpp
 659 ifeq ($(OPENJDK_TARGET_OS), linux)
 660   BUILD_LIBFONTMANAGER_ExtensionSubtables.cpp_CXXFLAGS := -fno-strict-aliasing
 661 endif
 662 
 663 $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \
 664     LIBRARY := fontmanager, \
 665     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 666     SRC := $(LIBFONTMANAGER_SRC), \
 667     EXCLUDE_FILES := $(LIBFONTMANAGER_EXCLUDE_FILES) \
 668         AccelGlyphCache.c, \
 669     TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
 670     CFLAGS := $(CFLAGS_JDKLIB) $(LIBFONTMANAGER_CFLAGS), \
 671     CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBFONTMANAGER_CFLAGS), \
 672     OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \
 673     CFLAGS_windows = -DCC_NOEX, \
 674     DISABLED_WARNINGS_gcc := sign-compare int-to-pointer-cast reorder \
 675         delete-non-virtual-dtor type-limits missing-field-initializers, \
 676     DISABLED_WARNINGS_clang := unused-value incompatible-pointer-types \
 677         tautological-constant-out-of-range-compare int-to-pointer-cast, \
 678     DISABLED_WARNINGS_solstudio := truncwarn, \
 679     DISABLED_WARNINGS_microsoft := 4267 4244 4018 4090 4996 4146 4334, \
 680     WARNINGS_AS_ERRORS_gcc := false, \
 681     WARNINGS_AS_ERRORS_solstudio := false, \
 682     MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \
 683     LDFLAGS := $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \
 684         $(call SET_SHARED_LIBRARY_ORIGIN), \
 685     LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
 686     LDFLAGS_macosx := -undefined dynamic_lookup, \
 687     LIBS := $(BUILD_LIBFONTMANAGER_FONTLIB), \
 688     LIBS_unix := -lawt -ljava -ljvm $(LIBM) $(LIBCXX), \
 689     LIBS_linux := -lc, \
 690     LIBS_solaris := -lawt_headless -lc, \
 691     LIBS_aix := -lawt_headless,\
 692     LIBS_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib gdi32.lib \
 693         $(WIN_AWT_LIB), \
 694     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 695     RC_FLAGS := $(RC_FLAGS) \
 696         -D "JDK_FNAME=fontmanager.dll" \
 697         -D "JDK_INTERNAL_NAME=fontmanager" \
 698         -D "JDK_FTYPE=0x2L", \
 699     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfontmanager, \
 700 ))
 701 
 702 $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT)
 703 
 704 ifneq (, $(findstring $(OPENJDK_TARGET_OS), solaris aix))
 705   $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT_HEADLESS)
 706 endif
 707 
 708 TARGETS += $(BUILD_LIBFONTMANAGER)
 709 
 710 ################################################################################
 711 
 712 ifeq ($(OPENJDK_TARGET_OS), windows)
 713   LIBJAWT_SRC := $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libjawt
 714   LIBJAWT_CFLAGS := -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/windows \
 715       -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/debug \
 716       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d \
 717       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
 718       -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/java2d/windows \
 719       -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
 720       -I$(JDK_TOPDIR)/src/java.desktop/windows/native/include \
 721       -I$(JDK_TOPDIR)/src/java.desktop/share/native/include \
 722       $(LIBJAVA_HEADER_FLAGS) \
 723       #
 724 
 725   ifeq ($(OPENJDK_TARGET_CPU), x86)
 726     KERNEL32_LIB := kernel32.lib
 727   endif
 728   $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT, \
 729       LIBRARY := jawt, \
 730       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 731       SRC := $(LIBJAWT_SRC), \
 732       INCLUDE_FILES := $(LIBJAWT_INCLUDE_FILES), \
 733       OPTIMIZATION := LOW, \
 734       CFLAGS := $(CXXFLAGS_JDKLIB) \
 735           -EHsc -DUNICODE -D_UNICODE \
 736           $(LIBJAWT_CFLAGS), \
 737       LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \
 738       LIBS := $(JDKLIB_LIBS) $(KERNEL32_LIB) advapi32.lib $(WIN_AWT_LIB), \
 739       VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 740       RC_FLAGS := $(RC_FLAGS) \
 741           -D "JDK_FNAME=jawt.dll" \
 742           -D "JDK_INTERNAL_NAME=jawt" \
 743           -D "JDK_FTYPE=0x2L", \
 744       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjawt, \
 745   ))
 746 
 747   $(BUILD_LIBJAWT): $(BUILD_LIBAWT)
 748 
 749   $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX): $(BUILD_LIBJAWT)
 750         $(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%, %, $@))
 751         $(call MakeDir, $(@D))
 752         $(CP) $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjawt/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX) $@
 753 
 754   TARGETS += $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
 755 
 756 else # OPENJDK_TARGET_OS not windows
 757 
 758   ifeq ($(OPENJDK_TARGET_OS), macosx)
 759     LIBJAWT_SRC := $(JDK_TOPDIR)/src/java.desktop/macosx/native/libjawt
 760   else
 761     LIBJAWT_SRC := $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libjawt
 762   endif
 763   LIBJAWT_CFLAGS := \
 764       -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
 765       -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS)/native/include \
 766       -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/include \
 767       -I$(JDK_TOPDIR)/src/java.desktop/share/native/include \
 768       $(LIBJAVA_HEADER_FLAGS) \
 769       #
 770 
 771   ifeq ($(OPENJDK_TARGET_OS), macosx)
 772     JAWT_LIBS := -lawt_lwawt
 773   else
 774     JAWT_LIBS :=
 775     ifneq ($(OPENJDK_TARGET_OS), solaris)
 776       JAWT_LIBS += -lawt
 777     endif
 778     ifndef BUILD_HEADLESS_ONLY
 779       JAWT_LIBS += -lawt_xawt
 780     else
 781       JAWT_LIBS += -lawt_headless
 782       HEADLESS_CFLAG += -DHEADLESS
 783     endif
 784   endif
 785 
 786   $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT, \
 787       LIBRARY := jawt, \
 788       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 789       SRC := $(LIBJAWT_SRC), \
 790       INCLUDE_FILES := $(JAWT_FILES), \
 791       OPTIMIZATION := LOW, \
 792       CFLAGS := $(CFLAGS_JDKLIB) \
 793           $(LIBJAWT_CFLAGS), \
 794       CFLAGS_linux := $(HEADLESS_CFLAG), \
 795       CFLAGS_macosx := $(LIBJAWT_CFLAGS_macosx), \
 796       MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjawt/mapfile-vers, \
 797       LDFLAGS := $(LDFLAGS_JDKLIB) \
 798           $(call SET_SHARED_LIBRARY_ORIGIN), \
 799       LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
 800       LDFLAGS_macosx := -Wl$(COMMA)-rpath$(COMMA)@loader_path, \
 801       LIBS_unix := $(JAWT_LIBS) $(JDKLIB_LIBS), \
 802       LIBS_solaris := $(X_LIBS) -lXrender, \
 803       LIBS_macosx := -framework Cocoa, \
 804       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjawt, \
 805   ))
 806 
 807   ifndef BUILD_HEADLESS_ONLY
 808     $(BUILD_LIBJAWT): $(BUILD_LIBAWT_XAWT)
 809   else
 810     $(BUILD_LIBJAWT): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_headless$(SHARED_LIBRARY_SUFFIX)
 811   endif
 812 
 813   ifeq ($(OPENJDK_TARGET_OS), macosx)
 814     $(BUILD_LIBJAWT): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_lwawt$(SHARED_LIBRARY_SUFFIX)
 815   endif
 816 
 817 endif # OPENJDK_TARGET_OS
 818 
 819 TARGETS += $(BUILD_LIBJAWT)
 820 
 821 ################################################################################
 822 
 823 ifndef BUILD_HEADLESS_ONLY
 824 
 825   LIBSPLASHSCREEN_DIRS := \
 826       $(JDK_TOPDIR)/src/java.desktop/share/native/libjavajpeg \
 827       $(JDK_TOPDIR)/src/java.desktop/share/native/libsplashscreen \
 828       #
 829 
 830   ifeq ($(USE_EXTERNAL_LIBGIF), true)
 831     GIFLIB_LIBS := -lgif
 832     LIBSPLASHSCREEN_EXCLUDES := giflib
 833   else
 834     LIBSPLASHSCREEN_CFLAGS += -I$(JDK_TOPDIR)/src/java.desktop/share/native/libsplashscreen/giflib
 835   endif
 836 
 837   ifeq ($(USE_EXTERNAL_LIBJPEG), true)
 838     LIBJPEG_LIBS := -ljpeg
 839   else
 840     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.desktop/share/native/libjavajpeg
 841     LIBJPEG_CFLAGS := -I$(JDK_TOPDIR)/src/java.desktop/share/native/libjavajpeg
 842   endif
 843 
 844   ifeq ($(USE_EXTERNAL_LIBPNG), false)
 845     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.desktop/share/native/libsplashscreen/libpng
 846   else
 847     LIBSPLASHSCREEN_EXCLUDES += libpng
 848   endif
 849 
 850   ifneq ($(OPENJDK_TARGET_OS), macosx)
 851     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libsplashscreen
 852   else
 853     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.desktop/macosx/native/libsplashscreen
 854   endif
 855 
 856   LIBSPLASHSCREEN_CFLAGS += -DSPLASHSCREEN -DPNG_NO_MMX_CODE -DPNG_ARM_NEON_OPT=0 \
 857       $(addprefix -I, $(LIBSPLASHSCREEN_DIRS)) \
 858       $(LIBJAVA_HEADER_FLAGS) \
 859       #
 860 
 861   ifeq ($(OPENJDK_TARGET_OS), macosx)
 862     LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX
 863     LIBSPLASHSCREEN_CFLAGS += -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libosxapp
 864 
 865     BUILD_LIBSPLASHSCREEN_java_awt_SplashScreen.c_CFLAGS := -x objective-c -O0
 866     BUILD_LIBSPLASHSCREEN_splashscreen_gfx_impl.c_CFLAGS := -x objective-c -O0
 867     BUILD_LIBSPLASHSCREEN_splashscreen_gif.c_CFLAGS := -x objective-c -O0
 868     BUILD_LIBSPLASHSCREEN_splashscreen_impl.c_CFLAGS := -x objective-c -O0
 869     BUILD_LIBSPLASHSCREEN_splashscreen_jpeg.c_CFLAGS := -x objective-c -O0
 870     BUILD_LIBSPLASHSCREEN_splashscreen_png.c_CFLAGS := -x objective-c -O0
 871     BUILD_LIBSPLASHSCREEN_splashscreen_sys.m_CFLAGS := -O0
 872 
 873   else ifeq ($(OPENJDK_TARGET_OS), windows)
 874     LIBSPLASHSCREEN_CFLAGS += -DWITH_WIN32
 875   else
 876     LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 $(X_CFLAGS)
 877   endif
 878 
 879   LIBSPLASHSCREEN_LIBS :=
 880 
 881   ifneq ($(USE_EXTERNAL_LIBZ), true)
 882     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib-1.2.8
 883     LIBSPLASHSCREEN_CFLAGS += $(ZLIB_CPPFLAGS)
 884   endif
 885 
 886   ifeq ($(OPENJDK_TARGET_OS), macosx)
 887     LIBSPLASHSCREEN_LDFLAGS := -L$(INSTALL_LIBRARIES_HERE)
 888     LIBSPLASHSCREEN_LIBS += \
 889         $(LIBM) -lpthread -liconv -losxapp \
 890         -framework ApplicationServices \
 891         -framework Foundation \
 892         -framework Cocoa \
 893         -framework JavaNativeFoundation
 894   else ifeq ($(OPENJDK_TARGET_OS), windows)
 895     LIBSPLASHSCREEN_LDFLAGS := -delayload:user32.dll
 896     LIBSPLASHSCREEN_LIBS += kernel32.lib user32.lib gdi32.lib delayimp.lib
 897   else
 898     LIBSPLASHSCREEN_LIBS += $(X_LIBS) -lX11 -lXext $(LIBM) -lpthread
 899   endif
 900 
 901   $(eval $(call SetupNativeCompilation,BUILD_LIBSPLASHSCREEN, \
 902       LIBRARY := splashscreen, \
 903       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 904       SRC := $(LIBSPLASHSCREEN_DIRS), \
 905       EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
 906       EXCLUDES := $(LIBSPLASHSCREEN_EXCLUDES), \
 907       OPTIMIZATION := LOW, \
 908       CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) \
 909                 $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS), \
 910       DISABLED_WARNINGS_gcc := sign-compare type-limits unused-result maybe-uninitialized, \
 911       DISABLED_WARNINGS_clang := incompatible-pointer-types, \
 912       DISABLED_WARNINGS_solstudio := E_NEWLINE_NOT_LAST E_DECLARATION_IN_CODE \
 913           E_STATEMENT_NOT_REACHED, \
 914       DISABLED_WARNINGS_microsoft := 4018 4244 4267, \
 915       MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libsplashscreen/mapfile-vers, \
 916       LDFLAGS := $(LIBSPLASHSCREEN_LDFLAGS) $(LDFLAGS_JDKLIB) \
 917           $(call SET_SHARED_LIBRARY_ORIGIN), \
 918       LIBS := $(JDKLIB_LIBS) $(LIBSPLASHSCREEN_LIBS) $(LIBZ) \
 919                         $(GIFLIB_LIBS) $(LIBJPEG_LIBS) $(PNG_LIBS), \
 920       LIBS_aix := -liconv, \
 921       VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 922       RC_FLAGS := $(RC_FLAGS) \
 923           -D "JDK_FNAME=splashscreen.dll" \
 924           -D "JDK_INTERNAL_NAME=splashscreen" \
 925           -D "JDK_FTYPE=0x2L", \
 926       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libsplashscreen, \
 927   ))
 928 
 929   TARGETS += $(BUILD_LIBSPLASHSCREEN)
 930 
 931   ifeq ($(OPENJDK_TARGET_OS), macosx)
 932     $(BUILD_LIBSPLASHSCREEN): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)osxapp$(SHARED_LIBRARY_SUFFIX)
 933   endif
 934 
 935 endif
 936 
 937 ################################################################################
 938 
 939 ifeq ($(OPENJDK_TARGET_OS), macosx)
 940 
 941   LIBAWT_LWAWT_DIRS := \
 942       $(JDK_TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt \
 943       $(JDK_TOPDIR)/src/java.desktop/unix/native/common/awt \
 944       $(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
 945       $(JDK_TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
 946       #
 947 
 948   LIBAWT_LWAWT_CFLAGS := \
 949       $(addprefix -I, $(LIBAWT_LWAWT_DIRS)) \
 950       -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
 951       -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/include \
 952       -I$(JDK_TOPDIR)/src/java.desktop/share/native/include \
 953       -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl \
 954       -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/awt \
 955       -I$(JDK_TOPDIR)/src/java.desktop/unix/native/libawt_xawt/awt \
 956       -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/font \
 957       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image \
 958       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d \
 959       -I$(JDK_TOPDIR)/src/java.desktop/unix/native/libawt/java2d \
 960       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libmlib_image/ \
 961       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
 962       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/loops \
 963       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe \
 964       -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/debug \
 965       -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libosxapp \
 966       $(LIBJAVA_HEADER_FLAGS) \
 967       #
 968 
 969   LIBAWT_LWAWT_EXFILES := fontpath.c awt_Font.c X11Color.c
 970   LIBAWT_LWAWT_EXCLUDES := $(JDK_TOPDIR)/src/java.desktop/unix/native/common/awt/medialib
 971 
 972   $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_LWAWT, \
 973       LIBRARY := awt_lwawt, \
 974       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 975       SRC := $(LIBAWT_LWAWT_DIRS), \
 976       INCLUDE_FILES := $(LIBAWT_LWAWT_FILES), \
 977       EXCLUDE_FILES := $(LIBAWT_LWAWT_EXFILES), \
 978       EXCLUDES := $(LIBAWT_LWAWT_EXCLUDES), \
 979       OPTIMIZATION := LOW, \
 980       CFLAGS := $(CFLAGS_JDKLIB) \
 981           $(X_CFLAGS) \
 982           $(X_LIBS) \
 983           $(LIBAWT_LWAWT_CFLAGS), \
 984       DISABLED_WARNINGS_clang := incomplete-implementation enum-conversion \
 985           deprecated-declarations objc-method-access bitwise-op-parentheses \
 986           incompatible-pointer-types parentheses-equality extra-tokens, \
 987       LDFLAGS := $(LDFLAGS_JDKLIB) \
 988           $(call SET_SHARED_LIBRARY_ORIGIN) \
 989           -L$(INSTALL_LIBRARIES_HERE), \
 990       LIBS := -lawt -lmlib_image -losxapp -ljvm $(LIBM) \
 991           -framework Accelerate \
 992           -framework ApplicationServices \
 993           -framework AudioToolbox \
 994           -framework Carbon \
 995           -framework Cocoa \
 996           -framework Security \
 997           -framework ExceptionHandling \
 998           -framework JavaNativeFoundation \
 999           -framework JavaRuntimeSupport \
1000           -framework OpenGL \
1001           -framework QuartzCore -ljava, \
1002       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt_lwawt, \
1003   ))
1004 
1005   TARGETS += $(BUILD_LIBAWT_LWAWT)
1006 
1007   $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBAWT)
1008 
1009   $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBMLIB_IMAGE)
1010 
1011   $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBOSXAPP)
1012 
1013   $(BUILD_LIBAWT_LWAWT): $(call FindLib, java.base, java)
1014 
1015 endif
1016 
1017 ################################################################################
1018 
1019 ifeq ($(OPENJDK_TARGET_OS), macosx)
1020 
1021   $(eval $(call SetupNativeCompilation,BUILD_LIBOSXUI, \
1022       LIBRARY := osxui, \
1023       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
1024       SRC := $(JDK_TOPDIR)/src/java.desktop/macosx/native/libosxui, \
1025       OPTIMIZATION := LOW, \
1026       CFLAGS := $(CFLAGS_JDKLIB) \
1027           -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libosxui \
1028           -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/awt \
1029           -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libosxapp \
1030           -I$(JDK_TOPDIR)/src/java.base/share/native/libjava \
1031           -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
1032           -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop,  \
1033       LDFLAGS := $(LDFLAGS_JDKLIB) \
1034           $(call SET_SHARED_LIBRARY_ORIGIN) \
1035           -Wl$(COMMA)-rpath$(COMMA)@loader_path \
1036           -L$(INSTALL_LIBRARIES_HERE), \
1037       LIBS := -lawt -losxapp -lawt_lwawt \
1038           -framework Cocoa \
1039           -framework Carbon \
1040           -framework ApplicationServices \
1041           -framework JavaNativeFoundation \
1042           -framework JavaRuntimeSupport \
1043           -ljava -ljvm, \
1044       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libosxui, \
1045   ))
1046 
1047   TARGETS += $(BUILD_LIBOSXUI)
1048 
1049   $(BUILD_LIBOSXUI): $(BUILD_LIBAWT)
1050 
1051   $(BUILD_LIBOSXUI): $(BUILD_LIBOSXAPP)
1052 
1053   $(BUILD_LIBOSXUI): $(BUILD_LIBAWT_LWAWT)
1054 
1055   #$(BUILD_LIBOSXUI): $(call FindLib, java.base, java)
1056 
1057 endif
1058 
1059 ################################################################################
1060 
1061 # Hook to include the corresponding custom file, if present.
1062 $(eval $(call IncludeCustomExtension, jdk, lib/Awt2dLibraries.gmk))
--- EOF ---