1 #
   2 # Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
   3 # ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
   4 #
   5 
   6 # This file is included by the JDK makefile lib/Awt2dLibraries.gmk.
   7 
   8 ifndef BUILD_HEADLESS_ONLY
   9   ifeq ($(OPENJDK_TARGET_OS), linux)
  10     ifndef OPENJDK
  11       ifeq ($(JDK_VARIANT), embedded)
  12         DISABLE_XRENDER=true
  13       endif
  14 
  15       ifeq ($(OPENJDK_TARGET_CPU_ARCH), arm)
  16         DISABLE_XRENDER=true
  17       endif
  18     endif
  19   endif
  20 endif
  21 
  22 ################################################################################
  23 
  24 LIBT2K_SRC := $(JDK_TOPDIR)/src/closed/java.desktop/share/native/libt2k
  25 LIBT2K_CFLAGS := $(addprefix -I, $(LIBT2K_SRC)) \
  26     -I$(JDK_TOPDIR)/src/closed/java.desktop/share/native/libt2k/t2k \
  27     -I$(JDK_TOPDIR)/src/java.desktop/share/native/libfontmanager \
  28     -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d \
  29     -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/loops \
  30     -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
  31     -I$(JDK_TOPDIR)/src/java.base/share/native/libjava \
  32     -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
  33     -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
  34     #
  35 
  36 $(eval $(call SetupNativeCompilation,BUILD_LIBT2K, \
  37     LIBRARY := t2k, \
  38     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
  39     SRC := $(LIBT2K_SRC), \
  40     EXCLUDE_FILES := t2k/orion.c, \
  41     LANG := C++, \
  42     OPTIMIZATION := HIGH, \
  43     CFLAGS := $(CFLAGS_JDKLIB) $(LIBT2K_CFLAGS), \
  44     CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBT2K_CFLAGS), \
  45     CFLAGS_windows = -DCC_NOEX, \
  46     CXXFLAGS_windows = -DCC_NOEX, \
  47     DISABLED_WARNINGS_gcc := unused-but-set-parameter sign-compare type-limits \
  48         maybe-uninitialized parentheses, \
  49     DISABLED_WARNINGS_clang := logical-op-parentheses dangling-else \
  50         unused-value bitwise-op-parentheses tautological-compare, \
  51     DISABLED_WARNINGS_microsoft := 4244, \
  52     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libt2k/mapfile-vers, \
  53     LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
  54         $(call SET_SHARED_LIBRARY_ORIGIN), \
  55     LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
  56     LDFLAGS_windows := user32.lib $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfontmanager/fontmanager.lib, \
  57     LDFLAGS_SUFFIX_unix := $(LIBM) $(LIBCXX) -lfontmanager -ljava -ljvm -lc, \
  58     LDFLAGS_SUFFIX_solaris := -lawt -lawt_headless, \
  59     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
  60     RC_FLAGS := $(RC_FLAGS) \
  61         -D "JDK_FNAME=t2k.dll" \
  62         -D "JDK_INTERNAL_NAME=t2k" \
  63         -D "JDK_FTYPE=0x2L", \
  64     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libt2k, \
  65     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
  66 
  67 # t2k is linked against fontmanager
  68 $(BUILD_LIBT2K): $(BUILD_LIBFONTMANAGER)
  69 
  70 TARGETS += $(BUILD_LIBT2K)
  71 
  72 ##########################################################################################
  73 
  74 LIBKCMS_SRC := $(JDK_TOPDIR)/src/closed/java.desktop/share/native/libkcms \
  75     $(JDK_TOPDIR)/src/closed/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libkcms \
  76     #
  77 LIBKCMS_CFLAGS += $(addprefix -I, $(LIBKCMS_SRC)) \
  78     -I$(JDK_TOPDIR)/src/java.base/share/native/libjava \
  79     -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
  80     -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
  81     #
  82 LIBKCMS_VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/closed/java.desktop/windows/native/libkcms/cmm.rc
  83 
  84 LIBKCMS_CFLAGS += $(CFLAGS_JDKLIB)
  85 
  86 ifeq ($(OPENJDK_TARGET_OS), solaris)
  87   # This particular library uses a feature called PIC_CODE_SMALL (on solaris)
  88   # implement it like this...since it's only used here
  89   LIBKCMS_CFLAGS := $(patsubst -KPIC, -Kpic, $(LIBKCMS_CFLAGS))
  90 else ifeq ($(OPENJDK_TARGET_CPU_ARCH), ppc)
  91   LIBKCMS_CFLAGS := $(patsubst -fPIC, -fpic, $(LIBKCMS_CFLAGS))
  92 endif
  93 
  94 $(eval $(call SetupNativeCompilation,BUILD_LIBKCMS, \
  95     LIBRARY := kcms, \
  96     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
  97     SRC := $(LIBKCMS_SRC), \
  98     LANG := C, \
  99     EXCLUDE_FILES := $(BUILD_LIBKCMS_EXCLUDE_FILES), \
 100     OPTIMIZATION := LOW, \
 101     CFLAGS := $(LIBKCMS_CFLAGS) \
 102         -DJAVACMM -DFUT_CALC_EX -DNO_FUT_GCONST, \
 103     CFLAGS_linux := -Wno-missing-field-initializers, \
 104     DISABLED_WARNINGS_gcc := sign-compare pointer-sign unused-but-set-parameter \
 105         maybe-uninitialized, \
 106     DISABLED_WARNINGS_clang := unused-value pointer-sign, \
 107     DISABLED_WARNINGS_solstudio := E_ARG_INCOMPATIBLE_WITH_ARG_L, \
 108     DISABLED_WARNINGS_microsoft := 4244 4700, \
 109     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libkcms/mapfile-vers, \
 110     LDFLAGS := $(LDFLAGS_JDKLIB) \
 111         $(call SET_SHARED_LIBRARY_ORIGIN), \
 112     LDFLAGS_SUFFIX_linux := -lc -lpthread, \
 113     LDFLAGS_SUFFIX_solaris := -lc, \
 114     LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib version.lib, \
 115     LDFLAGS_SUFFIX_unix := -lm -ljava -ljvm, \
 116     VERSIONINFO_RESOURCE := $(LIBKCMS_VERSIONINFO_RESOURCE), \
 117     RC_FLAGS := $(RC_FLAGS) \
 118         -D "JDK_FNAME=kcms.dll" \
 119         -D "JDK_INTERNAL_NAME=kcms" \
 120         -D "JDK_FTYPE=0x2L", \
 121     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libkcms, \
 122     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 123 
 124 $(BUILD_LIBKCMS): $(call FindLib, java.base, java)
 125 
 126 TARGETS += $(BUILD_LIBKCMS)
 127 
 128 ################################################################################
 129 
 130 ifeq ($(OPENJDK_TARGET_OS), solaris)
 131   ifneq ($(OPENJDK_TARGET_CPU), x86_64)
 132 
 133     ifeq ($(shell if test "$(OS_VERSION_MAJOR)" -eq 5 -a "$(OS_VERSION_MINOR)" -le 10; then $(ECHO) ok; fi), ok)
 134 
 135       SUNWJDGA_MAPFILE :=
 136       ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
 137         SUNWJDGA_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjdga/mapfile-vers
 138       endif
 139 
 140       $(eval $(call SetupNativeCompilation,BUILD_LIBSUNWJDGA, \
 141           LIBRARY := sunwjdga, \
 142           OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 143           SRC := $(JDK_TOPDIR)/src/java.desktop/unix/native/libsunwjdga, \
 144           LANG := C, \
 145           OPTIMIZATION := LOW, \
 146           CFLAGS := $(CFLAGS_JDKLIB) \
 147               -I$(JDK_TOPDIR)/src/share/javavm/export \
 148               -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_TYPE)/javavm/export \
 149               $(X_CFLAGS), \
 150           MAPFILE := $(SUNWJDGA_MAPFILE), \
 151           LDFLAGS := $(LDFLAGS_JDKLIB) \
 152               $(call SET_SHARED_LIBRARY_ORIGIN), \
 153           LDFLAGS_SUFFIX := $(X_LIBS) -ldga -lX11 $(LIBDL) -lc, \
 154           OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libsunwjdga, \
 155           DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 156 
 157       TARGETS += $(BUILD_LIBSUNWJDGA)
 158 
 159     endif
 160   endif
 161 endif
 162 
 163 ################################################################################
 164 
 165 LIBDCPR_SRC_DIRS := $(JDK_TOPDIR)/src/closed/java.desktop/share/native/libdcpr
 166 LIBDCPR_CFLAGS := $(addprefix -I, $(shell $(FIND) $(LIBDCPR_SRC_DIRS) -type d)) \
 167     -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe \
 168     -I$(JDK_TOPDIR)/src/java.base/share/native/libjava \
 169     -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
 170     -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
 171     #
 172 
 173 $(eval $(call SetupNativeCompilation,BUILD_LIBDCPR, \
 174     LIBRARY := dcpr, \
 175     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 176     SRC := $(LIBDCPR_SRC_DIRS), \
 177     LANG := C, \
 178     OPTIMIZATION := LOW, \
 179     CFLAGS := $(CFLAGS_JDKLIB) \
 180         $(LIBDCPR_CFLAGS), \
 181     DISABLED_WARNINGS_microsoft := 4244, \
 182     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libdcpr/mapfile-vers, \
 183     LDFLAGS := $(LDFLAGS_JDKLIB) \
 184         $(call SET_SHARED_LIBRARY_ORIGIN), \
 185     LDFLAGS_SUFFIX := $(LIBM) $(LDFLAGS_JDKLIB_SUFFIX), \
 186     LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB), \
 187     LDFLAGS_SUFFIX_unix := -lm, \
 188     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 189     RC_FLAGS := $(RC_FLAGS) \
 190         -D "JDK_FNAME=dcpr.dll" \
 191         -D "JDK_INTERNAL_NAME=dcpr" \
 192         -D "JDK_FTYPE=0x2L", \
 193     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libdcpr, \
 194     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 195 
 196 $(BUILD_LIBDCPR): $(call FindLib, java.base, java)
 197 
 198 TARGETS += $(BUILD_LIBDCPR)
 199 
 200 ################################################################################