Awt2dLibraries.gmk 52.5 KB
Newer Older
I
ihse 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#
# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.  Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

26
# Openwin is defined on Solaris.
I
ihse 已提交
27 28 29 30 31 32 33 34 35 36 37 38
OPENWIN_LIB := $(OPENWIN_HOME)/lib

WIN_AWT_LIB := $(JDK_OUTPUTDIR)/objs/libawt/awt.lib

##########################################################################################

BUILD_LIBMLIB_SRC := $(JDK_TOPDIR)/src/share/native/sun/awt/medialib
BUILD_LIBMLIB_CFLAGS := -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES \
    -I$(BUILD_LIBMLIB_SRC) \
    -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt/medialib

BUILD_LIBMLIB_LDLIBS :=
I
ihse 已提交
39
BUILD_LIBMLIB_IMAGE_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libmlib_image/mapfile-vers
I
ihse 已提交
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228

BUILD_LIBMLIB_CFLAGS += -DMLIB_NO_LIBSUNMATH

ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
  BUILD_LIBMLIB_CFLAGS += -DMLIB_OS64BIT
endif

ifneq ($(OPENJDK_TARGET_OS), windows)
  BUILD_LIBMLIB_LDLIBS += $(LIBM) $(LIBDL)
endif

$(eval $(call SetupNativeCompilation,BUILD_LIBMLIB_IMAGE, \
    LIBRARY := mlib_image, \
    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    SRC := $(BUILD_LIBMLIB_SRC), \
    EXCLUDE_FILES := awt_ImagingLib.c mlib_c_ImageBlendTable.c, \
    LANG := C, \
    OPTIMIZATION := HIGHEST, \
    CFLAGS := $(CFLAGS_JDKLIB) \
        $(BUILD_LIBMLIB_CFLAGS), \
    MAPFILE := $(BUILD_LIBMLIB_IMAGE_MAPFILE), \
    LDFLAGS := $(LDFLAGS_JDKLIB) \
        $(call SET_SHARED_LIBRARY_ORIGIN), \
    LDFLAGS_SUFFIX := $(BUILD_LIBMLIB_LDLIBS) \
        $(LDFLAGS_JDKLIB_SUFFIX), \
    LDFLAGS_SUFFIX_solaris := -lc, \
    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    RC_FLAGS := $(RC_FLAGS) \
        -D "JDK_FNAME=mlib_image.dll" \
        -D "JDK_INTERNAL_NAME=mlib_image" \
        -D "JDK_FTYPE=0x2L", \
    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libmlib_image, \
    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))

$(BUILD_LIBMLIB_IMAGE): $(BUILD_LIBJAVA)

BUILD_LIBRARIES += $(BUILD_LIBMLIB_IMAGE)

##########################################################################################

ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)

  BUILD_LIBMLIB_IMAGE_V_FILES := \
      mlib_v_ImageLookUp.c \
      mlib_ImageCreate.c \
      mlib_ImageAffine.c \
      mlib_ImageConvMxN.c \
      mlib_ImageConvKernelConvert.c \
      mlib_sys.c \
      mlib_ImageLookUp_64.c \
      mlib_ImageLookUp_Bit.c \
      mlib_ImageColorTrue2Index.c \
      mlib_c_ImageThresh1_U8.c \
      mlib_v_ImageLookUpS16S16Func.c \
      mlib_v_ImageLookUpS16S32Func.c \
      mlib_v_ImageLookUpS16U16Func.c \
      mlib_v_ImageLookUpS16U8Func.c \
      mlib_v_ImageLookUpS32S16Func.c \
      mlib_v_ImageLookUpS32S32Func.c \
      mlib_v_ImageLookUpS32U16Func.c \
      mlib_v_ImageLookUpS32U8Func.c \
      mlib_v_ImageLookUpSIS16S16Func.c \
      mlib_v_ImageLookUpSIS16S32Func.c \
      mlib_v_ImageLookUpSIS16U16Func.c \
      mlib_v_ImageLookUpSIS16U8Func.c \
      mlib_v_ImageLookUpSIS32S16Func.c \
      mlib_v_ImageLookUpSIS32S32Func.c \
      mlib_v_ImageLookUpSIS32U16Func.c \
      mlib_v_ImageLookUpSIS32U8Func.c \
      mlib_v_ImageLookUpSIU16S16Func.c \
      mlib_v_ImageLookUpSIU16S32Func.c \
      mlib_v_ImageLookUpSIU16U16Func.c \
      mlib_v_ImageLookUpSIU16U8Func.c \
      mlib_v_ImageLookUpSIU8S16Func.c \
      mlib_v_ImageLookUpSIU8S32Func.c \
      mlib_v_ImageLookUpSIU8U16Func.c \
      mlib_v_ImageLookUpSIU8U8Func.c \
      mlib_v_ImageLookUpU16S16Func.c \
      mlib_v_ImageLookUpU16S32Func.c \
      mlib_v_ImageLookUpU16U16Func.c \
      mlib_v_ImageLookUpU16U8Func.c \
      mlib_v_ImageLookUpU8S16Func.c \
      mlib_v_ImageLookUpU8S32Func.c \
      mlib_v_ImageLookUpU8U16Func.c \
      mlib_v_ImageLookUpU8U8Func.c \
      mlib_v_ImageAffineIndex_BC.c \
      mlib_v_ImageAffine_BC.c \
      mlib_v_ImageAffine_BC_S16.c \
      mlib_v_ImageAffine_BC_U16.c \
      mlib_v_ImageAffine_BL.c \
      mlib_v_ImageAffine_BL_S16.c \
      mlib_v_ImageAffine_BL_U16.c \
      mlib_v_ImageAffine_NN.c \
      mlib_v_ImageFilters.c \
      mlib_ImageAffineEdge.c \
      mlib_ImageAffine_BC_D64.c \
      mlib_ImageAffine_BC_F32.c \
      mlib_ImageAffine_BC_S32.c \
      mlib_ImageAffine_BL_D64.c \
      mlib_ImageAffine_BL_F32.c \
      mlib_ImageAffine_BL_S32.c \
      mlib_ImageAffine_NN.c \
      mlib_ImageAffine_NN_Bit.c \
      mlib_ImageFilters.c \
      mlib_ImageScanPoly.c \
      mlib_ImageConv_8nw.c \
      mlib_ImageConv_8ext.c \
      mlib_ImageConv_16nw.c \
      mlib_ImageConv_16ext.c \
      mlib_ImageConv_u16nw.c \
      mlib_ImageConv_u16ext.c \
      mlib_ImageConv_32nw.c \
      mlib_ImageConv_F32nw.c \
      mlib_ImageConvMxN_Fp.c \
      mlib_ImageConvMxN_ext.c \
      mlib_ImageConv_D64nw.c \
      mlib_ImageClipping.c \
      mlib_ImageConvCopyEdge_Bit.c \
      mlib_ImageConvClearEdge_Bit.c \
      mlib_ImageConv2x2_f.c \
      mlib_ImageConvClearEdge_Fp.c \
      mlib_v_ImageConvMxN_8.c \
      mlib_v_ImageConvClearEdge.c \
      mlib_v_ImageConvCopyEdge.c \
      mlib_v_ImageConvMxN_8ext.c \
      mlib_v_ImageConvVersion.c \
      mlib_v_ImageConv_8nw.c \
      mlib_ImageConvCopyEdge_Fp.c \
      mlib_v_ImageChannelInsert_1.c \
      mlib_v_ImageChannelExtract_43.c \
      mlib_v_ImageChannelExtract_1.c \
      mlib_ImageCopy_Bit.c \
      mlib_v_ImageCopy_f.c \
      mlib_ImageUtils.c \
      mlib_ImageDivTables.c

  BUILD_LIBMLIB_V_CFLAGS := $(filter-out -DMLIB_NO_LIBSUNMATH, $(BUILD_LIBMLIB_CFLAGS))

  $(eval $(call SetupNativeCompilation,BUILD_LIBMLIB_IMAGE_V, \
      LIBRARY := mlib_image_v, \
      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
      SRC := $(JDK_TOPDIR)/src/share/native/sun/awt/medialib \
          $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib, \
      LANG := C, \
      INCLUDE_FILES := $(BUILD_LIBMLIB_IMAGE_V_FILES), \
      OPTIMIZATION := HIGHEST, \
      CFLAGS := -xarch=sparcvis \
          $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib/vis_$(OPENJDK_TARGET_CPU_BITS).il \
          $(BUILD_LIBMLIB_V_CFLAGS) \
          $(CFLAGS_JDKLIB), \
      MAPFILE := $(BUILD_LIBMLIB_IMAGE_MAPFILE), \
      LDFLAGS := $(LDFLAGS_JDKLIB) \
          $(BUILD_LIBMLIB_LDLIBS) -ljava -ljvm \
          $(call SET_SHARED_LIBRARY_ORIGIN), \
      LDFLAGS_SUFFIX_solaris := -lc, \
      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libmlib_image_v, \
      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))

  $(BUILD_LIBMLIB_IMAGE_V): $(BUILD_LIBJAVA)

  BUILD_LIBRARIES += $(BUILD_LIBMLIB_IMAGE_V)

