1 #
   2 # Copyright (c) 2013, 2014, 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     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libt2k/mapfile-vers, \
  48     LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
  49         $(call SET_SHARED_LIBRARY_ORIGIN), \
  50     LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
  51     LDFLAGS_windows := user32.lib $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfontmanager/fontmanager.lib, \
  52     LDFLAGS_SUFFIX_unix := $(LIBM) $(LIBCXX) -lfontmanager -ljava -ljvm -lc, \
  53     LDFLAGS_SUFFIX_solaris := -lawt -lawt_headless, \
  54     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
  55     RC_FLAGS := $(RC_FLAGS) \
  56         -D "JDK_FNAME=t2k.dll" \
  57         -D "JDK_INTERNAL_NAME=t2k" \
  58         -D "JDK_FTYPE=0x2L", \
  59     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libt2k, \
  60     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
  61 
  62 # t2k is linked against fontmanager
  63 $(BUILD_LIBT2K): $(BUILD_LIBFONTMANAGER)
  64 
  65 TARGETS += $(BUILD_LIBT2K)
  66 
  67 ##########################################################################################
  68 
  69 LIBKCMS_SRC := $(JDK_TOPDIR)/src/closed/java.desktop/share/native/libkcms \
  70     $(JDK_TOPDIR)/src/closed/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libkcms \
  71     #
  72 LIBKCMS_CFLAGS += $(addprefix -I, $(LIBKCMS_SRC)) \
  73     -I$(JDK_TOPDIR)/src/java.base/share/native/libjava \
  74     -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
  75     -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
  76     #
  77 LIBKCMS_VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/closed/java.desktop/windows/native/libkcms/cmm.rc
  78 
  79 LIBKCMS_CFLAGS += $(CFLAGS_JDKLIB)
  80 
  81 ifeq ($(OPENJDK_TARGET_OS), solaris)
  82   # This particular library uses a feature called PIC_CODE_SMALL (on solaris)
  83   # implement it like this...since it's only used here
  84   LIBKCMS_CFLAGS := $(patsubst -KPIC, -Kpic, $(LIBKCMS_CFLAGS))
  85 else ifeq ($(OPENJDK_TARGET_CPU_ARCH), ppc)
  86   LIBKCMS_CFLAGS := $(patsubst -fPIC, -fpic, $(LIBKCMS_CFLAGS))
  87 endif
  88 
  89 $(eval $(call SetupNativeCompilation,BUILD_LIBKCMS, \
  90     LIBRARY := kcms, \
  91     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
  92     SRC := $(LIBKCMS_SRC), \
  93     LANG := C, \
  94     EXCLUDE_FILES := $(BUILD_LIBKCMS_EXCLUDE_FILES), \
  95     OPTIMIZATION := LOW, \
  96     CFLAGS := $(LIBKCMS_CFLAGS) \
  97         -DJAVACMM -DFUT_CALC_EX -DNO_FUT_GCONST, \
  98     CFLAGS_linux := -Wno-missing-field-initializers, \
  99     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libkcms/mapfile-vers, \
 100     LDFLAGS := $(LDFLAGS_JDKLIB) \
 101         $(call SET_SHARED_LIBRARY_ORIGIN), \
 102     LDFLAGS_SUFFIX_linux := -lc -lpthread, \
 103     LDFLAGS_SUFFIX_solaris := -lc, \
 104     LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib version.lib, \
 105     LDFLAGS_SUFFIX_unix := -lm -ljava -ljvm, \
 106     VERSIONINFO_RESOURCE := $(LIBKCMS_VERSIONINFO_RESOURCE), \
 107     RC_FLAGS := $(RC_FLAGS) \
 108         -D "JDK_FNAME=kcms.dll" \
 109         -D "JDK_INTERNAL_NAME=kcms" \
 110         -D "JDK_FTYPE=0x2L", \
 111     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libkcms, \
 112     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 113 
 114 $(BUILD_LIBKCMS): $(call FindLib, java.base, java)
 115 
 116 TARGETS += $(BUILD_LIBKCMS)
 117 
 118 ################################################################################
 119 
 120 ifeq ($(OPENJDK_TARGET_OS), solaris)
 121   ifneq ($(OPENJDK_TARGET_CPU), x86_64)
 122 
 123     ifeq ($(shell if test "$(OS_VERSION_MAJOR)" -eq 5 -a "$(OS_VERSION_MINOR)" -le 10; then $(ECHO) ok; fi), ok)
 124 
 125       SUNWJDGA_MAPFILE :=
 126       ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
 127         SUNWJDGA_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjdga/mapfile-vers
 128       endif
 129 
 130       $(eval $(call SetupNativeCompilation,BUILD_LIBSUNWJDGA, \
 131           LIBRARY := sunwjdga, \
 132           OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 133           SRC := $(JDK_TOPDIR)/src/java.desktop/unix/native/libsunwjdga, \
 134           LANG := C, \
 135           OPTIMIZATION := LOW, \
 136           CFLAGS := $(CFLAGS_JDKLIB) \
 137               -I$(JDK_TOPDIR)/src/share/javavm/export \
 138               -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_TYPE)/javavm/export \
 139               $(X_CFLAGS), \
 140           MAPFILE := $(SUNWJDGA_MAPFILE), \
 141           LDFLAGS := $(LDFLAGS_JDKLIB) \
 142               $(call SET_SHARED_LIBRARY_ORIGIN), \
 143           LDFLAGS_SUFFIX := $(X_LIBS) -ldga -lX11 $(LIBDL) -lc, \
 144           OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libsunwjdga, \
 145           DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 146 
 147       TARGETS += $(BUILD_LIBSUNWJDGA)
 148 
 149     endif
 150   endif
 151 endif
 152 
 153 ################################################################################
 154 
 155 LIBDCPR_SRC_DIRS := $(JDK_TOPDIR)/src/closed/java.desktop/share/native/libdcpr
 156 LIBDCPR_CFLAGS := $(addprefix -I, $(shell $(FIND) $(LIBDCPR_SRC_DIRS) -type d)) \
 157     -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe \
 158     -I$(JDK_TOPDIR)/src/java.base/share/native/libjava \
 159     -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
 160     -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
 161     #
 162 
 163 $(eval $(call SetupNativeCompilation,BUILD_LIBDCPR, \
 164     LIBRARY := dcpr, \
 165     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 166     SRC := $(LIBDCPR_SRC_DIRS), \
 167     LANG := C, \
 168     OPTIMIZATION := LOW, \
 169     CFLAGS := $(CFLAGS_JDKLIB) \
 170         $(LIBDCPR_CFLAGS), \
 171     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libdcpr/mapfile-vers, \
 172     LDFLAGS := $(LDFLAGS_JDKLIB) \
 173         $(call SET_SHARED_LIBRARY_ORIGIN), \
 174     LDFLAGS_SUFFIX := $(LIBM) $(LDFLAGS_JDKLIB_SUFFIX), \
 175     LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB), \
 176     LDFLAGS_SUFFIX_unix := -lm, \
 177     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 178     RC_FLAGS := $(RC_FLAGS) \
 179         -D "JDK_FNAME=dcpr.dll" \
 180         -D "JDK_INTERNAL_NAME=dcpr" \
 181         -D "JDK_FTYPE=0x2L", \
 182     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libdcpr, \
 183     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 184 
 185 $(BUILD_LIBDCPR): $(call FindLib, java.base, java)
 186 
 187 TARGETS += $(BUILD_LIBDCPR)
 188 
 189 ################################################################################