1 #
   2 # Copyright (c) 2011, 2014, 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 := $(JDK_OUTPUTDIR)/objs/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/sun/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_API_DIR)/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     LANG := C, \
  55     OPTIMIZATION := HIGHEST, \
  56     CFLAGS := $(CFLAGS_JDKLIB) \
  57         $(BUILD_LIBMLIB_CFLAGS), \
  58     MAPFILE := $(BUILD_LIBMLIB_IMAGE_MAPFILE), \
  59     LDFLAGS := $(LDFLAGS_JDKLIB) \
  60         $(call SET_SHARED_LIBRARY_ORIGIN), \
  61     LDFLAGS_SUFFIX := $(BUILD_LIBMLIB_LDLIBS) \
  62         $(LDFLAGS_JDKLIB_SUFFIX), \
  63     LDFLAGS_SUFFIX_solaris := -lc, \
  64     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
  65     RC_FLAGS := $(RC_FLAGS) \
  66         -D "JDK_FNAME=mlib_image.dll" \
  67         -D "JDK_INTERNAL_NAME=mlib_image" \
  68         -D "JDK_FTYPE=0x2L", \
  69     OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libmlib_image, \
  70     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
  71 
  72 $(BUILD_LIBMLIB_IMAGE): $(BUILD_LIBJAVA)
  73 
  74 DESKTOP_LIBRARIES += $(BUILD_LIBMLIB_IMAGE)
  75 
  76 ################################################################################
  77 
  78 ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
  79 
  80   LIBMLIB_IMAGE_V_SRC := $(JDK_TOPDIR)/src/java.desktop/share/native/libmlib_image \
  81       $(JDK_TOPDIR)/src/java.desktop/unix/native/libmlib_image \
  82       $(JDK_TOPDIR)/src/java.desktop/share/native/common/sun/awt/medialib \
  83       $(JDK_TOPDIR)/src/java.desktop/unix/native/common/sun/awt/medialib \
  84       #
  85   LIBMLIB_IMAGE_V_CFLAGS := $(JDK_TOPDIR)/src/java.desktop/unix/native/libmlib_image/vis_$(OPENJDK_TARGET_CPU_BITS).il \
  86       $(addprefix -I, $(LIBMLIB_IMAGE_V_SRC)) \
  87       #
  88 
  89   BUILD_LIBMLIB_IMAGE_V_EXFILES := \
  90       awt_ImagingLib.c \
  91       mlib_c_ImageAffine_BC.c \
  92       mlib_c_ImageAffine_BC_S16.c \
  93       mlib_c_ImageAffine_BC_U16.c \
  94       mlib_c_ImageAffine_BL.c \
  95       mlib_c_ImageAffine_BL_S16.c \
  96       mlib_c_ImageAffine_BL_U16.c \
  97       mlib_c_ImageAffineIndex_BC.c \
  98       mlib_c_ImageAffineIndex_BL.c \
  99       mlib_c_ImageAffine_NN.c \
 100       mlib_c_ImageBlendTable.c \
 101       mlib_c_ImageConvClearEdge.c \
 102       mlib_c_ImageConvCopyEdge.c \
 103       mlib_c_ImageConv_f.c \
 104       mlib_c_ImageConvVersion.c \
 105       mlib_c_ImageCopy.c \
 106       mlib_c_ImageLookUp.c \
 107       mlib_c_ImageLookUp_f.c \
 108       mlib_v_ImageChannelExtract.c \
 109       mlib_v_ImageChannelExtract_f.c \
 110       mlib_v_ImageChannelInsert_34.c \
 111       mlib_v_ImageChannelInsert.c \
 112       mlib_v_ImageConvIndex3_8_16nw.c \
 113       mlib_v_ImageConvIndex3_8_8nw.c \
 114       mlib_v_ImageCopy.c \
 115       mlib_v_ImageCopy_blk.s \
 116       #
 117 
 118   LIBMLIB_IMAGE_V_CFLAGS += $(filter-out -DMLIB_NO_LIBSUNMATH, $(BUILD_LIBMLIB_CFLAGS))
 119 
 120   $(eval $(call SetupNativeCompilation,BUILD_LIBMLIB_IMAGE_V, \
 121       LIBRARY := mlib_image_v, \
 122       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 123       SRC := $(LIBMLIB_IMAGE_V_SRC), \
 124       LANG := C, \
 125       EXCLUDE_FILES := $(BUILD_LIBMLIB_IMAGE_V_EXFILES), \
 126       OPTIMIZATION := HIGHEST, \
 127       CFLAGS := -xarch=sparcvis \
 128           $(LIBMLIB_IMAGE_V_CFLAGS) \
 129           $(CFLAGS_JDKLIB), \
 130       MAPFILE := $(BUILD_LIBMLIB_IMAGE_MAPFILE), \
 131       LDFLAGS := $(LDFLAGS_JDKLIB) \
 132           $(BUILD_LIBMLIB_LDLIBS) -ljava -ljvm \
 133           $(call SET_SHARED_LIBRARY_ORIGIN), \
 134       LDFLAGS_SUFFIX_solaris := -lc, \
 135       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libmlib_image_v, \
 136       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 137 
 138   $(BUILD_LIBMLIB_IMAGE_V): $(BUILD_LIBJAVA)
 139 
 140   DESKTOP_LIBRARIES += $(BUILD_LIBMLIB_IMAGE_V)
 141 
 142 endif
 143 
 144 ################################################################################
 145 
 146 LIBAWT_DIRS := $(JDK_TOPDIR)/src/java.desktop/share/native/libawt \
 147     $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libawt \
 148     $(JDK_TOPDIR)/src/java.desktop/share/native/common/sun/awt/debug \
 149     $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/common/sun/awt \
 150     #
 151 
 152 ifeq ($(OPENJDK_TARGET_OS), aix)
 153   LIBAWT_DIRS += $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS)/native/libawt
 154 endif
 155 
 156 ifeq ($(OPENJDK_TARGET_OS), windows)
 157   LIBAWT_DIRS += $(JDK_TOPDIR)/src/java.desktop/share/native/common/sun/awt/utility
 158 else
 159   LIBAWT_EXFILES := sun/java2d/ShaderList.c
 160 endif
 161 
 162 ifneq ($(filter $(OPENJDK_TARGET_OS), solaris linux macosx aix), )
 163   LIBAWT_EXFILES += awt_Font.c CUPSfuncs.c fontpath.c X11Color.c
 164 endif
 165 
 166 ifeq ($(OPENJDK_TARGET_OS), macosx)
 167   LIBAWT_EXFILES += initIDs.c sun/awt/image/cvutils/img_colors.c
 168 endif
 169 
 170 LIBAWT_CFLAGS += -I$(JDK_OUTPUTDIR)/gensrc_headers/java.desktop \
 171     $(addprefix -I, $(shell find $(LIBAWT_DIRS) -type d)) \
 172     $(LIBJAVA_HEADER_FLAGS) \
 173     $(addprefix -I, $(BUILD_LIBMLIB_IMAGE_SRC)) \
 174     #
 175 
 176 LIBAWT_CFLAGS += -D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES $(X_CFLAGS)
 177 
 178 ifeq ($(OPENJDK_TARGET_OS), macosx)
 179 endif
 180 
 181 ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
 182   LIBAWT_CFLAGS += -DMLIB_ADD_SUFF
 183   LIBAWT_CFLAGS += -xarch=sparcvis
 184 
 185   LIBAWT_CFLAGS += $(JDK_TOPDIR)/src/java.desktop/unix/native/libmlib_image/vis_$(OPENJDK_TARGET_CPU_BITS).il
 186   LIBAWT_DIRS += $(JDK_TOPDIR)/src/java.desktop/share/native/common/sun/awt/medialib
 187   LIBAWT_EXFILES += sun/java2d/loops/MapAccelFunc.c
 188 
 189   ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
 190     LIBAWT_ASFLAGS = -P -xarch=v9a
 191   else
 192     LIBAWT_ASFLAGS = -P -xarch=v8plusa
 193   endif
 194 else
 195   LIBAWT_EXCLUDES += \
 196       $(JDK_TOPDIR)/src/java.desktop/unix/native/libawt/sun/awt/medialib \
 197       $(JDK_TOPDIR)/src/java.desktop/unix/native/libawt/sun/java2d/loops \
 198       $(JDK_TOPDIR)/src/java.desktop/unix/native/common/sun/awt/medialib \
 199       #
 200 endif
 201 
 202 ifneq ($(OPENJDK_TARGET_OS), solaris)
 203   LIBAWT_CFLAGS += -DMLIB_NO_LIBSUNMATH
 204 endif
 205 
 206 LIBAWT_LANG := C
 207 
 208 ifeq ($(OPENJDK_TARGET_OS), windows)
 209   LIBAWT_DIRS += $(JDK_TOPDIR)/src/java.desktop/share/native/common/sun/font \
 210       $(JDK_TOPDIR)/src/java.desktop/share/native/common/sun/java2d/opengl \
 211   # Why does libawt need java.base headers?
 212   LIBAWT_CFLAGS += -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/sun/font \
 213       -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/sun/java2d/opengl \
 214       -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/common/sun/java2d/opengl \
 215       -I$(JDK_TOPDIR)/src/java.desktop/windows/native/include \
 216       -I$(JDK_TOPDIR)/src/java.desktop/share/native/include \
 217       -I$(JDK_OUTPUTDIR)/gensrc_headers/java.base \
 218       #
 219   LIBAWT_EXFILES += \
 220       sun/java2d/d3d/D3DPipeline.cpp \
 221       sun/java2d/d3d/D3DShaderGen.c \
 222       sun/awt/image/cvutils/img_colors.c \
 223       sun/windows/WBufferStrategy.cpp \
 224       #
 225 
 226   LIBAWT_LANG := C++
 227   LIBAWT_CFLAGS += -EHsc -DUNICODE -D_UNICODE
 228   ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
 229     LIBAWT_CFLAGS += -DMLIB_OS64BIT
 230   endif
 231 
 232   ifdef OPENJDK
 233     LIBAWT_RC_FLAGS := -i "$(JDK_TOPDIR)/src/java.base/windows/native/launcher/icons"
 234   else
 235     LIBAWT_RC_FLAGS := -i "$(JDK_TOPDIR)/src/closed/java.base/windows/native/launcher/icons"
 236   endif
 237   LIBAWT_VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/java.desktop/windows/native/libawt/sun/windows/awt.rc
 238 endif
 239 
 240 ifeq ($(MILESTONE), internal)
 241   LIBAWT_CFLAGS += -DINTERNAL_BUILD
 242 endif
 243 
 244 LIBAWT_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt/mapfile-vers
 245 ifeq ($(OPENJDK_TARGET_OS), linux)
 246   LIBAWT_MAPFILE :=
 247 endif
 248 
 249 $(eval $(call SetupNativeCompilation,BUILD_LIBAWT, \
 250     LIBRARY := awt, \
 251     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 252     SRC := $(LIBAWT_DIRS), \
 253     EXCLUDES := $(LIBAWT_EXCLUDES), \
 254     EXCLUDE_FILES := $(LIBAWT_EXFILES), \
 255     LANG := $(LIBAWT_LANG), \
 256     OPTIMIZATION := LOW, \
 257     CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_CFLAGS), \
 258     ASFLAGS := $(LIBAWT_ASFLAGS), \
 259     MAPFILE := $(LIBAWT_MAPFILE), \
 260     LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN), \
 261     LDFLAGS_SUFFIX_linux := -ljvm $(LIBM) $(LIBDL) -ljava, \
 262     LDFLAGS_SUFFIX_solaris := -ljvm $(LIBM) $(LIBDL) -ljava -lc, \
 263     LDFLAGS_SUFFIX_aix :=-ljvm $(LIBM) $(LIBDL) -ljava -lm,\
 264     LDFLAGS_SUFFIX_macosx := -lmlib_image -ljvm $(LIBM) \
 265         -framework Cocoa \
 266         -framework OpenGL \
 267         -framework JavaNativeFoundation \
 268         -framework JavaRuntimeSupport \
 269         -framework ApplicationServices \
 270         -framework AudioToolbox \
 271         -ljava, \
 272     LDFLAGS_SUFFIX_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         -DELAYLOAD:user32.dll -DELAYLOAD:gdi32.dll \
 277         -DELAYLOAD:shell32.dll -DELAYLOAD:winmm.dll \
 278         -DELAYLOAD:winspool.drv -DELAYLOAD:imm32.dll \
 279         -DELAYLOAD:ole32.dll -DELAYLOAD:comdlg32.dll \
 280         -DELAYLOAD:comctl32.dll -DELAYLOAD:shlwapi.dll, \
 281     VERSIONINFO_RESOURCE := $(LIBAWT_VERSIONINFO_RESOURCE), \
 282     RC_FLAGS := $(RC_FLAGS) $(LIBAWT_RC_FLAGS) \
 283         -D "JDK_FNAME=awt.dll" \
 284         -D "JDK_INTERNAL_NAME=awt" \
 285         -D "JDK_FTYPE=0x2L", \
 286     OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt, \
 287     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 288 
 289 $(BUILD_LIBAWT): $(BUILD_LIBJAVA)
 290 
 291 ifeq ($(OPENJDK_TARGET_OS), macosx)
 292   $(BUILD_LIBAWT): $(BUILD_LIBMLIB_IMAGE)
 293 endif
 294 
 295 DESKTOP_LIBRARIES += $(BUILD_LIBAWT)
 296 
 297 ################################################################################
 298 
 299 ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),)
 300   ifndef BUILD_HEADLESS_ONLY
 301 
 302     LIBAWT_XAWT_DIRS := \
 303         $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libawt_xawt \
 304         $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libjawt \
 305         $(JDK_TOPDIR)/src/java.desktop/share/native/common/sun/awt/debug \
 306         $(JDK_TOPDIR)/src/java.desktop/share/native/common/sun/awt/utility \
 307         $(JDK_TOPDIR)/src/java.desktop/share/native/common/sun/font \
 308         $(JDK_TOPDIR)/src/java.desktop/share/native/common/sun/java2d/opengl \
 309         $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/common/sun/java2d/opengl \
 310         $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/common/sun/java2d/x11 \
 311         $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/common/sun/awt \
 312         #
 313 
 314     LIBAWT_XAWT_EXCLUDES := medialib
 315 
 316     LIBAWT_XAWT_CFLAGS := $(addprefix -I, $(shell $(FIND) $(LIBAWT_XAWT_DIRS) -type d)) \
 317         -I$(JDK_OUTPUTDIR)/gensrc_headers/java.desktop \
 318         -I$(JDK_TOPDIR)/src/java.desktop/share/native/include \
 319         -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS)/native/include \
 320         -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/include \
 321         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/sun/java2d \
 322         -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libawt/sun/java2d \
 323         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/sun/java2d/loops \
 324         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/sun/java2d/pipe \
 325         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/sun/awt/image/cvutils \
 326         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/sun/awt/image \
 327         -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libsunwjdga \
 328         -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/common/sun/font \
 329         $(LIBJAVA_HEADER_FLAGS)
 330         #
 331 
 332     LIBAWT_XAWT_CFLAGS += -DXAWT -DXAWT_HACK \
 333         -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
 334         $(CUPS_CFLAGS)
 335 
 336     ifeq ($(OPENJDK_TARGET_OS), solaris)
 337       LIBAWT_XAWT_CFLAGS += -DFUNCPROTO=15
 338     endif
 339 
 340     ifeq ($(OPENJDK_TARGET_OS), linux)
 341       ifeq ($(DISABLE_XRENDER), true)
 342         LIBAWT_XAWT_CFLAGS += -DDISABLE_XRENDER_BY_DEFAULT=true
 343       endif
 344     endif
 345 
 346     ifeq ($(MILESTONE), internal)
 347       LIBAWT_XAWT_CFLAGS += -DINTERNAL_BUILD
 348     endif
 349 
 350     LIBAWT_XAWT_LDFLAGS_SUFFIX := $(LIBM) -lawt -lXext -lX11 -lXrender $(LIBDL) -lXtst -lXi -ljava -ljvm -lc
 351 
 352     ifeq ($(OPENJDK_TARGET_OS), linux)
 353       # To match old build, add this to LDFLAGS instead of suffix.
 354       LIBAWT_XAWT_LDFLAGS += -lpthread
 355     endif
 356 
 357     $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_XAWT, \
 358         LIBRARY := awt_xawt, \
 359         OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 360         SRC := $(LIBAWT_XAWT_DIRS), \
 361         EXCLUDES := $(LIBAWT_XAWT_EXCLUDES), \
 362         LANG := C, \
 363         OPTIMIZATION := LOW, \
 364         CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_XAWT_CFLAGS) \
 365             $(X_CFLAGS), \
 366         MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_xawt/mapfile-vers, \
 367         LDFLAGS := $(LDFLAGS_JDKLIB) \
 368             $(X_LIBS) $(LIBAWT_XAWT_LDFLAGS) \
 369             $(call SET_SHARED_LIBRARY_ORIGIN) \
 370             $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
 371         LDFLAGS_SUFFIX := $(LIBAWT_XAWT_LDFLAGS_SUFFIX), \
 372         VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 373         RC_FLAGS := $(RC_FLAGS) \
 374             -D "JDK_FNAME=xawt.dll" \
 375             -D "JDK_INTERNAL_NAME=xawt" \
 376             -D "JDK_FTYPE=0x2L", \
 377         OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt_xawt, \
 378         DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 379 
 380     $(BUILD_LIBAWT_XAWT): $(BUILD_LIBJAVA)
 381 
 382     $(BUILD_LIBAWT_XAWT): $(BUILD_LIBAWT)
 383 
 384     DESKTOP_LIBRARIES += $(BUILD_LIBAWT_XAWT)
 385 
 386   endif
 387 endif
 388 
 389 ################################################################################
 390 
 391 LIBLCMS_SRC := $(JDK_TOPDIR)/src/java.desktop/share/native/liblcms
 392 LIBLCMS_CPPFLAGS += -I$(JDK_OUTPUTDIR)/gensrc_headers/java.desktop \
 393     -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/sun/java2d \
 394     -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/sun/awt/debug \
 395     $(LIBJAVA_HEADER_FLAGS) \
 396     #
 397 
 398 ifeq ($(USE_EXTERNAL_LCMS), true)
 399   # If we're using an external library, we'll just need the wrapper part.
 400   # By including it explicitely, all other files will be excluded.
 401   BUILD_LIBLCMS_INCLUDE_FILES := LCMS.c
 402 else
 403   BUILD_LIBLCMS_INCLUDE_FILES :=
 404   # If we're using the bundled library, we'll need to include it in the
 405   # include path explicitly. Otherwise the system headers will be used.
 406   LIBLCMS_CPPFLAGS += $(addprefix -I, $(LIBLCMS_SRC))
 407 endif
 408 
 409 $(eval $(call SetupNativeCompilation,BUILD_LIBLCMS, \
 410     LIBRARY := lcms, \
 411     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 412     SRC := $(LIBLCMS_SRC), \
 413     INCLUDE_FILES := $(BUILD_LIBLCMS_INCLUDE_FILES), \
 414     LANG := C, \
 415     OPTIMIZATION := HIGHEST, \
 416     CFLAGS := $(filter-out -xc99=%none, $(CFLAGS_JDKLIB)) \
 417         $(SHARED_LIBRARY_FLAGS) $(LIBLCMS_CPPFLAGS) \
 418         $(LCMS_CFLAGS), \
 419     CFLAGS_solaris := -xc99=no_lib, \
 420     CFLAGS_windows := -DCMS_IS_WINDOWS_, \
 421     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/liblcms/mapfile-vers, \
 422     LDFLAGS := $(LDFLAGS_JDKLIB) \
 423         $(call SET_SHARED_LIBRARY_ORIGIN), \
 424     LDFLAGS_solaris := /usr/lib$(OPENJDK_TARGET_CPU_ISADIR)/libm.so.2, \
 425     LDFLAGS_windows := $(WIN_AWT_LIB) $(WIN_JAVA_LIB), \
 426     LDFLAGS_SUFFIX_solaris := -lawt -ljava -ljvm -lc $(LCMS_LIBS), \
 427     LDFLAGS_SUFFIX_macosx := $(LIBM) -lawt -ljava -ljvm $(LCMS_LIBS), \
 428     LDFLAGS_SUFFIX_linux := -lm -lawt -ljava -ljvm $(LCMS_LIBS), \
 429     LDFLAGS_SUFFIX_aix := -lm -lawt -ljava -ljvm $(LCMS_LIBS),\
 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 := $(JDK_OUTPUTDIR)/objs/liblcms, \
 436     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 437 
 438 DESKTOP_LIBRARIES += $(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     LANG := C, \
 494     OPTIMIZATION := HIGHEST, \
 495     CFLAGS := $(CFLAGS_JDKLIB) $(addprefix -I, $(LIBJAVAJPEG_SRC)) \
 496         $(LIBJAVA_HEADER_FLAGS) \
 497         -I$(JDK_OUTPUTDIR)/gensrc_headers/java.desktop, \
 498     MAPFILE := $(BUILD_LIBJAVAJPEG_MAPFILE), \
 499     LDFLAGS := $(LDFLAGS_JDKLIB) $(LIBJPEG_LIBS) \
 500         $(call SET_SHARED_LIBRARY_ORIGIN), \
 501     LDFLAGS_windows := $(WIN_JAVA_LIB) jvm.lib, \
 502     LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \
 503     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 504     RC_FLAGS := $(RC_FLAGS) \
 505         -D "JDK_FNAME=javajpeg.dll" \
 506         -D "JDK_INTERNAL_NAME=javajpeg" \
 507         -D "JDK_FTYPE=0x2L", \
 508     REORDER := $(BUILD_LIBJAVAJPEG_REORDER), \
 509     OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjavajpeg, \
 510     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 511 
 512 $(BUILD_LIBJAVAJPEG): $(BUILD_LIBJAVA)
 513 
 514 DESKTOP_LIBRARIES += $(BUILD_LIBJAVAJPEG)
 515 
 516 ################################################################################
 517 
 518 LIBFONTMANAGER_SRC := $(JDK_TOPDIR)/src/java.desktop/share/native/libfontmanager \
 519     $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libfontmanager
 520 LIBFONTMANAGER_CFLAGS := \
 521     $(addprefix -I, $(shell $(FIND) \
 522       $(LIBFONTMANAGER_SRC) \
 523       $(JDK_TOPDIR)/src/java.desktop/share/native/libawt \
 524       $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libawt \
 525       $(JDK_TOPDIR)/src/java.desktop/share/native/common \
 526       $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/common -type d)) \
 527     -I$(JDK_OUTPUTDIR)/gensrc_headers/java.desktop \
 528     $(LIBJAVA_HEADER_FLAGS) \
 529     #
 530 
 531 ifndef OPENJDK
 532   LIBFONTMANAGER_CFLAGS += -I$(JDK_TOPDIR)/src/closed/java.desktop/share/native/libt2k
 533   BUILD_LIBFONTMANAGER_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libfontmanager/mapfile-vers
 534   LIBFONTMANAGER_EXCLUDE_FILES += freetypeScaler.c
 535 else
 536   LIBFONTMANAGER_CFLAGS += $(FREETYPE_CFLAGS)
 537   BUILD_LIBFONTMANAGER_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libfontmanager/mapfile-vers.openjdk
 538   BUILD_LIBFONTMANAGER_FONTLIB := $(FREETYPE_LIBS)
 539 endif
 540 
 541 LIBFONTMANAGER_OPTIMIZATION := HIGH
 542 
 543 ifeq ($(OPENJDK_TARGET_OS), windows)
 544   LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
 545       X11TextRenderer.c
 546   LIBFONTMANAGER_OPTIMIZATION := HIGHEST
 547   LIBFONTMANAGER_CFLAGS += -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libawt/sun/windows
 548 else ifeq ($(OPENJDK_TARGET_OS), macosx)
 549   LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
 550       X11TextRenderer.c \
 551       fontpath.c \
 552       lcdglyph.c
 553 else
 554   LIBFONTMANAGER_EXCLUDE_FILES += fontpath.c \
 555       lcdglyph.c
 556 endif
 557 
 558 LIBFONTMANAGER_CFLAGS += $(FONT_HEADERS) $(X_CFLAGS) -DLE_STANDALONE -DHEADLESS
 559 
 560 # Turn off aliasing with GCC for ExtensionSubtables.cpp
 561 ifeq ($(OPENJDK_TARGET_OS), linux)
 562   BUILD_LIBFONTMANAGER_ExtensionSubtables.cpp_CXXFLAGS := -fno-strict-aliasing
 563 endif
 564 
 565 # Libfontmanager doesn't actually need X_LIBS to link, but if building
 566 # on a Solaris machine without X installed, using a devkit, linking
 567 # to libawt_xawt will fail without the -L parameters from X_LIBS. Filter
 568 # out the -R parameters since they aren't needed.
 569 $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \
 570     LIBRARY := fontmanager, \
 571     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 572     SRC := $(LIBFONTMANAGER_SRC), \
 573     EXCLUDE_FILES := $(LIBFONTMANAGER_EXCLUDE_FILES) \
 574         AccelGlyphCache.c, \
 575     LANG := C++, \
 576     CFLAGS := $(CFLAGS_JDKLIB) $(LIBFONTMANAGER_CFLAGS), \
 577     CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBFONTMANAGER_CFLAGS), \
 578     OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \
 579     CFLAGS_windows = -DCC_NOEX, \
 580     MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \
 581     LDFLAGS := $(subst -Xlinker -z -Xlinker defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \
 582         $(call SET_SHARED_LIBRARY_ORIGIN), \
 583     LDFLAGS_SUFFIX := $(BUILD_LIBFONTMANAGER_FONTLIB), \
 584     LDFLAGS_SUFFIX_linux := -lawt $(LIBM) $(LIBCXX) -ljava -ljvm -lc, \
 585     LDFLAGS_SUFFIX_solaris := $(filter-out -R%, $(X_LIBS)) \
 586         -lawt -lawt_xawt -lc $(LIBM) $(LIBCXX) -ljava -ljvm, \
 587     LDFLAGS_SUFFIX_aix := -lawt -lawt_xawt $(LIBM) $(LIBCXX) -ljava -ljvm,\
 588     LDFLAGS_SUFFIX_macosx := -lawt $(LIBM) $(LIBCXX) -undefined dynamic_lookup \
 589         -ljava -ljvm, \
 590     LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib gdi32.lib \
 591         $(WIN_AWT_LIB), \
 592     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 593     RC_FLAGS := $(RC_FLAGS) \
 594         -D "JDK_FNAME=fontmanager.dll" \
 595         -D "JDK_INTERNAL_NAME=fontmanager" \
 596         -D "JDK_FTYPE=0x2L", \
 597     OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libfontmanager, \
 598     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 599 
 600 $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT)
 601 
 602 ifneq (, $(findstring $(OPENJDK_TARGET_OS), solaris aix))
 603   $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT_XAWT)
 604 endif
 605 
 606 DESKTOP_LIBRARIES += $(BUILD_LIBFONTMANAGER)
 607 
 608 ################################################################################
 609 
 610 ifeq ($(OPENJDK_TARGET_OS), windows)
 611   LIBJAWT_SRC := $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libjawt
 612   LIBJAWT_CFLAGS := -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libawt/sun/windows \
 613       -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/sun/awt/debug \
 614       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/sun/java2d \
 615       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/sun/awt/image/cvutils \
 616       -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libawt/sun/java2d/windows \
 617       -I$(JDK_OUTPUTDIR)/gensrc_headers/java.desktop \
 618       -I$(JDK_TOPDIR)/src/java.desktop/windows/native/include \
 619       -I$(JDK_TOPDIR)/src/java.desktop/share/native/include \
 620       $(LIBJAVA_HEADER_FLAGS) \
 621       #
 622 
 623   ifeq ($(OPENJDK_TARGET_CPU), x86)
 624     KERNEL32_LIB := kernel32.lib
 625   endif
 626   $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT, \
 627       LIBRARY := jawt, \
 628       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 629       SRC := $(LIBJAWT_SRC), \
 630       INCLUDE_FILES := $(LIBJAWT_INCLUDE_FILES), \
 631       LANG := C++, \
 632       OPTIMIZATION := LOW, \
 633       CFLAGS := $(CXXFLAGS_JDKLIB) \
 634           -EHsc -DUNICODE -D_UNICODE \
 635           $(LIBJAWT_CFLAGS), \
 636       LDFLAGS := $(LDFLAGS_JDKLIB) $(KERNEL32_LIB) $(LDFLAGS_CXX_JDK) \
 637           advapi32.lib $(WIN_AWT_LIB), \
 638       LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \
 639       VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 640       RC_FLAGS := $(RC_FLAGS) \
 641           -D "JDK_FNAME=jawt.dll" \
 642           -D "JDK_INTERNAL_NAME=jawt" \
 643           -D "JDK_FTYPE=0x2L", \
 644       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjawt, \
 645       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 646 
 647   $(BUILD_LIBJAWT): $(BUILD_LIBAWT)
 648 
 649   $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX): $(BUILD_LIBJAWT)
 650         $(ECHO) Copying $(@F)
 651         $(CP) $(JDK_OUTPUTDIR)/objs/libjawt/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX) $@
 652 
 653   DESKTOP_LIBRARIES += $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
 654 
 655 else # OPENJDK_TARGET_OS not windows
 656 
 657   ifeq ($(OPENJDK_TARGET_OS), macosx)
 658     LIBJAWT_SRC := $(JDK_TOPDIR)/src/java.desktop/macosx/native/libjawt
 659   else
 660     LIBJAWT_SRC := $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libjawt
 661   endif
 662   LIBJAWT_CFLAGS := \
 663       -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/common/sun/awt \
 664       -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS)/native/include \
 665       -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/include \
 666       -I$(JDK_TOPDIR)/src/java.desktop/share/native/include \
 667       $(LIBJAVA_HEADER_FLAGS) \
 668       #
 669 
 670   ifeq ($(OPENJDK_TARGET_OS), macosx)
 671     JAWT_LIBS := -lawt_lwawt
 672   else
 673     JAWT_LIBS :=
 674     ifneq ($(OPENJDK_TARGET_OS), solaris)
 675       JAWT_LIBS += -lawt
 676     endif
 677     ifndef BUILD_HEADLESS_ONLY
 678       JAWT_LIBS += -lawt_xawt
 679     else
 680       JAWT_LIBS += -lawt_headless
 681       HEADLESS_CFLAG += -DHEADLESS
 682     endif
 683   endif
 684 
 685   $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT, \
 686       LIBRARY := jawt, \
 687       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 688       SRC := $(LIBJAWT_SRC), \
 689       INCLUDE_FILES := $(JAWT_FILES), \
 690       LANG := C, \
 691       OPTIMIZATION := LOW, \
 692       CFLAGS := $(CFLAGS_JDKLIB) \
 693           $(LIBJAWT_CFLAGS), \
 694       CFLAGS_linux := $(HEADLESS_CFLAG), \
 695       CFLAGS_macosx := $(LIBJAWT_CFLAGS_macosx), \
 696       MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjawt/mapfile-vers, \
 697       LDFLAGS := $(LDFLAGS_JDKLIB) \
 698           $(call SET_SHARED_LIBRARY_ORIGIN), \
 699       LDFLAGS_solaris := $(X_LIBS), \
 700       LDFLAGS_SUFFIX_linux := $(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX), \
 701       LDFLAGS_SUFFIX_aix := $(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX),\
 702       LDFLAGS_SUFFIX_solaris := $(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX) -lXrender, \
 703       LDFLAGS_SUFFIX_macosx := -Xlinker -rpath -Xlinker @loader_path $(JAWT_LIBS) \
 704           -framework Cocoa $(LDFLAGS_JDKLIB_SUFFIX), \
 705       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjawt, \
 706       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 707 
 708   ifndef BUILD_HEADLESS_ONLY
 709     $(BUILD_LIBJAWT): $(BUILD_LIBAWT_XAWT)
 710   else
 711     $(BUILD_LIBJAWT): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_headless$(SHARED_LIBRARY_SUFFIX)
 712   endif
 713 
 714   ifeq ($(OPENJDK_TARGET_OS), macosx)
 715     $(BUILD_LIBJAWT): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_lwawt$(SHARED_LIBRARY_SUFFIX)
 716   endif
 717 
 718 endif # OPENJDK_TARGET_OS
 719 
 720 DESKTOP_LIBRARIES += $(BUILD_LIBJAWT)
 721 
 722 ################################################################################
 723 
 724 ifeq ($(BUILD_HEADLESS), true)
 725   # Mac and Windows only use the native AWT lib, do not build libawt_headless
 726   ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx),)
 727 
 728     LIBAWT_HEADLESS_DIRS := $(JDK_TOPDIR)/src/java.desktop/unix/native/libawt_headless/sun/awt \
 729         $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/common/sun/awt \
 730         $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/common/sun/java2d/opengl \
 731         $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/common/sun/java2d/x11 \
 732         $(JDK_TOPDIR)/src/java.desktop/share/native/common/sun/java2d/opengl \
 733         $(JDK_TOPDIR)/src/java.desktop/share/native/common/sun/font \
 734         #
 735 
 736     LIBAWT_HEADLESS_EXCLUDES := medialib
 737     LIBAWT_HEADLESS_CFLAGS := -I$(JDK_OUTPUTDIR)/gensrc_headers/java.desktop \
 738         $(addprefix -I, $(LIBAWT_HEADLESS_DIRS)) \
 739         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/sun/java2d \
 740         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/sun/java2d/loops \
 741         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/sun/awt/image/cvutils \
 742         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/sun/java2d/pipe \
 743         -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/sun/awt/image \
 744         -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libawt/sun/java2d \
 745         -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/sun/font \
 746         -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/sun/awt/debug \
 747         -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/common/sun/font \
 748         -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libsunwjdga/ \
 749         $(LIBJAVA_HEADER_FLAGS) \
 750         #
 751     LIBAWT_HEADLESS_EXFILES := initIDs.c
 752 
 753     LIBAWT_HEADLESS_REORDER :=
 754     ifeq ($(OPENJDK_TARGET_OS), solaris)
 755       ifneq ($(OPENJDK_TARGET_CPU), x86_64)
 756         LIBAWT_HEADLESS_REORDER := $(JDK_TOPDIR)/make/mapfiles/libawt_headless/reorder-$(OPENJDK_TARGET_CPU)
 757       endif
 758     endif
 759 
 760     $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_HEADLESS, \
 761         LIBRARY := awt_headless, \
 762         OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 763         SRC := $(LIBAWT_HEADLESS_DIRS), \
 764         EXCLUDE_FILES := $(LIBAWT_HEADLESS_EXFILES), \
 765         EXCLUDES := $(LIBAWT_HEADLESS_EXCLUDES), \
 766         LANG := C, \
 767         OPTIMIZATION := LOW, \
 768         CFLAGS := $(CFLAGS_JDKLIB) \
 769             -DHEADLESS=true \
 770             -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
 771             $(CUPS_CFLAGS) \
 772             $(X_CFLAGS) \
 773             $(LIBAWT_HEADLESS_CFLAGS), \
 774         MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_headless/mapfile-vers, \
 775         LDFLAGS := $(LDFLAGS_JDKLIB) \
 776             $(call SET_SHARED_LIBRARY_ORIGIN), \
 777         LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
 778         LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
 779         LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN)., \
 780         REORDER := $(LIBAWT_HEADLESS_REORDER), \
 781         LDFLAGS_SUFFIX_linux := -ljvm -lawt -lm $(LIBDL) -ljava, \
 782         LDFLAGS_SUFFIX_aix := -ljvm -lawt -ljava,\
 783         LDFLAGS_SUFFIX_solaris := $(LIBDL) -ljvm -lawt -lm -ljava $(LIBCXX) -lc, \
 784         OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt_headless, \
 785         DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 786 
 787     $(BUILD_LIBAWT_HEADLESS): $(BUILD_LIBAWT)
 788 
 789     DESKTOP_LIBRARIES += $(BUILD_LIBAWT_HEADLESS)
 790 
 791   endif
 792 endif
 793 
 794 ################################################################################
 795 
 796 ifndef BUILD_HEADLESS_ONLY
 797 
 798   LIBSPLASHSCREEN_DIRS := \
 799       $(JDK_TOPDIR)/src/java.desktop/share/native/libjavajpeg \
 800       $(JDK_TOPDIR)/src/java.desktop/share/native/libsplashscreen \
 801       #
 802 
 803   ifeq ($(USE_EXTERNAL_LIBGIF), true)
 804     GIFLIB_LDFLAGS := -lgif
 805     LIBSPLASHSCREEN_EXCLUDES := giflib
 806   else
 807     LIBSPLASHSCREEN_CFLAGS += -I$(JDK_TOPDIR)/src/java.desktop/share/native/libsplashscreen/giflib
 808   endif
 809 
 810   ifeq ($(USE_EXTERNAL_LIBJPEG), true)
 811     LIBJPEG_LDFLAGS := -ljpeg
 812   else
 813     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.desktop/share/native/libjavajpeg
 814     LIBJPEG_CFLAGS := -I$(JDK_TOPDIR)/src/java.desktop/share/native/libjavajpeg
 815   endif
 816 
 817   ifeq ($(USE_EXTERNAL_LIBPNG), false)
 818     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.desktop/share/native/libsplashscreen/libpng
 819   else
 820     LIBSPLASHSCREEN_EXCLUDES += libpng
 821   endif
 822 
 823   ifneq ($(OPENJDK_TARGET_OS), macosx)
 824     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_API_DIR)/native/libsplashscreen
 825   else
 826     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.desktop/macosx/native/libsplashscreen
 827   endif
 828 
 829   LIBSPLASHSCREEN_CFLAGS += -DSPLASHSCREEN -DPNG_NO_MMX_CODE \
 830       $(addprefix -I, $(LIBSPLASHSCREEN_DIRS)) \
 831       $(LIBJAVA_HEADER_FLAGS) \
 832       #
 833 
 834   ifeq ($(OPENJDK_TARGET_OS), macosx)
 835     LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX
 836     LIBSPLASHSCREEN_CFLAGS += -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libosxapp
 837 
 838     BUILD_LIBSPLASHSCREEN_java_awt_SplashScreen.c_CFLAGS := -x objective-c -O0
 839     BUILD_LIBSPLASHSCREEN_splashscreen_gfx_impl.c_CFLAGS := -x objective-c -O0
 840     BUILD_LIBSPLASHSCREEN_splashscreen_gif.c_CFLAGS := -x objective-c -O0
 841     BUILD_LIBSPLASHSCREEN_splashscreen_impl.c_CFLAGS := -x objective-c -O0
 842     BUILD_LIBSPLASHSCREEN_splashscreen_jpeg.c_CFLAGS := -x objective-c -O0
 843     BUILD_LIBSPLASHSCREEN_splashscreen_png.c_CFLAGS := -x objective-c -O0
 844     BUILD_LIBSPLASHSCREEN_splashscreen_sys.m_CFLAGS := -O0
 845 
 846   else ifeq ($(OPENJDK_TARGET_OS), windows)
 847     LIBSPLASHSCREEN_CFLAGS += -DWITH_WIN32
 848   else
 849     LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 $(X_CFLAGS)
 850   endif
 851 
 852   LIBSPLASHSCREEN_LDFLAGS_SUFFIX :=
 853 
 854   ifneq ($(USE_EXTERNAL_LIBZ), true)
 855     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib-1.2.8
 856     LIBSPLASHSCREEN_CFLAGS += $(ZLIB_CPPFLAGS)
 857   endif
 858 
 859   ifeq ($(OPENJDK_TARGET_OS), macosx)
 860     LIBSPLASHSCREEN_LDFLAGS_SUFFIX += $(LIBM) -lpthread -liconv -losxapp \
 861         -framework ApplicationServices \
 862         -framework Foundation \
 863         -framework Cocoa \
 864         -framework JavaNativeFoundation
 865   else ifeq ($(OPENJDK_TARGET_OS), windows)
 866     LIBSPLASHSCREEN_LDFLAGS_SUFFIX += kernel32.lib user32.lib gdi32.lib delayimp.lib -DELAYLOAD:user32.dll
 867   else
 868     LIBSPLASHSCREEN_LDFLAGS_SUFFIX += $(X_LIBS) -lX11 -lXext $(LIBM) -lpthread
 869   endif
 870 
 871   $(eval $(call SetupNativeCompilation,BUILD_LIBSPLASHSCREEN, \
 872       LIBRARY := splashscreen, \
 873       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 874       SRC := $(LIBSPLASHSCREEN_DIRS), \
 875       EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
 876       EXCLUDES := $(LIBSPLASHSCREEN_EXCLUDES), \
 877       LANG := C, \
 878       OPTIMIZATION := LOW, \
 879       CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) \
 880                 $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS), \
 881       MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libsplashscreen/mapfile-vers, \
 882       LDFLAGS := $(LDFLAGS_JDKLIB) \
 883           $(call SET_SHARED_LIBRARY_ORIGIN), \
 884       LDFLAGS_SUFFIX := $(LIBSPLASHSCREEN_LDFLAGS_SUFFIX) $(LIBZ) \
 885                         $(GIFLIB_LDFLAGS) $(LIBJPEG_LDFLAGS) $(PNG_LIBS), \
 886       LDFLAGS_SUFFIX_solaris := -lc, \
 887       VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 888       RC_FLAGS := $(RC_FLAGS) \
 889           -D "JDK_FNAME=splashscreen.dll" \
 890           -D "JDK_INTERNAL_NAME=splashscreen" \
 891           -D "JDK_FTYPE=0x2L", \
 892       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libsplashscreen, \
 893       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 894 
 895   DESKTOP_LIBRARIES += $(BUILD_LIBSPLASHSCREEN)
 896 
 897   ifeq ($(OPENJDK_TARGET_OS), macosx)
 898     $(BUILD_LIBSPLASHSCREEN): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)osxapp$(SHARED_LIBRARY_SUFFIX)
 899   endif
 900 
 901 endif
 902 
 903 ################################################################################
 904 
 905 ifeq ($(OPENJDK_TARGET_OS), macosx)
 906 
 907   LIBAWT_LWAWT_DIRS := \
 908       $(JDK_TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt \
 909       $(JDK_TOPDIR)/src/java.desktop/unix/native/common/sun/awt \
 910       $(JDK_TOPDIR)/src/java.desktop/share/native/common/sun/font \
 911       $(JDK_TOPDIR)/src/java.desktop/share/native/common/sun/java2d/opengl \
 912       #
 913 
 914   LIBAWT_LWAWT_CFLAGS := \
 915       $(addprefix -I, $(LIBAWT_LWAWT_DIRS)) \
 916       -I$(JDK_OUTPUTDIR)/gensrc_headers/java.desktop \
 917       -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/include \
 918       -I$(JDK_TOPDIR)/src/java.desktop/share/native/include \
 919       -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/sun/java2d/opengl \
 920       -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/sun/awt \
 921       -I$(JDK_TOPDIR)/src/java.desktop/unix/native/libawt_xawt/sun/awt \
 922       -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/sun/font \
 923       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/sun/awt/image \
 924       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/sun/java2d \
 925       -I$(JDK_TOPDIR)/src/java.desktop/unix/native/libawt/sun/java2d \
 926       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libmlib_image/ \
 927       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/sun/awt/image/cvutils \
 928       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/sun/java2d/loops \
 929       -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/sun/java2d/pipe \
 930       -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/sun/awt/debug \
 931       -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libosxapp \
 932       $(LIBJAVA_HEADER_FLAGS) \
 933       #
 934 
 935   LIBAWT_LWAWT_EXFILES := fontpath.c awt_Font.c X11Color.c initIDs.c
 936   LIBAWT_LWAWT_EXCLUDES := $(JDK_TOPDIR)/src/java.desktop/unix/native/common/sun/awt/medialib
 937 
 938   $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_LWAWT, \
 939       LIBRARY := awt_lwawt, \
 940       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 941       SRC := $(LIBAWT_LWAWT_DIRS), \
 942       LANG := C, \
 943       INCLUDE_FILES := $(LIBAWT_LWAWT_FILES), \
 944       EXCLUDE_FILES := $(LIBAWT_LWAWT_EXFILES), \
 945       EXCLUDES := $(LIBAWT_LWAWT_EXCLUDES), \
 946       OPTIMIZATION := LOW, \
 947       CFLAGS := $(CFLAGS_JDKLIB) \
 948           $(X_CFLAGS) \
 949           $(X_LIBS) \
 950           $(LIBAWT_LWAWT_CFLAGS), \
 951       LDFLAGS := $(LDFLAGS_JDKLIB) \
 952           $(call SET_SHARED_LIBRARY_ORIGIN), \
 953       LDFLAGS_SUFFIX_macosx := -lawt -lmlib_image -losxapp -ljvm $(LIBM) \
 954           -framework Accelerate \
 955           -framework ApplicationServices \
 956           -framework AudioToolbox \
 957           -framework Carbon \
 958           -framework Cocoa \
 959           -framework Security \
 960           -framework ExceptionHandling \
 961           -framework JavaNativeFoundation \
 962           -framework JavaRuntimeSupport \
 963           -framework OpenGL \
 964           -framework QuartzCore -ljava, \
 965       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt_lwawt, \
 966       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 967 
 968   DESKTOP_LIBRARIES += $(BUILD_LIBAWT_LWAWT)
 969 
 970   $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBAWT)
 971 
 972   $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBMLIB_IMAGE)
 973 
 974   $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBOSXAPP)
 975 
 976   $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBJAVA)
 977 
 978 endif
 979 
 980 ################################################################################
 981 
 982 ifeq ($(OPENJDK_TARGET_OS), macosx)
 983 
 984   $(eval $(call SetupNativeCompilation,BUILD_LIBOSXUI, \
 985       LIBRARY := osxui, \
 986       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 987       SRC := $(JDK_TOPDIR)/src/java.desktop/macosx/native/libosxui, \
 988       LANG := C, \
 989       OPTIMIZATION := LOW, \
 990       CFLAGS := $(CFLAGS_JDKLIB) \
 991           -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libosxui \
 992           -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/sun/awt \
 993           -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libosxapp \
 994           -I$(JDK_TOPDIR)/src/java.base/share/native/libjava \
 995           -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_API_DIR)/native/libjava \
 996           -I$(JDK_OUTPUTDIR)/gensrc_headers/java.desktop,  \
 997       LDFLAGS := $(LDFLAGS_JDKLIB) \
 998           $(call SET_SHARED_LIBRARY_ORIGIN) \
 999           -Xlinker -rpath -Xlinker @loader_path, \
1000       LDFLAGS_SUFFIX_macosx := -lawt -losxapp -lawt_lwawt \
1001           -framework Cocoa \
1002           -framework Carbon \
1003           -framework ApplicationServices \
1004           -framework JavaNativeFoundation \
1005           -framework JavaRuntimeSupport \
1006           -ljava -ljvm, \
1007       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libosxui, \
1008       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
1009 
1010   DESKTOP_LIBRARIES += $(BUILD_LIBOSXUI)
1011 
1012   $(BUILD_LIBOSXUI): $(BUILD_LIBAWT)
1013 
1014   $(BUILD_LIBOSXUI): $(BUILD_LIBOSXAPP)
1015 
1016   $(BUILD_LIBOSXUI): $(BUILD_LIBAWT_LWAWT)
1017 
1018   #$(BUILD_LIBOSXUI): $(BUILD_LIBJAVA)
1019 
1020 endif
1021 
1022 ################################################################################
1023 
1024 # Hook to include the corresponding custom file, if present.
1025 $(eval $(call IncludeCustomExtension, jdk, lib/Awt2dLibraries.gmk))