endif

##########################################################################################

LIBAWT_DIRS := \
    $(JDK_TOPDIR)/src/share/native/sun/awt \
    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \
    $(JDK_TOPDIR)/src/share/native/sun/awt/image \
    $(JDK_TOPDIR)/src/share/native/sun/awt/image/gif \
    $(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
    $(JDK_TOPDIR)/src/share/native/sun/awt/medialib \
    $(JDK_TOPDIR)/src/share/native/sun/awt/debug \
    $(JDK_TOPDIR)/src/share/native/sun/awt/utility \
    $(JDK_TOPDIR)/src/share/native/sun/java2d \
    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
    $(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
    $(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
    $(JDK_TOPDIR)/src/share/native/sun/awt/image \
    $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/opengl \
    $(JDK_TOPDIR)/src/share/native/sun/font

ifeq ($(OPENJDK_TARGET_OS), windows)
  LIBAWT_DIRS += \
      $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \
      $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/windows \
      $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/d3d
229
else ifneq ($(OPENJDK_TARGET_OS), macosx)
I
ihse 已提交
230 231 232 233
  LIBAWT_DIRS += \
      $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/x11
endif

234 235 236 237
ifeq ($(OPENJDK_TARGET_OS), aix)
  LIBAWT_DIRS += $(JDK_TOPDIR)/src/aix/porting
endif

I
ihse 已提交
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311
LIBAWT_CFLAGS += -D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES \
    $(X_CFLAGS) \
    $(foreach dir, $(LIBAWT_DIRS), -I$(dir))

LIBAWT_FILES := \
    gifdecoder.c \
    imageInitIDs.c \
    img_globals.c \
    SurfaceData.c \
    Region.c \
    BufImgSurfaceData.c \
    Disposer.c \
    Trace.c \
    GraphicsPrimitiveMgr.c \
    Blit.c \
    BlitBg.c \
    ScaledBlit.c \
    FillRect.c \
    FillSpans.c \
    FillParallelogram.c \
    DrawParallelogram.c \
    DrawLine.c \
    DrawRect.c \
    DrawPolygons.c \
    DrawPath.c \
    FillPath.c \
    ProcessPath.c \
    MaskBlit.c \
    MaskFill.c \
    TransformHelper.c \
    AlphaMath.c \
    AlphaMacros.c \
    AnyByte.c \
    ByteBinary1Bit.c \
    ByteBinary2Bit.c \
    ByteBinary4Bit.c \
    ByteIndexed.c \
    ByteGray.c \
    Index8Gray.c \
    Index12Gray.c \
    AnyShort.c \
    Ushort555Rgb.c \
    Ushort565Rgb.c \
    Ushort4444Argb.c \
    Ushort555Rgbx.c \
    UshortGray.c \
    UshortIndexed.c \
    Any3Byte.c \
    ThreeByteBgr.c \
    AnyInt.c \
    IntArgb.c \
    IntArgbPre.c \
    IntArgbBm.c \
    IntRgb.c \
    IntBgr.c \
    IntRgbx.c \
    Any4Byte.c \
    FourByteAbgr.c \
    FourByteAbgrPre.c \
    BufferedMaskBlit.c \
    BufferedRenderPipe.c \
    ShapeSpanIterator.c \
    SpanClipRenderer.c \
    awt_ImageRep.c \
    awt_ImagingLib.c \
    awt_Mlib.c \
    awt_parseImage.c \
    DataBufferNative.c \
    dither.c \
    debug_assert.c \
    debug_mem.c \
    debug_trace.c \
    debug_util.c

312
ifneq (, $(filter $(OPENJDK_TARGET_OS), solaris linux aix))
I
ihse 已提交
313
  LIBAWT_FILES += awt_LoadLibrary.c initIDs.c img_colors.c
314 315 316 317
endif

ifeq ($(OPENJDK_TARGET_OS), aix)
  LIBAWT_FILES += porting_aix.c
I
ihse 已提交
318 319 320
endif

ifeq ($(OPENJDK_TARGET_OS), macosx)
321
  LIBAWT_FILES += awt_LoadLibrary.c
I
ihse 已提交
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463
endif

ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
  LIBAWT_CFLAGS += -DMLIB_ADD_SUFF
  LIBAWT_CFLAGS += -xarch=sparcvis
  LIBAWT_CFLAGS += $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib/vis_$(OPENJDK_TARGET_CPU_BITS).il
  LIBAWT_CFLAGS += \
      -I$(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib \
      -I$(JDK_TOPDIR)/src/solaris/native/sun/java2d/medialib \
      -I$(JDK_TOPDIR)/src/solaris/native/sun/java2d/loops

  LIBAWT_DIRS += $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib \
      $(JDK_TOPDIR)/src/solaris/native/sun/java2d/loops

  LIBAWT_FILES += \
      vis_FuncArray.c \
      java2d_Mlib.c \
      mlib_ImageCreate.c \
      mlib_ImageZoom_NN.c \
      mlib_ImageCopy_Bit.c \
      mlib_sys.c \
      mlib_v_ImageClear.c \
      mlib_v_ImageClear_f.c \
      mlib_v_ImageConstXor.c \
      mlib_v_ImageCopy.c \
      mlib_v_ImageCopy_f.c \
      mlib_v_ImageXor.c \
      mlib_v_ImageZoom_NN_f.c \
      vis_Interp.c \
      vis_AlphaMacros.c \
      vis_AlphaMaskBlit.c \
      vis_AlphaMaskFill.c \
      vis_ByteGray.c \
      vis_ByteGray_FromRgb.c \
      vis_ByteGray_Mask.c \
      vis_ByteIndexed.c \
      vis_DrawLine.c \
      vis_FourByteAbgr.c \
      vis_IntArgb.c \
      vis_IntArgbPre.c \
      vis_IntArgbPre_Mask.c \
      vis_IntBgr.c \
      vis_IntRgb.c \
      vis_IntRgbx.c \
      vis_SrcMaskFill.c \
      vis_SrcOverMaskBlit.c \
      vis_SrcOverMaskFill.c \
      vis_FourByteAbgrPre.c \
      vis_GlyphList.c \
      vis_GlyphListXor.c \
      vis_IntArgbBm.c \
      vis_ThreeByteBgr.c \
      vis_UshortGray.c \
      vis_UshortGray_FromRgb.c \
      vis_XorBlit.c \
      mlib_v_ImageCopy_blk.s

  ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
    LIBAWT_ASFLAGS = -P -xarch=v9a
  else
    LIBAWT_ASFLAGS = -P -xarch=v8plusa
  endif
else
  LIBAWT_FILES += MapAccelFunc.c
endif

ifneq ($(OPENJDK_TARGET_OS), solaris)
  LIBAWT_CFLAGS += -DMLIB_NO_LIBSUNMATH
endif

LIBAWT_LANG := C

ifeq ($(OPENJDK_TARGET_OS), windows)
  LIBAWT_FILES += AccelGlyphCache.c \
      ShaderList.c \
      CmdIDList.cpp \
      Hashtable.cpp \
      GDIHashtable.cpp \
      Devices.cpp \
      ObjectList.cpp \
      GDIBlitLoops.cpp \
      GDIRenderer.cpp \
      GDIWindowSurfaceData.cpp \
      WindowsFlags.cpp \
      WPrinterJob.cpp \
      awt_%.cpp \
      D3DBlitLoops.cpp \
      D3DBufImgOps.cpp \
      D3DContext.cpp \
      D3DGlyphCache.cpp \
      D3DGraphicsDevice.cpp \
      D3DMaskBlit.cpp \
      D3DMaskCache.cpp \
      D3DMaskFill.cpp \
      D3DPipelineManager.cpp \
      D3DPaints.cpp \
      D3DRenderer.cpp \
      D3DRenderQueue.cpp \
      D3DResourceManager.cpp \
      D3DSurfaceData.cpp \
      D3DTextRenderer.cpp \
      D3DVertexCacher.cpp \
      ShellFolder2.cpp \
      ThemeReader.cpp \
      ComCtl32Util.cpp \
      DllUtil.cpp \
      initIDs.cpp \
      MouseInfo.cpp \
      rect.c \
      OGLBlitLoops.c \
      OGLBufImgOps.c \
      OGLContext.c \
      OGLFuncs.c \
      OGLMaskBlit.c \
      OGLMaskFill.c \
      OGLPaints.c \
      OGLRenderQueue.c \
      OGLRenderer.c \
      OGLSurfaceData.c \
      OGLTextRenderer.c \
      OGLVertexCache.c \
      WGLGraphicsConfig.c \
      WGLSurfaceData.c

  LIBAWT_LANG := C++
  LIBAWT_CFLAGS += -EHsc -DUNICODE -D_UNICODE
  ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
    LIBAWT_CFLAGS += -DMLIB_OS64BIT
  endif

  ifdef OPENJDK
    LIBAWT_RC_FLAGS := -i "$(JDK_TOPDIR)/src/windows/resource/icons"
  else
    LIBAWT_RC_FLAGS := -i "$(JDK_TOPDIR)/src/closed/windows/native/sun/windows"
  endif
  LIBAWT_VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/native/sun/windows/awt.rc
endif

ifeq ($(MILESTONE), internal)
  LIBAWT_CFLAGS += -DINTERNAL_BUILD
endif

I
ihse 已提交
464
LIBAWT_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt/mapfile-vers
I
ihse 已提交
465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482
ifeq ($(OPENJDK_TARGET_OS), linux)
  LIBAWT_MAPFILE :=
endif

$(eval $(call SetupNativeCompilation,BUILD_LIBAWT, \
    LIBRARY := awt, \
    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    SRC := $(LIBAWT_DIRS), \
    INCLUDE_FILES := $(LIBAWT_FILES), \
    LANG := $(LIBAWT_LANG), \
    OPTIMIZATION := LOW, \
    CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_CFLAGS), \
    ASFLAGS := $(LIBAWT_ASFLAGS), \
    MAPFILE := $(LIBAWT_MAPFILE), \
    LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN), \
    LDFLAGS_solaris := -R/usr/dt/lib$(OPENJDK_TARGET_CPU_ISADIR) -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR), \
    LDFLAGS_SUFFIX_linux := -ljvm $(LIBM) $(LIBDL) -ljava, \
    LDFLAGS_SUFFIX_solaris := -ljvm $(LIBM) $(LIBDL) -ljava -lc, \
483
    LDFLAGS_SUFFIX_aix :=-ljvm $(LIBM) $(LIBDL) -ljava -lm,\
I
ihse 已提交
484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518
    LDFLAGS_SUFFIX_macosx := -lmlib_image -ljvm $(LIBM) \
        -framework Cocoa \
        -framework OpenGL \
        -framework JavaNativeFoundation \
        -framework JavaRuntimeSupport \
        -framework ApplicationServices \
        -framework AudioToolbox \
        -ljava, \
    LDFLAGS_SUFFIX_windows := kernel32.lib user32.lib gdi32.lib winspool.lib \
        imm32.lib ole32.lib uuid.lib shell32.lib \
        comdlg32.lib winmm.lib comctl32.lib shlwapi.lib \
        delayimp.lib jvm.lib $(WIN_JAVA_LIB) advapi32.lib \
        -DELAYLOAD:user32.dll -DELAYLOAD:gdi32.dll \
        -DELAYLOAD:shell32.dll -DELAYLOAD:winmm.dll \
        -DELAYLOAD:winspool.drv -DELAYLOAD:imm32.dll \
        -DELAYLOAD:ole32.dll -DELAYLOAD:comdlg32.dll \
        -DELAYLOAD:comctl32.dll -DELAYLOAD:shlwapi.dll, \
    VERSIONINFO_RESOURCE := $(LIBAWT_VERSIONINFO_RESOURCE), \
    RC_FLAGS := $(RC_FLAGS) $(LIBAWT_RC_FLAGS) \
        -D "JDK_FNAME=awt.dll" \
        -D "JDK_INTERNAL_NAME=awt" \
        -D "JDK_FTYPE=0x2L", \
    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt, \
    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))

$(BUILD_LIBAWT): $(BUILD_LIBJAVA)

ifeq ($(OPENJDK_TARGET_OS), macosx)
  $(BUILD_LIBAWT): $(BUILD_LIBMLIB_IMAGE)
endif

BUILD_LIBRARIES += $(BUILD_LIBAWT)

##########################################################################################

519
ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),)
I
ihse 已提交
520 521 522 523 524 525 526 527 528 529 530 531 532 533
  ifndef BUILD_HEADLESS_ONLY

    LIBAWT_XAWT_DIRS := \
        $(JDK_TOPDIR)/src/share/native/sun/awt/debug \
        $(JDK_TOPDIR)/src/share/native/sun/awt/utility \
        $(JDK_TOPDIR)/src/share/native/sun/font \
        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/font \
        $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \
        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/opengl \
        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/x11 \
        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/xawt \

    LIBAWT_XAWT_CFLAGS := -DXAWT -DXAWT_HACK \
