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 img_colors.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         awt_Plugin.c \
 615         gnome_interface.c \
 616         gtk2_interface.c \
 617         swing_GTKEngine.c \
 618         swing_GTKStyle.c \
 619         rect.c \
 620         sun_awt_X11_GtkFileDialogPeer.c \
 621         XRSurfaceData.c \
 622         XRBackendNative.c
 623 
 624     LIBAWT_XAWT_LDFLAGS_SUFFIX := $(LIBM) -lawt -lXext -lX11 -lXrender $(LIBDL) -lXtst -lXi -ljava -ljvm -lc
 625 
 626     ifeq ($(OPENJDK_TARGET_OS), linux)
 627       # To match old build, add this to LDFLAGS instead of suffix.
 628       LIBAWT_XAWT_LDFLAGS += -lpthread
 629     endif
 630 
 631     $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_XAWT, \
 632         LIBRARY := awt_xawt, \
 633         OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 634         SRC := $(LIBAWT_XAWT_DIRS), \
 635         INCLUDE_FILES := $(LIBAWT_XAWT_FILES), \
 636         LANG := C, \
 637         OPTIMIZATION := LOW, \
 638         CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_XAWT_CFLAGS) \
 639             $(X_CFLAGS), \
 640         MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_xawt/mapfile-vers, \
 641         LDFLAGS := $(LDFLAGS_JDKLIB) \
 642             $(X_LIBS) $(LIBAWT_XAWT_LDFLAGS), \
 643         LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN) \
 644             $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
 645         LDFLAGS_solaris := -L$(OPENWIN_HOME)/sfw/lib$(OPENJDK_TARGET_CPU_ISADIR) \
 646             -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) \
 647             -R$(OPENWIN_HOME)/sfw/lib$(OPENJDK_TARGET_CPU_ISADIR) \
 648             -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) \
 649             -R/usr/dt/lib$(OPENJDK_TARGET_CPU_ISADIR) \
 650             $(call SET_SHARED_LIBRARY_ORIGIN) \
 651             $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
 652         LDFLAGS_SUFFIX := $(LIBAWT_XAWT_LDFLAGS_SUFFIX), \
 653         VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
 654         RC_FLAGS := $(RC_FLAGS) \
 655             -D "JDK_FNAME=xawt.dll" \
 656             -D "JDK_INTERNAL_NAME=xawt" \
 657             -D "JDK_FTYPE=0x2L", \
 658         OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt_xawt, \
 659         DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 660 
 661     $(BUILD_LIBAWT_XAWT): $(BUILD_LIBJAVA)
 662 
 663     $(BUILD_LIBAWT_XAWT): $(BUILD_LIBAWT)
 664 
 665     BUILD_LIBRARIES += $(BUILD_LIBAWT_XAWT)
 666 
 667   endif
 668 endif
 669 
 670 ##########################################################################################
 671 
 672 # TODO: Update awt lib path when awt is converted
 673 $(eval $(call SetupNativeCompilation,BUILD_LIBLCMS, \
 674     LIBRARY := lcms, \
 675     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 676     SRC := $(JDK_TOPDIR)/src/share/native/sun/java2d/cmm/lcms, \
 677     LANG := C, \
 678     OPTIMIZATION := HIGHEST, \
 679     CFLAGS := $(filter-out -xc99=%none, $(CFLAGS_JDKLIB)) \
 680         $(SHARED_LIBRARY_FLAGS) \
 681         -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
 682         -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug, \
 683     CFLAGS_solaris := -xc99=no_lib, \
 684     CFLAGS_windows := -DCMS_IS_WINDOWS_, \
 685     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/liblcms/mapfile-vers, \
 686     LDFLAGS := $(LDFLAGS_JDKLIB) \
 687         $(call SET_SHARED_LIBRARY_ORIGIN), \
 688     LDFLAGS_solaris := /usr/lib$(OPENJDK_TARGET_CPU_ISADIR)/libm.so.2, \
 689     LDFLAGS_windows := $(WIN_AWT_LIB) $(WIN_JAVA_LIB), \
 690     LDFLAGS_SUFFIX_solaris := -lawt -ljava -ljvm -lc, \
 691     LDFLAGS_SUFFIX_macosx := $(LIBM) -lawt -ljava -ljvm, \
 692     LDFLAGS_SUFFIX_linux := -lm -lawt -ljava -ljvm, \
 693     LDFLAGS_SUFFIX_aix := -lm -lawt -ljava -ljvm,\
 694     VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
 695     RC_FLAGS := $(RC_FLAGS) \
 696         -D "JDK_FNAME=lcms.dll" \
 697         -D "JDK_INTERNAL_NAME=lcms" \
 698         -D "JDK_FTYPE=0x2L", \
 699     OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/liblcms, \
 700     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 701 
 702 BUILD_LIBRARIES += $(BUILD_LIBLCMS)
 703 
 704 $(BUILD_LIBLCMS): $(BUILD_LIBAWT)
 705 
 706 ##########################################################################################
 707 
 708 ifdef OPENJDK
 709   BUILD_LIBJPEG_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers
 710 else
 711   BUILD_LIBJPEG_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers-closed
 712   BUILD_LIBJPEG_CLOSED_SRC := $(JDK_TOPDIR)/src/closed/share/native/sun/awt/image/jpeg
 713   BUILD_LIBJPEG_CLOSED_INCLUDES := -I$(BUILD_LIBJPEG_CLOSED_SRC)
 714 endif
 715 
 716 BUILD_LIBJPEG_REORDER :=
 717 ifeq ($(OPENJDK_TARGET_OS), solaris)
 718   ifneq ($(OPENJDK_TARGET_CPU), x86_64)
 719     BUILD_LIBJPEG_REORDER := $(JDK_TOPDIR)/make/mapfiles/libjpeg/reorder-$(OPENJDK_TARGET_CPU)
 720   endif
 721 endif
 722 
 723 # Suppress gcc warnings like "variable might be clobbered by 'longjmp'
 724 # or 'vfork'": this warning indicates that some variable is placed to
 725 # a register by optimized compiler and it's value might be lost on longjmp().
 726 # Recommended way to avoid such warning is to declare the variable as
 727 # volatile to prevent the optimization. However, this approach does not
 728 # work because we have to declare all variables as volatile in result.
 729 #ifndef CROSS_COMPILE_ARCH
 730 #  CC_43_OR_NEWER := \
 731 #      $(shell $(EXPR) $(CC_MAJORVER) \> 4 \| \
 732 #          \( $(CC_MAJORVER) = 4 \& $(CC_MINORVER) \>= 3 \) )
 733 #  ifeq ($(CC_43_OR_NEWER), 1)
 734 #    BUILD_LIBJPEG_CFLAGS_linux += -Wno-clobbered
 735 #  endif
 736 #endif
 737 
 738 $(eval $(call SetupNativeCompilation,BUILD_LIBJPEG, \
 739     LIBRARY := jpeg, \
 740     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 741     SRC := $(BUILD_LIBJPEG_CLOSED_SRC) \
 742         $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg, \
 743     LANG := C, \
 744     OPTIMIZATION := HIGHEST, \
 745     CFLAGS := $(CFLAGS_JDKLIB) \
 746         $(BUILD_LIBJPEG_CLOSED_INCLUDES) \
 747         -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg, \
 748     MAPFILE := $(BUILD_LIBJPEG_MAPFILE), \
 749     LDFLAGS := $(LDFLAGS_JDKLIB) \
 750         $(call SET_SHARED_LIBRARY_ORIGIN), \
 751     LDFLAGS_windows := $(WIN_JAVA_LIB) jvm.lib, \
 752     LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \
 753     VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
 754     RC_FLAGS := $(RC_FLAGS) \
 755         -D "JDK_FNAME=jpeg.dll" \
 756         -D "JDK_INTERNAL_NAME=jpeg" \
 757         -D "JDK_FTYPE=0x2L", \
 758     REORDER := $(BUILD_LIBJPEG_REORDER), \
 759     OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjpeg, \
 760     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 761 
 762 $(BUILD_LIBJPEG): $(BUILD_LIBJAVA)
 763 
 764 BUILD_LIBRARIES += $(BUILD_LIBJPEG)
 765 
 766 ##########################################################################################
 767 
 768 ifndef OPENJDK
 769   FONT_HEADERS := -I$(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k
 770   BUILD_LIBFONTMANAGER_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libfontmanager/mapfile-vers
 771   LIBFONTMANAGER_EXCLUDE_FILES += freetypeScaler.c
 772 else
 773   FONT_HEADERS := $(FREETYPE_CFLAGS)
 774   BUILD_LIBFONTMANAGER_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libfontmanager/mapfile-vers.openjdk
 775   BUILD_LIBFONTMANAGER_FONTLIB := $(FREETYPE_LIBS)
 776 endif
 777 
 778 LIBFONTMANAGER_OPTIMIZATION := HIGH
 779 
 780 ifeq ($(OPENJDK_TARGET_OS), windows)
 781   LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
 782       X11TextRenderer.c
 783   LIBFONTMANAGER_OPTIMIZATION := HIGHEST
 784 else ifeq ($(OPENJDK_TARGET_OS), macosx)
 785   LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
 786       X11TextRenderer.c \
 787       fontpath.c \
 788       lcdglyph.c
 789 else
 790   LIBFONTMANAGER_EXCLUDE_FILES += fontpath.c \
 791       lcdglyph.c
 792 endif
 793 
 794 BUILD_LIBFONTMANAGER_CFLAGS_COMMON := \
 795     $(X_CFLAGS) \
 796     -DLE_STANDALONE -DHEADLESS \
 797     $(FONT_HEADERS) \
 798     -I$(JDK_TOPDIR)/src/share/native/sun/font \
 799     -I$(JDK_TOPDIR)/src/share/native/sun/font/layout \
 800     -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
 801     -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \
 802     -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
 803     -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
 804     -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
 805     -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
 806     -I$(JDK_TOPDIR)/src/share/native/sun/java2d
 807 
 808 # Turn off aliasing with GCC for ExtensionSubtables.cpp
 809 ifeq ($(OPENJDK_TARGET_OS), linux)
 810   BUILD_LIBFONTMANAGER_ExtensionSubtables.cpp_CXXFLAGS := -fno-strict-aliasing
 811 endif
 812 
 813 $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \
 814     LIBRARY := fontmanager, \
 815     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 816     SRC := $(JDK_TOPDIR)/src/share/native/sun/font \
 817         $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/font, \
 818     EXCLUDE_FILES := $(LIBFONTMANAGER_EXCLUDE_FILES) \
 819         AccelGlyphCache.c, \
 820     LANG := C++, \
 821     CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBFONTMANAGER_CFLAGS_COMMON), \
 822     CXXFLAGS := $(CXXFLAGS_JDKLIB) $(BUILD_LIBFONTMANAGER_CFLAGS_COMMON), \
 823     OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \
 824     CFLAGS_windows = -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \
 825         -DCC_NOEX, \
 826     MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \
 827     LDFLAGS := $(subst -Xlinker -z -Xlinker defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \
 828         $(call SET_SHARED_LIBRARY_ORIGIN), \
 829     LDFLAGS_SUFFIX := $(BUILD_LIBFONTMANAGER_FONTLIB), \
 830     LDFLAGS_SUFFIX_linux := -lawt $(LIBM) $(LIBCXX) -ljava -ljvm -lc, \
 831     LDFLAGS_SUFFIX_solaris := -lawt -lawt_xawt -lc $(LIBM) $(LIBCXX) -ljava -ljvm, \
 832     LDFLAGS_SUFFIX_aix := -lawt -lawt_xawt $(LIBM) $(LIBCXX) -ljava -ljvm,\
 833     LDFLAGS_SUFFIX_macosx := -lawt $(LIBM) $(LIBCXX) -undefined dynamic_lookup \
 834         -ljava -ljvm, \
 835     LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib gdi32.lib \
 836         $(WIN_AWT_LIB), \
 837     VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
 838     RC_FLAGS := $(RC_FLAGS) \
 839         -D "JDK_FNAME=fontmanager.dll" \
 840         -D "JDK_INTERNAL_NAME=fontmanager" \
 841         -D "JDK_FTYPE=0x2L", \
 842     OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libfontmanager, \
 843     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 844 
 845 $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT)
 846 
 847 ifneq (, $(findstring $(OPENJDK_TARGET_OS), solaris aix))
 848   $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT_XAWT)
 849 endif
 850 
 851 BUILD_LIBRARIES += $(BUILD_LIBFONTMANAGER)
 852 
 853 ##########################################################################################
 854 
 855 ifndef OPENJDK
 856 
 857   #ifeq ($(OPENJDK_TARGET_OS), linux)
 858   #  ifeq ("$(CC_VER_MAJOR)", "3")
 859   #    OTHER_LDLIBS += -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
 860   #  endif
 861   #endif
 862   #
 863   # The resulting size of the t2k lib file is (at least on linux) dependant on the order of
 864   # the input .o files. Because of this the new build will differ in size to the old build.
 865   BUILD_LIBT2K_CFLAGS_COMMON := -I$(JDK_TOPDIR)/src/share/native/sun/font \
 866       -I$(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k \
 867       -I$(JDK_TOPDIR)/src/closed/share/native/sun/font \
 868       -I$(JDK_TOPDIR)/src/share/share/native/sun/font \
 869       -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/font \
 870       -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
 871       -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
 872       -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
 873       -I$(JDK_TOPDIR)/src/share/native/sun/java2d
 874 
 875   $(eval $(call SetupNativeCompilation,BUILD_LIBT2K, \
 876       LIBRARY := t2k, \
 877       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 878       SRC := $(JDK_TOPDIR)/src/closed/share/native/sun/font \
 879           $(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k \
 880           $(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k/ttHints, \
 881       EXCLUDE_FILES := orion.c, \
 882       LANG := C++, \
 883       OPTIMIZATION := HIGH, \
 884       CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBT2K_CFLAGS_COMMON), \
 885       CXXFLAGS := $(CXXFLAGS_JDKLIB) $(BUILD_LIBT2K_CFLAGS_COMMON), \
 886       CFLAGS_windows = -DCC_NOEX, \
 887       CXXFLAGS_windows = -DCC_NOEX, \
 888       MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libt2k/mapfile-vers, \
 889       LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
 890           $(call SET_SHARED_LIBRARY_ORIGIN), \
 891       LDFLAGS_windows := user32.lib $(JDK_OUTPUTDIR)/objs/libfontmanager/fontmanager.lib, \
 892       LDFLAGS_SUFFIX_posix := $(LIBM) $(LIBCXX) -lfontmanager -ljava -ljvm -lc, \
 893       LDFLAGS_SUFFIX_solaris := -lawt -lawt_xawt, \
 894       VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
 895       RC_FLAGS := $(RC_FLAGS) \
 896           -D "JDK_FNAME=t2k.dll" \
 897           -D "JDK_INTERNAL_NAME=t2k" \
 898           -D "JDK_FTYPE=0x2L", \
 899       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libt2k, \
 900       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 901 
 902   # t2k is linked against fontmanager
 903   $(BUILD_LIBT2K): $(BUILD_LIBFONTMANAGER)
 904 
 905   BUILD_LIBRARIES += $(BUILD_LIBT2K)
 906 endif
 907 
 908 ##########################################################################################
 909 
 910 ifeq ($(OPENJDK_TARGET_OS), windows)
 911   ifeq ($(OPENJDK_TARGET_CPU), x86)
 912     KERNEL32_LIB := kernel32.lib
 913   endif
 914   $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT, \
 915       LIBRARY := jawt, \
 916       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 917       SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows, \
 918       INCLUDE_FILES := jawt.cpp, \
 919       LANG := C++, \
 920       OPTIMIZATION := LOW, \
 921       CFLAGS := $(CXXFLAGS_JDKLIB) \
 922           -EHsc -DUNICODE -D_UNICODE \
 923           -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \
 924           -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
 925           -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
 926           -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
 927           -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/windows, \
 928       LDFLAGS := $(LDFLAGS_JDKLIB) $(KERNEL32_LIB) $(LDFLAGS_CXX_JDK) \
 929           advapi32.lib $(WIN_AWT_LIB), \
 930       LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \
 931       VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
 932       RC_FLAGS := $(RC_FLAGS) \
 933           -D "JDK_FNAME=jawt.dll" \
 934           -D "JDK_INTERNAL_NAME=jawt" \
 935           -D "JDK_FTYPE=0x2L", \
 936       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjawt, \
 937       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 938 
 939   $(BUILD_LIBJAWT): $(BUILD_LIBAWT)
 940 
 941   $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX): $(BUILD_LIBJAWT)
 942         $(ECHO) Copying $(@F)
 943         $(CP) $(JDK_OUTPUTDIR)/objs/libjawt/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX) $@
 944 
 945   BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
 946 
 947 else # OPENJDK_TARGET_OS not windows
 948 
 949   ifeq ($(OPENJDK_TARGET_OS), macosx)
 950     JAWT_FILES := jawt.m
 951     JAWT_LIBS := -lawt_lwawt
 952   else
 953     JAWT_FILES := jawt.c
 954     JAWT_LIBS :=
 955     ifneq ($(OPENJDK_TARGET_OS), solaris)
 956       JAWT_LIBS += -lawt
 957     endif
 958     ifndef BUILD_HEADLESS_ONLY
 959       JAWT_LIBS += -lawt_xawt
 960     else
 961       JAWT_LIBS += -lawt_headless
 962       HEADLESS_CFLAG += -DHEADLESS
 963     endif
 964   endif
 965 
 966   $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT, \
 967       LIBRARY := jawt, \
 968       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 969       SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \
 970           $(JDK_TOPDIR)/src/macosx/native/sun/awt, \
 971       INCLUDE_FILES := $(JAWT_FILES), \
 972       LANG := C, \
 973       OPTIMIZATION := LOW, \
 974       CFLAGS := $(CFLAGS_JDKLIB), \
 975       CFLAGS_linux := $(HEADLESS_CFLAG), \
 976       CFLAGS_macosx := -I$(JDK_TOPDIR)/src/solaris/native/sun/awt, \
 977       MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjawt/mapfile-vers, \
 978       LDFLAGS := $(LDFLAGS_JDKLIB) \
 979           $(call SET_SHARED_LIBRARY_ORIGIN), \
 980       LDFLAGS_solaris := -L$(OPENWIN_HOME)/sfw/lib$(OPENJDK_TARGET_CPU_ISADIR) -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR), \
 981       LDFLAGS_SUFFIX_linux := $(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX), \
 982       LDFLAGS_SUFFIX_aix := $(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX),\
 983       LDFLAGS_SUFFIX_solaris := $(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX) -lXrender, \
 984       LDFLAGS_SUFFIX_macosx := -Xlinker -rpath -Xlinker @loader_path $(JAWT_LIBS) \
 985           -framework Cocoa $(LDFLAGS_JDKLIB_SUFFIX), \
 986       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjawt, \
 987       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 988 
 989   ifndef BUILD_HEADLESS_ONLY
 990     $(BUILD_LIBJAWT): $(BUILD_LIBAWT_XAWT)
 991   else
 992     $(BUILD_LIBJAWT): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_headless$(SHARED_LIBRARY_SUFFIX)
 993   endif
 994 
 995   ifeq ($(OPENJDK_TARGET_OS), macosx)
 996     $(BUILD_LIBJAWT): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_lwawt$(SHARED_LIBRARY_SUFFIX)
 997   endif
 998 
 999 endif # OPENJDK_TARGET_OS
1000 
1001 BUILD_LIBRARIES += $(BUILD_LIBJAWT)
1002 
1003 ##########################################################################################
1004 
1005 ifndef OPENJDK
1006 
1007   BUILD_LIBKCMS_EXCLUDE_FILES :=
1008   ifeq ($(OPENJDK_TARGET_OS), windows)
1009     BUILD_LIBKCMS_EXCLUDE_FILES += ukcpmgr.c unixmem.c
1010   else
1011     BUILD_LIBKCMS_EXCLUDE_FILES += cmmdll.c registry.c spxffile.c sysinfo.c winmem.c wkcpmgr.c
1012   endif
1013 
1014   BUILD_LIBKCMS_FLAGS := $(CFLAGS_JDKLIB)
1015 
1016   ifeq ($(OPENJDK_TARGET_OS), solaris)
1017     # This particular library uses a feature called PIC_CODE_SMALL (on solaris)
1018     # implement it like this...since it's only used here
1019     BUILD_LIBKCMS_FLAGS := $(patsubst -KPIC, -Kpic, $(BUILD_LIBKCMS_FLAGS))
1020   else ifeq ($(OPENJDK_TARGET_CPU_ARCH), ppc)
1021     BUILD_LIBKCMS_FLAGS := $(patsubst -fPIC, -fpic, $(BUILD_LIBKCMS_FLAGS))
1022   endif
1023 
1024   $(eval $(call SetupNativeCompilation,BUILD_LIBKCMS, \
1025       LIBRARY := kcms, \
1026       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
1027       SRC := $(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms, \
1028       LANG := C, \
1029       EXCLUDE_FILES := $(BUILD_LIBKCMS_EXCLUDE_FILES), \
1030       OPTIMIZATION := LOW, \
1031       CFLAGS := $(BUILD_LIBKCMS_FLAGS) \
1032           -DJAVACMM -DFUT_CALC_EX -DNO_FUT_GCONST, \
1033       CFLAGS_linux := -Wno-missing-field-initializers, \
1034       MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libkcms/mapfile-vers, \
1035       LDFLAGS := $(LDFLAGS_JDKLIB) \
1036           $(call SET_SHARED_LIBRARY_ORIGIN), \
1037       LDFLAGS_SUFFIX_linux := -lc -lpthread, \
1038       LDFLAGS_SUFFIX_solaris := -lc, \
1039       LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib version.lib, \
1040       LDFLAGS_SUFFIX_posix := -lm -ljava -ljvm, \
1041       VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms/cmm.rc, \
1042       VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms/cmm.rc, \
1043       RC_FLAGS := $(RC_FLAGS) \
1044           -D "JDK_FNAME=kcms.dll" \
1045           -D "JDK_INTERNAL_NAME=kcms" \
1046           -D "JDK_FTYPE=0x2L", \
1047       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libkcms, \
1048       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
1049 
1050   $(BUILD_LIBKCMS): $(BUILD_LIBJAVA)
1051 
1052   BUILD_LIBRARIES += $(BUILD_LIBKCMS)
1053 
1054 endif
1055 
1056 ##########################################################################################
1057 
1058 ifndef OPENJDK
1059   ifeq ($(OPENJDK_TARGET_OS), solaris)
1060     ifneq ($(OPENJDK_TARGET_CPU), x86_64)
1061 
1062       ifeq ($(shell if test "$(OS_VERSION_MAJOR)" -eq 5 -a "$(OS_VERSION_MINOR)" -le 10; then $(ECHO) ok; fi), ok)
1063 
1064         SUNWJDGA_MAPFILE :=
1065         ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
1066           SUNWJDGA_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjdga/mapfile-vers
1067         endif
1068 
1069         $(eval $(call SetupNativeCompilation,BUILD_LIBSUNWJDGA, \
1070             LIBRARY := sunwjdga, \
1071             OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
1072             SRC := $(JDK_TOPDIR)/src/solaris/native/sun/jdga, \
1073             LANG := C, \
1074             OPTIMIZATION := LOW, \
1075             CFLAGS := $(CFLAGS_JDKLIB) \
1076                 -I$(JDK_TOPDIR)/src/share/javavm/export \
1077                 -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/javavm/export \
1078                 -I$(OPENWIN_HOME)/include, \
1079             MAPFILE := $(SUNWJDGA_MAPFILE), \
1080             LDFLAGS := $(LDFLAGS_JDKLIB) \
1081                 $(call SET_SHARED_LIBRARY_ORIGIN), \
1082             LDFLAGS_SUFFIX := -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) -ldga -lX11 $(LIBDL) -lc, \
1083             OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libsunwjdga, \
1084             DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
1085 
1086         BUILD_LIBRARIES += $(BUILD_LIBSUNWJDGA)
1087 
1088       endif
1089     endif
1090   endif
1091 endif
1092 
1093 ##########################################################################################
1094 
1095 ifeq ($(BUILD_HEADLESS), true)
1096   # Mac and Windows only use the native AWT lib, do not build libawt_headless
1097   ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx),)
1098 
1099     LIBAWT_HEADLESS_DIRS := $(JDK_TOPDIR)/src/share/native/sun/font \
1100         $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
1101         $(JDK_TOPDIR)/src/solaris/native/sun/font \
1102         $(JDK_TOPDIR)/src/solaris/native/sun/awt \
1103         $(JDK_TOPDIR)/src/solaris/native/sun/java2d/opengl \
1104         $(JDK_TOPDIR)/src/solaris/native/sun/java2d/x11
1105 
1106     ifeq ($(OPENJDK_TARGET_OS), macosx)
1107       LIBAWT_HEADLESS_DIRS += $(JDK_TOPDIR)/src/macosx/native/sun/font
1108     endif
1109 
1110     LIBAWT_HEADLESS_CFLAGS := -DHEADLESS=true \
1111         -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
1112         $(CUPS_CFLAGS) \
1113         $(X_CFLAGS) \
1114         -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
1115         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
1116         -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
1117         -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
1118         -I$(JDK_TOPDIR)/src/share/native/sun/awt/image \
1119         -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
1120         -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
1121         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/jdga \
1122         $(foreach dir, $(LIBAWT_HEADLESS_DIRS), -I$(dir))
1123 
1124     ifeq ($(OPENJDK_TARGET_OS), macosx)
1125       LIBAWT_HEADLESS_CFLAGS += \
1126           -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
1127           -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks
1128     endif
1129 
1130     LIBAWT_HEADLESS_FILES := \
1131         awt_Font.c \
1132         HeadlessToolkit.c \
1133         fontpath.c \
1134         VDrawingArea.c \
1135         X11Color.c \
1136         X11Renderer.c \
1137         X11PMBlitLoops.c \
1138         X11SurfaceData.c \
1139         X11FontScaler_md.c \
1140         X11TextRenderer_md.c \
1141         OGLBlitLoops.c \
1142         OGLBufImgOps.c \
1143         OGLContext.c \
1144         OGLFuncs.c \
1145         OGLMaskBlit.c \
1146         OGLMaskFill.c \
1147         OGLPaints.c \
1148         OGLRenderQueue.c \
1149         OGLRenderer.c \
1150         OGLSurfaceData.c \
1151         OGLTextRenderer.c \
1152         OGLVertexCache.c \
1153         GLXGraphicsConfig.c \
1154         GLXSurfaceData.c \
1155         AccelGlyphCache.c \
1156         CUPSfuncs.c
1157 
1158     LIBAWT_HEADLESS_REORDER :=
1159     ifeq ($(OPENJDK_TARGET_OS), solaris)
1160       ifneq ($(OPENJDK_TARGET_CPU), x86_64)
1161         LIBAWT_HEADLESS_REORDER := $(JDK_TOPDIR)/make/mapfiles/libawt_headless/reorder-$(OPENJDK_TARGET_CPU)
1162       endif
1163     endif
1164 
1165     $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_HEADLESS, \
1166         LIBRARY := awt_headless, \
1167         OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
1168         SRC := $(LIBAWT_HEADLESS_DIRS), \
1169         INCLUDE_FILES := $(LIBAWT_HEADLESS_FILES), \
1170         LANG := C, \
1171         OPTIMIZATION := LOW, \
1172         CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_HEADLESS_CFLAGS), \
1173         MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_headless/mapfile-vers, \
1174         LDFLAGS := $(LDFLAGS_JDKLIB) \
1175             $(call SET_SHARED_LIBRARY_ORIGIN), \
1176         LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
1177         LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..) \
1178             -R/usr/dt/lib$(OPENJDK_TARGET_CPU_ISADIR) \
1179             -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR), \
1180         LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN)., \
1181         REORDER := $(LIBAWT_HEADLESS_REORDER), \
1182         LDFLAGS_SUFFIX_linux := -ljvm -lawt -lm $(LIBDL) -ljava, \
1183         LDFLAGS_SUFFIX_aix := -ljvm -lawt -ljava,\
1184         LDFLAGS_SUFFIX_solaris := $(LIBDL) -ljvm -lawt -lm -ljava $(LIBCXX) -lc, \
1185         OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt_headless, \
1186         DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
1187 
1188     $(BUILD_LIBAWT_HEADLESS): $(BUILD_LIBAWT)
1189 
1190     BUILD_LIBRARIES += $(BUILD_LIBAWT_HEADLESS)
1191 
1192   endif
1193 endif
1194 
1195 ##########################################################################################
1196 
1197 ifndef BUILD_HEADLESS_ONLY
1198   LIBSPLASHSCREEN_DIRS := \
1199     $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg \
1200     $(JDK_TOPDIR)/src/share/native/sun/awt/libpng \
1201     $(JDK_TOPDIR)/src/share/native/sun/awt/splashscreen
1202 
1203   ifeq ($(USE_EXTERNAL_LIBGIF), true)
1204     GIFLIB_LDFLAGS := -lgif
1205   else
1206     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/sun/awt/giflib
1207     GIFLIB_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/awt/giflib
1208   endif
1209 
1210   ifneq ($(OPENJDK_TARGET_OS), macosx)
1211     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt/splashscreen
1212   else
1213     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen
1214   endif
1215 
1216   LIBSPLASHSCREEN_CFLAGS := -DSPLASHSCREEN -DPNG_NO_MMX_CODE \
1217       $(foreach dir, $(LIBSPLASHSCREEN_DIRS), -I$(dir))
1218 
1219   ifeq ($(OPENJDK_TARGET_OS), macosx)
1220     LIBSPLASHSCREEN_CFLAGS := -I$(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen \
1221         $(LIBSPLASHSCREEN_CFLAGS) \
1222         -F/System/Library/Frameworks/JavaVM.framework/Frameworks
1223     LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX
1224     LIBSPLASHSCREEN_CFLAGS += -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp
1225 
1226     LIBSPLASHSCREEN_java_awt_SplashScreen.c_CFLAGS := -x objective-c -O0
1227     LIBSPLASHSCREEN_splashscreen_gfx_impl.c_CFLAGS := -x objective-c -O0
1228     LIBSPLASHSCREEN_splashscreen_gif.c_CFLAGS := -x objective-c -O0
1229     LIBSPLASHSCREEN_splashscreen_impl.c_CFLAGS := -x objective-c -O0
1230     LIBSPLASHSCREEN_splashscreen_jpeg.c_CFLAGS := -x objective-c -O0
1231     LIBSPLASHSCREEN_splashscreen_png.c_CFLAGS := -x objective-c -O0
1232     LIBSPLASHSCREEN_splashscreen_sys.m_CFLAGS := -O0
1233 
1234   else ifeq ($(OPENJDK_TARGET_OS), windows)
1235     LIBSPLASHSCREEN_CFLAGS += -DWITH_WIN32
1236   else ifeq ($(OPENJDK_TARGET_OS), solaris)
1237     LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 -I$(OPENWIN_HOME)/include -I$(OPENWIN_HOME)/include/X11/extensions
1238   else
1239     LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 $(X_CFLAGS)
1240   endif
1241 
1242   LIBSPLASHSCREEN_LDFLAGS_SUFFIX :=
1243 
1244   ifneq ($(USE_EXTERNAL_LIBZ), true)
1245     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
1246     LIBSPLASHSCREEN_CFLAGS += $(ZLIB_CPPFLAGS)
1247   endif
1248 
1249   ifeq ($(OPENJDK_TARGET_OS), macosx)
1250     LIBSPLASHSCREEN_LDFLAGS_SUFFIX += $(LIBM) -lpthread -liconv -losxapp \
1251         -framework ApplicationServices \
1252         -framework Foundation \
1253         -framework Cocoa \
1254         -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
1255         -framework JavaNativeFoundation
1256   else ifeq ($(OPENJDK_TARGET_OS), windows)
1257     LIBSPLASHSCREEN_LDFLAGS_SUFFIX += kernel32.lib user32.lib gdi32.lib delayimp.lib -DELAYLOAD:user32.dll
1258   else ifeq ($(OPENJDK_TARGET_OS), solaris)
1259     # Solaris still uses OPENWIN_LIB ..
1260     LIBSPLASHSCREEN_LDFLAGS_SUFFIX += -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) -lX11 -lXext $(LIBM) -lpthread
1261   else  # .. all other Unixes can use X_LIBS
1262     LIBSPLASHSCREEN_LDFLAGS_SUFFIX += $(X_LIBS) -lX11 -lXext $(LIBM) -lpthread
1263   endif
1264 
1265   $(eval $(call SetupNativeCompilation,LIBSPLASHSCREEN, \
1266       LIBRARY := splashscreen, \
1267       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
1268       SRC := $(LIBSPLASHSCREEN_DIRS), \
1269       EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
1270       LANG := C, \
1271       OPTIMIZATION := LOW, \
1272       CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) $(GIFLIB_CFLAGS), \
1273       MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libsplashscreen/mapfile-vers, \
1274       LDFLAGS := $(LDFLAGS_JDKLIB) \
1275           $(call SET_SHARED_LIBRARY_ORIGIN), \
1276       LDFLAGS_SUFFIX := $(LIBSPLASHSCREEN_LDFLAGS_SUFFIX) $(LIBZ) $(GIFLIB_LDFLAGS), \
1277       LDFLAGS_SUFFIX_solaris := -lc, \
1278       VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
1279       RC_FLAGS := $(RC_FLAGS) \
1280           -D "JDK_FNAME=splashscreen.dll" \
1281           -D "JDK_INTERNAL_NAME=splashscreen" \
1282           -D "JDK_FTYPE=0x2L", \
1283       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libsplashscreen, \
1284       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
1285 
1286   BUILD_LIBRARIES += $(LIBSPLASHSCREEN)
1287 
1288   ifeq ($(OPENJDK_TARGET_OS), macosx)
1289     $(LIBSPLASHSCREEN): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)osxapp$(SHARED_LIBRARY_SUFFIX)
1290   endif
1291 
1292 endif
1293 
1294 ##########################################################################################
1295 
1296 ifndef OPENJDK
1297 
1298   LIBDCPR_SRC_DIRS := \
1299       $(JDK_TOPDIR)/src/closed/share/native/sun/dc/doe \
1300       $(JDK_TOPDIR)/src/closed/share/native/sun/dc/path \
1301       $(JDK_TOPDIR)/src/closed/share/native/sun/dc/pr \
1302       $(JDK_TOPDIR)/src/closed/share/native/sun/dc/util
1303 
1304   LIBDCPR_CFLAGS := $(foreach dir, $(LIBDCPR_SRC_DIRS), -I$(dir)) \
1305       -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe
1306 
1307   $(eval $(call SetupNativeCompilation,BUILD_LIBDCPR, \
1308       LIBRARY := dcpr, \
1309       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
1310       SRC := $(LIBDCPR_SRC_DIRS), \
1311       LANG := C, \
1312       OPTIMIZATION := LOW, \
1313       CFLAGS := $(CFLAGS_JDKLIB) \
1314           $(LIBDCPR_CFLAGS), \
1315       MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libdcpr/mapfile-vers, \
1316       LDFLAGS := $(LDFLAGS_JDKLIB) \
1317           $(call SET_SHARED_LIBRARY_ORIGIN), \
1318       LDFLAGS_SUFFIX := $(LIBM) $(LDFLAGS_JDKLIB_SUFFIX), \
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