1 #
   2 # Copyright (c) 2011, 2013, 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 # Openwin is defined on Solaris.
  27 OPENWIN_LIB := $(OPENWIN_HOME)/lib
  28 
  29 WIN_AWT_LIB := $(JDK_OUTPUTDIR)/objs/libawt/awt.lib
  30 
  31 ##########################################################################################
  32 
  33 BUILD_LIBMLIB_SRC := $(JDK_TOPDIR)/src/share/native/sun/awt/medialib
  34 BUILD_LIBMLIB_CFLAGS := -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES \
  35     -I$(BUILD_LIBMLIB_SRC) \
  36     -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt/medialib
  37 
  38 BUILD_LIBMLIB_LDLIBS :=
  39 BUILD_LIBMLIB_IMAGE_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libmlib_image/mapfile-vers
  40 
  41 BUILD_LIBMLIB_CFLAGS += -DMLIB_NO_LIBSUNMATH
  42 
  43 ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
  44   BUILD_LIBMLIB_CFLAGS += -DMLIB_OS64BIT
  45 endif
  46 
  47 ifneq ($(OPENJDK_TARGET_OS), windows)
  48   BUILD_LIBMLIB_LDLIBS += $(LIBM) $(LIBDL)
  49 endif
  50 
  51 $(eval $(call SetupNativeCompilation,BUILD_LIBMLIB_IMAGE, \
  52     LIBRARY := mlib_image, \
  53     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
  54     SRC := $(BUILD_LIBMLIB_SRC), \
  55     EXCLUDE_FILES := awt_ImagingLib.c mlib_c_ImageBlendTable.c, \
  56     LANG := C, \
  57     OPTIMIZATION := HIGHEST, \
  58     CFLAGS := $(CFLAGS_JDKLIB) \
  59         $(BUILD_LIBMLIB_CFLAGS), \
  60     MAPFILE := $(BUILD_LIBMLIB_IMAGE_MAPFILE), \
  61     LDFLAGS := $(LDFLAGS_JDKLIB) \
  62         $(call SET_SHARED_LIBRARY_ORIGIN), \
  63     LDFLAGS_SUFFIX := $(BUILD_LIBMLIB_LDLIBS) \
  64         $(LDFLAGS_JDKLIB_SUFFIX), \
  65     LDFLAGS_SUFFIX_solaris := -lc, \
  66     VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
  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 := $(JDK_OUTPUTDIR)/objs/libmlib_image, \
  72     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
  73 
  74 $(BUILD_LIBMLIB_IMAGE): $(BUILD_LIBJAVA)
  75 
  76 BUILD_LIBRARIES += $(BUILD_LIBMLIB_IMAGE)
  77 
  78 ##########################################################################################
  79 
  80 ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
  81 
  82   BUILD_LIBMLIB_IMAGE_V_FILES := \
  83       mlib_v_ImageLookUp.c \
  84       mlib_ImageCreate.c \
  85       mlib_ImageAffine.c \
  86       mlib_ImageConvMxN.c \
  87       mlib_ImageConvKernelConvert.c \
  88       mlib_sys.c \
  89       mlib_ImageLookUp_64.c \
  90       mlib_ImageLookUp_Bit.c \
  91       mlib_ImageColorTrue2Index.c \
  92       mlib_c_ImageThresh1_U8.c \
  93       mlib_v_ImageLookUpS16S16Func.c \
  94       mlib_v_ImageLookUpS16S32Func.c \
  95       mlib_v_ImageLookUpS16U16Func.c \
  96       mlib_v_ImageLookUpS16U8Func.c \
  97       mlib_v_ImageLookUpS32S16Func.c \
  98       mlib_v_ImageLookUpS32S32Func.c \
  99       mlib_v_ImageLookUpS32U16Func.c \
 100       mlib_v_ImageLookUpS32U8Func.c \
 101       mlib_v_ImageLookUpSIS16S16Func.c \
 102       mlib_v_ImageLookUpSIS16S32Func.c \
 103       mlib_v_ImageLookUpSIS16U16Func.c \
 104       mlib_v_ImageLookUpSIS16U8Func.c \
 105       mlib_v_ImageLookUpSIS32S16Func.c \
 106       mlib_v_ImageLookUpSIS32S32Func.c \
 107       mlib_v_ImageLookUpSIS32U16Func.c \
 108       mlib_v_ImageLookUpSIS32U8Func.c \
 109       mlib_v_ImageLookUpSIU16S16Func.c \
 110       mlib_v_ImageLookUpSIU16S32Func.c \
 111       mlib_v_ImageLookUpSIU16U16Func.c \
 112       mlib_v_ImageLookUpSIU16U8Func.c \
 113       mlib_v_ImageLookUpSIU8S16Func.c \
 114       mlib_v_ImageLookUpSIU8S32Func.c \
 115       mlib_v_ImageLookUpSIU8U16Func.c \
 116       mlib_v_ImageLookUpSIU8U8Func.c \
 117       mlib_v_ImageLookUpU16S16Func.c \
 118       mlib_v_ImageLookUpU16S32Func.c \
 119       mlib_v_ImageLookUpU16U16Func.c \
 120       mlib_v_ImageLookUpU16U8Func.c \
 121       mlib_v_ImageLookUpU8S16Func.c \
 122       mlib_v_ImageLookUpU8S32Func.c \
 123       mlib_v_ImageLookUpU8U16Func.c \
 124       mlib_v_ImageLookUpU8U8Func.c \
 125       mlib_v_ImageAffineIndex_BC.c \
 126       mlib_v_ImageAffine_BC.c \
 127       mlib_v_ImageAffine_BC_S16.c \
 128       mlib_v_ImageAffine_BC_U16.c \
 129       mlib_v_ImageAffine_BL.c \
 130       mlib_v_ImageAffine_BL_S16.c \
 131       mlib_v_ImageAffine_BL_U16.c \
 132       mlib_v_ImageAffine_NN.c \
 133       mlib_v_ImageFilters.c \
 134       mlib_ImageAffineEdge.c \
 135       mlib_ImageAffine_BC_D64.c \
 136       mlib_ImageAffine_BC_F32.c \
 137       mlib_ImageAffine_BC_S32.c \
 138       mlib_ImageAffine_BL_D64.c \
 139       mlib_ImageAffine_BL_F32.c \
 140       mlib_ImageAffine_BL_S32.c \
 141       mlib_ImageAffine_NN.c \
 142       mlib_ImageAffine_NN_Bit.c \
 143       mlib_ImageFilters.c \
 144       mlib_ImageScanPoly.c \
 145       mlib_ImageConv_8nw.c \
 146       mlib_ImageConv_8ext.c \
 147       mlib_ImageConv_16nw.c \
 148       mlib_ImageConv_16ext.c \
 149       mlib_ImageConv_u16nw.c \
 150       mlib_ImageConv_u16ext.c \
 151       mlib_ImageConv_32nw.c \
 152       mlib_ImageConv_F32nw.c \
 153       mlib_ImageConvMxN_Fp.c \
 154       mlib_ImageConvMxN_ext.c \
 155       mlib_ImageConv_D64nw.c \
 156       mlib_ImageClipping.c \
 157       mlib_ImageConvCopyEdge_Bit.c \
 158       mlib_ImageConvClearEdge_Bit.c \
 159       mlib_ImageConv2x2_f.c \
 160       mlib_ImageConvClearEdge_Fp.c \
 161       mlib_v_ImageConvMxN_8.c \
 162       mlib_v_ImageConvClearEdge.c \
 163       mlib_v_ImageConvCopyEdge.c \
 164       mlib_v_ImageConvMxN_8ext.c \
 165       mlib_v_ImageConvVersion.c \
 166       mlib_v_ImageConv_8nw.c \
 167       mlib_ImageConvCopyEdge_Fp.c \
 168       mlib_v_ImageChannelInsert_1.c \
 169       mlib_v_ImageChannelExtract_43.c \
 170       mlib_v_ImageChannelExtract_1.c \
 171       mlib_ImageCopy_Bit.c \
 172       mlib_v_ImageCopy_f.c \
 173       mlib_ImageUtils.c \
 174       mlib_ImageDivTables.c
 175 
 176   BUILD_LIBMLIB_V_CFLAGS := $(filter-out -DMLIB_NO_LIBSUNMATH, $(BUILD_LIBMLIB_CFLAGS))
 177 
 178   $(eval $(call SetupNativeCompilation,BUILD_LIBMLIB_IMAGE_V, \
 179       LIBRARY := mlib_image_v, \
 180       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 181       SRC := $(JDK_TOPDIR)/src/share/native/sun/awt/medialib \
 182           $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib, \
 183       LANG := C, \
 184       INCLUDE_FILES := $(BUILD_LIBMLIB_IMAGE_V_FILES), \
 185       OPTIMIZATION := HIGHEST, \
 186       CFLAGS := -xarch=sparcvis \
 187           $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib/vis_$(OPENJDK_TARGET_CPU_BITS).il \
 188           $(BUILD_LIBMLIB_V_CFLAGS) \
 189           $(CFLAGS_JDKLIB), \
 190       MAPFILE := $(BUILD_LIBMLIB_IMAGE_MAPFILE), \
 191       LDFLAGS := $(LDFLAGS_JDKLIB) \
 192           $(BUILD_LIBMLIB_LDLIBS) -ljava -ljvm \
 193           $(call SET_SHARED_LIBRARY_ORIGIN), \
 194       LDFLAGS_SUFFIX_solaris := -lc, \
 195       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libmlib_image_v, \
 196       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 197 
 198   $(BUILD_LIBMLIB_IMAGE_V): $(BUILD_LIBJAVA)
 199 
 200   BUILD_LIBRARIES += $(BUILD_LIBMLIB_IMAGE_V)
 201 
 202 endif
 203 
 204 ##########################################################################################
 205 
 206 LIBAWT_DIRS := \
 207     $(JDK_TOPDIR)/src/share/native/sun/awt \
 208     $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \
 209     $(JDK_TOPDIR)/src/share/native/sun/awt/image \
 210     $(JDK_TOPDIR)/src/share/native/sun/awt/image/gif \
 211     $(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
 212     $(JDK_TOPDIR)/src/share/native/sun/awt/medialib \
 213     $(JDK_TOPDIR)/src/share/native/sun/awt/debug \
 214     $(JDK_TOPDIR)/src/share/native/sun/awt/utility \
 215     $(JDK_TOPDIR)/src/share/native/sun/java2d \
 216     $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
 217     $(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
 218     $(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
 219     $(JDK_TOPDIR)/src/share/native/sun/awt/image \
 220     $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
 221     $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/opengl \
 222     $(JDK_TOPDIR)/src/share/native/sun/font
 223 
 224 ifeq ($(OPENJDK_TARGET_OS), windows)
 225   LIBAWT_DIRS += \
 226       $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \
 227       $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/windows \
 228       $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/d3d
 229 else ifneq ($(OPENJDK_TARGET_OS), macosx)
 230   LIBAWT_DIRS += \
 231       $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/x11
 232 endif
 233 
 234 ifeq ($(OPENJDK_TARGET_OS), aix)
 235   LIBAWT_DIRS += $(JDK_TOPDIR)/src/aix/porting
 236 endif
 237 
 238 LIBAWT_CFLAGS += -D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES \
 239     $(X_CFLAGS) \
 240     $(foreach dir, $(LIBAWT_DIRS), -I$(dir))
 241 
 242 LIBAWT_FILES := \
 243     gifdecoder.c \
 244     imageInitIDs.c \
 245     img_globals.c \
 246     SurfaceData.c \
 247     Region.c \
 248     BufImgSurfaceData.c \
 249     Disposer.c \
 250     Trace.c \
 251     GraphicsPrimitiveMgr.c \
 252     Blit.c \
 253     BlitBg.c \
 254     ScaledBlit.c \
 255     FillRect.c \
 256     FillSpans.c \
 257     FillParallelogram.c \
 258     DrawParallelogram.c \
 259     DrawLine.c \
 260     DrawRect.c \
 261     DrawPolygons.c \
 262     DrawPath.c \
 263     FillPath.c \
 264     ProcessPath.c \
 265     MaskBlit.c \
 266     MaskFill.c \
 267     TransformHelper.c \
 268     AlphaMath.c \
 269     AlphaMacros.c \
 270     AnyByte.c \
 271     ByteBinary1Bit.c \
 272     ByteBinary2Bit.c \
 273     ByteBinary4Bit.c \
 274     ByteIndexed.c \
 275     ByteGray.c \
 276     Index8Gray.c \
 277     Index12Gray.c \
 278     AnyShort.c \
 279     Ushort555Rgb.c \
 280     Ushort565Rgb.c \
 281     Ushort4444Argb.c \
 282     Ushort555Rgbx.c \
 283     UshortGray.c \
 284     UshortIndexed.c \
 285     Any3Byte.c \
 286     ThreeByteBgr.c \
 287     AnyInt.c \
 288     IntArgb.c \
 289     IntArgbPre.c \
 290     IntArgbBm.c \
 291     IntRgb.c \
 292     IntBgr.c \
 293     IntRgbx.c \
 294     Any4Byte.c \
 295     FourByteAbgr.c \
 296     FourByteAbgrPre.c \
 297     BufferedMaskBlit.c \
 298     BufferedRenderPipe.c \
 299     ShapeSpanIterator.c \
 300     SpanClipRenderer.c \
 301     awt_ImageRep.c \
 302     awt_ImagingLib.c \
 303     awt_Mlib.c \
 304     awt_parseImage.c \
 305     DataBufferNative.c \
 306     dither.c \
 307     debug_assert.c \
 308     debug_mem.c \
 309     debug_trace.c \
 310     debug_util.c
 311 
 312 ifneq (, $(filter $(OPENJDK_TARGET_OS), solaris linux aix))
 313   LIBAWT_FILES += awt_LoadLibrary.c initIDs.c img_colors.c
 314 endif
 315 
 316 ifeq ($(OPENJDK_TARGET_OS), aix)
 317   LIBAWT_FILES += porting_aix.c
 318 endif
 319 
 320 ifeq ($(OPENJDK_TARGET_OS), macosx)
 321   LIBAWT_FILES += awt_LoadLibrary.c
 322   LIBAWT_CFLAGS += -F/System/Library/Frameworks/JavaVM.framework/Frameworks
 323 endif
 324 
 325 ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
 326   LIBAWT_CFLAGS += -DMLIB_ADD_SUFF
 327   LIBAWT_CFLAGS += -xarch=sparcvis
 328   LIBAWT_CFLAGS += $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib/vis_$(OPENJDK_TARGET_CPU_BITS).il
 329   LIBAWT_CFLAGS += \
 330       -I$(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib \
 331       -I$(JDK_TOPDIR)/src/solaris/native/sun/java2d/medialib \
 332       -I$(JDK_TOPDIR)/src/solaris/native/sun/java2d/loops
 333 
 334   LIBAWT_DIRS += $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib \
 335       $(JDK_TOPDIR)/src/solaris/native/sun/java2d/loops
 336 
 337   LIBAWT_FILES += \
 338       vis_FuncArray.c \
 339       java2d_Mlib.c \
 340       mlib_ImageCreate.c \
 341       mlib_ImageZoom_NN.c \
 342       mlib_ImageCopy_Bit.c \
 343       mlib_sys.c \
 344       mlib_v_ImageClear.c \
 345       mlib_v_ImageClear_f.c \
 346       mlib_v_ImageConstXor.c \
 347       mlib_v_ImageCopy.c \
 348       mlib_v_ImageCopy_f.c \
 349       mlib_v_ImageXor.c \
 350       mlib_v_ImageZoom_NN_f.c \
 351       vis_Interp.c \
 352       vis_AlphaMacros.c \
 353       vis_AlphaMaskBlit.c \
 354       vis_AlphaMaskFill.c \
 355       vis_ByteGray.c \
 356       vis_ByteGray_FromRgb.c \
 357       vis_ByteGray_Mask.c \
 358       vis_ByteIndexed.c \
 359       vis_DrawLine.c \
 360       vis_FourByteAbgr.c \
 361       vis_IntArgb.c \
 362       vis_IntArgbPre.c \
 363       vis_IntArgbPre_Mask.c \
 364       vis_IntBgr.c \
 365       vis_IntRgb.c \
 366       vis_IntRgbx.c \
 367       vis_SrcMaskFill.c \
 368       vis_SrcOverMaskBlit.c \
 369       vis_SrcOverMaskFill.c \
 370       vis_FourByteAbgrPre.c \
 371       vis_GlyphList.c \
 372       vis_GlyphListXor.c \
 373       vis_IntArgbBm.c \
 374       vis_ThreeByteBgr.c \
 375       vis_UshortGray.c \
 376       vis_UshortGray_FromRgb.c \
 377       vis_XorBlit.c \
 378       mlib_v_ImageCopy_blk.s
 379 
 380   ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
 381     LIBAWT_ASFLAGS = -P -xarch=v9a
 382   else
 383     LIBAWT_ASFLAGS = -P -xarch=v8plusa
 384   endif
 385 else
 386   LIBAWT_FILES += MapAccelFunc.c
 387 endif
 388 
 389 ifneq ($(OPENJDK_TARGET_OS), solaris)
 390   LIBAWT_CFLAGS += -DMLIB_NO_LIBSUNMATH
 391 endif
 392 
 393 LIBAWT_LANG := C
 394 
 395 ifeq ($(OPENJDK_TARGET_OS), windows)
 396   LIBAWT_FILES += AccelGlyphCache.c \
 397       ShaderList.c \
 398       CmdIDList.cpp \
 399       Hashtable.cpp \
 400       GDIHashtable.cpp \
 401       Devices.cpp \
 402       ObjectList.cpp \
 403       GDIBlitLoops.cpp \
 404       GDIRenderer.cpp \
 405       GDIWindowSurfaceData.cpp \
 406       WindowsFlags.cpp \
 407       WPrinterJob.cpp \
 408       awt_%.cpp \
 409       D3DBlitLoops.cpp \
 410       D3DBufImgOps.cpp \
 411       D3DContext.cpp \
 412       D3DGlyphCache.cpp \
 413       D3DGraphicsDevice.cpp \
 414       D3DMaskBlit.cpp \
 415       D3DMaskCache.cpp \
 416       D3DMaskFill.cpp \
 417       D3DPipelineManager.cpp \
 418       D3DPaints.cpp \
 419       D3DRenderer.cpp \
 420       D3DRenderQueue.cpp \
 421       D3DResourceManager.cpp \
 422       D3DSurfaceData.cpp \
 423       D3DTextRenderer.cpp \
 424       D3DVertexCacher.cpp \
 425       ShellFolder2.cpp \
 426       ThemeReader.cpp \
 427       ComCtl32Util.cpp \
 428       DllUtil.cpp \
 429       initIDs.cpp \
 430       MouseInfo.cpp \
 431       rect.c \
 432       OGLBlitLoops.c \
 433       OGLBufImgOps.c \
 434       OGLContext.c \
 435       OGLFuncs.c \
 436       OGLMaskBlit.c \
 437       OGLMaskFill.c \
 438       OGLPaints.c \
 439       OGLRenderQueue.c \
 440       OGLRenderer.c \
 441       OGLSurfaceData.c \
 442       OGLTextRenderer.c \
 443       OGLVertexCache.c \
 444       WGLGraphicsConfig.c \
 445       WGLSurfaceData.c
 446 
 447   LIBAWT_LANG := C++
 448   LIBAWT_CFLAGS += -EHsc -DUNICODE -D_UNICODE
 449   ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
 450     LIBAWT_CFLAGS += -DMLIB_OS64BIT
 451   endif
 452 
 453   ifdef OPENJDK
 454     LIBAWT_RC_FLAGS := -i "$(JDK_TOPDIR)/src/windows/resource/icons"
 455   else
 456     LIBAWT_RC_FLAGS := -i "$(JDK_TOPDIR)/src/closed/windows/native/sun/windows"
 457   endif
 458   LIBAWT_VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/native/sun/windows/awt.rc
 459 endif
 460 
 461 ifeq ($(MILESTONE), internal)
 462   LIBAWT_CFLAGS += -DINTERNAL_BUILD
 463 endif
 464 
 465 LIBAWT_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt/mapfile-vers
 466 ifeq ($(OPENJDK_TARGET_OS), linux)
 467   LIBAWT_MAPFILE :=
 468 endif
 469 
 470 $(eval $(call SetupNativeCompilation,BUILD_LIBAWT, \
 471     LIBRARY := awt, \
 472     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 473     SRC := $(LIBAWT_DIRS), \
 474     INCLUDE_FILES := $(LIBAWT_FILES), \
 475     LANG := $(LIBAWT_LANG), \
 476     OPTIMIZATION := LOW, \
 477     CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_CFLAGS), \
 478     ASFLAGS := $(LIBAWT_ASFLAGS), \
 479     MAPFILE := $(LIBAWT_MAPFILE), \
 480     LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN), \
 481     LDFLAGS_solaris := -R/usr/dt/lib$(OPENJDK_TARGET_CPU_ISADIR) -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR), \
 482     LDFLAGS_SUFFIX_linux := -ljvm $(LIBM) $(LIBDL) -ljava, \
 483     LDFLAGS_SUFFIX_solaris := -ljvm $(LIBM) $(LIBDL) -ljava -lc, \
 484     LDFLAGS_SUFFIX_aix :=-ljvm $(LIBM) $(LIBDL) -ljava -lm,\
 485     LDFLAGS_SUFFIX_macosx := -lmlib_image -ljvm $(LIBM) \
 486         -framework Cocoa \
 487         -framework OpenGL \
 488         -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
 489         -framework JavaNativeFoundation \
 490         -framework JavaRuntimeSupport \
 491         -framework ApplicationServices \
 492         -framework AudioToolbox \
 493         -ljava, \
 494     LDFLAGS_SUFFIX_windows := kernel32.lib user32.lib gdi32.lib winspool.lib \
 495         imm32.lib ole32.lib uuid.lib shell32.lib \
 496         comdlg32.lib winmm.lib comctl32.lib shlwapi.lib \
 497         delayimp.lib jvm.lib $(WIN_JAVA_LIB) advapi32.lib \
 498         -DELAYLOAD:user32.dll -DELAYLOAD:gdi32.dll \
 499         -DELAYLOAD:shell32.dll -DELAYLOAD:winmm.dll \
 500         -DELAYLOAD:winspool.drv -DELAYLOAD:imm32.dll \
 501         -DELAYLOAD:ole32.dll -DELAYLOAD:comdlg32.dll \
 502         -DELAYLOAD:comctl32.dll -DELAYLOAD:shlwapi.dll, \
 503     VERSIONINFO_RESOURCE := $(LIBAWT_VERSIONINFO_RESOURCE), \
 504     RC_FLAGS := $(RC_FLAGS) $(LIBAWT_RC_FLAGS) \
 505         -D "JDK_FNAME=awt.dll" \
 506         -D "JDK_INTERNAL_NAME=awt" \
 507         -D "JDK_FTYPE=0x2L", \
 508     OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt, \
 509     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 510 
 511 $(BUILD_LIBAWT): $(BUILD_LIBJAVA)
 512 
 513 ifeq ($(OPENJDK_TARGET_OS), macosx)
 514   $(BUILD_LIBAWT): $(BUILD_LIBMLIB_IMAGE)
 515 endif
 516 
 517 BUILD_LIBRARIES += $(BUILD_LIBAWT)
 518 
 519 ##########################################################################################
 520 
 521 ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),)
 522   ifndef BUILD_HEADLESS_ONLY
 523 
 524     LIBAWT_XAWT_DIRS := \
 525         $(JDK_TOPDIR)/src/share/native/sun/awt/debug \
 526         $(JDK_TOPDIR)/src/share/native/sun/awt/utility \
 527         $(JDK_TOPDIR)/src/share/native/sun/font \
 528         $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/font \
 529         $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
 530         $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \
 531         $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/opengl \
 532         $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/x11 \
 533         $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/xawt \
 534 
 535     LIBAWT_XAWT_CFLAGS := -DXAWT -DXAWT_HACK \
 536         -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
 537         $(CUPS_CFLAGS) \
 538         $(foreach dir, $(LIBAWT_XAWT_DIRS), -I$(dir)) \
 539         -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
 540         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
 541         -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
 542         -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
 543         -I$(JDK_TOPDIR)/src/share/native/sun/awt/image \
 544         -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
 545         -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
 546         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/jdga
 547 
 548     ifeq ($(OPENJDK_TARGET_OS), solaris)
 549       LIBAWT_XAWT_CFLAGS += -DFUNCPROTO=15
 550     endif
 551 
 552     ifeq ($(OPENJDK_TARGET_OS), linux)
 553       ifndef OPENJDK
 554         include $(JDK_TOPDIR)/make/closed/xawt.gmk
 555       endif
 556 
 557       ifeq ($(DISABLE_XRENDER), true)
 558         LIBAWT_XAWT_CFLAGS += -DDISABLE_XRENDER_BY_DEFAULT=true
 559       endif
 560     endif
 561 
 562     ifeq ($(MILESTONE), internal)
 563       LIBAWT_XAWT_CFLAGS += -DINTERNAL_BUILD
 564     endif
 565 
 566     LIBAWT_XAWT_FILES := \
 567         XlibWrapper.c \
 568         XWindow.c \
 569         XToolkit.c \
 570         X11Color.c \
 571         X11SurfaceData.c \
 572         awt_GraphicsEnv.c \
 573         awt_InputMethod.c \
 574         robot_common.c \
 575         awt_Robot.c \
 576         list.c \
 577         multiVis.c \
 578         initIDs.c \
 579         awt_util.c \
 580         awt_Desktop.c \
 581         awt_UNIXToolkit.c \
 582         X11FontScaler_md.c \
 583         X11TextRenderer_md.c \
 584         fontpath.c \
 585         awt_Insets.c \
 586         awt_Event.c \
 587         X11Renderer.c \
 588         X11PMBlitLoops.c \
 589         OGLBlitLoops.c \
 590         OGLBufImgOps.c \
 591         OGLContext.c \
 592         OGLFuncs.c \
 593         OGLMaskBlit.c \
 594         OGLMaskFill.c \
 595         OGLPaints.c \
 596         OGLRenderQueue.c \
 597         OGLRenderer.c \
 598         OGLSurfaceData.c \
 599         OGLTextRenderer.c \
 600         OGLVertexCache.c \
 601         GLXGraphicsConfig.c \
 602         GLXSurfaceData.c \
 603         AccelGlyphCache.c \
 604         awt_Font.c \
 605         multi_font.c \
 606         awt_AWTEvent.c \
 607         awt_DrawingSurface.c \
 608         jawt.c \
 609         CUPSfuncs.c \
 610         debug_assert.c \
 611         debug_mem.c \
 612         debug_trace.c \
 613         debug_util.c \
 614         gnome_interface.c \
 615         gtk2_interface.c \
 616         swing_GTKEngine.c \
 617         swing_GTKStyle.c \
 618         rect.c \
 619         sun_awt_X11_GtkFileDialogPeer.c \
 620         XRSurfaceData.c \
 621         XRBackendNative.c
 622 
 623     LIBAWT_XAWT_LDFLAGS_SUFFIX := $(LIBM) -lawt -lXext -lX11 -lXrender $(LIBDL) -lXtst -lXi -ljava -ljvm -lc
 624 
 625     ifeq ($(OPENJDK_TARGET_OS), linux)
 626       # To match old build, add this to LDFLAGS instead of suffix.
 627       LIBAWT_XAWT_LDFLAGS += -lpthread
 628     endif
 629 
 630     $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_XAWT, \
 631         LIBRARY := awt_xawt, \
 632         OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 633         SRC := $(LIBAWT_XAWT_DIRS), \
 634         INCLUDE_FILES := $(LIBAWT_XAWT_FILES), \
 635         LANG := C, \
 636         OPTIMIZATION := LOW, \
 637         CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_XAWT_CFLAGS) \
 638             $(X_CFLAGS), \
 639         MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_xawt/mapfile-vers, \
 640         LDFLAGS := $(LDFLAGS_JDKLIB) \
 641             $(X_LIBS) $(LIBAWT_XAWT_LDFLAGS), \
 642         LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN) \
 643             $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
 644         LDFLAGS_solaris := -L$(OPENWIN_HOME)/sfw/lib$(OPENJDK_TARGET_CPU_ISADIR) \
 645             -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) \
 646             -R$(OPENWIN_HOME)/sfw/lib$(OPENJDK_TARGET_CPU_ISADIR) \
 647             -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) \
 648             -R/usr/dt/lib$(OPENJDK_TARGET_CPU_ISADIR) \
 649             $(call SET_SHARED_LIBRARY_ORIGIN) \
 650             $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
 651         LDFLAGS_SUFFIX := $(LIBAWT_XAWT_LDFLAGS_SUFFIX), \
 652         VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
 653         RC_FLAGS := $(RC_FLAGS) \
 654             -D "JDK_FNAME=xawt.dll" \
 655             -D "JDK_INTERNAL_NAME=xawt" \
 656             -D "JDK_FTYPE=0x2L", \
 657         OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt_xawt, \
 658         DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 659 
 660     $(BUILD_LIBAWT_XAWT): $(BUILD_LIBJAVA)
 661 
 662     $(BUILD_LIBAWT_XAWT): $(BUILD_LIBAWT)
 663 
 664     BUILD_LIBRARIES += $(BUILD_LIBAWT_XAWT)
 665 
 666   endif
 667 endif
 668 
 669 ##########################################################################################
 670 
 671 # TODO: Update awt lib path when awt is converted
 672 $(eval $(call SetupNativeCompilation,BUILD_LIBLCMS, \
 673     LIBRARY := lcms, \
 674     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 675     SRC := $(JDK_TOPDIR)/src/share/native/sun/java2d/cmm/lcms, \
 676     LANG := C, \
 677     OPTIMIZATION := HIGHEST, \
 678     CFLAGS := $(filter-out -xc99=%none, $(CFLAGS_JDKLIB)) \
 679         $(SHARED_LIBRARY_FLAGS) \
 680         -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
 681         -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug, \
 682     CFLAGS_solaris := -xc99=no_lib, \
 683     CFLAGS_windows := -DCMS_IS_WINDOWS_, \
 684     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/liblcms/mapfile-vers, \
 685     LDFLAGS := $(LDFLAGS_JDKLIB) \
 686         $(call SET_SHARED_LIBRARY_ORIGIN), \
 687     LDFLAGS_solaris := /usr/lib$(OPENJDK_TARGET_CPU_ISADIR)/libm.so.2, \
 688     LDFLAGS_windows := $(WIN_AWT_LIB) $(WIN_JAVA_LIB), \
 689     LDFLAGS_SUFFIX_solaris := -lawt -ljava -ljvm -lc, \
 690     LDFLAGS_SUFFIX_macosx := $(LIBM) -lawt -ljava -ljvm, \
 691     LDFLAGS_SUFFIX_linux := -lm -lawt -ljava -ljvm, \
 692     LDFLAGS_SUFFIX_aix := -lm -lawt -ljava -ljvm,\
 693     VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
 694     RC_FLAGS := $(RC_FLAGS) \
 695         -D "JDK_FNAME=lcms.dll" \
 696         -D "JDK_INTERNAL_NAME=lcms" \
 697         -D "JDK_FTYPE=0x2L", \
 698     OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/liblcms, \
 699     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 700 
 701 BUILD_LIBRARIES += $(BUILD_LIBLCMS)
 702 
 703 $(BUILD_LIBLCMS): $(BUILD_LIBAWT)
 704 
 705 ##########################################################################################
 706 
 707 ifdef OPENJDK
 708   BUILD_LIBJPEG_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers
 709 else
 710   BUILD_LIBJPEG_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers-closed
 711   BUILD_LIBJPEG_CLOSED_SRC := $(JDK_TOPDIR)/src/closed/share/native/sun/awt/image/jpeg
 712   BUILD_LIBJPEG_CLOSED_INCLUDES := -I$(BUILD_LIBJPEG_CLOSED_SRC)
 713 endif
 714 
 715 BUILD_LIBJPEG_REORDER :=
 716 ifeq ($(OPENJDK_TARGET_OS), solaris)
 717   ifneq ($(OPENJDK_TARGET_CPU), x86_64)
 718     BUILD_LIBJPEG_REORDER := $(JDK_TOPDIR)/make/mapfiles/libjpeg/reorder-$(OPENJDK_TARGET_CPU)
 719   endif
 720 endif
 721 
 722 # Suppress gcc warnings like "variable might be clobbered by 'longjmp'
 723 # or 'vfork'": this warning indicates that some variable is placed to
 724 # a register by optimized compiler and it's value might be lost on longjmp().
 725 # Recommended way to avoid such warning is to declare the variable as
 726 # volatile to prevent the optimization. However, this approach does not
 727 # work because we have to declare all variables as volatile in result.
 728 #ifndef CROSS_COMPILE_ARCH
 729 #  CC_43_OR_NEWER := \
 730 #      $(shell $(EXPR) $(CC_MAJORVER) \> 4 \| \
 731 #          \( $(CC_MAJORVER) = 4 \& $(CC_MINORVER) \>= 3 \) )
 732 #  ifeq ($(CC_43_OR_NEWER), 1)
 733 #    BUILD_LIBJPEG_CFLAGS_linux += -Wno-clobbered
 734 #  endif
 735 #endif
 736 
 737 $(eval $(call SetupNativeCompilation,BUILD_LIBJPEG, \
 738     LIBRARY := jpeg, \
 739     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 740     SRC := $(BUILD_LIBJPEG_CLOSED_SRC) \
 741         $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg, \
 742     LANG := C, \
 743     OPTIMIZATION := HIGHEST, \
 744     CFLAGS := $(CFLAGS_JDKLIB) \
 745         $(BUILD_LIBJPEG_CLOSED_INCLUDES) \
 746         -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg, \
 747     MAPFILE := $(BUILD_LIBJPEG_MAPFILE), \
 748     LDFLAGS := $(LDFLAGS_JDKLIB) \
 749         $(call SET_SHARED_LIBRARY_ORIGIN), \
 750     LDFLAGS_windows := $(WIN_JAVA_LIB) jvm.lib, \
 751     LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \
 752     VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
 753     RC_FLAGS := $(RC_FLAGS) \
 754         -D "JDK_FNAME=jpeg.dll" \
 755         -D "JDK_INTERNAL_NAME=jpeg" \
 756         -D "JDK_FTYPE=0x2L", \
 757     REORDER := $(BUILD_LIBJPEG_REORDER), \
 758     OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjpeg, \
 759     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 760 
 761 $(BUILD_LIBJPEG): $(BUILD_LIBJAVA)
 762 
 763 BUILD_LIBRARIES += $(BUILD_LIBJPEG)
 764 
 765 ##########################################################################################
 766 
 767 ifeq ($(BUILD_HEADLESS), true)
 768   # Mac and Windows only use the native AWT lib, do not build libawt_headless
 769   ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx),)
 770 
 771     LIBAWT_HEADLESS_DIRS := $(JDK_TOPDIR)/src/share/native/sun/font \
 772         $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
 773         $(JDK_TOPDIR)/src/solaris/native/sun/font \
 774         $(JDK_TOPDIR)/src/solaris/native/sun/awt \
 775         $(JDK_TOPDIR)/src/solaris/native/sun/java2d/opengl \
 776         $(JDK_TOPDIR)/src/solaris/native/sun/java2d/x11
 777 
 778     ifeq ($(OPENJDK_TARGET_OS), macosx)
 779       LIBAWT_HEADLESS_DIRS += $(JDK_TOPDIR)/src/macosx/native/sun/font
 780     endif
 781 
 782     LIBAWT_HEADLESS_CFLAGS := -DHEADLESS=true \
 783         -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
 784         $(CUPS_CFLAGS) \
 785         $(X_CFLAGS) \
 786         -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
 787         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
 788         -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
 789         -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
 790         -I$(JDK_TOPDIR)/src/share/native/sun/awt/image \
 791         -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
 792         -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
 793         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/jdga \
 794         $(foreach dir, $(LIBAWT_HEADLESS_DIRS), -I$(dir))
 795 
 796     ifeq ($(OPENJDK_TARGET_OS), macosx)
 797       LIBAWT_HEADLESS_CFLAGS += \
 798           -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
 799           -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks
 800     endif
 801 
 802     LIBAWT_HEADLESS_FILES := \
 803         awt_Font.c \
 804         HeadlessToolkit.c \
 805         fontpath.c \
 806         VDrawingArea.c \
 807         X11Color.c \
 808         X11Renderer.c \
 809         X11PMBlitLoops.c \
 810         X11SurfaceData.c \
 811         X11FontScaler_md.c \
 812         X11TextRenderer_md.c \
 813         OGLBlitLoops.c \
 814         OGLBufImgOps.c \
 815         OGLContext.c \
 816         OGLFuncs.c \
 817         OGLMaskBlit.c \
 818         OGLMaskFill.c \
 819         OGLPaints.c \
 820         OGLRenderQueue.c \
 821         OGLRenderer.c \
 822         OGLSurfaceData.c \
 823         OGLTextRenderer.c \
 824         OGLVertexCache.c \
 825         GLXGraphicsConfig.c \
 826         GLXSurfaceData.c \
 827         AccelGlyphCache.c \
 828         CUPSfuncs.c
 829 
 830     LIBAWT_HEADLESS_REORDER :=
 831     ifeq ($(OPENJDK_TARGET_OS), solaris)
 832       ifneq ($(OPENJDK_TARGET_CPU), x86_64)
 833         LIBAWT_HEADLESS_REORDER := $(JDK_TOPDIR)/make/mapfiles/libawt_headless/reorder-$(OPENJDK_TARGET_CPU)
 834       endif
 835     endif
 836 
 837     $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_HEADLESS, \
 838         LIBRARY := awt_headless, \
 839         OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 840         SRC := $(LIBAWT_HEADLESS_DIRS), \
 841         INCLUDE_FILES := $(LIBAWT_HEADLESS_FILES), \
 842         LANG := C, \
 843         OPTIMIZATION := LOW, \
 844         CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_HEADLESS_CFLAGS), \
 845         MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_headless/mapfile-vers, \
 846         LDFLAGS := $(LDFLAGS_JDKLIB) \
 847             $(call SET_SHARED_LIBRARY_ORIGIN), \
 848         LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
 849         LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..) \
 850             -R/usr/dt/lib$(OPENJDK_TARGET_CPU_ISADIR) \
 851             -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR), \
 852         LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN)., \
 853         REORDER := $(LIBAWT_HEADLESS_REORDER), \
 854         LDFLAGS_SUFFIX_linux := -ljvm -lawt -lm $(LIBDL) -ljava, \
 855         LDFLAGS_SUFFIX_aix := -ljvm -lawt -ljava,\
 856         LDFLAGS_SUFFIX_solaris := $(LIBDL) -ljvm -lawt -lm -ljava $(LIBCXX) -lc, \
 857         OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt_headless, \
 858         DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 859 
 860     $(BUILD_LIBAWT_HEADLESS): $(BUILD_LIBAWT)
 861 
 862     BUILD_LIBRARIES += $(BUILD_LIBAWT_HEADLESS)
 863 
 864   endif
 865 endif
 866 
 867 ##########################################################################################
 868 
 869 ifndef OPENJDK
 870   FONT_HEADERS := -I$(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k
 871   BUILD_LIBFONTMANAGER_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libfontmanager/mapfile-vers
 872   LIBFONTMANAGER_EXCLUDE_FILES += freetypeScaler.c
 873 else
 874   FONT_HEADERS := $(FREETYPE_CFLAGS)
 875   BUILD_LIBFONTMANAGER_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libfontmanager/mapfile-vers.openjdk
 876   BUILD_LIBFONTMANAGER_FONTLIB := $(FREETYPE_LIBS)
 877 endif
 878 
 879 LIBFONTMANAGER_OPTIMIZATION := HIGH
 880 
 881 ifeq ($(OPENJDK_TARGET_OS), windows)
 882   LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
 883       X11TextRenderer.c
 884   LIBFONTMANAGER_OPTIMIZATION := HIGHEST
 885 else ifeq ($(OPENJDK_TARGET_OS), macosx)
 886   LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
 887       X11TextRenderer.c \
 888       fontpath.c \
 889       lcdglyph.c
 890 else
 891   LIBFONTMANAGER_EXCLUDE_FILES += fontpath.c \
 892       lcdglyph.c
 893 endif
 894 
 895 BUILD_LIBFONTMANAGER_CFLAGS_COMMON := \
 896     $(X_CFLAGS) \
 897     -DLE_STANDALONE -DHEADLESS \
 898     $(FONT_HEADERS) \
 899     -I$(JDK_TOPDIR)/src/share/native/sun/font \
 900     -I$(JDK_TOPDIR)/src/share/native/sun/font/layout \
 901     -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
 902     -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \
 903     -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
 904     -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
 905     -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
 906     -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
 907     -I$(JDK_TOPDIR)/src/share/native/sun/java2d
 908 
 909 # Turn off aliasing with GCC for ExtensionSubtables.cpp
 910 ifeq ($(OPENJDK_TARGET_OS), linux)
 911   BUILD_LIBFONTMANAGER_ExtensionSubtables.cpp_CXXFLAGS := -fno-strict-aliasing
 912 endif
 913 
 914 $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \
 915     LIBRARY := fontmanager, \
 916     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 917     SRC := $(JDK_TOPDIR)/src/share/native/sun/font \
 918         $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/font, \
 919     EXCLUDE_FILES := $(LIBFONTMANAGER_EXCLUDE_FILES) \
 920         AccelGlyphCache.c, \
 921     LANG := C++, \
 922     CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBFONTMANAGER_CFLAGS_COMMON), \
 923     CXXFLAGS := $(CXXFLAGS_JDKLIB) $(BUILD_LIBFONTMANAGER_CFLAGS_COMMON), \
 924     OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \
 925     CFLAGS_windows = -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \
 926         -DCC_NOEX, \
 927     MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \
 928     LDFLAGS := $(subst -Xlinker -z -Xlinker defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \
 929         $(call SET_SHARED_LIBRARY_ORIGIN), \
 930     LDFLAGS_SUFFIX := $(BUILD_LIBFONTMANAGER_FONTLIB), \
 931     LDFLAGS_SUFFIX_linux := -lawt $(LIBM) $(LIBCXX) -ljava -ljvm -lc, \
 932     LDFLAGS_SUFFIX_solaris := -lawt -lawt_headless -lc $(LIBM) $(LIBCXX) -ljava -ljvm, \
 933     LDFLAGS_SUFFIX_aix := -lawt -lawt_headless $(LIBM) $(LIBCXX) -ljava -ljvm,\
 934     LDFLAGS_SUFFIX_macosx := -lawt $(LIBM) $(LIBCXX) -undefined dynamic_lookup \
 935         -ljava -ljvm, \
 936     LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib gdi32.lib \
 937         $(WIN_AWT_LIB), \
 938     VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
 939     RC_FLAGS := $(RC_FLAGS) \
 940         -D "JDK_FNAME=fontmanager.dll" \
 941         -D "JDK_INTERNAL_NAME=fontmanager" \
 942         -D "JDK_FTYPE=0x2L", \
 943     OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libfontmanager, \
 944     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 945 
 946 $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT)
 947 
 948 ifneq (, $(findstring $(OPENJDK_TARGET_OS), solaris aix))
 949   $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT_HEADLESS)
 950 endif
 951 
 952 BUILD_LIBRARIES += $(BUILD_LIBFONTMANAGER)
 953 
 954 ##########################################################################################
 955 
 956 ifndef OPENJDK
 957 
 958   #ifeq ($(OPENJDK_TARGET_OS), linux)
 959   #  ifeq ("$(CC_VER_MAJOR)", "3")
 960   #    OTHER_LDLIBS += -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
 961   #  endif
 962   #endif
 963   #
 964   # The resulting size of the t2k lib file is (at least on linux) dependant on the order of
 965   # the input .o files. Because of this the new build will differ in size to the old build.
 966   BUILD_LIBT2K_CFLAGS_COMMON := -I$(JDK_TOPDIR)/src/share/native/sun/font \
 967       -I$(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k \
 968       -I$(JDK_TOPDIR)/src/closed/share/native/sun/font \
 969       -I$(JDK_TOPDIR)/src/share/share/native/sun/font \
 970       -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/font \
 971       -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
 972       -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
 973       -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
 974       -I$(JDK_TOPDIR)/src/share/native/sun/java2d
 975 
 976   $(eval $(call SetupNativeCompilation,BUILD_LIBT2K, \
 977       LIBRARY := t2k, \
 978       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 979       SRC := $(JDK_TOPDIR)/src/closed/share/native/sun/font \
 980           $(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k \
 981           $(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k/ttHints, \
 982       EXCLUDE_FILES := orion.c, \
 983       LANG := C++, \
 984       OPTIMIZATION := HIGH, \
 985       CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBT2K_CFLAGS_COMMON), \
 986       CXXFLAGS := $(CXXFLAGS_JDKLIB) $(BUILD_LIBT2K_CFLAGS_COMMON), \
 987       CFLAGS_windows = -DCC_NOEX, \
 988       CXXFLAGS_windows = -DCC_NOEX, \
 989       MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libt2k/mapfile-vers, \
 990       LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
 991           $(call SET_SHARED_LIBRARY_ORIGIN), \
 992       LDFLAGS_windows := user32.lib $(JDK_OUTPUTDIR)/objs/libfontmanager/fontmanager.lib, \
 993       LDFLAGS_SUFFIX_posix := $(LIBM) $(LIBCXX) -lfontmanager -ljava -ljvm -lc, \
 994       LDFLAGS_SUFFIX_solaris := -lawt -lawt_xawt, \
 995       VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
 996       RC_FLAGS := $(RC_FLAGS) \
 997           -D "JDK_FNAME=t2k.dll" \
 998           -D "JDK_INTERNAL_NAME=t2k" \
 999           -D "JDK_FTYPE=0x2L", \
1000       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libt2k, \
1001       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
1002 
1003   # t2k is linked against fontmanager
1004   $(BUILD_LIBT2K): $(BUILD_LIBFONTMANAGER)
1005 
1006   BUILD_LIBRARIES += $(BUILD_LIBT2K)
1007 endif
1008 
1009 ##########################################################################################
1010 
1011 ifeq ($(OPENJDK_TARGET_OS), windows)
1012   ifeq ($(OPENJDK_TARGET_CPU), x86)
1013     KERNEL32_LIB := kernel32.lib
1014   endif
1015   $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT, \
1016       LIBRARY := jawt, \
1017       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
1018       SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows, \
1019       INCLUDE_FILES := jawt.cpp, \
1020       LANG := C++, \
1021       OPTIMIZATION := LOW, \
1022       CFLAGS := $(CXXFLAGS_JDKLIB) \
1023           -EHsc -DUNICODE -D_UNICODE \
1024           -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \
1025           -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
1026           -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
1027           -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
1028           -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/windows, \
1029       LDFLAGS := $(LDFLAGS_JDKLIB) $(KERNEL32_LIB) $(LDFLAGS_CXX_JDK) \
1030           advapi32.lib $(WIN_AWT_LIB), \
1031       LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \
1032       VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
1033       RC_FLAGS := $(RC_FLAGS) \
1034           -D "JDK_FNAME=jawt.dll" \
1035           -D "JDK_INTERNAL_NAME=jawt" \
1036           -D "JDK_FTYPE=0x2L", \
1037       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjawt, \
1038       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
1039 
1040   $(BUILD_LIBJAWT): $(BUILD_LIBAWT)
1041 
1042   $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX): $(BUILD_LIBJAWT)
1043         $(ECHO) Copying $(@F)
1044         $(CP) $(JDK_OUTPUTDIR)/objs/libjawt/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX) $@
1045 
1046   BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
1047 
1048 else # OPENJDK_TARGET_OS not windows
1049 
1050   ifeq ($(OPENJDK_TARGET_OS), macosx)
1051     JAWT_FILES := jawt.m
1052     JAWT_LIBS := -lawt_lwawt
1053   else
1054     JAWT_FILES := jawt.c
1055     JAWT_LIBS :=
1056     ifneq ($(OPENJDK_TARGET_OS), solaris)
1057       JAWT_LIBS += -lawt
1058     endif
1059     ifndef BUILD_HEADLESS_ONLY
1060       JAWT_LIBS += -lawt_xawt
1061     else
1062       JAWT_LIBS += -lawt_headless
1063       HEADLESS_CFLAG += -DHEADLESS
1064     endif
1065   endif
1066 
1067   $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT, \
1068       LIBRARY := jawt, \
1069       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
1070       SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \
1071           $(JDK_TOPDIR)/src/macosx/native/sun/awt, \
1072       INCLUDE_FILES := $(JAWT_FILES), \
1073       LANG := C, \
1074       OPTIMIZATION := LOW, \
1075       CFLAGS := $(CFLAGS_JDKLIB), \
1076       CFLAGS_linux := $(HEADLESS_CFLAG), \
1077       CFLAGS_macosx := -I$(JDK_TOPDIR)/src/solaris/native/sun/awt, \
1078       MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjawt/mapfile-vers, \
1079       LDFLAGS := $(LDFLAGS_JDKLIB) \
1080           $(call SET_SHARED_LIBRARY_ORIGIN), \
1081       LDFLAGS_solaris := -L$(OPENWIN_HOME)/sfw/lib$(OPENJDK_TARGET_CPU_ISADIR) -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR), \
1082       LDFLAGS_SUFFIX_linux := $(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX), \
1083       LDFLAGS_SUFFIX_aix := $(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX),\
1084       LDFLAGS_SUFFIX_solaris := $(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX) -lXrender, \
1085       LDFLAGS_SUFFIX_macosx := -Xlinker -rpath -Xlinker @loader_path $(JAWT_LIBS) \
1086           -framework Cocoa $(LDFLAGS_JDKLIB_SUFFIX), \
1087       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjawt, \
1088       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
1089 
1090   ifndef BUILD_HEADLESS_ONLY
1091     $(BUILD_LIBJAWT): $(BUILD_LIBAWT_XAWT)
1092   else
1093     $(BUILD_LIBJAWT): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_headless$(SHARED_LIBRARY_SUFFIX)
1094   endif
1095 
1096   ifeq ($(OPENJDK_TARGET_OS), macosx)
1097     $(BUILD_LIBJAWT): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_lwawt$(SHARED_LIBRARY_SUFFIX)
1098   endif
1099 
1100 endif # OPENJDK_TARGET_OS
1101 
1102 BUILD_LIBRARIES += $(BUILD_LIBJAWT)
1103 
1104 ##########################################################################################
1105 
1106 ifndef OPENJDK
1107 
1108   BUILD_LIBKCMS_EXCLUDE_FILES :=
1109   ifeq ($(OPENJDK_TARGET_OS), windows)
1110     BUILD_LIBKCMS_EXCLUDE_FILES += ukcpmgr.c unixmem.c
1111   else
1112     BUILD_LIBKCMS_EXCLUDE_FILES += cmmdll.c registry.c spxffile.c sysinfo.c winmem.c wkcpmgr.c
1113   endif
1114 
1115   BUILD_LIBKCMS_FLAGS := $(CFLAGS_JDKLIB)
1116 
1117   ifeq ($(OPENJDK_TARGET_OS), solaris)
1118     # This particular library uses a feature called PIC_CODE_SMALL (on solaris)
1119     # implement it like this...since it's only used here
1120     BUILD_LIBKCMS_FLAGS := $(patsubst -KPIC, -Kpic, $(BUILD_LIBKCMS_FLAGS))
1121   else ifeq ($(OPENJDK_TARGET_CPU_ARCH), ppc)
1122     BUILD_LIBKCMS_FLAGS := $(patsubst -fPIC, -fpic, $(BUILD_LIBKCMS_FLAGS))
1123   endif
1124 
1125   $(eval $(call SetupNativeCompilation,BUILD_LIBKCMS, \
1126       LIBRARY := kcms, \
1127       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
1128       SRC := $(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms, \
1129       LANG := C, \
1130       EXCLUDE_FILES := $(BUILD_LIBKCMS_EXCLUDE_FILES), \
1131       OPTIMIZATION := LOW, \
1132       CFLAGS := $(BUILD_LIBKCMS_FLAGS) \
1133           -DJAVACMM -DFUT_CALC_EX -DNO_FUT_GCONST, \
1134       CFLAGS_linux := -Wno-missing-field-initializers, \
1135       MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libkcms/mapfile-vers, \
1136       LDFLAGS := $(LDFLAGS_JDKLIB) \
1137           $(call SET_SHARED_LIBRARY_ORIGIN), \
1138       LDFLAGS_SUFFIX_linux := -lc -lpthread, \
1139       LDFLAGS_SUFFIX_solaris := -lc, \
1140       LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib version.lib, \
1141       LDFLAGS_SUFFIX_posix := -lm -ljava -ljvm, \
1142       VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms/cmm.rc, \
1143       VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms/cmm.rc, \
1144       RC_FLAGS := $(RC_FLAGS) \
1145           -D "JDK_FNAME=kcms.dll" \
1146           -D "JDK_INTERNAL_NAME=kcms" \
1147           -D "JDK_FTYPE=0x2L", \
1148       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libkcms, \
1149       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
1150 
1151   $(BUILD_LIBKCMS): $(BUILD_LIBJAVA)
1152 
1153   BUILD_LIBRARIES += $(BUILD_LIBKCMS)
1154 
1155 endif
1156 
1157 ##########################################################################################
1158 
1159 ifndef OPENJDK
1160   ifeq ($(OPENJDK_TARGET_OS), solaris)
1161     ifneq ($(OPENJDK_TARGET_CPU), x86_64)
1162 
1163       ifeq ($(shell if test "$(OS_VERSION_MAJOR)" -eq 5 -a "$(OS_VERSION_MINOR)" -le 10; then $(ECHO) ok; fi), ok)
1164 
1165         SUNWJDGA_MAPFILE :=
1166         ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
1167           SUNWJDGA_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjdga/mapfile-vers
1168         endif
1169 
1170         $(eval $(call SetupNativeCompilation,BUILD_LIBSUNWJDGA, \
1171             LIBRARY := sunwjdga, \
1172             OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
1173             SRC := $(JDK_TOPDIR)/src/solaris/native/sun/jdga, \
1174             LANG := C, \
1175             OPTIMIZATION := LOW, \
1176             CFLAGS := $(CFLAGS_JDKLIB) \
1177                 -I$(JDK_TOPDIR)/src/share/javavm/export \
1178                 -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/javavm/export \
1179                 -I$(OPENWIN_HOME)/include, \
1180             MAPFILE := $(SUNWJDGA_MAPFILE), \
1181             LDFLAGS := $(LDFLAGS_JDKLIB) \
1182                 $(call SET_SHARED_LIBRARY_ORIGIN), \
1183             LDFLAGS_SUFFIX := -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) -ldga -lX11 $(LIBDL) -lc, \
1184             OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libsunwjdga, \
1185             DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
1186 
1187         BUILD_LIBRARIES += $(BUILD_LIBSUNWJDGA)
1188 
1189       endif
1190     endif
1191   endif
1192 endif
1193 
1194 ##########################################################################################
1195 
1196 ifndef BUILD_HEADLESS_ONLY
1197   LIBSPLASHSCREEN_DIRS := \
1198     $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg \
1199     $(JDK_TOPDIR)/src/share/native/sun/awt/libpng \
1200     $(JDK_TOPDIR)/src/share/native/sun/awt/splashscreen
1201 
1202   ifeq ($(USE_EXTERNAL_LIBGIF), true)
1203     GIFLIB_LDFLAGS := -lgif
1204   else
1205     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/sun/awt/giflib
1206     GIFLIB_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/awt/giflib
1207   endif
1208 
1209   ifneq ($(OPENJDK_TARGET_OS), macosx)
1210     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt/splashscreen
1211   else
1212     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen
1213   endif
1214 
1215   LIBSPLASHSCREEN_CFLAGS := -DSPLASHSCREEN -DPNG_NO_MMX_CODE \
1216       $(foreach dir, $(LIBSPLASHSCREEN_DIRS), -I$(dir))
1217 
1218   ifeq ($(OPENJDK_TARGET_OS), macosx)
1219     LIBSPLASHSCREEN_CFLAGS := -I$(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen \
1220         $(LIBSPLASHSCREEN_CFLAGS) \
1221         -F/System/Library/Frameworks/JavaVM.framework/Frameworks
1222     LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX
1223     LIBSPLASHSCREEN_CFLAGS += -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp
1224 
1225     LIBSPLASHSCREEN_java_awt_SplashScreen.c_CFLAGS := -x objective-c -O0
1226     LIBSPLASHSCREEN_splashscreen_gfx_impl.c_CFLAGS := -x objective-c -O0
1227     LIBSPLASHSCREEN_splashscreen_gif.c_CFLAGS := -x objective-c -O0
1228     LIBSPLASHSCREEN_splashscreen_impl.c_CFLAGS := -x objective-c -O0
1229     LIBSPLASHSCREEN_splashscreen_jpeg.c_CFLAGS := -x objective-c -O0
1230     LIBSPLASHSCREEN_splashscreen_png.c_CFLAGS := -x objective-c -O0
1231     LIBSPLASHSCREEN_splashscreen_sys.m_CFLAGS := -O0
1232 
1233   else ifeq ($(OPENJDK_TARGET_OS), windows)
1234     LIBSPLASHSCREEN_CFLAGS += -DWITH_WIN32
1235   else ifeq ($(OPENJDK_TARGET_OS), solaris)
1236     LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 -I$(OPENWIN_HOME)/include -I$(OPENWIN_HOME)/include/X11/extensions
1237   else
1238     LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 $(X_CFLAGS)
1239   endif
1240 
1241   LIBSPLASHSCREEN_LDFLAGS_SUFFIX :=
1242 
1243   ifneq ($(USE_EXTERNAL_LIBZ), true)
1244     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.8
1245     LIBSPLASHSCREEN_CFLAGS += $(ZLIB_CPPFLAGS)
1246   endif
1247 
1248   ifeq ($(OPENJDK_TARGET_OS), macosx)
1249     LIBSPLASHSCREEN_LDFLAGS_SUFFIX += $(LIBM) -lpthread -liconv -losxapp \
1250         -framework ApplicationServices \
1251         -framework Foundation \
1252         -framework Cocoa \
1253         -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
1254         -framework JavaNativeFoundation
1255   else ifeq ($(OPENJDK_TARGET_OS), windows)
1256     LIBSPLASHSCREEN_LDFLAGS_SUFFIX += kernel32.lib user32.lib gdi32.lib delayimp.lib -DELAYLOAD:user32.dll
1257   else ifeq ($(OPENJDK_TARGET_OS), solaris)
1258     # Solaris still uses OPENWIN_LIB ..
1259     LIBSPLASHSCREEN_LDFLAGS_SUFFIX += -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) -lX11 -lXext $(LIBM) -lpthread
1260   else  # .. all other Unixes can use X_LIBS
1261     LIBSPLASHSCREEN_LDFLAGS_SUFFIX += $(X_LIBS) -lX11 -lXext $(LIBM) -lpthread
1262   endif
1263 
1264   $(eval $(call SetupNativeCompilation,LIBSPLASHSCREEN, \
1265       LIBRARY := splashscreen, \
1266       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
1267       SRC := $(LIBSPLASHSCREEN_DIRS), \
1268       EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
1269       LANG := C, \
1270       OPTIMIZATION := LOW, \
1271       CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) $(GIFLIB_CFLAGS), \
1272       MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libsplashscreen/mapfile-vers, \
1273       LDFLAGS := $(LDFLAGS_JDKLIB) \
1274           $(call SET_SHARED_LIBRARY_ORIGIN), \
1275       LDFLAGS_SUFFIX := $(LIBSPLASHSCREEN_LDFLAGS_SUFFIX) $(LIBZ) $(GIFLIB_LDFLAGS), \
1276       LDFLAGS_SUFFIX_solaris := -lc, \
1277       VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
1278       RC_FLAGS := $(RC_FLAGS) \
1279           -D "JDK_FNAME=splashscreen.dll" \
1280           -D "JDK_INTERNAL_NAME=splashscreen" \
1281           -D "JDK_FTYPE=0x2L", \
1282       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libsplashscreen, \
1283       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
1284 
1285   BUILD_LIBRARIES += $(LIBSPLASHSCREEN)
1286 
1287   ifeq ($(OPENJDK_TARGET_OS), macosx)
1288     $(LIBSPLASHSCREEN): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)osxapp$(SHARED_LIBRARY_SUFFIX)
1289   endif
1290 
1291 endif
1292 
1293 ##########################################################################################
1294 
1295 ifndef OPENJDK
1296 
1297   LIBDCPR_SRC_DIRS := \
1298       $(JDK_TOPDIR)/src/closed/share/native/sun/dc/doe \
1299       $(JDK_TOPDIR)/src/closed/share/native/sun/dc/path \
1300       $(JDK_TOPDIR)/src/closed/share/native/sun/dc/pr \
1301       $(JDK_TOPDIR)/src/closed/share/native/sun/dc/util
1302 
1303   LIBDCPR_CFLAGS := $(foreach dir, $(LIBDCPR_SRC_DIRS), -I$(dir)) \
1304       -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe
1305 
1306   $(eval $(call SetupNativeCompilation,BUILD_LIBDCPR, \
1307       LIBRARY := dcpr, \
1308       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
1309       SRC := $(LIBDCPR_SRC_DIRS), \
1310       LANG := C, \
1311       OPTIMIZATION := LOW, \
1312       CFLAGS := $(CFLAGS_JDKLIB) \
1313           $(LIBDCPR_CFLAGS), \
1314       MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libdcpr/mapfile-vers, \
1315       LDFLAGS := $(LDFLAGS_JDKLIB) \
1316           $(call SET_SHARED_LIBRARY_ORIGIN), \
1317       LDFLAGS_SUFFIX := $(LIBM) $(LDFLAGS_JDKLIB_SUFFIX), \
1318       LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB), \
1319       LDFLAGS_SUFFIX_posix := -lm, \
1320       VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
1321       RC_FLAGS := $(RC_FLAGS) \
1322           -D "JDK_FNAME=dcpr.dll" \
1323           -D "JDK_INTERNAL_NAME=dcpr" \
1324           -D "JDK_FTYPE=0x2L", \
1325       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libdcpr, \
1326       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
1327 
1328   $(BUILD_LIBDCPR): $(BUILD_LIBJAVA)
1329 
1330   BUILD_LIBRARIES += $(BUILD_LIBDCPR)
1331 
1332 endif
1333 
1334 ##########################################################################################
1335 
1336 ifeq ($(OPENJDK_TARGET_OS), macosx)
1337 
1338   LIBAWT_LWAWT_FILES := \
1339       awt.m \
1340       ApplicationDelegate.m \
1341       CFRetainedResource.m \
1342       CGLGraphicsConfig.m \
1343       CGLSurfaceData.m \
1344       CGLLayer.m \
1345       CGraphicsConfig.m \
1346       CGraphicsDevice.m \
1347       CGraphicsEnv.m \
1348       CCharToGlyphMapper.m \
1349       CSystemColors.m \
1350       AWTFont.m \
1351       CGGlyphOutlines.m \
1352       CGGlyphImages.m \
1353       CoreTextSupport.m \
1354       AWTStrike.m \
1355       InitIDs.m \
1356       AWTEvent.m \
1357       AWTView.m \
1358       AWTWindow.m \
1359       AWTSurfaceLayers.m \
1360       CCursorManager.m \
1361       CClipboard.m \
1362       CDataTransferer.m \
1363       CDragSource.m \
1364       CDragSourceContextPeer.m \
1365       CDropTarget.m \
1366       CDropTargetContextPeer.m \
1367       CInputMethod.m \
1368       CDesktopPeer.m \
1369       OSVersion.m \
1370       DnDUtilities.m \
1371       CFileDialog.m \
1372       CImage.m \
1373       CMenu.m \
1374       CMenuBar.m \
1375       CMenuComponent.m \
1376       CMenuItem.m \
1377       CPopupMenu.m \
1378       CRobot.m \
1379       CTrayIcon.m \
1380       CWrapper.m \
1381       JavaAccessibilityAction.m \
1382       JavaAccessibilityUtilities.m \
1383       JavaComponentAccessibility.m \
1384       JavaTextAccessibility.m \
1385       LWCToolkit.m \
1386       GeomUtilities.m \
1387       CPrinterJob.m \
1388       PrintModel.m \
1389       PrinterSurfaceData.m \
1390       PrinterView.m \
1391       QuartzSurfaceData.m \
1392       QuartzRenderer.m \
1393       CTextPipe.m \
1394       ImageSurfaceData.m \
1395       awt_DrawingSurface.m \
1396       \
1397       OGLBlitLoops.c \
1398       OGLBufImgOps.c \
1399       OGLContext.c \
1400       OGLFuncs.c \
1401       OGLMaskBlit.c \
1402       OGLMaskFill.c \
1403       OGLPaints.c \
1404       OGLRenderQueue.c \
1405       OGLRenderer.c \
1406       OGLSurfaceData.c \
1407       OGLTextRenderer.c \
1408       OGLVertexCache.c \
1409       AccelGlyphCache.c \
1410       CUPSfuncs.c
1411 
1412 
1413   LIBAWT_LWAWT_DIRS := \
1414       $(JDK_TOPDIR)/src/macosx/native/sun/awt \
1415       $(JDK_TOPDIR)/src/macosx/native/sun/font \
1416       $(JDK_TOPDIR)/src/macosx/native/sun/java2d/opengl \
1417       $(JDK_TOPDIR)/src/solaris/native/sun/awt \
1418       $(JDK_TOPDIR)/src/share/native/sun/font \
1419       $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
1420 
1421   $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_LWAWT, \
1422       LIBRARY := awt_lwawt, \
1423       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
1424       SRC := $(LIBAWT_LWAWT_DIRS), \
1425       LANG := C, \
1426       INCLUDE_FILES := $(LIBAWT_LWAWT_FILES), \
1427       OPTIMIZATION := LOW, \
1428       CFLAGS := $(CFLAGS_JDKLIB) \
1429           $(X_CFLAGS) \
1430           $(X_LIBS) \
1431           $(foreach dir, $(LIBAWT_LWAWT_DIRS), -I$(dir)) \
1432           -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
1433           -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
1434           -I$(JDK_TOPDIR)/src/solaris/native/sun/java2d \
1435           -I$(JDK_TOPDIR)/src/share/native/sun/awt/image \
1436           -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
1437           -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
1438           -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
1439           -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
1440           -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
1441           -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
1442       LDFLAGS := $(LDFLAGS_JDKLIB) \
1443           $(call SET_SHARED_LIBRARY_ORIGIN), \
1444       LDFLAGS_SUFFIX_macosx := -lawt -lmlib_image -losxapp -ljvm $(LIBM) \
1445           -framework Accelerate \
1446           -framework ApplicationServices \
1447           -framework AudioToolbox \
1448           -framework Carbon \
1449           -framework Cocoa \
1450           -framework Security \
1451           -framework ExceptionHandling \
1452           -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
1453           -framework JavaNativeFoundation \
1454           -framework JavaRuntimeSupport \
1455           -framework OpenGL \
1456           -framework QuartzCore -ljava, \
1457       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt_lwawt, \
1458       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
1459 
1460   BUILD_LIBRARIES += $(BUILD_LIBAWT_LWAWT)
1461 
1462   $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBAWT)
1463 
1464   $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBMLIB_IMAGE)
1465 
1466   $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBOSXAPP)
1467 
1468   $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBJAVA)
1469 
1470 endif
1471 
1472 ##########################################################################################
1473 
1474 ifeq ($(OPENJDK_TARGET_OS), macosx)
1475 
1476   $(eval $(call SetupNativeCompilation,BUILD_LIBOSXUI, \
1477       LIBRARY := osxui, \
1478       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
1479       SRC := $(JDK_TOPDIR)/src/macosx/native/com/apple/laf, \
1480       LANG := C, \
1481       OPTIMIZATION := LOW, \
1482       CFLAGS := $(CFLAGS_JDKLIB) \
1483           -I$(JDK_TOPDIR)/src/macosx/native/com/apple/laf \
1484           -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
1485           -I$(JDK_TOPDIR)/src/macosx/native/sun/awt \
1486           -F/System/Library/Frameworks/JavaVM.framework/Frameworks, \
1487       LDFLAGS := $(LDFLAGS_JDKLIB) \
1488           $(call SET_SHARED_LIBRARY_ORIGIN) \
1489           -Xlinker -rpath -Xlinker @loader_path, \
1490       LDFLAGS_SUFFIX_macosx := -lawt -losxapp -lawt_lwawt \
1491           -framework Cocoa \
1492           -framework Carbon \
1493           -framework ApplicationServices \
1494           -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
1495           -framework JavaNativeFoundation \
1496           -framework JavaRuntimeSupport \
1497           -ljava -ljvm, \
1498       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libosxui, \
1499       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
1500 
1501   BUILD_LIBRARIES += $(BUILD_LIBOSXUI)
1502 
1503   $(BUILD_LIBOSXUI): $(BUILD_LIBAWT)
1504 
1505   $(BUILD_LIBOSXUI): $(BUILD_LIBOSXAPP)
1506 
1507   $(BUILD_LIBOSXUI): $(BUILD_LIBAWT_LWAWT)
1508 
1509   #$(BUILD_LIBOSXUI): $(BUILD_LIBJAVA)
1510 
1511 endif