534
        -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
I
ihse 已提交
535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636
        $(CUPS_CFLAGS) \
        $(foreach dir, $(LIBAWT_XAWT_DIRS), -I$(dir)) \
        -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
        -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
        -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
        -I$(JDK_TOPDIR)/src/share/native/sun/awt/image \
        -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
        -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/jdga

    ifeq ($(OPENJDK_TARGET_OS), solaris)
      LIBAWT_XAWT_CFLAGS += -DFUNCPROTO=15
    endif

    ifeq ($(OPENJDK_TARGET_OS), linux)
      ifndef OPENJDK
        include $(JDK_TOPDIR)/make/closed/xawt.gmk
      endif

      ifeq ($(DISABLE_XRENDER), true)
        LIBAWT_XAWT_CFLAGS += -DDISABLE_XRENDER_BY_DEFAULT=true
      endif
    endif

    ifeq ($(MILESTONE), internal)
      LIBAWT_XAWT_CFLAGS += -DINTERNAL_BUILD
    endif

    LIBAWT_XAWT_FILES := \
        XlibWrapper.c \
        XWindow.c \
        XToolkit.c \
        X11Color.c \
        X11SurfaceData.c \
        awt_GraphicsEnv.c \
        awt_InputMethod.c \
        robot_common.c \
        awt_Robot.c \
        list.c \
        multiVis.c \
        initIDs.c \
        awt_util.c \
        awt_Desktop.c \
        awt_UNIXToolkit.c \
        X11FontScaler_md.c \
        X11TextRenderer_md.c \
        fontpath.c \
        awt_Insets.c \
        awt_Event.c \
        X11Renderer.c \
        X11PMBlitLoops.c \
        OGLBlitLoops.c \
        OGLBufImgOps.c \
        OGLContext.c \
        OGLFuncs.c \
        OGLMaskBlit.c \
        OGLMaskFill.c \
        OGLPaints.c \
        OGLRenderQueue.c \
        OGLRenderer.c \
        OGLSurfaceData.c \
        OGLTextRenderer.c \
        OGLVertexCache.c \
        GLXGraphicsConfig.c \
        GLXSurfaceData.c \
        AccelGlyphCache.c \
        awt_Font.c \
        multi_font.c \
        awt_AWTEvent.c \
        awt_DrawingSurface.c \
        jawt.c \
        CUPSfuncs.c \
        debug_assert.c \
        debug_mem.c \
        debug_trace.c \
        debug_util.c \
        gnome_interface.c \
        gtk2_interface.c \
        swing_GTKEngine.c \
        swing_GTKStyle.c \
        rect.c \
        sun_awt_X11_GtkFileDialogPeer.c \
        XRSurfaceData.c \
        XRBackendNative.c

    LIBAWT_XAWT_LDFLAGS_SUFFIX := $(LIBM) -lawt -lXext -lX11 -lXrender $(LIBDL) -lXtst -lXi -ljava -ljvm -lc

    ifeq ($(OPENJDK_TARGET_OS), linux)
      # To match old build, add this to LDFLAGS instead of suffix.
      LIBAWT_XAWT_LDFLAGS += -lpthread
    endif

    $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_XAWT, \
        LIBRARY := awt_xawt, \
        OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
        SRC := $(LIBAWT_XAWT_DIRS), \
        INCLUDE_FILES := $(LIBAWT_XAWT_FILES), \
        LANG := C, \
        OPTIMIZATION := LOW, \
        CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_XAWT_CFLAGS) \
            $(X_CFLAGS), \
I
ihse 已提交
637
        MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_xawt/mapfile-vers, \
I
ihse 已提交
638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681
        LDFLAGS := $(LDFLAGS_JDKLIB) \
            $(X_LIBS) $(LIBAWT_XAWT_LDFLAGS), \
        LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN) \
            $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
        LDFLAGS_solaris := -L$(OPENWIN_HOME)/sfw/lib$(OPENJDK_TARGET_CPU_ISADIR) \
            -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) \
            -R$(OPENWIN_HOME)/sfw/lib$(OPENJDK_TARGET_CPU_ISADIR) \
            -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) \
            -R/usr/dt/lib$(OPENJDK_TARGET_CPU_ISADIR) \
            $(call SET_SHARED_LIBRARY_ORIGIN) \
            $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
        LDFLAGS_SUFFIX := $(LIBAWT_XAWT_LDFLAGS_SUFFIX), \
        VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
        RC_FLAGS := $(RC_FLAGS) \
            -D "JDK_FNAME=xawt.dll" \
            -D "JDK_INTERNAL_NAME=xawt" \
            -D "JDK_FTYPE=0x2L", \
        OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt_xawt, \
        DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))

    $(BUILD_LIBAWT_XAWT): $(BUILD_LIBJAVA)

    $(BUILD_LIBAWT_XAWT): $(BUILD_LIBAWT)

    BUILD_LIBRARIES += $(BUILD_LIBAWT_XAWT)

  endif
endif

##########################################################################################

# TODO: Update awt lib path when awt is converted
$(eval $(call SetupNativeCompilation,BUILD_LIBLCMS, \
    LIBRARY := lcms, \
    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    SRC := $(JDK_TOPDIR)/src/share/native/sun/java2d/cmm/lcms, \
    LANG := C, \
    OPTIMIZATION := HIGHEST, \
    CFLAGS := $(filter-out -xc99=%none, $(CFLAGS_JDKLIB)) \
        $(SHARED_LIBRARY_FLAGS) \
        -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
        -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug, \
    CFLAGS_solaris := -xc99=no_lib, \
    CFLAGS_windows := -DCMS_IS_WINDOWS_, \
I
ihse 已提交
682
    MAPFILE := $(JDK_TOPDIR)/make/mapfiles/liblcms/mapfile-vers, \
I
ihse 已提交
683 684 685 686 687 688 689
    LDFLAGS := $(LDFLAGS_JDKLIB) \
        $(call SET_SHARED_LIBRARY_ORIGIN), \
    LDFLAGS_solaris := /usr/lib$(OPENJDK_TARGET_CPU_ISADIR)/libm.so.2, \
    LDFLAGS_windows := $(WIN_AWT_LIB) $(WIN_JAVA_LIB), \
    LDFLAGS_SUFFIX_solaris := -lawt -ljava -ljvm -lc, \
    LDFLAGS_SUFFIX_macosx := $(LIBM) -lawt -ljava -ljvm, \
    LDFLAGS_SUFFIX_linux := -lm -lawt -ljava -ljvm, \
690
    LDFLAGS_SUFFIX_aix := -lm -lawt -ljava -ljvm,\
I
ihse 已提交
691 692 693 694 695 696 697 698 699 700 701 702 703 704 705
    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    RC_FLAGS := $(RC_FLAGS) \
        -D "JDK_FNAME=lcms.dll" \
        -D "JDK_INTERNAL_NAME=lcms" \
        -D "JDK_FTYPE=0x2L", \
    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/liblcms, \
    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))

BUILD_LIBRARIES += $(BUILD_LIBLCMS)

$(BUILD_LIBLCMS): $(BUILD_LIBAWT)

##########################################################################################

ifdef OPENJDK
I
ihse 已提交
706
  BUILD_LIBJPEG_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers
I
ihse 已提交
707
else
I
ihse 已提交
708
  BUILD_LIBJPEG_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers-closed
I
ihse 已提交
709 710 711 712 713 714 715
  BUILD_LIBJPEG_CLOSED_SRC := $(JDK_TOPDIR)/src/closed/share/native/sun/awt/image/jpeg
  BUILD_LIBJPEG_CLOSED_INCLUDES := -I$(BUILD_LIBJPEG_CLOSED_SRC)
endif

BUILD_LIBJPEG_REORDER :=
ifeq ($(OPENJDK_TARGET_OS), solaris)
  ifneq ($(OPENJDK_TARGET_CPU), x86_64)
I
ihse 已提交
716
    BUILD_LIBJPEG_REORDER := $(JDK_TOPDIR)/make/mapfiles/libjpeg/reorder-$(OPENJDK_TARGET_CPU)
I
ihse 已提交
717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766
  endif
endif

# Suppress gcc warnings like "variable might be clobbered by 'longjmp'
# or 'vfork'": this warning indicates that some variable is placed to
# a register by optimized compiler and it's value might be lost on longjmp().
# Recommended way to avoid such warning is to declare the variable as
# volatile to prevent the optimization. However, this approach does not
# work because we have to declare all variables as volatile in result.
#ifndef CROSS_COMPILE_ARCH
#  CC_43_OR_NEWER := \
#      $(shell $(EXPR) $(CC_MAJORVER) \> 4 \| \
#          \( $(CC_MAJORVER) = 4 \& $(CC_MINORVER) \>= 3 \) )
#  ifeq ($(CC_43_OR_NEWER), 1)
#    BUILD_LIBJPEG_CFLAGS_linux += -Wno-clobbered
#  endif
#endif

$(eval $(call SetupNativeCompilation,BUILD_LIBJPEG, \
    LIBRARY := jpeg, \
    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    SRC := $(BUILD_LIBJPEG_CLOSED_SRC) \
        $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg, \
    LANG := C, \
    OPTIMIZATION := HIGHEST, \
    CFLAGS := $(CFLAGS_JDKLIB) \
        $(BUILD_LIBJPEG_CLOSED_INCLUDES) \
        -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg, \
    MAPFILE := $(BUILD_LIBJPEG_MAPFILE), \
    LDFLAGS := $(LDFLAGS_JDKLIB) \
        $(call SET_SHARED_LIBRARY_ORIGIN), \
    LDFLAGS_windows := $(WIN_JAVA_LIB) jvm.lib, \
    LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \
    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    RC_FLAGS := $(RC_FLAGS) \
        -D "JDK_FNAME=jpeg.dll" \
        -D "JDK_INTERNAL_NAME=jpeg" \
        -D "JDK_FTYPE=0x2L", \
    REORDER := $(BUILD_LIBJPEG_REORDER), \
    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjpeg, \
    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))

$(BUILD_LIBJPEG): $(BUILD_LIBJAVA)

BUILD_LIBRARIES += $(BUILD_LIBJPEG)

##########################################################################################

ifndef OPENJDK
  FONT_HEADERS := -I$(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k
I
ihse 已提交
767
  BUILD_LIBFONTMANAGER_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libfontmanager/mapfile-vers
I
ihse 已提交
768 769
  LIBFONTMANAGER_EXCLUDE_FILES += freetypeScaler.c
else
I
ihse 已提交
770
  FONT_HEADERS := $(FREETYPE_CFLAGS)
I
ihse 已提交
771
  BUILD_LIBFONTMANAGER_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libfontmanager/mapfile-vers.openjdk
I
ihse 已提交
772
  BUILD_LIBFONTMANAGER_FONTLIB := $(FREETYPE_LIBS)
I
ihse 已提交
773 774 775 776 777 778 779 780
endif

LIBFONTMANAGER_OPTIMIZATION := HIGH

ifeq ($(OPENJDK_TARGET_OS), windows)
  LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
      X11TextRenderer.c
  LIBFONTMANAGER_OPTIMIZATION := HIGHEST
781 782 783 784 785
else ifeq ($(OPENJDK_TARGET_OS), macosx)
  LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
      X11TextRenderer.c \
      fontpath.c \
      lcdglyph.c
I
ihse 已提交
786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827
else
  LIBFONTMANAGER_EXCLUDE_FILES += fontpath.c \
      lcdglyph.c
endif

BUILD_LIBFONTMANAGER_CFLAGS_COMMON := \
    $(X_CFLAGS) \
    -DLE_STANDALONE -DHEADLESS \
    $(FONT_HEADERS) \
    -I$(JDK_TOPDIR)/src/share/native/sun/font \
    -I$(JDK_TOPDIR)/src/share/native/sun/font/layout \
    -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
    -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \
    -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
    -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
    -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
    -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
    -I$(JDK_TOPDIR)/src/share/native/sun/java2d

# Turn off aliasing with GCC for ExtensionSubtables.cpp
ifeq ($(OPENJDK_TARGET_OS), linux)
  BUILD_LIBFONTMANAGER_ExtensionSubtables.cpp_CXXFLAGS := -fno-strict-aliasing
endif

$(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \
    LIBRARY := fontmanager, \
    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    SRC := $(JDK_TOPDIR)/src/share/native/sun/font \
        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/font, \
    EXCLUDE_FILES := $(LIBFONTMANAGER_EXCLUDE_FILES) \
        AccelGlyphCache.c, \
    LANG := C++, \
    CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBFONTMANAGER_CFLAGS_COMMON), \
    CXXFLAGS := $(CXXFLAGS_JDKLIB) $(BUILD_LIBFONTMANAGER_CFLAGS_COMMON), \
    OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \
    CFLAGS_windows = -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \
        -DCC_NOEX, \
    MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \
    LDFLAGS := $(subst -Xlinker -z -Xlinker defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \
        $(call SET_SHARED_LIBRARY_ORIGIN), \
    LDFLAGS_SUFFIX := $(BUILD_LIBFONTMANAGER_FONTLIB), \
    LDFLAGS_SUFFIX_linux := -lawt $(LIBM) $(LIBCXX) -ljava -ljvm -lc, \
828 829
    LDFLAGS_SUFFIX_solaris := -lawt -lawt_headless -lc $(LIBM) $(LIBCXX) -ljava -ljvm, \
    LDFLAGS_SUFFIX_aix := -lawt -lawt_headless $(LIBM) $(LIBCXX) -ljava -ljvm,\
I
ihse 已提交
830 831 832 833 834 835 836 837 838 839 840 841 842 843
    LDFLAGS_SUFFIX_macosx := -lawt $(LIBM) $(LIBCXX) -undefined dynamic_lookup \
        -ljava -ljvm, \
    LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib gdi32.lib \
        $(WIN_AWT_LIB), \
    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    RC_FLAGS := $(RC_FLAGS) \
        -D "JDK_FNAME=fontmanager.dll" \
        -D "JDK_INTERNAL_NAME=fontmanager" \
        -D "JDK_FTYPE=0x2L", \
    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libfontmanager, \
    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))

$(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT)

844
ifneq (, $(findstring $(OPENJDK_TARGET_OS), solaris aix))
I
ihse 已提交
845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884
  $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT_XAWT)
endif

BUILD_LIBRARIES += $(BUILD_LIBFONTMANAGER)

##########################################################################################

ifndef OPENJDK

  #ifeq ($(OPENJDK_TARGET_OS), linux)
  #  ifeq ("$(CC_VER_MAJOR)", "3")
  #    OTHER_LDLIBS += -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
  #  endif
  #endif
  #
  # The resulting size of the t2k lib file is (at least on linux) dependant on the order of
  # the input .o files. Because of this the new build will differ in size to the old build.
  BUILD_LIBT2K_CFLAGS_COMMON := -I$(JDK_TOPDIR)/src/share/native/sun/font \
      -I$(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k \
      -I$(JDK_TOPDIR)/src/closed/share/native/sun/font \
      -I$(JDK_TOPDIR)/src/share/share/native/sun/font \
      -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/font \
      -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
      -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
      -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
      -I$(JDK_TOPDIR)/src/share/native/sun/java2d

  $(eval $(call SetupNativeCompilation,BUILD_LIBT2K, \
      LIBRARY := t2k, \
      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
      SRC := $(JDK_TOPDIR)/src/closed/share/native/sun/font \
          $(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k \
          $(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k/ttHints, \
      EXCLUDE_FILES := orion.c, \
      LANG := C++, \
      OPTIMIZATION := HIGH, \
      CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBT2K_CFLAGS_COMMON), \
      CXXFLAGS := $(CXXFLAGS_JDKLIB) $(BUILD_LIBT2K_CFLAGS_COMMON), \
      CFLAGS_windows = -DCC_NOEX, \
      CXXFLAGS_windows = -DCC_NOEX, \
I
ihse 已提交
885
      MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libt2k/mapfile-vers, \
I
ihse 已提交
886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948
      LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
          $(call SET_SHARED_LIBRARY_ORIGIN), \
      LDFLAGS_windows := user32.lib $(JDK_OUTPUTDIR)/objs/libfontmanager/fontmanager.lib, \
      LDFLAGS_SUFFIX_posix := $(LIBM) $(LIBCXX) -lfontmanager -ljava -ljvm -lc, \
      LDFLAGS_SUFFIX_solaris := -lawt -lawt_xawt, \
      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
      RC_FLAGS := $(RC_FLAGS) \
          -D "JDK_FNAME=t2k.dll" \
          -D "JDK_INTERNAL_NAME=t2k" \
          -D "JDK_FTYPE=0x2L", \
      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libt2k, \
      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))

  # t2k is linked against fontmanager
  $(BUILD_LIBT2K): $(BUILD_LIBFONTMANAGER)

  BUILD_LIBRARIES += $(BUILD_LIBT2K)
endif

##########################################################################################

ifeq ($(OPENJDK_TARGET_OS), windows)
  ifeq ($(OPENJDK_TARGET_CPU), x86)
    KERNEL32_LIB := kernel32.lib
  endif
  $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT, \
      LIBRARY := jawt, \
      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
      SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows, \
      INCLUDE_FILES := jawt.cpp, \
      LANG := C++, \
      OPTIMIZATION := LOW, \
      CFLAGS := $(CXXFLAGS_JDKLIB) \
          -EHsc -DUNICODE -D_UNICODE \
          -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \
          -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
          -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
          -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
          -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/windows, \
      LDFLAGS := $(LDFLAGS_JDKLIB) $(KERNEL32_LIB) $(LDFLAGS_CXX_JDK) \
          advapi32.lib $(WIN_AWT_LIB), \
      LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \
      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
      RC_FLAGS := $(RC_FLAGS) \
          -D "JDK_FNAME=jawt.dll" \
          -D "JDK_INTERNAL_NAME=jawt" \
          -D "JDK_FTYPE=0x2L", \
      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjawt, \
      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))

  $(BUILD_LIBJAWT): $(BUILD_LIBAWT)

  $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX): $(BUILD_LIBJAWT)
	$(ECHO) Copying $(@F)
	$(CP) $(JDK_OUTPUTDIR)/objs/libjawt/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX) $@

  BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)

else # OPENJDK_TARGET_OS not windows

  ifeq ($(OPENJDK_TARGET_OS), macosx)
    JAWT_FILES := jawt.m
    JAWT_LIBS := -lawt_lwawt
949 950 951 952 953 954 955 956 957 958 959 960
  else
    JAWT_FILES := jawt.c
    JAWT_LIBS :=
    ifneq ($(OPENJDK_TARGET_OS), solaris)
      JAWT_LIBS += -lawt
    endif
    ifndef BUILD_HEADLESS_ONLY
      JAWT_LIBS += -lawt_xawt
    else
      JAWT_LIBS += -lawt_headless
      HEADLESS_CFLAG += -DHEADLESS
    endif
I
ihse 已提交
961 962 963 964 965 966 967 968 969 970 971 972 973
  endif

  $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT, \
      LIBRARY := jawt, \
      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
      SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \
          $(JDK_TOPDIR)/src/macosx/native/sun/awt, \
      INCLUDE_FILES := $(JAWT_FILES), \
      LANG := C, \
      OPTIMIZATION := LOW, \
      CFLAGS := $(CFLAGS_JDKLIB), \
      CFLAGS_linux := $(HEADLESS_CFLAG), \
      CFLAGS_macosx := -I$(JDK_TOPDIR)/src/solaris/native/sun/awt, \
I
ihse 已提交
974
      MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjawt/mapfile-vers, \
I
ihse 已提交
975 976 977 978
      LDFLAGS := $(LDFLAGS_JDKLIB) \
          $(call SET_SHARED_LIBRARY_ORIGIN), \
      LDFLAGS_solaris := -L$(OPENWIN_HOME)/sfw/lib$(OPENJDK_TARGET_CPU_ISADIR) -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR), \
      LDFLAGS_SUFFIX_linux := $(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX), \
979
      LDFLAGS_SUFFIX_aix := $(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX),\
I
ihse 已提交
980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030
      LDFLAGS_SUFFIX_solaris := $(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX) -lXrender, \
      LDFLAGS_SUFFIX_macosx := -Xlinker -rpath -Xlinker @loader_path $(JAWT_LIBS) \
          -framework Cocoa $(LDFLAGS_JDKLIB_SUFFIX), \
      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjawt, \
      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))

  ifndef BUILD_HEADLESS_ONLY
    $(BUILD_LIBJAWT): $(BUILD_LIBAWT_XAWT)
  else
    $(BUILD_LIBJAWT): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_headless$(SHARED_LIBRARY_SUFFIX)
  endif

  ifeq ($(OPENJDK_TARGET_OS), macosx)
    $(BUILD_LIBJAWT): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_lwawt$(SHARED_LIBRARY_SUFFIX)
  endif

endif # OPENJDK_TARGET_OS

BUILD_LIBRARIES += $(BUILD_LIBJAWT)

##########################################################################################

ifndef OPENJDK

  BUILD_LIBKCMS_EXCLUDE_FILES :=
  ifeq ($(OPENJDK_TARGET_OS), windows)
    BUILD_LIBKCMS_EXCLUDE_FILES += ukcpmgr.c unixmem.c
  else
    BUILD_LIBKCMS_EXCLUDE_FILES += cmmdll.c registry.c spxffile.c sysinfo.c winmem.c wkcpmgr.c
  endif

  BUILD_LIBKCMS_FLAGS := $(CFLAGS_JDKLIB)

  ifeq ($(OPENJDK_TARGET_OS), solaris)
    # This particular library uses a feature called PIC_CODE_SMALL (on solaris)
    # implement it like this...since it's only used here
    BUILD_LIBKCMS_FLAGS := $(patsubst -KPIC, -Kpic, $(BUILD_LIBKCMS_FLAGS))
  else ifeq ($(OPENJDK_TARGET_CPU_ARCH), ppc)
    BUILD_LIBKCMS_FLAGS := $(patsubst -fPIC, -fpic, $(BUILD_LIBKCMS_FLAGS))
  endif

  $(eval $(call SetupNativeCompilation,BUILD_LIBKCMS, \
      LIBRARY := kcms, \
      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
      SRC := $(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms, \
      LANG := C, \
      EXCLUDE_FILES := $(BUILD_LIBKCMS_EXCLUDE_FILES), \
      OPTIMIZATION := LOW, \
      CFLAGS := $(BUILD_LIBKCMS_FLAGS) \
          -DJAVACMM -DFUT_CALC_EX -DNO_FUT_GCONST, \
      CFLAGS_linux := -Wno-missing-field-initializers, \
I
ihse 已提交
1031
      MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libkcms/mapfile-vers, \
I
ihse 已提交
1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062
      LDFLAGS := $(LDFLAGS_JDKLIB) \
          $(call SET_SHARED_LIBRARY_ORIGIN), \
      LDFLAGS_SUFFIX_linux := -lc -lpthread, \
      LDFLAGS_SUFFIX_solaris := -lc, \
      LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib version.lib, \
      LDFLAGS_SUFFIX_posix := -lm -ljava -ljvm, \
      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms/cmm.rc, \
      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms/cmm.rc, \
      RC_FLAGS := $(RC_FLAGS) \
          -D "JDK_FNAME=kcms.dll" \
          -D "JDK_INTERNAL_NAME=kcms" \
          -D "JDK_FTYPE=0x2L", \
      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libkcms, \
      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))

  $(BUILD_LIBKCMS): $(BUILD_LIBJAVA)

  BUILD_LIBRARIES += $(BUILD_LIBKCMS)

endif

##########################################################################################

ifndef OPENJDK
  ifeq ($(OPENJDK_TARGET_OS), solaris)
    ifneq ($(OPENJDK_TARGET_CPU), x86_64)

      ifeq ($(shell if test "$(OS_VERSION_MAJOR)" -eq 5 -a "$(OS_VERSION_MINOR)" -le 10; then $(ECHO) ok; fi), ok)

        SUNWJDGA_MAPFILE :=
        ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
I
ihse 已提交
1063
          SUNWJDGA_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjdga/mapfile-vers
I
ihse 已提交
1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092
        endif

        $(eval $(call SetupNativeCompilation,BUILD_LIBSUNWJDGA, \
            LIBRARY := sunwjdga, \
            OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
            SRC := $(JDK_TOPDIR)/src/solaris/native/sun/jdga, \
            LANG := C, \
            OPTIMIZATION := LOW, \
            CFLAGS := $(CFLAGS_JDKLIB) \
                -I$(JDK_TOPDIR)/src/share/javavm/export \
                -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/javavm/export \
                -I$(OPENWIN_HOME)/include, \
            MAPFILE := $(SUNWJDGA_MAPFILE), \
            LDFLAGS := $(LDFLAGS_JDKLIB) \
                $(call SET_SHARED_LIBRARY_ORIGIN), \
            LDFLAGS_SUFFIX := -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) -ldga -lX11 $(LIBDL) -lc, \
            OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libsunwjdga, \
            DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))

        BUILD_LIBRARIES += $(BUILD_LIBSUNWJDGA)

      endif
    endif
  endif
endif

##########################################################################################

ifeq ($(BUILD_HEADLESS), true)
1093 1094
  # Mac and Windows only use the native AWT lib, do not build libawt_headless
  ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx),)
I
ihse 已提交
1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107

    LIBAWT_HEADLESS_DIRS := $(JDK_TOPDIR)/src/share/native/sun/font \
        $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
        $(JDK_TOPDIR)/src/solaris/native/sun/font \
        $(JDK_TOPDIR)/src/solaris/native/sun/awt \
        $(JDK_TOPDIR)/src/solaris/native/sun/java2d/opengl \
        $(JDK_TOPDIR)/src/solaris/native/sun/java2d/x11

    ifeq ($(OPENJDK_TARGET_OS), macosx)
      LIBAWT_HEADLESS_DIRS += $(JDK_TOPDIR)/src/macosx/native/sun/font
    endif

    LIBAWT_HEADLESS_CFLAGS := -DHEADLESS=true \
1108
        -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
I
ihse 已提交
1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151
        $(CUPS_CFLAGS) \
        $(X_CFLAGS) \
        -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
        -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
        -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
        -I$(JDK_TOPDIR)/src/share/native/sun/awt/image \
        -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
        -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/jdga \
        $(foreach dir, $(LIBAWT_HEADLESS_DIRS), -I$(dir))

    LIBAWT_HEADLESS_FILES := \
        awt_Font.c \
        HeadlessToolkit.c \
        fontpath.c \
        VDrawingArea.c \
        X11Color.c \
        X11Renderer.c \
        X11PMBlitLoops.c \
        X11SurfaceData.c \
        X11FontScaler_md.c \
        X11TextRenderer_md.c \
        OGLBlitLoops.c \
        OGLBufImgOps.c \
        OGLContext.c \
        OGLFuncs.c \
        OGLMaskBlit.c \
        OGLMaskFill.c \
        OGLPaints.c \
        OGLRenderQueue.c \
        OGLRenderer.c \
        OGLSurfaceData.c \
        OGLTextRenderer.c \
        OGLVertexCache.c \
        GLXGraphicsConfig.c \
        GLXSurfaceData.c \
        AccelGlyphCache.c \
        CUPSfuncs.c

    LIBAWT_HEADLESS_REORDER :=
    ifeq ($(OPENJDK_TARGET_OS), solaris)
      ifneq ($(OPENJDK_TARGET_CPU), x86_64)
I
ihse 已提交
1152
        LIBAWT_HEADLESS_REORDER := $(JDK_TOPDIR)/make/mapfiles/libawt_headless/reorder-$(OPENJDK_TARGET_CPU)
I
ihse 已提交
1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163
      endif
    endif

    $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_HEADLESS, \
        LIBRARY := awt_headless, \
        OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
        SRC := $(LIBAWT_HEADLESS_DIRS), \
        INCLUDE_FILES := $(LIBAWT_HEADLESS_FILES), \
        LANG := C, \
        OPTIMIZATION := LOW, \
        CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_HEADLESS_CFLAGS), \
I
ihse 已提交
1164
        MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_headless/mapfile-vers, \
I
ihse 已提交
1165 1166 1167 1168 1169 1170 1171 1172 1173
        LDFLAGS := $(LDFLAGS_JDKLIB) \
            $(call SET_SHARED_LIBRARY_ORIGIN), \
        LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
        LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..) \
            -R/usr/dt/lib$(OPENJDK_TARGET_CPU_ISADIR) \
            -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR), \
        LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN)., \
        REORDER := $(LIBAWT_HEADLESS_REORDER), \
        LDFLAGS_SUFFIX_linux := -ljvm -lawt -lm $(LIBDL) -ljava, \
1174
        LDFLAGS_SUFFIX_aix := -ljvm -lawt -ljava,\
I
ihse 已提交
1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211
        LDFLAGS_SUFFIX_solaris := $(LIBDL) -ljvm -lawt -lm -ljava $(LIBCXX) -lc, \
        OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt_headless, \
        DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))

    $(BUILD_LIBAWT_HEADLESS): $(BUILD_LIBAWT)

    BUILD_LIBRARIES += $(BUILD_LIBAWT_HEADLESS)

  endif
endif

##########################################################################################

ifndef BUILD_HEADLESS_ONLY
  LIBSPLASHSCREEN_DIRS := \
    $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg \
    $(JDK_TOPDIR)/src/share/native/sun/awt/libpng \
    $(JDK_TOPDIR)/src/share/native/sun/awt/splashscreen

  ifeq ($(USE_EXTERNAL_LIBGIF), true)
    GIFLIB_LDFLAGS := -lgif
  else
    LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/sun/awt/giflib
    GIFLIB_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/awt/giflib
  endif

  ifneq ($(OPENJDK_TARGET_OS), macosx)
    LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt/splashscreen
  else
    LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen
  endif

  LIBSPLASHSCREEN_CFLAGS := -DSPLASHSCREEN -DPNG_NO_MMX_CODE \
      $(foreach dir, $(LIBSPLASHSCREEN_DIRS), -I$(dir))

  ifeq ($(OPENJDK_TARGET_OS), macosx)
    LIBSPLASHSCREEN_CFLAGS := -I$(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen \
1212
        $(LIBSPLASHSCREEN_CFLAGS)
I
ihse 已提交
1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223
    LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX
    LIBSPLASHSCREEN_CFLAGS += -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp

    LIBSPLASHSCREEN_java_awt_SplashScreen.c_CFLAGS := -x objective-c -O0
    LIBSPLASHSCREEN_splashscreen_gfx_impl.c_CFLAGS := -x objective-c -O0
    LIBSPLASHSCREEN_splashscreen_gif.c_CFLAGS := -x objective-c -O0
    LIBSPLASHSCREEN_splashscreen_impl.c_CFLAGS := -x objective-c -O0
    LIBSPLASHSCREEN_splashscreen_jpeg.c_CFLAGS := -x objective-c -O0
    LIBSPLASHSCREEN_splashscreen_png.c_CFLAGS := -x objective-c -O0
    LIBSPLASHSCREEN_splashscreen_sys.m_CFLAGS := -O0

1224 1225 1226
  else ifeq ($(OPENJDK_TARGET_OS), windows)
    LIBSPLASHSCREEN_CFLAGS += -DWITH_WIN32
  else ifeq ($(OPENJDK_TARGET_OS), solaris)
I
ihse 已提交
1227 1228
    LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 -I$(OPENWIN_HOME)/include -I$(OPENWIN_HOME)/include/X11/extensions
  else
1229
    LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 $(X_CFLAGS)
I
ihse 已提交
1230 1231 1232 1233 1234
  endif

  LIBSPLASHSCREEN_LDFLAGS_SUFFIX :=

  ifneq ($(USE_EXTERNAL_LIBZ), true)
1235
    LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.8
I
ihse 已提交
1236 1237 1238 1239 1240 1241 1242 1243 1244
    LIBSPLASHSCREEN_CFLAGS += $(ZLIB_CPPFLAGS)
  endif

  ifeq ($(OPENJDK_TARGET_OS), macosx)
    LIBSPLASHSCREEN_LDFLAGS_SUFFIX += $(LIBM) -lpthread -liconv -losxapp \
        -framework ApplicationServices \
        -framework Foundation \
        -framework Cocoa \
        -framework JavaNativeFoundation
1245
  else ifeq ($(OPENJDK_TARGET_OS), windows)
I
ihse 已提交
1246
    LIBSPLASHSCREEN_LDFLAGS_SUFFIX += kernel32.lib user32.lib gdi32.lib delayimp.lib -DELAYLOAD:user32.dll
1247 1248 1249 1250 1251 1252
  else ifeq ($(OPENJDK_TARGET_OS), solaris)
    # Solaris still uses OPENWIN_LIB ..
    LIBSPLASHSCREEN_LDFLAGS_SUFFIX += -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) -lX11 -lXext $(LIBM) -lpthread
  else	# .. all other Unixes can use X_LIBS
    LIBSPLASHSCREEN_LDFLAGS_SUFFIX += $(X_LIBS) -lX11 -lXext $(LIBM) -lpthread
  endif
I
ihse 已提交
1253 1254 1255 1256 1257 1258 1259 1260 1261

  $(eval $(call SetupNativeCompilation,LIBSPLASHSCREEN, \
      LIBRARY := splashscreen, \
      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
      SRC := $(LIBSPLASHSCREEN_DIRS), \
      EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
      LANG := C, \
      OPTIMIZATION := LOW, \
      CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) $(GIFLIB_CFLAGS), \
I
ihse 已提交
1262
      MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libsplashscreen/mapfile-vers, \
I
ihse 已提交
1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303
      LDFLAGS := $(LDFLAGS_JDKLIB) \
          $(call SET_SHARED_LIBRARY_ORIGIN), \
      LDFLAGS_SUFFIX := $(LIBSPLASHSCREEN_LDFLAGS_SUFFIX) $(LIBZ) $(GIFLIB_LDFLAGS), \
      LDFLAGS_SUFFIX_solaris := -lc, \
      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
      RC_FLAGS := $(RC_FLAGS) \
          -D "JDK_FNAME=splashscreen.dll" \
          -D "JDK_INTERNAL_NAME=splashscreen" \
          -D "JDK_FTYPE=0x2L", \
      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libsplashscreen, \
      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))

  BUILD_LIBRARIES += $(LIBSPLASHSCREEN)

  ifeq ($(OPENJDK_TARGET_OS), macosx)
    $(LIBSPLASHSCREEN): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)osxapp$(SHARED_LIBRARY_SUFFIX)
  endif

endif

##########################################################################################

ifndef OPENJDK

  LIBDCPR_SRC_DIRS := \
      $(JDK_TOPDIR)/src/closed/share/native/sun/dc/doe \
      $(JDK_TOPDIR)/src/closed/share/native/sun/dc/path \
      $(JDK_TOPDIR)/src/closed/share/native/sun/dc/pr \
      $(JDK_TOPDIR)/src/closed/share/native/sun/dc/util

  LIBDCPR_CFLAGS := $(foreach dir, $(LIBDCPR_SRC_DIRS), -I$(dir)) \
      -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe

  $(eval $(call SetupNativeCompilation,BUILD_LIBDCPR, \
      LIBRARY := dcpr, \
      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
      SRC := $(LIBDCPR_SRC_DIRS), \
      LANG := C, \
      OPTIMIZATION := LOW, \
      CFLAGS := $(CFLAGS_JDKLIB) \
          $(LIBDCPR_CFLAGS), \
I
ihse 已提交
1304
      MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libdcpr/mapfile-vers, \
I
ihse 已提交
1305 1306 1307
      LDFLAGS := $(LDFLAGS_JDKLIB) \
          $(call SET_SHARED_LIBRARY_ORIGIN), \
      LDFLAGS_SUFFIX := $(LIBM) $(LDFLAGS_JDKLIB_SUFFIX), \
1308
      LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB), \
I
ihse 已提交
1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418
      LDFLAGS_SUFFIX_posix := -lm, \
      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
      RC_FLAGS := $(RC_FLAGS) \
          -D "JDK_FNAME=dcpr.dll" \
          -D "JDK_INTERNAL_NAME=dcpr" \
          -D "JDK_FTYPE=0x2L", \
      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libdcpr, \
      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))

  $(BUILD_LIBDCPR): $(BUILD_LIBJAVA)

  BUILD_LIBRARIES += $(BUILD_LIBDCPR)

endif

##########################################################################################

ifeq ($(OPENJDK_TARGET_OS), macosx)

  LIBAWT_LWAWT_FILES := \
      awt.m \
      ApplicationDelegate.m \
      CFRetainedResource.m \
      CGLGraphicsConfig.m \
      CGLSurfaceData.m \
      CGLLayer.m \
      CGraphicsConfig.m \
      CGraphicsDevice.m \
      CGraphicsEnv.m \
      CCharToGlyphMapper.m \
      CSystemColors.m \
      AWTFont.m \
      CGGlyphOutlines.m \
      CGGlyphImages.m \
      CoreTextSupport.m \
      AWTStrike.m \
      InitIDs.m \
      AWTEvent.m \
      AWTView.m \
      AWTWindow.m \
      AWTSurfaceLayers.m \
      CCursorManager.m \
      CClipboard.m \
      CDataTransferer.m \
      CDragSource.m \
      CDragSourceContextPeer.m \
      CDropTarget.m \
      CDropTargetContextPeer.m \
      CInputMethod.m \
      CDesktopPeer.m \
      OSVersion.m \
      DnDUtilities.m \
      CFileDialog.m \
      CImage.m \
      CMenu.m \
      CMenuBar.m \
      CMenuComponent.m \
      CMenuItem.m \
      CPopupMenu.m \
      CRobot.m \
      CTrayIcon.m \
      CWrapper.m \
      JavaAccessibilityAction.m \
      JavaAccessibilityUtilities.m \
      JavaComponentAccessibility.m \
      JavaTextAccessibility.m \
      LWCToolkit.m \
      GeomUtilities.m \
      CPrinterJob.m \
      PrintModel.m \
      PrinterSurfaceData.m \
      PrinterView.m \
      QuartzSurfaceData.m \
      QuartzRenderer.m \
      CTextPipe.m \
      ImageSurfaceData.m \
      awt_DrawingSurface.m \
      \
      OGLBlitLoops.c \
      OGLBufImgOps.c \
      OGLContext.c \
      OGLFuncs.c \
      OGLMaskBlit.c \
      OGLMaskFill.c \
      OGLPaints.c \
      OGLRenderQueue.c \
      OGLRenderer.c \
      OGLSurfaceData.c \
      OGLTextRenderer.c \
      OGLVertexCache.c \
      AccelGlyphCache.c \
      CUPSfuncs.c


  LIBAWT_LWAWT_DIRS := \
      $(JDK_TOPDIR)/src/macosx/native/sun/awt \
      $(JDK_TOPDIR)/src/macosx/native/sun/font \
      $(JDK_TOPDIR)/src/macosx/native/sun/java2d/opengl \
      $(JDK_TOPDIR)/src/solaris/native/sun/awt \
      $(JDK_TOPDIR)/src/share/native/sun/font \
      $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \

  $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_LWAWT, \
      LIBRARY := awt_lwawt, \
      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
      SRC := $(LIBAWT_LWAWT_DIRS), \
      LANG := C, \
      INCLUDE_FILES := $(LIBAWT_LWAWT_FILES), \
      OPTIMIZATION := LOW, \
      CFLAGS := $(CFLAGS_JDKLIB) \
1419 1420 1421
          $(X_CFLAGS) \
          $(X_LIBS) \
          $(foreach dir, $(LIBAWT_LWAWT_DIRS), -I$(dir)) \
I
ihse 已提交
1422 1423 1424 1425 1426 1427 1428
          -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
          -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
          -I$(JDK_TOPDIR)/src/solaris/native/sun/java2d \
          -I$(JDK_TOPDIR)/src/share/native/sun/awt/image \
          -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
          -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
          -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
1429
          -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug, \
I
ihse 已提交
1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471
      LDFLAGS := $(LDFLAGS_JDKLIB) \
          $(call SET_SHARED_LIBRARY_ORIGIN), \
      LDFLAGS_SUFFIX_macosx := -lawt -lmlib_image -losxapp -ljvm $(LIBM) \
          -framework Accelerate \
          -framework ApplicationServices \
          -framework AudioToolbox \
          -framework Carbon \
          -framework Cocoa \
          -framework Security \
          -framework ExceptionHandling \
          -framework JavaNativeFoundation \
          -framework JavaRuntimeSupport \
          -framework OpenGL \
          -framework QuartzCore -ljava, \
      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt_lwawt, \
      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))

  BUILD_LIBRARIES += $(BUILD_LIBAWT_LWAWT)

  $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBAWT)

  $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBMLIB_IMAGE)

  $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBOSXAPP)

  $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBJAVA)

endif

##########################################################################################

ifeq ($(OPENJDK_TARGET_OS), macosx)

  $(eval $(call SetupNativeCompilation,BUILD_LIBOSXUI, \
      LIBRARY := osxui, \
      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
      SRC := $(JDK_TOPDIR)/src/macosx/native/com/apple/laf, \
      LANG := C, \
      OPTIMIZATION := LOW, \
      CFLAGS := $(CFLAGS_JDKLIB) \
          -I$(JDK_TOPDIR)/src/macosx/native/com/apple/laf \
          -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
1472
          -I$(JDK_TOPDIR)/src/macosx/native/sun/awt, \
I
ihse 已提交
1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496
      LDFLAGS := $(LDFLAGS_JDKLIB) \
          $(call SET_SHARED_LIBRARY_ORIGIN) \
          -Xlinker -rpath -Xlinker @loader_path, \
      LDFLAGS_SUFFIX_macosx := -lawt -losxapp -lawt_lwawt \
          -framework Cocoa \
          -framework Carbon \
          -framework ApplicationServices \
          -framework JavaNativeFoundation \
          -framework JavaRuntimeSupport \
          -ljava -ljvm, \
      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libosxui, \
      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))

  BUILD_LIBRARIES += $(BUILD_LIBOSXUI)

  $(BUILD_LIBOSXUI): $(BUILD_LIBAWT)

  $(BUILD_LIBOSXUI): $(BUILD_LIBOSXAPP)

  $(BUILD_LIBOSXUI): $(BUILD_LIBAWT_LWAWT)

  #$(BUILD_LIBOSXUI): $(BUILD_LIBJAVA)

endif